Skip to content

BlockSuite API Documentation / @blocksuite/block-std / Chain

Type Alias: Chain<CommandCtx>

Chain<CommandCtx> = object

Defined in: packages/framework/block-std/src/command/types.ts:23

Type Parameters

CommandCtx

CommandCtx extends object = InitCommandCtx

Properties

[cmdSymbol]

[cmdSymbol]: Command[]

Defined in: packages/framework/block-std/src/command/types.ts:24


pipe()

pipe: <Out>(command) => Chain<CommandCtx & Out><Out, In>(command, input?) => Chain<CommandCtx & In & Out>

Defined in: packages/framework/block-std/src/command/types.ts:26

Type Parameters

Out

Out extends object

Parameters

command

Command<CommandCtx, Out>

Returns

Chain<CommandCtx & Out>

Type Parameters

Out

Out extends object

In

In extends object

Parameters

command

Command<In, Out>

input?

In

Returns

Chain<CommandCtx & In & Out>


run()

run: () => [false, Partial<CommandCtx> & InitCommandCtx] | [true, CommandCtx]

Defined in: packages/framework/block-std/src/command/types.ts:41

Returns

[false, Partial<CommandCtx> & InitCommandCtx] | [true, CommandCtx]


try()

try: <Out>(commands) => Chain<CommandCtx & Out>

Defined in: packages/framework/block-std/src/command/types.ts:35

Type Parameters

Out

Out extends object

Parameters

commands

(chain) => Chain<CommandCtx & Out>[]

Returns

Chain<CommandCtx & Out>


tryAll()

tryAll: <Out>(commands) => Chain<CommandCtx & Out>

Defined in: packages/framework/block-std/src/command/types.ts:38

Type Parameters

Out

Out extends object

Parameters

commands

(chain) => Chain<CommandCtx & Out>[]

Returns

Chain<CommandCtx & Out>


with()

with: <Out>(input) => Chain<CommandCtx & Out>

Defined in: packages/framework/block-std/src/command/types.ts:25

Type Parameters

Out

Out extends object

Parameters

input

Out

Returns

Chain<CommandCtx & Out>