UNPKG

@1771technologies/lytenyte-pro

Version:

Blazingly fast headless React data grid with 100s of features.

32 lines (31 loc) 1.43 kB
import { type Dispatch, type RefObject, type SetStateAction } from "react"; import type { BaseOption, SmartSelectKinds } from "./type"; import type { ComboOptionState } from "./use-async-options"; export interface SmartSelectContext { readonly kindAndValue: SmartSelectKinds<BaseOption>; readonly open: boolean; readonly onOpenChange: (b: boolean) => void; readonly openKeys: string[]; readonly closeKeys: string[]; readonly options: BaseOption[]; readonly openOnClick: boolean; readonly closeOnSelect: boolean; readonly onOptionSelect: (b: BaseOption) => void; readonly onOptionsChange: (b: BaseOption[]) => void; readonly rtl: boolean; readonly inputRef: RefObject<HTMLElement | null>; readonly trigger: HTMLElement | null; readonly setTrigger: Dispatch<SetStateAction<HTMLElement | null>>; readonly activeId: string | null; readonly setActiveId: Dispatch<SetStateAction<string | null>>; readonly container: HTMLElement | null; readonly setContainer: Dispatch<SetStateAction<HTMLElement | null>>; readonly query: string; readonly onQueryChange: (change: string) => void; readonly comboState: ComboOptionState<BaseOption>; readonly preventNextOpen: { current: boolean; }; } export declare const SmartSelectProvider: import("react").Provider<SmartSelectContext>; export declare const useSmartSelect: () => SmartSelectContext;