Skip to content

Commit 91c62df

Browse files
committed
🚚 Move index.d.ts -> typings/index.d.ts
1 parent 0eea9e5 commit 91c62df

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
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",

index.d.ts renamed to typings/index.d.ts

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
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+
}

0 commit comments

Comments
 (0)