import * as React from "react"; import { Data } from "../../lang-utils/data-class"; import { NodeKeypressTesting } from "../../tui-node-keyboard"; /** Props for custom indicator component. */ export declare type IndicatorProps = { isHighlighted: boolean; }; /** Props for custom check box component. */ export declare type CheckBoxProps = { isSelected: boolean; singleSelectionMode: boolean; }; /** Props for custom item component. */ export declare type ItemProps = { label: string; isHighlighted: boolean; }; export declare class ListItem extends Data { readonly label: string; readonly value?: any; readonly key: string; private constructor(); static createImmutable(label: string, value?: any): Readonly; static createFromArray(array: string[]): Readonly[]; } export declare type OperateOnOneItemFn = (item: ListItem) => void; export declare type OperateOnManyItemsFn = (items: ListItem[]) => void; export declare type MultiSelectInputProps = { /** Items to display in a list. Each item must be an object and have `label`. */ items: ListItem[]; /** Enable or disable whether this component can accept user input via keyboard. */ hasFocus?: boolean; /** Enable single selection mode (default is multi selection mode). */ singleSelectionMode?: boolean; /** Limit the max number of items to display. */ maxRows?: number; /** Items set as selected by default. */ initialSelected?: ListItem[]; /** Index of initially highlighted item in `items` array. */ initialHighlightedIndex?: number; /** Function to call when user selects an item. */ onSelect?: OperateOnOneItemFn; /** Function to call when user's cursor is over an item. */ onHighlight?: OperateOnOneItemFn; /** Function to call when user unselects an item. */ onUnselect?: OperateOnOneItemFn; /** Function to call when user submits selected items. */ onSubmit?: OperateOnManyItemsFn; /** Custom component to override the default indicator component. */ indicatorComponent?: React.ComponentType; /** Custom component to override the default check box component. */ checkboxComponent?: React.ComponentType; /** Custom component to override the default item component. */ itemComponent?: React.ComponentType; /** Optional argument that enables test mode. */ testing?: NodeKeypressTesting; };