File tree Expand file tree Collapse file tree 2 files changed +27
-7
lines changed Expand file tree Collapse file tree 2 files changed +27
-7
lines changed Original file line number Diff line number Diff line change 25
25
"react" : " ^16.2.0" ,
26
26
"react-dom" : " ^16.2.0"
27
27
},
28
- "typings" : " . /index.d.ts" ,
28
+ "typings" : " typings /index.d.ts" ,
29
29
"devDependencies" : {
30
30
"babel-cli" : " ^6.26.0" ,
31
31
"babel-core" : " ^6.26.3" ,
Original file line number Diff line number Diff line change 1
- import React from 'react' ;
1
+ import * as React from 'react' ;
2
2
3
- export default OtpInput ;
4
- declare class OtpInput extends React . Component {
3
+ export class OtpInput extends React . Component < OtpInputProps , OtpInputState > {
5
4
static defaultProps : {
6
5
numInputs : number ;
7
6
onChange : ( otp : number ) => void ;
8
7
isDisabled : boolean ;
9
8
shouldAutoFocus : boolean ;
10
9
value : string ;
11
10
} ;
12
- state : {
13
- activeInput : number ;
14
- } ;
15
11
getOtpValue : ( ) => any ;
16
12
getPlaceholderValue : ( ) => any ;
17
13
handleOtpChange : ( otp : string [ ] ) => void ;
@@ -26,3 +22,27 @@ declare class OtpInput extends React.Component {
26
22
handleOnInput : ( e : Object ) => void ;
27
23
renderInputs : ( ) => any [ ] ;
28
24
}
25
+
26
+ export interface OtpInputProps {
27
+ className ?: string ;
28
+ containerStyle ?: Object ;
29
+ disabledStyle ?: Object ;
30
+ errorStyle ?: Object ;
31
+ focusStyle ?: Object ;
32
+ hasErrored ?: boolean ;
33
+ inputStyle ?: Object ;
34
+ isDisabled ?: boolean ;
35
+ isInputNum ?: boolean ;
36
+ isInputSecure ?: boolean ;
37
+ numInputs : number ;
38
+ onChange : Function ;
39
+ placeholder : string ;
40
+ separator ?: Object ;
41
+ shouldAutoFocus ?: boolean ;
42
+ value ?: string ;
43
+ }
44
+
45
+ export interface OtpInputState {
46
+ activeInput : number ;
47
+ otp : string [ ] ;
48
+ }
You can’t perform that action at this time.
0 commit comments