Class: ReorderNodeCommand\<TRow\>
Defined in: src/tree-editor/commands/reorder-node.ts:16
Swaps a node with its previous (up) or next (down) sibling within the
same parent. A no-op when the node is already at the edge of its sibling
list — execute() returns the same state reference and undo() does
nothing.
Type Parameters
TRow
TRow
Implements
Command<TRow>
Constructors
Constructor
new ReorderNodeCommand<
TRow>(options):ReorderNodeCommand<TRow>
Defined in: src/tree-editor/commands/reorder-node.ts:29
Parameters
options
Returns
ReorderNodeCommand<TRow>
Properties
description
readonlydescription:string
Defined in: src/tree-editor/commands/reorder-node.ts:18
Human-readable description for undo/redo UI.
Implementation of
type
readonlytype:"reorder-node"='reorder-node'
Defined in: src/tree-editor/commands/reorder-node.ts:17
Unique command type identifier (e.g., ‘add-node’, ‘move-node’).
Implementation of
Methods
execute()
execute(
state):TreeState<TRow>
Defined in: src/tree-editor/commands/reorder-node.ts:35
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/reorder-node.ts:74
Reverse the mutation. Returns the previous tree state.
Parameters
state
TreeState<TRow>
Returns
TreeState<TRow>