mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
@types/react-select: Async make non-mandatory props optional (#30485)
This commit is contained in:
committed by
Pranav Senthilnathan
parent
cf27af28ad
commit
8b68c2fbb5
Vendored
+6
-4
@@ -6,14 +6,16 @@ import { OptionsType, InputActionMeta } from './types';
|
||||
|
||||
export interface AsyncProps<OptionType> {
|
||||
/* The default set of options to show before the user starts searching. When
|
||||
set to `true`, the results for loadOptions('') will be autoloaded. */
|
||||
defaultOptions: OptionsType<OptionType> | boolean;
|
||||
set to `true`, the results for loadOptions('') will be autoloaded.
|
||||
Default: false. */
|
||||
defaultOptions?: OptionsType<OptionType> | boolean;
|
||||
/* Function that returns a promise, which is the set of options to be used
|
||||
once the promise resolves. */
|
||||
loadOptions: (inputValue: string, callback: ((options: OptionsType<OptionType>) => void)) => Promise<any> | void;
|
||||
/* If cacheOptions is truthy, then the loaded data will be cached. The cache
|
||||
will remain until `cacheOptions` changes value. */
|
||||
cacheOptions: any;
|
||||
will remain until `cacheOptions` changes value.
|
||||
Default: false. */
|
||||
cacheOptions?: any;
|
||||
}
|
||||
|
||||
export type Props<OptionType> = SelectProps<OptionType> & AsyncProps<OptionType>;
|
||||
|
||||
Reference in New Issue
Block a user