Skip to content

Class: IndentNodeCommand\<TRow\>

Defined in: src/tree-editor/commands/indent-node.ts:25

Indents a node — it becomes the last child of its immediately preceding sibling. Works for both root-level and nested nodes.

Implementation: indent is a special case of move. We resolve the previous sibling and delegate to MoveNodeCommand.

No-op (returns the same state reference) when the node has no previous sibling — i.e., it is the first child of its parent (or the first root). Throws MoveRejectedError only if a custom validator rejects.

Type Parameters

TRow

TRow

Implements

Constructors

Constructor

new IndentNodeCommand<TRow>(options): IndentNodeCommand<TRow>

Defined in: src/tree-editor/commands/indent-node.ts:36

Parameters

options

IndentNodeOptions<TRow>

Returns

IndentNodeCommand<TRow>

Properties

description

readonly description: string

Defined in: src/tree-editor/commands/indent-node.ts:27

Human-readable description for undo/redo UI.

Implementation of

Command.description


type

readonly type: "indent-node" = 'indent-node'

Defined in: src/tree-editor/commands/indent-node.ts:26

Unique command type identifier (e.g., ‘add-node’, ‘move-node’).

Implementation of

Command.type

Methods

execute()

execute(state): TreeState<TRow>

Defined in: src/tree-editor/commands/indent-node.ts:42

Apply the mutation. Returns the new tree state.

Parameters

state

TreeState<TRow>

Returns

TreeState<TRow>

Implementation of

Command.execute


undo()

undo(state): TreeState<TRow>

Defined in: src/tree-editor/commands/indent-node.ts:85

Reverse the mutation. Returns the previous tree state.

Parameters

state

TreeState<TRow>

Returns

TreeState<TRow>

Implementation of

Command.undo