forked from bhrott/react-native-masked-text
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
43 lines (35 loc) · 1.18 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
import * as React from "react";
import {TextInput, TextInputProps} from "react-native";
// Type prop of TextInputMask.
type TextInputMaskTypeProp = "credit-card" | "cpf" | "cnpj" | "zip-code" | "only-numbers" | "money" | "cel-phone" | "datetime" | "custom";
// Option prop of TextInputMask.
type TextInputMaskOptionProp = {
// Money type.
precision?: number;
separator?: string;
delimiter?: string;
unit?: string;
suffixUnit?: string;
zeroCents?: boolean;
// Phone type.
withDDD?: boolean;
dddMask?: string;
// Datetime type.
format?: string;
// Credit card type.
obfuscated?: boolean;
};
// TextInputMask Props
interface TextInputMaskProps extends TextInputProps {
type: TextInputMaskTypeProp;
options?: TextInputMaskOptionProp;
checkText?: (previous: string, next: string) => boolean;
onChangeText?: (text: string) => void;
}
// TextInputMask Component
export declare class TextInputMask extends React.Component<TextInputMaskProps> {}
// MaskService
export declare class MaskService {
static toMask(type: string, value: any, options: TextInputMaskOptionProp): string;
static isValid(type: string, value: any, options: TextInputMaskOptionProp): boolean;
}