1 | import React, { ChangeEvent, ComponentType, ReactNode } from 'react';
|
2 | import Typeahead from '../core/Typeahead';
|
3 | import { TypeaheadComponentProps } from '../components/Typeahead';
|
4 | import type { Option } from '../types';
|
5 | export interface UseAsyncProps extends TypeaheadComponentProps {
|
6 | delay?: number;
|
7 | isLoading: boolean;
|
8 | onSearch: (query: string) => void;
|
9 | promptText?: ReactNode;
|
10 | searchText?: ReactNode;
|
11 | useCache?: boolean;
|
12 | }
|
13 | export declare function useAsync(props: UseAsyncProps): {
|
14 | allowNew: boolean | ((options: Option[], state: import("../types").TypeaheadPropsAndState) => boolean) | undefined;
|
15 | emptyLabel: React.ReactNode;
|
16 | isLoading: boolean;
|
17 | minLength: number;
|
18 | onInputChange: (query: string, e: ChangeEvent<HTMLInputElement>) => void;
|
19 | options: Option[];
|
20 | align?: "justify" | "left" | "right" | undefined;
|
21 | className?: string | undefined;
|
22 | clearButton?: boolean | undefined;
|
23 | disabled?: boolean | undefined;
|
24 | dropup?: boolean | undefined;
|
25 | flip?: boolean | undefined;
|
26 | instanceRef?: React.Ref<Typeahead> | undefined;
|
27 | isInvalid?: boolean | undefined;
|
28 | isValid?: boolean | undefined;
|
29 | maxHeight?: string | undefined;
|
30 | newSelectionPrefix?: React.ReactNode;
|
31 | paginationText?: React.ReactNode;
|
32 | placeholder?: string | undefined;
|
33 | positionFixed?: boolean | undefined;
|
34 | renderInput?: ((inputProps: import("../types").TypeaheadInputProps, props: import("../types").TypeaheadManagerChildProps) => JSX.Element) | undefined;
|
35 | renderMenu?: ((results: Option[], menuProps: import("../components/Typeahead").RenderMenuProps, state: import("../types").TypeaheadManagerChildProps) => JSX.Element) | undefined;
|
36 | renderMenuItemChildren?: import("..").RenderMenuItemChildren | undefined;
|
37 | renderToken?: import("../types").RenderToken | undefined;
|
38 | size?: "lg" | "sm" | undefined;
|
39 | style?: React.CSSProperties | undefined;
|
40 | autoFocus?: boolean | undefined;
|
41 | caseSensitive?: boolean | undefined;
|
42 | children?: import("../types").TypeaheadChildren;
|
43 | defaultInputValue?: string | undefined;
|
44 | defaultOpen?: boolean | undefined;
|
45 | defaultSelected?: Option[] | undefined;
|
46 | filterBy?: import("../types").FilterByCallback | string[] | undefined;
|
47 | highlightOnlyResult?: boolean | undefined;
|
48 | id?: string | undefined;
|
49 | ignoreDiacritics?: boolean | undefined;
|
50 | inputProps?: import("../types").InputProps | undefined;
|
51 | labelKey?: import("../types").LabelKey | undefined;
|
52 | maxResults?: number | undefined;
|
53 | multiple?: boolean | undefined;
|
54 | onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
55 | onChange?: ((selected: Option[]) => void) | undefined;
|
56 | onFocus?: ((event: React.SyntheticEvent<HTMLInputElement, Event>) => void) | undefined;
|
57 | onKeyDown?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
|
58 | onMenuToggle?: ((isOpen: boolean) => void) | undefined;
|
59 | onPaginate?: ((event: import("../types").SelectEvent<HTMLElement>, shownResults: number) => void) | undefined;
|
60 | open?: boolean | undefined;
|
61 | paginate?: boolean | undefined;
|
62 | selected?: Option[] | undefined;
|
63 | selectHint?: import("../types").SelectHint | undefined;
|
64 | };
|
65 | export declare function withAsync<T extends UseAsyncProps = UseAsyncProps>(Component: ComponentType<T>): React.ForwardRefExoticComponent<React.PropsWithoutRef<T> & React.RefAttributes<Typeahead>>;
|
66 |
|
\ | No newline at end of file |