blessed-components - v1.20.0
    Preparing search index...

    Interface TreeHandle<TNode>

    Imperative handle returned by tree.

    interface TreeHandle<TNode extends TreeNode = TreeNode> {
        collapse(id?: string): readonly string[];
        expand(id?: string): readonly string[];
        activeId(): string | undefined;
        expandedIds(): readonly string[];
        focus(): void;
        focusItem(id: string): string | undefined;
        first(): string | undefined;
        last(): string | undefined;
        next(): string | undefined;
        pageBackward(): string | undefined;
        pageForward(): string | undefined;
        previous(): string | undefined;
        selectActive(): string | undefined;
        toggleActive(): readonly string[];
        value(): string | undefined;
        element: BoxElement;
        destroy(): void;
        setData(data: TreeData): void;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    element: BoxElement

    Underlying Blessed element available for standard element operations.

    Methods

    • Collapses a node id, or the active node when omitted.

      Parameters

      • Optionalid: string

      Returns readonly string[]

    • Expands a node id, or the active node when omitted.

      Parameters

      • Optionalid: string

      Returns readonly string[]

    • Returns the current enabled cursor identifier.

      Returns string | undefined

    • Returns the current controlled or uncontrolled expanded identifiers.

      Returns readonly string[]

    • Moves the cursor to an enabled identifier.

      Parameters

      • id: string

      Returns string | undefined

    • Moves the cursor to the first enabled visible node.

      Returns string | undefined

    • Moves the cursor to the last enabled visible node.

      Returns string | undefined

    • Moves the cursor to the next enabled visible node, wrapping at the end.

      Returns string | undefined

    • Moves the cursor one viewport page backward.

      Returns string | undefined

    • Moves the cursor one viewport page forward.

      Returns string | undefined

    • Moves the cursor to the previous enabled visible node, wrapping at the start.

      Returns string | undefined

    • Selects the active node or emits a controlled selection request.

      Returns string | undefined

    • Returns the current controlled or uncontrolled selected identifier.

      Returns string | undefined