Class: OutdentNodeCommand\<TRow\>
Defined in: src/tree-editor/commands/outdent-node.ts:26
Outdents a node — it moves out from under its current parent and becomes the next sibling of that parent (at the same depth as the parent).
Implementation: outdent is a special case of move. We resolve the parent,
grandparent, and the parent’s index among its siblings, then delegate to
MoveNodeCommand inserting at parentIndex + 1.
No-op (returns the same state reference) when the node is already at the
top level (has no parent) — there is nowhere to outdent to.
Throws MoveRejectedError only if a custom validator rejects.
Type Parameters
TRow
TRow
Implements
Command<TRow>
Constructors
Constructor
new OutdentNodeCommand<
TRow>(options):OutdentNodeCommand<TRow>
Defined in: src/tree-editor/commands/outdent-node.ts:37
Parameters
options
OutdentNodeOptions<TRow>
Returns
OutdentNodeCommand<TRow>
Properties
description
readonlydescription:string
Defined in: src/tree-editor/commands/outdent-node.ts:28
Human-readable description for undo/redo UI.
Implementation of
type
readonlytype:"outdent-node"='outdent-node'
Defined in: src/tree-editor/commands/outdent-node.ts:27
Unique command type identifier (e.g., ‘add-node’, ‘move-node’).
Implementation of
Methods
execute()
execute(
state):TreeState<TRow>
Defined in: src/tree-editor/commands/outdent-node.ts:43
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/outdent-node.ts:87
Reverse the mutation. Returns the previous tree state.
Parameters
state
TreeState<TRow>
Returns
TreeState<TRow>