mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-21 08:12:50 +00:00
Merge pull request #19439 from onatm/react-select/add-onNewOptionClick
[react-select] add onNewOptionClick prop to ReactCreatableSelectProps
This commit is contained in:
commit
494b17ab8a
7
types/react-select/index.d.ts
vendored
7
types/react-select/index.d.ts
vendored
@ -7,6 +7,7 @@
|
||||
// Mark Vujevits <https://github.com/vujevits>
|
||||
// Mike Deverell <https://github.com/devrelm>
|
||||
// MartynasZilinskas <https://github.com/MartynasZilinskas>
|
||||
// Onat Yigit Mercan <https://github.com/onatm>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@ -49,6 +50,7 @@ declare namespace ReactSelectClass {
|
||||
type OnChangeSingleHandler<TValue = OptionValues> = OnChangeHandler<Option<TValue>>;
|
||||
type OnChangeMultipleHandler<TValue = OptionValues> = OnChangeHandler<Options<TValue>>;
|
||||
type OnChangeHandler<TOption = Option | Options> = (newValue: TOption | null) => void;
|
||||
type OnNewOptionClickHandler = (option: Option) => void;
|
||||
|
||||
type LoadOptionsHandler = LoadOptionsAsyncHandler | LoadOptionsLegacyHandler;
|
||||
type LoadOptionsAsyncHandler = (input: string) => Promise<AutocompleteResult>;
|
||||
@ -453,6 +455,11 @@ declare namespace ReactSelectClass {
|
||||
* Decides if a keyDown event (eg its 'keyCode') should result in the creation of a new option.
|
||||
*/
|
||||
shouldKeyDownEventCreateNewOption?: ShouldKeyDownEventCreateNewOptionHandler;
|
||||
|
||||
/**
|
||||
* new option click handler: function (option) {}
|
||||
*/
|
||||
onNewOptionClick?: OnNewOptionClickHandler;
|
||||
}
|
||||
|
||||
interface ReactAsyncSelectProps extends ReactSelectProps {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user