import { default as React } from 'react'; import { MenuTriggerProps, MenuTriggerState } from 'react-stately'; import { MultiSelectListProps, MultiSelectListState } from './useMultiSelectListState'; /** MultiSelect option selectors. */ export type MultiSelectSelectors = { /** Gets the key for the option. */ getOptionValue: (option: T) => string; /** Gets the text label for the option. */ getOptionLabel: (option: T) => string; /** Renders the label for the option. If not present, `getOptionLabel` is used. */ renderLabel?: (option: T) => React.ReactNode | undefined; /** Gets the children for the option (meant for section). */ getGroupOptions?: (option: T) => T[] | undefined; }; /** Props for the useMultiSelectState hook. */ export interface MultiSelectStateProps extends Omit, 'children' | 'onSelectionChange'>, MultiSelectSelectors, MenuTriggerProps { /** Handler that is called when the selection changes. */ onSelectionChange?: (selection: string[]) => void; } export interface MultiSelectState extends MultiSelectListState, MenuTriggerState { /** Whether the select is currently focused. */ isFilterFocused: boolean; /** Sets whether the select is focused. */ setFilterFocused(isFocused: boolean): void; } export declare function useMultiSelectState({ getOptionValue, getOptionLabel, renderLabel, getGroupOptions, ...props }: MultiSelectStateProps): MultiSelectState; export declare function extractAllItemKeys(items: T[], getValue: MultiSelectSelectors['getOptionValue'], getGroupOptions: MultiSelectSelectors['getGroupOptions']): string[];