1 | import countryPhoneData from './data/country_phone_data';
|
2 | export interface PhoneInvalidResult {
|
3 | isValid: false;
|
4 | phoneNumber: null;
|
5 | countryIso2: null;
|
6 | countryIso3: null;
|
7 | countryCode: null;
|
8 | }
|
9 | export interface PhoneValidResult {
|
10 | isValid: true;
|
11 | phoneNumber: string;
|
12 | countryIso2: string;
|
13 | countryIso3: string;
|
14 | countryCode: string;
|
15 | }
|
16 | export type PhoneResult = PhoneInvalidResult | PhoneValidResult;
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | export default function phone(phoneNumber: string, { country, validateMobilePrefix, strictDetection }?: {
|
28 | country?: string;
|
29 | validateMobilePrefix?: boolean;
|
30 | strictDetection?: boolean;
|
31 | }): PhoneResult;
|
32 | export { phone, countryPhoneData, };
|