import { Ref, ComputedRef, MaybeRef } from 'vue'; import { Option } from '@wolf-tui/shared'; export type UseMultiSelectStateProps = { /** * Number of visible options. * * @default 5 */ visibleOptionCount?: number; /** * Options. */ options: Option[]; /** * Controlled value. When provided, component reflects this value. */ value?: MaybeRef; /** * Initially selected option values (uncontrolled mode). */ defaultValue?: string[]; /** * Callback for selecting options. */ onChange?: (value: string[]) => void; /** * Callback when user presses enter. * First argument is an array of selected option values. */ onSubmit?: (value: string[]) => void; }; export type MultiSelectState = { /** * Value of the currently focused option. */ focusedValue: Ref; /** * Index of the first visible option. */ visibleFromIndex: Ref; /** * Index of the last visible option. */ visibleToIndex: Ref; /** * Values of selected options. */ 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. */ toggleFocusedOption: () => void; /** * Trigger `onSubmit` callback. */ submit: () => void; }; export declare const useMultiSelectState: ({ visibleOptionCount, options, value: controlledValue, defaultValue, onChange, onSubmit, }: UseMultiSelectStateProps) => MultiSelectState; //# sourceMappingURL=use-multi-select-state.d.ts.map