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

    Interface SelectHandle<TItem>

    Imperative handle returned by select.

    interface SelectHandle<TItem extends SelectItem = SelectItem> {
        activeId(): string | undefined;
        close(): boolean;
        focus(): void;
        focusItem(id: string): string | undefined;
        next(): string | undefined;
        open(): boolean;
        opened(): boolean;
        previous(): string | undefined;
        selectActive(): string | undefined;
        toggle(): boolean;
        value(): string | undefined;
        element: BoxElement;
        destroy(): void;
        setData(data: SelectData): void;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    element: BoxElement

    Underlying Blessed element available for standard element operations.

    Methods

    • Moves the cursor to an enabled identifier.

      Parameters

      • id: string

      Returns string | undefined

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

      Returns string | undefined

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

      Returns string | undefined

    • Selects the focused option and closes the list.

      Returns string | undefined

    • Returns the current controlled or uncontrolled selected identifier.

      Returns string | undefined