Skip to content

Commit 8c83065

Browse files
committed
update types, fix #232
1 parent b08bd55 commit 8c83065

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

index.d.ts

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,61 @@ declare module "react-phone-input-2" {
4242
data: CountryData | {}
4343
): void;
4444
onKeyDown?(event: React.KeyboardEvent<HTMLInputElement>): void;
45+
isValid?: ((
46+
value: string,
47+
country: object,
48+
countries: object[],
49+
hiddenAreaCodes: object[],
50+
) => boolean | string) | boolean;
4551
}
4652

4753
export interface PhoneInputProps extends PhoneInputEventsProps, Style {
4854
country?: string;
4955
value?: string;
56+
5057
onlyCountries?: string[];
5158
preferredCountries?: string[];
5259
excludeCountries?: string[];
60+
5361
placeholder?: string;
5462
searchPlaceholder?: string;
55-
inputProps?: object;
63+
searchNotFound?: string;
64+
disabled?: boolean;
5665

5766
autoFormat?: boolean;
58-
disabled?: boolean;
59-
disableDropdown?: boolean;
60-
disableCountryCode?: boolean;
6167
enableAreaCodes?: boolean;
6268
enableTerritories?: boolean;
69+
70+
disableCountryCode?: boolean;
71+
disableDropdown?: boolean;
6372
enableLongNumbers?: boolean;
6473
countryCodeEditable?: boolean;
6574
enableSearch?: boolean;
6675
disableSearchIcon?: boolean;
76+
77+
regions?: string | string[];
78+
79+
inputProps?: object;
80+
localization?: object;
81+
masks?: object;
82+
areaCodes?: object;
83+
84+
preserveOrder?: string[];
85+
86+
defaultMask?: string;
87+
88+
alwaysDefaultMask?: boolean;
89+
prefix?: string;
90+
copyNumbersOnly?: boolean;
91+
renderStringAsFlag?: string;
92+
autocompleteSearch?: boolean;
93+
jumpCursorToEnd?: boolean;
94+
priority?: object;
95+
enableAreaCodeStretch?: boolean;
96+
enableClickOutside?: boolean;
97+
showDropdown?: boolean;
98+
99+
defaultErrorMessage?: string;
67100
}
68101
const PhoneInput: React.FC<PhoneInputProps>;
69102
export default PhoneInput;

0 commit comments

Comments
 (0)