PhoneNumberValidity

Machine-readable validation outcome, kept separate from the user-facing message so hosts can branch on the reason without string matching.

This is intentionally finer-grained than a boolean: "too short" while typing should not look like "invalid", and an unsupported region is a configuration problem rather than user error.

Entries

Link copied to clipboard

Nothing typed yet. Not an error — do not show a message.

Link copied to clipboard

Plausible prefix but not yet long enough. The normal state while typing.

Link copied to clipboard

Shorter than any valid number for the region.

Link copied to clipboard

Longer than any valid number for the region.

Link copied to clipboard

Length is plausible for the region but the number is not a valid assigned number.

Link copied to clipboard

A real, dialable number. The only value for which submission should be allowed.

Link copied to clipboard

Parsed, but not a valid number for the region and not merely a length problem.

Link copied to clipboard

The leading country calling code does not correspond to any region.

Link copied to clipboard

libphonenumber has no metadata for the selected country, so it cannot be validated.

Link copied to clipboard

A real, dialable number — but not one of the types the caller accepts.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard

True for states where the user should be shown an error rather than left alone.

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.