BlockSuite API Documentation / @blocksuite/block-std / CommandManager
Class: CommandManager
Constructors
new CommandManager()
new CommandManager(
std
):CommandManager
Parameters
• std: BlockStdScope
Returns
Source
packages/framework/block-std/src/command/manager.ts:14
Properties
_commands
private
_commands:Map
<string
,Command
>
Source
packages/framework/block-std/src/command/manager.ts:12
std
std:
BlockStdScope
Source
packages/framework/block-std/src/command/manager.ts:14
Methods
_createChain()
private
_createChain(methods
,_cmds
):Chain
Parameters
• methods: Record
<keyof Commands
, unknown
>
• _cmds: Command
[]
Returns
Source
packages/framework/block-std/src/command/manager.ts:22
_getCommandCtx()
private
_getCommandCtx():InitCommandCtx
Returns
Source
packages/framework/block-std/src/command/manager.ts:16
add()
add<
N
>(name
,command
):CommandManager
Type parameters
• N extends keyof Commands
Parameters
• name: N
• command: Commands
[N
]
Returns
Source
packages/framework/block-std/src/command/manager.ts:131
chain()
chain():
Chain
<InitCommandCtx
>
Returns
Source
packages/framework/block-std/src/command/manager.ts:140
exec()
exec<
K
>(command
, ...args
):ExecCommandResult
<K
>
Type parameters
• K extends keyof Commands
Parameters
• command: K
• ...args: IfAllKeysOptional
<Omit
<InDataOfCommand
<Commands
[K
]>, "std"
>, [void
| Omit
<InDataOfCommand
<Commands
[K
]>, "std"
>], [Omit
<InDataOfCommand
<Commands
[K
]>, "std"
>]>
Returns
Source
packages/framework/block-std/src/command/manager.ts:162