Class: BatchCommand\<TRow\>
Defined in: src/tree-editor/commands/batch.ts:10
Groups several commands so they undo/redo as a single unit.
Execute applies the commands in order. Undo reverses them in reverse
order so each command’s undo runs against the state its execute left
behind.
Type Parameters
TRow
TRow
Implements
Command<TRow>
Constructors
Constructor
new BatchCommand<
TRow>(commands,description?):BatchCommand<TRow>
Defined in: src/tree-editor/commands/batch.ts:15
Parameters
commands
Command<TRow>[]
description?
string
Returns
BatchCommand<TRow>
Properties
description
readonlydescription:string
Defined in: src/tree-editor/commands/batch.ts:12
Human-readable description for undo/redo UI.
Implementation of
type
readonlytype:"batch"='batch'
Defined in: src/tree-editor/commands/batch.ts:11
Unique command type identifier (e.g., ‘add-node’, ‘move-node’).
Implementation of
Methods
execute()
execute(
state):TreeState<TRow>
Defined in: src/tree-editor/commands/batch.ts:20
Apply the mutation. Returns the new tree state.
Parameters
state
TreeState<TRow>
Returns
TreeState<TRow>
Implementation of
undo()
undo(
state):TreeState<TRow>
Defined in: src/tree-editor/commands/batch.ts:26
Reverse the mutation. Returns the previous tree state.
Parameters
state
TreeState<TRow>
Returns
TreeState<TRow>