import { type SelectionChangeDetail, type SelectionChangeReason } from './selection.cjs'; export { nextSelection, selectedValueOf, toSelectionValues, toValues, type SelectionChangeDetail, type SelectionChangeReason, type SelectionValueOptions, } from './selection.cjs'; /** Options for {@link useSelection}. */ export interface UseSelectionOptions { /** Selected value(s), for controlled usage — a bare `string` or a `string[]` under either cardinality. */ value?: string | string[] | undefined; /** Initially selected value(s), for uncontrolled usage — same shapes as `value`. */ defaultValue?: string | string[] | undefined; /** Fires with the selection-value rule's strict-out change detail whenever the selection changes. */ onValueChange?: ((detail: SelectionChangeDetail) => void) | undefined; /** Whether choosing an option toggles it within a set rather than replacing the selection. */ multiple?: boolean | undefined; /** Whether re-choosing the only selected value clears it; single-selection only. */ deselectable?: boolean | undefined; /** Component name used in the selection-value error, e.g. `Select` — the member is appended. */ label: string; } /** What {@link useSelection} hands back to a component's context. */ export interface Selection { /** Every selected value, normalised to an array whether or not `multiple`. */ selectedValues: string[]; /** Whether one option value is currently selected. */ isSelected: (value: string) => boolean; /** Commits an option: replaces the selection, or toggles it within it when `multiple`. */ selectItem: (value: string, reason?: SelectionChangeReason) => void; /** * Replaces the whole selection outright, without going through the * replace-or-toggle decision — what a `
` reset needs, since it * restores a value rather than choosing an option. */ setSelection: (value: string | string[]) => void; } /** Shared selection model for Listbox, Select, Combobox and toggle families, owning only selection normalization; side effects (Combobox closing, Select keeping focus) stay in each component. */ export declare function useSelection({ value, defaultValue, onValueChange, multiple, deselectable, label, }: UseSelectionOptions): Selection;