forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreact-select.d.ts
80 lines (70 loc) · 2.7 KB
/
react-select.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Type definitions for react-select v0.9.10
// Project: https://github.com/JedWatson/react-select
// Definitions by: ESQUIBET Hugo <https://github.com/Hesquibet/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../react/react.d.ts"/>
// Typings for https://github.com/JedWatson/react-select
//***Usage***
// import ReactSelect = require('react-select');
// <ReactSelect options={this.options} name="form-field-name" onChange={this._onSelect} value={this.state.Type} />
declare module "react-select" {
// Import React
import React = require("react");
interface Option{
label : string;
value : string;
}
interface ReactSelectProps extends React.Props<ReactSelectClass>{
addLabelText? : string;
allowCreate? : boolean;
autoload? : boolean;
backspaceRemoves? : boolean;
cacheAsyncResults? : boolean;
className? : string;
clearable? : boolean;
clearAllText? : string;
clearValueText? : string;
delimiter? : string;
disabled? : boolean;
filterOption? : (option : Option,filterString : string)=>Option;
filterOptions? : (options:Array<Option>,filterString : string,values : Array<Object>)=>Array<Option>;
ignoreCase? : boolean; // default true whether to perform case-insensitive filtering
inputProps? : Object;
isLoading? : boolean;
labelKey? : string;
matchPos? : string;
matchProp? : string;
multi? : boolean;
name? : string;
newOptionCreator? : ()=>Option;
noResultsText? : string;
onBlur? : (event : Event)=>void;
onChange? : (newValue : string)=>void;
onFocus? : (event : Event)=>void;
onInputChange? : (inputValue : string)=>void;
onOptionLabelClick? : (value : string, event : Event)=>void;
optionRenderer? : ()=>void;
options? : Array<Option>;
placeholder? : string;
searchable? : boolean;
searchingText? : string;
searchPromptText? : string;
value? : Option;
valueKey? : string;
valueRenderer? : ()=>void;
}
interface ReactAsyncSelectProps extends React.Props<ReactSelectClass>{
cache? : any;
loadOptions? : ()=>void;
ignoreAccents? : boolean;
isLoading? : boolean;
loadingPlaceholder? : string;
}
interface ReactSelect extends React.ReactElement<ReactSelectProps> { }
interface ReactSelectClass extends React.ComponentClass<ReactSelectProps>{}
interface SelectWithAsync extends ReactSelectClass {
Async? : ReactAsyncSelectProps;
}
var ReactSelect: SelectWithAsync;
export default ReactSelect;
}