@nhtio/phone-object
An immutable data structure representing a specific phone number and accompanying methods.
Classes
| Class | Description |
|---|---|
| Phone | The Phone class represents a phone number and provides methods to retrieve information about it. It implements the PhoneModel interface. |
Interfaces
| Interface | Description |
|---|---|
| AreaCodeMap | An interface describing an object where a NANPA area code is a key, and a NANPA country code is a value. |
| PhoneModel | The PhoneModel interface represents a phone number object with various properties and methods. |
| PhoneModelInstanceObject | The PhoneModelInstanceObject interface represents the properties of a Phone instance. |
| SpecificTimeAdvancedOptions | Interface representing advanced options for specifying a specific time for use with the getCountriesWithSpecificTime function. |
Type Aliases
| Type Alias | Description |
|---|---|
| Country | Represents the ISO 3166-1 alpha-2 country codes of all countries recognized by the library. |
| CountryOrUnknown | 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. |
| CountryTimezone | Represents the possible timezones of all countries recognized by the library. |
| Numeric | Represents a numeric value that can be either a string or a number. |
| PhoneTypes | 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. |
| PossiblePhoneTimezone | 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'. |
| RawCountryType | The RawCountryType type represents the country which should be used to parse the phone number. It is of type Country. |
| RawPhoneType | The RawPhoneType type represents the phone number which should be parsed. It can be either a string or a number. |
Variables
| Variable | Description |
|---|---|
| areaCodeMap | A map of NANPA area codes to NANPA country codes. |
| countries | 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. |
| isos | An immutable set of all of the ISO 3166-1 alpha-2 country codes recognized by the library. |
| nanpaCountries | A list of NANPA country codes. |
| PhoneTypes | 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. |
| timezones | 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. |
| version | The current version of the package. |
Functions
| Function | Description |
|---|---|
| getCountriesWithSpecificTime | Returns an array of ISO 3166-1 alpha-2 country codes that have the same specific time as the given options. |