import { Ref, ComputedRef, MaybeRef } from 'vue'; import { Option } from '@wolf-tui/shared'; export type UseSelectStateProps = { /** * Number of items to display. * * @default 5 */ visibleOptionCount?: number; /** * Options. */ options: Option[]; /** * Controlled value. When provided, component reflects this value. */ value?: MaybeRef; /** * Initially selected option's value (uncontrolled mode). */ defaultValue?: string; /** * Callback for selecting an option. */ onChange?: (value: string) => void; }; export type SelectState = { /** * Value of the currently focused option. */ focusedValue: Ref; /** * Index of the first visible option. */ visibleFromIndex: Ref; /** * Index of the last visible option. */ visibleToIndex: Ref; /** * Value of the selected option. */ value: ComputedRef; /** * Visible options. */ visibleOptions: ComputedRef>; /** * Focus next option and scroll the list down, if needed. */ focusNextOption: () => void; /** * Focus previous option and scroll the list up, if needed. */ focusPreviousOption: () => void; /** * Select currently focused option. */ selectFocusedOption: () => void; }; export declare const useSelectState: ({ visibleOptionCount, options, value: controlledValue, defaultValue, onChange, }: UseSelectStateProps) => SelectState; //# sourceMappingURL=use-select-state.d.ts.map