1 |
|
2 | import { noop } from '../utils';
|
3 | import { Id, Option, OptionHandler, SelectEvent } from '../types';
|
4 | export interface TypeaheadContextType {
|
5 | activeIndex: number;
|
6 | hintText: string;
|
7 | id: Id;
|
8 | initialItem: Option | null;
|
9 | inputNode: HTMLInputElement | null;
|
10 | isOnlyResult: boolean;
|
11 | onActiveItemChange: OptionHandler;
|
12 | onAdd: OptionHandler;
|
13 | onInitialItemChange: (option?: Option) => void;
|
14 | onMenuItemClick: (option: Option, event: SelectEvent<HTMLElement>) => void;
|
15 | setItem: (option: Option, position: number) => void;
|
16 | }
|
17 | export declare const defaultContext: {
|
18 | activeIndex: number;
|
19 | hintText: string;
|
20 | id: string;
|
21 | initialItem: null;
|
22 | inputNode: null;
|
23 | isOnlyResult: boolean;
|
24 | onActiveItemChange: typeof noop;
|
25 | onAdd: typeof noop;
|
26 | onInitialItemChange: typeof noop;
|
27 | onMenuItemClick: typeof noop;
|
28 | setItem: typeof noop;
|
29 | };
|
30 | export declare const TypeaheadContext: import("react").Context<TypeaheadContextType>;
|
31 | export declare const useTypeaheadContext: () => TypeaheadContextType;
|