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

View File

@@ -5,14 +5,12 @@ import {
} from '@blocksuite/affine-shared/utils';
import { type Command, TextSelection } from '@blocksuite/block-std';
export const indentBlocks: Command<
never,
never,
{
blockIds?: string[];
stopCapture?: boolean;
}
> = (ctx, next) => {
import { indentBlock } from './indent-block';
export const indentBlocks: Command<{
blockIds?: string[];
stopCapture?: boolean;
}> = (ctx, next) => {
let { blockIds } = ctx;
const { std, stopCapture = true } = ctx;
const { store, selection, range, host } = std;
@@ -95,7 +93,7 @@ export const indentBlocks: Command<
}
indentIds.forEach(id => {
std.command.exec('indentBlock', { blockId: id, stopCapture: false });
std.command.exec(indentBlock, { blockId: id, stopCapture: false });
});
{