1 | import { StateManagerProps } from './useStateManager';
|
2 | import { GroupBase, OptionsOrGroups } from './types';
|
3 | declare type AsyncManagedPropKeys = 'options' | 'isLoading' | 'onInputChange' | 'filterOption';
|
4 | export interface AsyncAdditionalProps<Option, Group extends GroupBase<Option>> {
|
5 | |
6 |
|
7 |
|
8 |
|
9 | defaultOptions?: OptionsOrGroups<Option, Group> | boolean;
|
10 | |
11 |
|
12 |
|
13 |
|
14 | cacheOptions?: any;
|
15 | |
16 |
|
17 |
|
18 |
|
19 | loadOptions?: (inputValue: string, callback: (options: OptionsOrGroups<Option, Group>) => void) => Promise<OptionsOrGroups<Option, Group>> | void;
|
20 | |
21 |
|
22 |
|
23 |
|
24 | isLoading?: boolean;
|
25 | }
|
26 | export declare type AsyncProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = StateManagerProps<Option, IsMulti, Group> & AsyncAdditionalProps<Option, Group>;
|
27 | export default function useAsync<Option, IsMulti extends boolean, Group extends GroupBase<Option>, AdditionalProps>({ defaultOptions: propsDefaultOptions, cacheOptions, loadOptions: propsLoadOptions, options: propsOptions, isLoading: propsIsLoading, onInputChange: propsOnInputChange, filterOption, ...restSelectProps }: AsyncProps<Option, IsMulti, Group> & AdditionalProps): StateManagerProps<Option, IsMulti, Group> & Omit<AdditionalProps, keyof AsyncAdditionalProps<Option, Group> | AsyncManagedPropKeys>;
|
28 | export {};
|