libphonenumber-js 1.10.40 → 1.10.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/libphonenumber-js.min.js +1 -1
- package/bundle/libphonenumber-js.min.js.map +1 -1
- package/bundle/libphonenumber-max.js +1 -1
- package/bundle/libphonenumber-max.js.map +1 -1
- package/bundle/libphonenumber-min.js +1 -1
- package/bundle/libphonenumber-min.js.map +1 -1
- package/bundle/libphonenumber-mobile.js +1 -1
- package/bundle/libphonenumber-mobile.js.map +1 -1
- package/core/package.json +0 -1
- package/max/index.d.cts +102 -0
- package/max/index.d.ts +102 -0
- package/max/package.json +0 -2
- package/metadata.full.json +1 -1
- package/metadata.full.json.js +1 -1
- package/metadata.max.json +1 -1
- package/metadata.max.json.js +1 -1
- package/metadata.min.json +1 -1
- package/metadata.min.json.js +1 -1
- package/metadata.mobile.json +1 -1
- package/metadata.mobile.json.js +1 -1
- package/min/package.json +0 -1
- package/mobile/index.d.cts +102 -0
- package/mobile/index.d.ts +102 -0
- package/mobile/package.json +0 -2
- package/package.json +4 -3
- package/types.d.cts +131 -0
package/core/package.json
CHANGED
package/max/index.d.cts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MetadataJson,
|
|
3
|
+
Examples,
|
|
4
|
+
PhoneNumber,
|
|
5
|
+
E164Number,
|
|
6
|
+
CountryCallingCode,
|
|
7
|
+
CountryCode,
|
|
8
|
+
CarrierCode,
|
|
9
|
+
NationalNumber,
|
|
10
|
+
Extension,
|
|
11
|
+
ParseError,
|
|
12
|
+
NumberFoundLegacy,
|
|
13
|
+
NumberFound,
|
|
14
|
+
NumberType,
|
|
15
|
+
NumberFormat,
|
|
16
|
+
NumberingPlan,
|
|
17
|
+
ValidatePhoneNumberLengthResult
|
|
18
|
+
} from '../types.d.js';
|
|
19
|
+
|
|
20
|
+
// They say this re-export is required.
|
|
21
|
+
// https://github.com/catamphetamine/libphonenumber-js/pull/290#issuecomment-453281180
|
|
22
|
+
export {
|
|
23
|
+
MetadataJson,
|
|
24
|
+
Examples,
|
|
25
|
+
PhoneNumber,
|
|
26
|
+
E164Number,
|
|
27
|
+
CountryCallingCode,
|
|
28
|
+
CountryCode,
|
|
29
|
+
CarrierCode,
|
|
30
|
+
NationalNumber,
|
|
31
|
+
Extension,
|
|
32
|
+
ParseError,
|
|
33
|
+
NumberFoundLegacy,
|
|
34
|
+
NumberFound,
|
|
35
|
+
NumberType,
|
|
36
|
+
NumberFormat,
|
|
37
|
+
NumberingPlan,
|
|
38
|
+
ValidatePhoneNumberLengthResult
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// `parsePhoneNumber()` named export has been renamed to `parsePhoneNumberWithError()`.
|
|
42
|
+
export function parsePhoneNumber(text: string, defaultCountry?: CountryCode): PhoneNumber;
|
|
43
|
+
|
|
44
|
+
export function parsePhoneNumberWithError(text: string, defaultCountry?: CountryCode): PhoneNumber;
|
|
45
|
+
|
|
46
|
+
// `parsePhoneNumberFromString()` named export is now considered legacy:
|
|
47
|
+
// it has been promoted to a default export due to being too verbose.
|
|
48
|
+
export function parsePhoneNumberFromString(text: string, defaultCountry?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string, extract?: boolean }): PhoneNumber | undefined;
|
|
49
|
+
|
|
50
|
+
export default parsePhoneNumberFromString;
|
|
51
|
+
|
|
52
|
+
export function isValidPhoneNumber(text: string, defaultCountry?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string }): boolean;
|
|
53
|
+
export function isPossiblePhoneNumber(text: string, defaultCountry?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string }): boolean;
|
|
54
|
+
export function validatePhoneNumberLength(text: string, defaultCountry?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string }): ValidatePhoneNumberLengthResult | undefined;
|
|
55
|
+
|
|
56
|
+
export function findNumbers(text: string, options?: CountryCode): NumberFoundLegacy[];
|
|
57
|
+
export function searchNumbers(text: string, options?: CountryCode): IterableIterator<NumberFoundLegacy>;
|
|
58
|
+
|
|
59
|
+
export function findNumbers(text: string, options?: { defaultCountry?: CountryCode, v2: true }): NumberFound[];
|
|
60
|
+
export function searchNumbers(text: string, options?: { defaultCountry?: CountryCode, v2: true }): IterableIterator<NumberFound>;
|
|
61
|
+
|
|
62
|
+
export function findPhoneNumbersInText(text: string, options?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string, extended?: boolean }): NumberFound[];
|
|
63
|
+
export function searchPhoneNumbersInText(text: string, options?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string, extended?: boolean }): IterableIterator<NumberFound>;
|
|
64
|
+
|
|
65
|
+
export class PhoneNumberMatcher {
|
|
66
|
+
constructor(text: string, options?: { defaultCountry?: CountryCode, v2: true });
|
|
67
|
+
hasNext(): boolean;
|
|
68
|
+
next(): NumberFound | undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function isSupportedCountry(countryCode: CountryCode): boolean;
|
|
72
|
+
export function getCountries(): CountryCode[];
|
|
73
|
+
export function getCountryCallingCode(countryCode: CountryCode): CountryCallingCode;
|
|
74
|
+
export function getExtPrefix(countryCode: CountryCode): string;
|
|
75
|
+
|
|
76
|
+
export function getExampleNumber(country: CountryCode, examples: Examples): PhoneNumber | undefined;
|
|
77
|
+
|
|
78
|
+
export function formatIncompletePhoneNumber(number: string, countryCode?: CountryCode): string;
|
|
79
|
+
export function parseIncompletePhoneNumber(text: string): string;
|
|
80
|
+
export function parsePhoneNumberCharacter(character: string): string;
|
|
81
|
+
export function parseDigits(character: string): string;
|
|
82
|
+
|
|
83
|
+
export class AsYouType {
|
|
84
|
+
constructor(defaultCountryCode?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string });
|
|
85
|
+
input(text: string): string;
|
|
86
|
+
reset(): void;
|
|
87
|
+
getNumber(): PhoneNumber | undefined;
|
|
88
|
+
getNumberValue(): E164Number | undefined;
|
|
89
|
+
getChars(): string;
|
|
90
|
+
getTemplate(): string;
|
|
91
|
+
getCallingCode(): string | undefined;
|
|
92
|
+
getCountry(): CountryCode | undefined;
|
|
93
|
+
isInternational(): boolean;
|
|
94
|
+
isPossible(): boolean;
|
|
95
|
+
isValid(): boolean;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export class Metadata {
|
|
99
|
+
constructor();
|
|
100
|
+
selectNumberingPlan(country: CountryCode): void;
|
|
101
|
+
numberingPlan?: NumberingPlan;
|
|
102
|
+
}
|
package/max/index.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MetadataJson,
|
|
3
|
+
Examples,
|
|
4
|
+
PhoneNumber,
|
|
5
|
+
E164Number,
|
|
6
|
+
CountryCallingCode,
|
|
7
|
+
CountryCode,
|
|
8
|
+
CarrierCode,
|
|
9
|
+
NationalNumber,
|
|
10
|
+
Extension,
|
|
11
|
+
ParseError,
|
|
12
|
+
NumberFoundLegacy,
|
|
13
|
+
NumberFound,
|
|
14
|
+
NumberType,
|
|
15
|
+
NumberFormat,
|
|
16
|
+
NumberingPlan,
|
|
17
|
+
ValidatePhoneNumberLengthResult
|
|
18
|
+
} from '../types.d.js';
|
|
19
|
+
|
|
20
|
+
// They say this re-export is required.
|
|
21
|
+
// https://github.com/catamphetamine/libphonenumber-js/pull/290#issuecomment-453281180
|
|
22
|
+
export {
|
|
23
|
+
MetadataJson,
|
|
24
|
+
Examples,
|
|
25
|
+
PhoneNumber,
|
|
26
|
+
E164Number,
|
|
27
|
+
CountryCallingCode,
|
|
28
|
+
CountryCode,
|
|
29
|
+
CarrierCode,
|
|
30
|
+
NationalNumber,
|
|
31
|
+
Extension,
|
|
32
|
+
ParseError,
|
|
33
|
+
NumberFoundLegacy,
|
|
34
|
+
NumberFound,
|
|
35
|
+
NumberType,
|
|
36
|
+
NumberFormat,
|
|
37
|
+
NumberingPlan,
|
|
38
|
+
ValidatePhoneNumberLengthResult
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// `parsePhoneNumber()` named export has been renamed to `parsePhoneNumberWithError()`.
|
|
42
|
+
export function parsePhoneNumber(text: string, defaultCountry?: CountryCode): PhoneNumber;
|
|
43
|
+
|
|
44
|
+
export function parsePhoneNumberWithError(text: string, defaultCountry?: CountryCode): PhoneNumber;
|
|
45
|
+
|
|
46
|
+
// `parsePhoneNumberFromString()` named export is now considered legacy:
|
|
47
|
+
// it has been promoted to a default export due to being too verbose.
|
|
48
|
+
export function parsePhoneNumberFromString(text: string, defaultCountry?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string, extract?: boolean }): PhoneNumber | undefined;
|
|
49
|
+
|
|
50
|
+
export default parsePhoneNumberFromString;
|
|
51
|
+
|
|
52
|
+
export function isValidPhoneNumber(text: string, defaultCountry?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string }): boolean;
|
|
53
|
+
export function isPossiblePhoneNumber(text: string, defaultCountry?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string }): boolean;
|
|
54
|
+
export function validatePhoneNumberLength(text: string, defaultCountry?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string }): ValidatePhoneNumberLengthResult | undefined;
|
|
55
|
+
|
|
56
|
+
export function findNumbers(text: string, options?: CountryCode): NumberFoundLegacy[];
|
|
57
|
+
export function searchNumbers(text: string, options?: CountryCode): IterableIterator<NumberFoundLegacy>;
|
|
58
|
+
|
|
59
|
+
export function findNumbers(text: string, options?: { defaultCountry?: CountryCode, v2: true }): NumberFound[];
|
|
60
|
+
export function searchNumbers(text: string, options?: { defaultCountry?: CountryCode, v2: true }): IterableIterator<NumberFound>;
|
|
61
|
+
|
|
62
|
+
export function findPhoneNumbersInText(text: string, options?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string, extended?: boolean }): NumberFound[];
|
|
63
|
+
export function searchPhoneNumbersInText(text: string, options?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string, extended?: boolean }): IterableIterator<NumberFound>;
|
|
64
|
+
|
|
65
|
+
export class PhoneNumberMatcher {
|
|
66
|
+
constructor(text: string, options?: { defaultCountry?: CountryCode, v2: true });
|
|
67
|
+
hasNext(): boolean;
|
|
68
|
+
next(): NumberFound | undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function isSupportedCountry(countryCode: CountryCode): boolean;
|
|
72
|
+
export function getCountries(): CountryCode[];
|
|
73
|
+
export function getCountryCallingCode(countryCode: CountryCode): CountryCallingCode;
|
|
74
|
+
export function getExtPrefix(countryCode: CountryCode): string;
|
|
75
|
+
|
|
76
|
+
export function getExampleNumber(country: CountryCode, examples: Examples): PhoneNumber | undefined;
|
|
77
|
+
|
|
78
|
+
export function formatIncompletePhoneNumber(number: string, countryCode?: CountryCode): string;
|
|
79
|
+
export function parseIncompletePhoneNumber(text: string): string;
|
|
80
|
+
export function parsePhoneNumberCharacter(character: string): string;
|
|
81
|
+
export function parseDigits(character: string): string;
|
|
82
|
+
|
|
83
|
+
export class AsYouType {
|
|
84
|
+
constructor(defaultCountryCode?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string });
|
|
85
|
+
input(text: string): string;
|
|
86
|
+
reset(): void;
|
|
87
|
+
getNumber(): PhoneNumber | undefined;
|
|
88
|
+
getNumberValue(): E164Number | undefined;
|
|
89
|
+
getChars(): string;
|
|
90
|
+
getTemplate(): string;
|
|
91
|
+
getCallingCode(): string | undefined;
|
|
92
|
+
getCountry(): CountryCode | undefined;
|
|
93
|
+
isInternational(): boolean;
|
|
94
|
+
isPossible(): boolean;
|
|
95
|
+
isValid(): boolean;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export class Metadata {
|
|
99
|
+
constructor();
|
|
100
|
+
selectNumberingPlan(country: CountryCode): void;
|
|
101
|
+
numberingPlan?: NumberingPlan;
|
|
102
|
+
}
|
package/max/package.json
CHANGED