refactor(editor): remove dependency of command global types (#9903)

Closes: [BS-2216](https://linear.app/affine-design/issue/BS-2216/remove-global-types-in-command)
This commit is contained in:
Saul-Mirone
2025-01-27 12:28:46 +00:00
parent 4b549e0484
commit 17bf75e843
170 changed files with 1461 additions and 2124 deletions
@@ -1,6 +1,3 @@
import type { getImageSelectionsCommand } from '@blocksuite/affine-shared/commands';
import type { insertImagesCommand } from './commands/insert-images.js';
import { ImageBlockFallbackCard } from './components/image-block-fallback.js';
import { ImageBlockPageComponent } from './components/page-image-block.js';
import { ImageBlockComponent } from './image-block.js';
@@ -16,21 +13,6 @@ export function effects() {
declare global {
namespace BlockSuite {
interface CommandContext {
insertedImageIds?: Promise<string[]>;
}
interface Commands {
getImageSelections: typeof getImageSelectionsCommand;
/**
* open file dialog to insert images before or after the current block selection
* @param removeEmptyLine remove the current block if it is empty
* @param place where to insert the images
* @returns a promise that resolves to the inserted image ids
*/
insertImages: typeof insertImagesCommand;
}
interface BlockServices {
'affine:image': ImageBlockService;
}