import type { CountryCode } from 'libphonenumber-js/max'; /** * empty: nothing typed. invalid: not a real number for the country. wrong-type: a real number, but its * type is not in acceptedNumbersTypes. valid: real and accepted. */ export type PhoneNumberStatus = 'empty' | 'invalid' | 'wrong-type' | 'valid'; export interface PhoneNumberModel { phone: { countryCode?: CountryCode; dialCode?: string; e164Number?: string; internationalNumber: string; nationalNumber?: string; number?: string; } | undefined; valid: boolean; /** Optional so hand-built models still type-check; the element always sets them. */ status?: PhoneNumberStatus; /** The detected type of the number, when it parses. */ type?: PhoneNumberType; /** Length is plausible for the country (libphonenumber isPossible). */ possible?: boolean; } export type PhoneNumberType = 'MOBILE' | 'FIXED_LINE_OR_MOBILE' | 'FIXED_LINE' | 'PREMIUM_RATE' | 'TOLL_FREE' | 'SHARED_COST' | 'VOIP' | 'PERSONAL_NUMBER' | 'PAGER' | 'UAN' | 'VOICEMAIL';