forked from bl00mber/react-phone-input-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
103 lines (88 loc) · 2.45 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
100
101
102
103
declare module "react-phone-input-2" {
import React from "react";
interface CountryData {
name: string;
dialCode: string;
countryCode: string;
format: string;
}
interface Style {
containerClass?: string;
inputClass?: string;
buttonClass?: string;
dropdownClass?: string;
searchClass?: string;
containerStyle?: React.CSSProperties;
inputStyle?: React.CSSProperties;
buttonStyle?: React.CSSProperties;
dropdownStyle?: React.CSSProperties;
searchStyle?: React.CSSProperties;
}
interface PhoneInputEventsProps {
onChange?(
value: string,
data: CountryData | {},
event: React.ChangeEvent<HTMLInputElement>,
formattedValue: string
): void;
onFocus?(
event: React.FocusEvent<HTMLInputElement>,
data: CountryData | {}
): void;
onBlur?(
event: React.FocusEvent<HTMLInputElement>,
data: CountryData | {}
): void;
onClick?(
event: React.MouseEvent<HTMLInputElement>,
data: CountryData | {}
): void;
onKeyDown?(event: React.KeyboardEvent<HTMLInputElement>): void;
isValid?: ((
value: string,
country: object,
countries: object[],
hiddenAreaCodes: object[],
) => boolean | string) | boolean;
}
export interface PhoneInputProps extends PhoneInputEventsProps, Style {
country?: string;
value?: string;
onlyCountries?: string[];
preferredCountries?: string[];
excludeCountries?: string[];
placeholder?: string;
searchPlaceholder?: string;
searchNotFound?: string;
disabled?: boolean;
autoFormat?: boolean;
enableAreaCodes?: boolean;
enableTerritories?: boolean;
disableCountryCode?: boolean;
disableDropdown?: boolean;
enableLongNumbers?: boolean;
countryCodeEditable?: boolean;
enableSearch?: boolean;
disableSearchIcon?: boolean;
regions?: string | string[];
inputProps?: object;
localization?: object;
masks?: object;
areaCodes?: object;
preserveOrder?: string[];
defaultMask?: string;
alwaysDefaultMask?: boolean;
prefix?: string;
copyNumbersOnly?: boolean;
renderStringAsFlag?: string;
autocompleteSearch?: boolean;
jumpCursorToEnd?: boolean;
priority?: object;
enableAreaCodeStretch?: boolean;
enableClickOutside?: boolean;
showDropdown?: boolean;
defaultErrorMessage?: string;
}
const PhoneInput: React.FC<PhoneInputProps>;
export default PhoneInput;
}