forked from grantila/awesome-phonenumber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
55 lines (47 loc) · 1.28 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
declare namespace AwesomePhonenumber {
type PhoneNumberFormat =
'e164' |
'international' |
'national' |
'rfc3966' |
'significant';
type PhoneNumberTypes =
'fixed-line' |
'fixed-line-or-mobile' |
'mobile' |
'pager' |
'personal-number' |
'premium-rate' |
'shared-cost' |
'toll-free' |
'uan' |
'voip' |
'unknown';
class PhoneNumber {
constructor(phoneNumber: string, countryCode?: string);
isValid(): boolean;
canBeInternationallyDialled(): boolean;
getLengthOfGeographicalAreaCode(): number;
isPossible(): boolean;
getType(): PhoneNumberTypes;
isMobile(): boolean;
isFixedLine(): boolean;
getNumber(type?: PhoneNumberFormat): string;
getNumberFrom(regionCode: string): string;
getRegionCode(): string;
toJSON(): any;
static getCountryCodeForRegionCode(regionCode: string): number;
static getRegionCodeForCountryCode(countryCode: number): string;
static getSupportedCallingCodes(): string[];
static getExample(regionCode: string, type?: PhoneNumberTypes): PhoneNumber;
static getAsYouType(regionCode: string): AsYouType;
}
class AsYouType {
addChar(char: string): string;
number(): string;
removeChar(): string;
reset(number?: string): string;
getPhoneNumber(): PhoneNumber;
}
}
export default AwesomePhonenumber.PhoneNumber;