forked from tttstudios/react-native-otp-input
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
100 lines (91 loc) · 2.33 KB
/
index.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* typescript declaration file created for @twotalltotems/react-native-otp-input
* created by: Eric Dao, Becky Wu from TTTStudios
*/
declare module '@twotalltotems/react-native-otp-input' {
import * as React from 'react'
import { TextStyle, ViewStyle } from 'react-native';
/**
* Define types of keyboard
* There are 4 main types:
* default, email-address, number-pad and phone-pad
*/
type KeyboardType = 'default' | 'email-address' | 'number-pad' | 'phone-pad';
export interface InputProps {
/**
* Digits of pins in the OTP
*/
pinCount: number;
/**
* Style of the input fields
*/
codeInputFieldStyle?: TextStyle;
/**
* Style of highlighted status for input fields
*/
codeInputHighlightStyle?: TextStyle;
/**
* Callback function
* Trigger when all fields of the OTP has been filled
*
* @param code The verification code
*/
onCodeFilled?: (code: string) => void;
/**
* Callback function
* Trigger when a field of the OTP is changed
*
* @param code The verification code
*/
onCodeChanged?: (code: string) => void;
/**
* If keyboard is automatically brought up when OTP is loaded.
*/
autoFocusOnLoad?: boolean;
/**
* Initial pin code
*/
code?: string;
/**
* Secure input text
*/
secureTextEntry?: boolean;
/**
* Set editable for inputs
*/
editable?: boolean;
/**
* Type of the keyboard
*/
keyboardType?: KeyboardType;
/**
* Placeholder character to fill all inputs when the OTP is empty
*/
placeholderCharacter?: string;
/**
* Placeholder text color of inputs
*/
placeholderTextColor?: string;
/**
* Style of the OTP container view
*/
style?: ViewStyle;
/**
* The highlight (and cursor on iOS) color of the text input.
*/
selectionColor?: string;
/**
* If inputs are automatically cleared.
*/
clearInputs?: boolean;
/**
* Keyboard appearance. The value can be 'default', 'dark' or 'light'.
*/
keyboardAppearance?: 'default' | 'dark' | 'light';
}
export interface OTPInputViewState {
digits: string[];
selectedIndex: number;
}
export default class OTPInputView extends React.Component<InputProps, OTPInputViewState> {
}
}