File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 "react" : " ^16.2.0" ,
2626 "react-dom" : " ^16.2.0"
2727 },
28- "typings" : " . /index.d.ts" ,
28+ "typings" : " typings /index.d.ts" ,
2929 "devDependencies" : {
3030 "babel-cli" : " ^6.26.0" ,
3131 "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' ;
22
3- export default OtpInput ;
4- declare class OtpInput extends React . Component {
3+ export class OtpInput extends React . Component < OtpInputProps , OtpInputState > {
54 static defaultProps : {
65 numInputs : number ;
76 onChange : ( otp : number ) => void ;
87 isDisabled : boolean ;
98 shouldAutoFocus : boolean ;
109 value : string ;
1110 } ;
12- state : {
13- activeInput : number ;
14- } ;
1511 getOtpValue : ( ) => any ;
1612 getPlaceholderValue : ( ) => any ;
1713 handleOtpChange : ( otp : string [ ] ) => void ;
@@ -26,3 +22,27 @@ declare class OtpInput extends React.Component {
2622 handleOnInput : ( e : Object ) => void ;
2723 renderInputs : ( ) => any [ ] ;
2824}
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