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/core/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,
@@ -83,7 +85,7 @@ export function getCountries(metadata: MetadataJson): CountryCode[];
83
85
  export function getCountryCallingCode(countryCode: CountryCode, metadata: MetadataJson): CountryCallingCode;
84
86
  export function getExtPrefix(countryCode: CountryCode, metadata: MetadataJson): string;
85
87
 
86
- export function getExampleNumber(country: CountryCode, examples: { [country in CountryCode]: NationalNumber }, metadata: MetadataJson): PhoneNumber | undefined;
88
+ export function getExampleNumber(country: CountryCode, examples: Examples, metadata: MetadataJson): PhoneNumber | undefined;
87
89
 
88
90
  export function formatIncompletePhoneNumber(number: string, metadata: MetadataJson): string;
89
91
  export function formatIncompletePhoneNumber(number: string, countryCode: CountryCode, metadata: MetadataJson): string;
package/custom.d.ts CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  import {
5
5
  MetadataJson,
6
+ Examples,
6
7
  PhoneNumber,
7
8
  E164Number,
8
9
  CountryCallingCode,
@@ -26,6 +27,7 @@ import {
26
27
 
27
28
  export {
28
29
  MetadataJson,
30
+ Examples,
29
31
  PhoneNumber,
30
32
  E164Number,
31
33
  CountryCallingCode,
@@ -83,7 +85,7 @@ export function getNumberType(parsedNumber: ParsedNumber, metadata: MetadataJson
83
85
  export function getNumberType(phone: NationalNumber, metadata: MetadataJson): NumberType;
84
86
  export function getNumberType(phone: NationalNumber, country: CountryCode, metadata: MetadataJson): NumberType;
85
87
 
86
- export function getExampleNumber(country: CountryCode, examples: { [country in CountryCode]: NationalNumber }, metadata: MetadataJson): PhoneNumber | undefined;
88
+ export function getExampleNumber(country: CountryCode, examples: Examples, metadata: MetadataJson): PhoneNumber | undefined;
87
89
 
88
90
  export function isPossibleNumber(parsedNumber: ParsedNumber, metadata: MetadataJson): boolean;
89
91
  export function isPossibleNumber(phone: NationalNumber, metadata: MetadataJson): boolean;
@@ -1,8 +1,4 @@
1
- import { CountryCode, NationalNumber } from './types';
1
+ import { Examples } from './types';
2
2
 
3
- export default interface Examples {
4
- // `in` operator docs:
5
- // https://www.typescriptlang.org/docs/handbook/advanced-types.html#mapped-types
6
- // `country in CountryCode` means "for each and every CountryCode".
7
- [country in CountryCode]: NationalNumber;
8
- };
3
+ declare const examples: Examples;
4
+ export default examples;
package/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,
@@ -18,6 +19,7 @@ import {
18
19
 
19
20
  export {
20
21
  MetadataJson,
22
+ Examples,
21
23
  PhoneNumber,
22
24
  E164Number,
23
25
  CountryCallingCode,
@@ -96,7 +98,7 @@ export function formatNumber(phone: NationalNumber, country: CountryCode, format
96
98
  export function getNumberType(parsedNumber: ParsedNumber): NumberType;
97
99
  export function getNumberType(phone: NationalNumber, country?: CountryCode): NumberType;
98
100
 
99
- export function getExampleNumber(country: CountryCode, examples: { [country in CountryCode]: NationalNumber }): PhoneNumber | undefined;
101
+ export function getExampleNumber(country: CountryCode, examples: Examples): PhoneNumber | undefined;
100
102
 
101
103
  export function isPossibleNumber(parsedNumber: ParsedNumber): boolean;
102
104
  export function isPossibleNumber(phone: NationalNumber, country?: CountryCode): boolean;