Interface PhoneModelInstanceObject

The PhoneModelInstanceObject interface represents the properties of a Phone instance.

Hierarchy

  • PhoneModelInstanceObject

Properties

The country property represents the country that was used to create the Phone instance.

Remarks

In cases where the country was not recognized and could not be guessed from the phone number, 'XX' is used.

e164: string

The e164 property represents the phone number as a string in the E.164 format.

international: string

The international property represents the phone number as a string in the international format for the parsed country.

mobile: boolean

The mobile property represents whether the phone number is possibly a mobile phone number or not.

Remarks

This property is true if the phone number type is either 'MOBILE' or 'FIXED_LINE_OR_MOBILE'. 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.

national: string

The national property represents the phone number as a string in the national format for the parsed country.

phone: string

The phone property represents the raw phone number string that was used to create the Phone instance.

raw: string

The raw property represents the phone number as a string stripped of all non-numeric characters.

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'.

Remarks

In cases where the phone number's country has several timezones, the timezone with the greatest population is used. In cases where the phone number's country is not recognized or has no timezone defined, 'UTC' is used.

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.

valid: boolean

The valid property represents whether the phone number uses a valid format for the parsed country or not.