@nhtio/phone-object 1.20250512.0 → 1.20251205.0

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/index.d.mts ADDED
@@ -0,0 +1,517 @@
1
+ /**
2
+ * An interface describing an object where a NANPA area code is a key, and a NANPA country code is a value.
3
+ */
4
+ export declare interface AreaCodeMap {
5
+ [areaCode: string]: string;
6
+ }
7
+
8
+ /**
9
+ * A map of NANPA area codes to NANPA country codes.
10
+ */
11
+ export declare const areaCodeMap: AreaCodeMap;
12
+
13
+ /**
14
+ * An immutable map of all of the names of the countries recognized by the library in English using ISO 3166-1 alpha-2 country codes as keys.
15
+ */
16
+ export declare const countries: Readonly<Map<string, string>>;
17
+
18
+ /**
19
+ * Represents the ISO 3166-1 alpha-2 country codes of all countries recognized by the library.
20
+ */
21
+ export declare type Country = 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AO' | 'AQ' | 'AR' | 'AS' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'FI' | 'FJ' | 'FK' | 'FM' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GU' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MH' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MP' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PR' | 'PS' | 'PT' | 'PW' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TW' | 'TZ' | 'UA' | 'UG' | 'UM' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VI' | 'VN' | 'VU' | 'WF' | 'WS' | 'XK' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW';
22
+
23
+ /**
24
+ * Represents either the ISO 3166-1 alpha-2 country codes of all countries recognized by the library or the string `'XX'` to represent an unknown country.
25
+ */
26
+ export declare type CountryOrUnknown = Country | 'XX';
27
+
28
+ /**
29
+ * Represents the possible timezones of all countries recognized by the library.
30
+ */
31
+ export declare type CountryTimezone = 'Europe/Andorra' | 'Asia/Dubai' | 'Asia/Kabul' | 'America/Antigua' | 'America/Anguilla' | 'Europe/Tirane' | 'Asia/Yerevan' | 'Africa/Luanda' | 'Antarctica/Casey' | 'America/Argentina/Buenos_Aires' | 'Pacific/Pago_Pago' | 'Europe/Vienna' | 'Australia/Sydney' | 'America/Aruba' | 'Europe/Mariehamn' | 'Asia/Baku' | 'Europe/Sarajevo' | 'America/Barbados' | 'Asia/Dhaka' | 'Europe/Brussels' | 'Africa/Ouagadougou' | 'Europe/Sofia' | 'Asia/Bahrain' | 'Africa/Bujumbura' | 'Africa/Porto-Novo' | 'America/St_Barthelemy' | 'Atlantic/Bermuda' | 'Asia/Brunei' | 'America/La_Paz' | 'America/Kralendijk' | 'America/Sao_Paulo' | 'America/Nassau' | 'Asia/Thimphu' | 'Africa/Gaborone' | 'Europe/Minsk' | 'America/Belize' | 'America/Toronto' | 'Indian/Cocos' | 'Africa/Kinshasa' | 'Africa/Bangui' | 'Africa/Brazzaville' | 'Europe/Zurich' | 'Africa/Abidjan' | 'Pacific/Rarotonga' | 'America/Santiago' | 'Africa/Douala' | 'Asia/Shanghai' | 'America/Bogota' | 'America/Costa_Rica' | 'America/Havana' | 'Atlantic/Cape_Verde' | 'America/Curacao' | 'Indian/Christmas' | 'Asia/Nicosia' | 'Europe/Prague' | 'Europe/Berlin' | 'Africa/Djibouti' | 'Europe/Copenhagen' | 'America/Dominica' | 'America/Santo_Domingo' | 'Africa/Algiers' | 'America/Guayaquil' | 'Europe/Tallinn' | 'Africa/Cairo' | 'Africa/El_Aaiun' | 'Africa/Asmara' | 'Europe/Madrid' | 'Africa/Addis_Ababa' | 'Europe/Helsinki' | 'Pacific/Fiji' | 'Atlantic/Stanley' | 'Pacific/Pohnpei' | 'Atlantic/Faroe' | 'Europe/Paris' | 'Africa/Libreville' | 'Europe/London' | 'America/Grenada' | 'Asia/Tbilisi' | 'America/Cayenne' | 'Europe/Guernsey' | 'Africa/Accra' | 'Europe/Gibraltar' | 'America/Godthab' | 'Africa/Banjul' | 'Africa/Conakry' | 'America/Guadeloupe' | 'Africa/Malabo' | 'Europe/Athens' | 'Atlantic/South_Georgia' | 'America/Guatemala' | 'Pacific/Guam' | 'Africa/Bissau' | 'America/Guyana' | 'Asia/Hong_Kong' | 'America/Tegucigalpa' | 'Europe/Zagreb' | 'America/Port-au-Prince' | 'Europe/Budapest' | 'Asia/Jakarta' | 'Europe/Dublin' | 'Asia/Jerusalem' | 'Europe/Isle_of_Man' | 'Asia/Kolkata' | 'Indian/Chagos' | 'Asia/Baghdad' | 'Asia/Tehran' | 'Atlantic/Reykjavik' | 'Europe/Rome' | 'Europe/Jersey' | 'America/Jamaica' | 'Asia/Amman' | 'Asia/Tokyo' | 'Africa/Nairobi' | 'Asia/Bishkek' | 'Asia/Phnom_Penh' | 'Pacific/Tarawa' | 'Indian/Comoro' | 'America/St_Kitts' | 'Asia/Pyongyang' | 'Asia/Seoul' | 'Asia/Kuwait' | 'America/Cayman' | 'Asia/Almaty' | 'Asia/Vientiane' | 'Asia/Beirut' | 'America/St_Lucia' | 'Europe/Vaduz' | 'Asia/Colombo' | 'Africa/Monrovia' | 'Africa/Maseru' | 'Europe/Vilnius' | 'Europe/Luxembourg' | 'Europe/Riga' | 'Africa/Tripoli' | 'Africa/Casablanca' | 'Europe/Monaco' | 'Europe/Chisinau' | 'Europe/Podgorica' | 'America/Marigot' | 'Indian/Antananarivo' | 'Pacific/Majuro' | 'Europe/Skopje' | 'Africa/Bamako' | 'Asia/Yangon' | 'Asia/Ulaanbaatar' | 'Asia/Macau' | 'Pacific/Saipan' | 'America/Martinique' | 'Africa/Nouakchott' | 'America/Montserrat' | 'Europe/Malta' | 'Indian/Mauritius' | 'Indian/Maldives' | 'Africa/Blantyre' | 'America/Mexico_City' | 'Asia/Kuala_Lumpur' | 'Africa/Maputo' | 'Africa/Windhoek' | 'Pacific/Noumea' | 'Africa/Niamey' | 'Pacific/Norfolk' | 'Africa/Lagos' | 'America/Managua' | 'Europe/Amsterdam' | 'Europe/Oslo' | 'Asia/Kathmandu' | 'Pacific/Nauru' | 'Pacific/Niue' | 'Pacific/Auckland' | 'Asia/Muscat' | 'America/Panama' | 'America/Lima' | 'Pacific/Tahiti' | 'Pacific/Port_Moresby' | 'Asia/Manila' | 'Asia/Karachi' | 'Europe/Warsaw' | 'America/Miquelon' | 'Pacific/Pitcairn' | 'America/Puerto_Rico' | 'Asia/Gaza' | 'Europe/Lisbon' | 'Pacific/Palau' | 'America/Asuncion' | 'Asia/Qatar' | 'Indian/Reunion' | 'Europe/Bucharest' | 'Europe/Belgrade' | 'Europe/Moscow' | 'Africa/Kigali' | 'Asia/Riyadh' | 'Pacific/Guadalcanal' | 'Indian/Mahe' | 'Africa/Khartoum' | 'Europe/Stockholm' | 'Asia/Singapore' | 'Atlantic/St_Helena' | 'Europe/Ljubljana' | 'Arctic/Longyearbyen' | 'Europe/Bratislava' | 'Africa/Freetown' | 'Europe/San_Marino' | 'Africa/Dakar' | 'Africa/Mogadishu' | 'America/Paramaribo' | 'Africa/Juba' | 'Africa/Sao_Tome' | 'America/El_Salvador' | 'America/Lower_Princes' | 'Asia/Damascus' | 'Africa/Mbabane' | 'America/Grand_Turk' | 'Africa/Ndjamena' | 'Indian/Kerguelen' | 'Africa/Lome' | 'Asia/Bangkok' | 'Asia/Dushanbe' | 'Pacific/Fakaofo' | 'Asia/Dili' | 'Asia/Ashgabat' | 'Africa/Tunis' | 'Pacific/Tongatapu' | 'Europe/Istanbul' | 'America/Port_of_Spain' | 'Pacific/Funafuti' | 'Asia/Taipei' | 'Africa/Dar_es_Salaam' | 'Europe/Kiev' | 'Africa/Kampala' | 'Pacific/Wake' | 'America/New_York' | 'America/Montevideo' | 'Asia/Tashkent' | 'Europe/Vatican' | 'America/St_Vincent' | 'America/Caracas' | 'America/Tortola' | 'America/St_Thomas' | 'Asia/Ho_Chi_Minh' | 'Pacific/Efate' | 'Pacific/Wallis' | 'Pacific/Apia' | 'Asia/Aden' | 'Indian/Mayotte' | 'Africa/Johannesburg' | 'Africa/Lusaka' | 'Africa/Harare';
32
+
33
+ /**
34
+ * Returns an array of ISO 3166-1 alpha-2 country codes that have the same specific time as the given options.
35
+ * @param minute - The minute of the specific time.
36
+ * @param hour - The hour of the specific time. Can be a number or an object of advanced options.
37
+ * @param advanced - An object of advanced options for the specific time.
38
+ * @returns An array of ISO 3166-1 alpha-2 country codes that have the same specific time as the given options.
39
+ */
40
+ export declare function getCountriesWithSpecificTime(minute: Numeric, hour?: Numeric | SpecificTimeAdvancedOptions, advanced?: SpecificTimeAdvancedOptions): string[];
41
+
42
+ /**
43
+ * An immutable set of all of the ISO 3166-1 alpha-2 country codes recognized by the library.
44
+ */
45
+ export declare const isos: Readonly<Set<string>>;
46
+
47
+ /**
48
+ * A list of NANPA country codes.
49
+ */
50
+ export declare const nanpaCountries: Array<string>;
51
+
52
+ /**
53
+ * Represents a numeric value that can be either a string or a number.
54
+ */
55
+ export declare type Numeric = string | number;
56
+
57
+ /**
58
+ * The `Phone` class represents a phone number and provides methods to retrieve information about it.
59
+ * It implements the `PhoneModel` interface.
60
+ * @implements {PhoneModel}
61
+ */
62
+ export declare class Phone implements PhoneModel {
63
+ #private;
64
+ /**
65
+ * The `Phone` class constructor takes a `phone` argument of type `RawPhoneType` and an optional `country` argument of type `RawCountryType`.
66
+ * It initializes `Phone` instance.
67
+ * @constructor
68
+ * @param {RawPhoneType} phone - The phone number to be parsed and validated.
69
+ * @param {RawCountryType} [country] - The country code of the phone number. If not provided, the country will be guessed based on the phone number.
70
+ */
71
+ constructor(phone: RawPhoneType, country?: RawCountryType);
72
+ /**
73
+ * Returns the country code of the phone number.
74
+ * @readonly
75
+ * @type {CountryOrUnknown}
76
+ */
77
+ readonly country: CountryOrUnknown;
78
+ /**
79
+ * Returns whether the phone number uses a valid format for the parsed country or not.
80
+ * @readonly
81
+ * @type {boolean}
82
+ */
83
+ readonly valid: boolean;
84
+ /**
85
+ * Returns the type of the phone number.
86
+ * @readonly
87
+ * @type {PhoneTypes}
88
+ */
89
+ readonly type: PhoneTypes;
90
+ /**
91
+ * Returns whether the phone number is a mobile number or not.
92
+ * @readonly
93
+ * @type {boolean}
94
+ */
95
+ readonly mobile: boolean;
96
+ /**
97
+ * Returns the raw phone number.
98
+ * @readonly
99
+ * @type {string}
100
+ *
101
+ * @remarks
102
+ * If the phone number is not a valid phone number, the initial phone number which was passed to the constructor is returned.
103
+ */
104
+ readonly raw: string;
105
+ /**
106
+ * Returns the national format of the phone number.
107
+ * @readonly
108
+ * @type {string}
109
+ *
110
+ * @remarks
111
+ * If the phone number is not a valid phone number, the initial phone number which was passed to the constructor is returned.
112
+ */
113
+ readonly national: string;
114
+ /**
115
+ * Returns the international format of the phone number.
116
+ * @readonly
117
+ * @type {string}
118
+ *
119
+ * @remarks
120
+ * If the phone number is not a valid phone number, the initial phone number which was passed to the constructor is returned.
121
+ */
122
+ readonly international: string;
123
+ /**
124
+ * Returns the E.164 format of the phone number.
125
+ * @readonly
126
+ * @type {string}
127
+ *
128
+ * @remarks
129
+ * If the phone number is not a valid phone number, the initial phone number which was passed to the constructor is returned.
130
+ */
131
+ readonly e164: string;
132
+ /**
133
+ * Returns the timezone of the phone number.
134
+ * @readonly
135
+ * @type {PossiblePhoneTimezone}
136
+ */
137
+ readonly timezone: PossiblePhoneTimezone;
138
+ /**
139
+ * Returns an object representation of the phone number.
140
+ * @returns {{
141
+ * phone: string;
142
+ * country: string;
143
+ * valid: boolean;
144
+ * type: PhoneTypes;
145
+ * mobile: boolean;
146
+ * raw: string;
147
+ * national: string;
148
+ * international: string;
149
+ * e164: string;
150
+ * timezone: PossiblePhoneTimezone;
151
+ * }} - An object representation of the phone number.
152
+ */
153
+ toObject(): {
154
+ /**
155
+ * The phone number as a string stripped of all non-numeric characters.
156
+ */
157
+ phone: string;
158
+ /**
159
+ * The country code of the phone number.
160
+ * @remarks
161
+ * In cases where the country was not recognized and could not be guessed from the phone number, `'XX'` is used.
162
+ * @type {CountryOrUnknown}
163
+ */
164
+ country: CountryOrUnknown;
165
+ /**
166
+ * Whether the phone number uses a valid format for the parsed country or not.
167
+ * @type {boolean}
168
+ */
169
+ valid: boolean;
170
+ /**
171
+ * The type of the phone number.
172
+ * @type {PhoneTypes}
173
+ */
174
+ type: "FIXED_LINE" | "MOBILE" | "FIXED_LINE_OR_MOBILE" | "TOLL_FREE" | "PREMIUM_RATE" | "SHARED_COST" | "VOIP" | "PERSONAL_NUMBER" | "PAGER" | "UAN" | "VOICEMAIL" | "UNKNOWN" | "INVALID";
175
+ /**
176
+ * Whether the phone number is possibly a mobile number or not.
177
+ * @type {boolean}
178
+ */
179
+ mobile: boolean;
180
+ /**
181
+ * The phone number as a string stripped of all non-numeric characters.
182
+ * @type {string}
183
+ */
184
+ raw: string;
185
+ /**
186
+ * The phone number as a string in the national format for the parsed country.
187
+ * @type {string}
188
+ */
189
+ national: string;
190
+ /**
191
+ * The phone number as a string in the international format for the parsed country.
192
+ * @type {string}
193
+ */
194
+ international: string;
195
+ /**
196
+ * The phone number as a string in the E.164 format.
197
+ * @type {string}
198
+ */
199
+ e164: string;
200
+ /**
201
+ * The estimated timezone of the phone number based on the phone number's country. It can be either a `CountryTimezone` or `'UTC'`.
202
+ */
203
+ timezone: PossiblePhoneTimezone;
204
+ };
205
+ /**
206
+ * Returns a JSON representation of the phone number.
207
+ * @returns {{
208
+ * phone: string;
209
+ * country: string;
210
+ * valid: boolean;
211
+ * type: PhoneTypes;
212
+ * mobile: boolean;
213
+ * raw: string;
214
+ * national: string;
215
+ * international: string;
216
+ * e164: string;
217
+ * timezone: PossiblePhoneTimezone;
218
+ * }} - A JSON-safe representation of the phone number.
219
+ */
220
+ toJSON(): {
221
+ /**
222
+ * The phone number as a string stripped of all non-numeric characters.
223
+ */
224
+ phone: string;
225
+ /**
226
+ * The country code of the phone number.
227
+ * @remarks
228
+ * In cases where the country was not recognized and could not be guessed from the phone number, `'XX'` is used.
229
+ * @type {CountryOrUnknown}
230
+ */
231
+ country: CountryOrUnknown;
232
+ /**
233
+ * Whether the phone number uses a valid format for the parsed country or not.
234
+ * @type {boolean}
235
+ */
236
+ valid: boolean;
237
+ /**
238
+ * The type of the phone number.
239
+ * @type {PhoneTypes}
240
+ */
241
+ type: "FIXED_LINE" | "MOBILE" | "FIXED_LINE_OR_MOBILE" | "TOLL_FREE" | "PREMIUM_RATE" | "SHARED_COST" | "VOIP" | "PERSONAL_NUMBER" | "PAGER" | "UAN" | "VOICEMAIL" | "UNKNOWN" | "INVALID";
242
+ /**
243
+ * Whether the phone number is possibly a mobile number or not.
244
+ * @type {boolean}
245
+ */
246
+ mobile: boolean;
247
+ /**
248
+ * The phone number as a string stripped of all non-numeric characters.
249
+ * @type {string}
250
+ */
251
+ raw: string;
252
+ /**
253
+ * The phone number as a string in the national format for the parsed country.
254
+ * @type {string}
255
+ */
256
+ national: string;
257
+ /**
258
+ * The phone number as a string in the international format for the parsed country.
259
+ * @type {string}
260
+ */
261
+ international: string;
262
+ /**
263
+ * The phone number as a string in the E.164 format.
264
+ * @type {string}
265
+ */
266
+ e164: string;
267
+ /**
268
+ * The estimated timezone of the phone number based on the phone number's country. It can be either a `CountryTimezone` or `'UTC'`.
269
+ */
270
+ timezone: PossiblePhoneTimezone;
271
+ };
272
+ /**
273
+ * Returns the E.164 format of the phone number as a string.
274
+ * @returns {string} - The E.164 format of the phone number.
275
+ */
276
+ toString(): string;
277
+ /**
278
+ * Returns a stringified representation of the phone number.
279
+ * @returns {string} - A string representation of the phone number.
280
+ */
281
+ inspect(): string;
282
+ /**
283
+ * Serializes the phone object to an obfuscated string which can be used to recreate the phone object from the `Phone.deserialize` method.
284
+ * @returns {string} - The serialized phone object.
285
+ */
286
+ serialize(): string;
287
+ /**
288
+ * Creates a new phone object from a serialized phone object.
289
+ * @param serialized The serialized phone object returned from the `Phone.serialize` method.
290
+ * @returns A Phone instance with the same properties as the original phone object.
291
+ * @throws An error if the serialized phone object is not valid.
292
+ */
293
+ static deserialize(serialized: string): Phone;
294
+ }
295
+
296
+ /**
297
+ * The `PhoneModel` interface represents a phone number object with various properties and methods.
298
+ * @interface
299
+ */
300
+ export declare interface PhoneModel {
301
+ /**
302
+ * The `country` property represents the country that was used to create the `Phone` instance.
303
+ * @type {CountryOrUnknown}
304
+ * @remarks
305
+ *
306
+ * In cases where the country was not recognized and could not be guessed from the phone number, `'XX'` is used.
307
+ */
308
+ country: CountryOrUnknown;
309
+ /**
310
+ * The `valid` property represents whether the phone number uses a valid format for the parsed country or not.
311
+ * @type {boolean}
312
+ */
313
+ valid: boolean;
314
+ /**
315
+ * The `type` property represents the type of the phone number. It can be any of the keys of the `PhoneNumberType` object in the `google-libphonenumber` library, or `'INVALID'` if the phone number is not valid.
316
+ * @type {PhoneTypes}
317
+ */
318
+ type: PhoneTypes;
319
+ /**
320
+ * The `mobile` property represents whether the phone number is possibly a mobile phone number or not.
321
+ * @type {boolean}
322
+ * @remarks
323
+ *
324
+ * This property is `true` if the phone number type is either `'MOBILE'` or `'FIXED_LINE_OR_MOBILE'`.
325
+ * This covers cases like in the United States and Canada where it is not possible to tell if a phone number is a mobile phone number or not based on the phone number alone.
326
+ */
327
+ mobile: boolean;
328
+ /**
329
+ * The `raw` property represents the phone number as a string stripped of all non-numeric characters.
330
+ * @type {string}
331
+ */
332
+ raw: string;
333
+ /**
334
+ * The `national` property represents the phone number as a string in the national format for the parsed country.
335
+ * @type {string}
336
+ */
337
+ national: string;
338
+ /**
339
+ * The `international` property represents the phone number as a string in the international format for the parsed country.
340
+ * @type {string}
341
+ */
342
+ international: string;
343
+ /**
344
+ * The `e164` property represents the phone number as a string in the E.164 format.
345
+ * @type {string}
346
+ */
347
+ e164: string;
348
+ /**
349
+ * The `timezone` property represents the estimated timezone of the phone number based on the phone number's country. It can be either a `CountryTimezone` or `'UTC'`.
350
+ * @type {PossiblePhoneTimezone}
351
+ * @remarks
352
+ *
353
+ * In cases where the phone number's country has several timezones, the timezone with the greatest population is used.
354
+ * In cases where the phone number's country is not recognized or has no timezone defined, `'UTC'` is used.
355
+ */
356
+ timezone: PossiblePhoneTimezone;
357
+ /**
358
+ * The `toObject` method returns an object with the same properties as the `PhoneModelInstanceObject` interface.
359
+ * @returns {PhoneModelInstanceObject}
360
+ */
361
+ toObject(): PhoneModelInstanceObject;
362
+ /**
363
+ * The `toJSON` method returns an object with the same properties as the `PhoneModelInstanceObject` interface.
364
+ * @returns {PhoneModelInstanceObject}
365
+ */
366
+ toJSON(): PhoneModelInstanceObject;
367
+ /**
368
+ * The `toString` method returns the phone number as a string in the international format for the parsed country.
369
+ * @returns {string}
370
+ */
371
+ toString(): string;
372
+ }
373
+
374
+ /**
375
+ * The `PhoneModelInstanceObject` interface represents the properties of a `Phone` instance.
376
+ * @interface
377
+ */
378
+ export declare interface PhoneModelInstanceObject {
379
+ /**
380
+ * The `phone` property represents the raw phone number string that was used to create the `Phone` instance.
381
+ * @type {string}
382
+ */
383
+ phone: string;
384
+ /**
385
+ * The `country` property represents the country that was used to create the `Phone` instance.
386
+ * @type {CountryOrUnknown}
387
+ * @remarks
388
+ *
389
+ * In cases where the country was not recognized and could not be guessed from the phone number, `'XX'` is used.
390
+ */
391
+ country: CountryOrUnknown;
392
+ /**
393
+ * The `valid` property represents whether the phone number uses a valid format for the parsed country or not.
394
+ * @type {boolean}
395
+ */
396
+ valid: boolean;
397
+ /**
398
+ * The `type` property represents the type of the phone number. It can be any of the keys of the `PhoneNumberType` object in the `google-libphonenumber` library, or `'INVALID'` if the phone number is not valid.
399
+ * @type {PhoneTypes}
400
+ */
401
+ type: PhoneTypes;
402
+ /**
403
+ * The `mobile` property represents whether the phone number is possibly a mobile phone number or not.
404
+ * @type {boolean}
405
+ * @remarks
406
+ *
407
+ * This property is `true` if the phone number type is either `'MOBILE'` or `'FIXED_LINE_OR_MOBILE'`.
408
+ * This covers cases like in the United States and Canada where it is not possible to tell if a phone number is a mobile phone number or not based on the phone number alone.
409
+ */
410
+ mobile: boolean;
411
+ /**
412
+ * The `raw` property represents the phone number as a string stripped of all non-numeric characters.
413
+ * @type {string}
414
+ */
415
+ raw: string;
416
+ /**
417
+ * The `national` property represents the phone number as a string in the national format for the parsed country.
418
+ * @type {string}
419
+ */
420
+ national: string;
421
+ /**
422
+ * The `international` property represents the phone number as a string in the international format for the parsed country.
423
+ * @type {string}
424
+ */
425
+ international: string;
426
+ /**
427
+ * The `e164` property represents the phone number as a string in the E.164 format.
428
+ * @type {string}
429
+ */
430
+ e164: string;
431
+ /**
432
+ * The `timezone` property represents the estimated timezone of the phone number based on the phone number's country. It can be either a `CountryTimezone` or `'UTC'`.
433
+ * @type {PossiblePhoneTimezone}
434
+ * @remarks
435
+ *
436
+ * In cases where the phone number's country has several timezones, the timezone with the greatest population is used.
437
+ * In cases where the phone number's country is not recognized or has no timezone defined, `'UTC'` is used.
438
+ */
439
+ timezone: PossiblePhoneTimezone;
440
+ }
441
+
442
+ /**
443
+ * The `PhoneTypes` type represents the possible types of a phone number. It can be any of the keys of the `PhoneNumberType` object in the `google-libphonenumber` library, or `'INVALID'` if the phone number is not valid.
444
+ */
445
+ export declare const PhoneTypes: readonly ["FIXED_LINE", "MOBILE", "FIXED_LINE_OR_MOBILE", "TOLL_FREE", "PREMIUM_RATE", "SHARED_COST", "VOIP", "PERSONAL_NUMBER", "PAGER", "UAN", "VOICEMAIL", "UNKNOWN", "INVALID"];
446
+
447
+ /**
448
+ * The `PhoneTypes` type represents the possible types of a phone number. It can be any of the keys of the `PhoneNumberType` object in the `google-libphonenumber` library, or `'INVALID'` if the phone number is not valid.
449
+ */
450
+ export declare type PhoneTypes = (typeof PhoneTypes)[number];
451
+
452
+ /**
453
+ * The `PossiblePhoneTimezone` type represents the estimated timezone of a phone number based on the phone number's country. It can be either a `CountryTimezone` or `'UTC'`.
454
+ * @typedef {CountryTimezone | 'UTC'} PossiblePhoneTimezone
455
+ * @remarks
456
+ *
457
+ * In cases where the phone number's country has several timezones, the timezone with the greatest population is used.
458
+ * In cases where the phone number's country is not recognized or has no timezone defined, `'UTC'` is used.
459
+ */
460
+ export declare type PossiblePhoneTimezone = CountryTimezone | 'UTC';
461
+
462
+ /**
463
+ * The `RawCountryType` type represents the country which should be used to parse the phone number. It is of type `Country`.
464
+ * @typedef {Country} RawCountryType
465
+ */
466
+ export declare type RawCountryType = Country;
467
+
468
+ /**
469
+ * The `RawPhoneType` type represents the phone number which should be parsed. It can be either a string or a number.
470
+ * @typedef {string | number} RawPhoneType
471
+ */
472
+ export declare type RawPhoneType = string | number;
473
+
474
+ /**
475
+ * Interface representing advanced options for specifying a specific time for use with the `getCountriesWithSpecificTime` function.
476
+ * @interface
477
+ */
478
+ export declare interface SpecificTimeAdvancedOptions {
479
+ /**
480
+ * The hour of the day to match.
481
+ */
482
+ hourOfDay?: Numeric;
483
+ /**
484
+ * The day of the week to match.
485
+ */
486
+ dayOfWeek?: Numeric;
487
+ /**
488
+ * The week of the year to match.
489
+ */
490
+ weekOfYear?: Numeric;
491
+ /**
492
+ * The day of the month to match.
493
+ */
494
+ dayOfMonth?: Numeric;
495
+ /**
496
+ * The month of the year to match.
497
+ */
498
+ monthOfYear?: Numeric;
499
+ /**
500
+ * The year to match.
501
+ */
502
+ year?: Numeric;
503
+ }
504
+
505
+ /**
506
+ * An immutable map of all of the timezones of the countries recognized by the library using ISO 3166-1 alpha-2 country codes as keys.
507
+ */
508
+ export declare const timezones: Readonly<Map<string, CountryTimezone>>;
509
+
510
+ /**
511
+ * The current version of the package.
512
+ *
513
+ * @tip This is a constant that is replaced during the build process with the actual version of the package.
514
+ */
515
+ export declare const version: string;
516
+
517
+ export { }