import { KeyboardEvent, RefObject } from "react"; export interface OptionInterface { value: string; label?: string; } export interface SelectState { value: S; isOpen: boolean; searchValue: string; hoverIndex: number; } export interface UseSelect { options: OptionInterface[]; reducer: (s: SelectState, a: any) => SelectState; initialState: SelectState; filterOptions?: (state: SelectState, options: OptionInterface[]) => OptionInterface[]; onChange?: (s: S) => any; onCreate?: (s: OptionInterface) => any; } interface Action { type: string; payload: S; } export declare function createBaseReducer(initialState: SelectState): (state: SelectState, action: Action) => SelectState; export declare function searchReducer(state: SelectState, action: Action): SelectState; export declare function createSingleValueReducer(initialState: SelectState): (state: SelectState, action: Action) => SelectState; export declare function multiValueReducer(state: SelectState, action: Action): SelectState; export declare type Reducer = (s: SelectState, action: any) => SelectState; export declare const combineReducers: (reducers: Reducer[]) => (state: SelectState, action: any) => SelectState; interface UseSelectPosition { listboxStyles: { top: number; left: number; width: string; }; comboboxRef: RefObject; } export declare const useSelectPosition: () => UseSelectPosition; export declare const useSelect: ({ options, reducer, initialState, filterOptions, onChange, onCreate, }: UseSelect) => { state: SelectState; open: () => void; add: (value: OptionInterface) => void; select: (value: OptionInterface) => void; remove: (value: OptionInterface) => void; search: (query: string) => void; availableOptions: OptionInterface[]; ref: RefObject; close: () => void; hover: (index: number | undefined) => void; create: (item: OptionInterface) => void; onKeyPress: (event: KeyboardEvent) => void; clear: () => void; listboxStyles: { top: number; left: number; width: string; }; comboboxRef: RefObject; }; export {};