libphonenumber-js 1.9.29 → 1.9.34
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/index.d.ts +3 -1
- package/custom.d.ts +3 -1
- package/examples.mobile.json.d.ts +3 -7
- package/index.d.ts +3 -1
- package/metadata.full.json +1 -1
- package/metadata.full.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/index.d.ts +3 -1
- package/package.json +1 -1
- package/types.d.ts +7 -0
package/min/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MetadataJson,
|
|
3
|
+
Examples,
|
|
3
4
|
PhoneNumber,
|
|
4
5
|
E164Number,
|
|
5
6
|
CountryCallingCode,
|
|
@@ -20,6 +21,7 @@ import {
|
|
|
20
21
|
// https://github.com/catamphetamine/libphonenumber-js/pull/290#issuecomment-453281180
|
|
21
22
|
export {
|
|
22
23
|
MetadataJson,
|
|
24
|
+
Examples,
|
|
23
25
|
PhoneNumber,
|
|
24
26
|
E164Number,
|
|
25
27
|
CountryCallingCode,
|
|
@@ -71,7 +73,7 @@ export function getCountries(): CountryCode[];
|
|
|
71
73
|
export function getCountryCallingCode(countryCode: CountryCode): CountryCallingCode;
|
|
72
74
|
export function getExtPrefix(countryCode: CountryCode): string;
|
|
73
75
|
|
|
74
|
-
export function getExampleNumber(country: CountryCode, examples:
|
|
76
|
+
export function getExampleNumber(country: CountryCode, examples: Examples): PhoneNumber | undefined;
|
|
75
77
|
|
|
76
78
|
export function formatIncompletePhoneNumber(number: string, countryCode?: CountryCode): string;
|
|
77
79
|
export function parseIncompletePhoneNumber(text: string): string;
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -32,6 +32,13 @@ export type MetadataJson = {
|
|
|
32
32
|
countries: Countries;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
+
export type Examples = {
|
|
36
|
+
// `in` operator docs:
|
|
37
|
+
// https://www.typescriptlang.org/docs/handbook/advanced-types.html#mapped-types
|
|
38
|
+
// `country in CountryCode` means "for each and every CountryCode".
|
|
39
|
+
[country in CountryCode]: NationalNumber;
|
|
40
|
+
};
|
|
41
|
+
|
|
35
42
|
// 'National' and 'International' formats are deprecated.
|
|
36
43
|
export type NumberFormat = 'NATIONAL' | 'National' | 'INTERNATIONAL' | 'International' | 'E.164' | 'RFC3966' | 'IDD';
|
|
37
44
|
export type NumberType = undefined | 'PREMIUM_RATE' | 'TOLL_FREE' | 'SHARED_COST' | 'VOIP' | 'PERSONAL_NUMBER' | 'PAGER' | 'UAN' | 'VOICEMAIL' | 'FIXED_LINE_OR_MOBILE' | 'FIXED_LINE' | 'MOBILE';
|