import { AllOptionAccessor, OptionAccessor } from '../Shared/types'; import { ChipItem, SelectOptionType } from './types'; interface UseSelectStateConfig { options: T[]; value: (string | number)[] | string | number | undefined; defaultValue?: (string | number)[] | string | number; isControlled: boolean; multiple: boolean; optionLabel: OptionAccessor; optionValue: OptionAccessor; optionActive?: AllOptionAccessor; groupSelection?: boolean; onChange?: ((newValue: SelectOptionType | undefined, name?: string) => void) | ((newValue: SelectOptionType[], name?: string) => void); onOptionClick?: (option: SelectOptionType, name?: string) => void; onRemoveOption?: (option: T) => void; name?: string; } interface UseSelectStateReturn { flatOptions: T[]; sanitizedOptions: SelectOptionType[]; selectedOptions: T[]; selectedIds: Set; chipItems: ChipItem[]; toggleOption: (optionValue: string | number) => void; selectGroup: (groupId: string | number, mode: "toggle" | "select" | "deselect") => void; removeOption: (optionId: string | number) => void; removeOptions: (optionIds: (string | number)[]) => void; clearSelection: () => void; selectByValue: (value: string | number) => void; } declare function useSelectState({ options, value, defaultValue, isControlled, multiple, optionLabel, optionValue, optionActive, groupSelection, onChange, onOptionClick, onRemoveOption, name, }: UseSelectStateConfig): UseSelectStateReturn; export { useSelectState }; export type { UseSelectStateConfig, UseSelectStateReturn };