Phone Number Value
Everything a caller needs to know about the phone number currently in the field.
The point of this type is that callers never build an E.164 string themselves. Concatenating dialCode + digits is wrong for any country with a national trunk prefix (a UK mobile typed as 07400 123456 is +447400123456, not +4407400123456), so e164Number is produced by libphonenumber and is null — deliberately, not empty-string — whenever the number is not yet parseable.
Constructors
Properties
Storage/API form (e.g. "+254712345678"), or null when the number cannot be parsed. Never treat null as "no number" — check nationalNumber for that.
The same digits grouped for display (e.g. "0712 345 678").
Human-readable international form (e.g. "+254 712 345 678"). Falls back to the raw input when parsing fails, so it is always safe to display.
libphonenumber considers the length plausible for the region. True before isValid becomes true, which makes it the right signal for "keep typing" affordances.
Digits the user typed, with formatting stripped (e.g. "712345678").
What kind of line this is, or null when nothing has been typed yet or the number could not be parsed. Note that many regions report PhoneNumberType.FixedLineOrMobile for every valid number — compare with PhoneNumberType.satisfies rather than by equality.
The granular reason behind isValid, for precise error messaging.
Functions
Projects a PhoneNumberValue into the legacy Phone snapshot.