mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-23 09:17:06 +08:00
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:
@@ -1,9 +1,9 @@
|
||||
import type { Command } from '@blocksuite/block-std';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
|
||||
export const deleteSelectedModelsCommand: Command<'selectedModels'> = (
|
||||
ctx,
|
||||
next
|
||||
) => {
|
||||
export const deleteSelectedModelsCommand: Command<{
|
||||
selectedModels?: BlockModel[];
|
||||
}> = (ctx, next) => {
|
||||
const models = ctx.selectedModels;
|
||||
|
||||
if (!models) {
|
||||
@@ -19,11 +19,3 @@ export const deleteSelectedModelsCommand: Command<'selectedModels'> = (
|
||||
|
||||
return next();
|
||||
};
|
||||
|
||||
declare global {
|
||||
namespace BlockSuite {
|
||||
interface Commands {
|
||||
deleteSelectedModels: typeof deleteSelectedModelsCommand;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user