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

    Interface TreeData<TNode>

    Stateful data accepted by the Blessed tree adapter.

    interface TreeData<TNode extends TreeNode = TreeNode> {
        activeId?: string;
        characters?: TreeCharacters;
        defaultExpandedIds?: readonly string[];
        defaultValue?: string;
        emptyText?: string;
        expandedIds?: readonly string[];
        indent?: number;
        nodes: readonly TNode[];
        onActiveIdChange?: (activeId: string) => void;
        onExpandedIdsChange?: (expandedIds: readonly string[]) => void;
        onValueChange?: (value: string) => void;
        value?: string;
    }

    Type Parameters

    Index

    Properties

    activeId?: string

    Preferred initial cursor identifier.

    characters?: TreeCharacters

    Character tokens used by the pure renderer.

    defaultExpandedIds?: readonly string[]

    Initial expanded node identifiers for uncontrolled expansion.

    defaultValue?: string

    Initial selection for uncontrolled usage. Ignored when value is supplied.

    emptyText?: string

    Text displayed when no nodes exist.

    expandedIds?: readonly string[]

    Controlled expanded node identifiers.

    indent?: number

    Spaces inserted for each nesting depth.

    2

    nodes: readonly TNode[]

    Ordered root nodes. Disabled nodes are visible but not interactive.

    onActiveIdChange?: (activeId: string) => void

    Called after the cursor moves to a different enabled node.

    onExpandedIdsChange?: (expandedIds: readonly string[]) => void

    Called when expansion changes or is requested in controlled mode.

    onValueChange?: (value: string) => void

    Called when Enter or TreeHandle.selectActive requests selection.

    value?: string

    Controlled selected identifier.