@types/react-select: Async make non-mandatory props optional (#30485)

This commit is contained in:
Radu
2018-11-15 13:31:28 -08:00
committed by Pranav Senthilnathan
parent cf27af28ad
commit 8b68c2fbb5
+6 -4
View File
@@ -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>;