import type { PhoneFieldOptions } from '../types/field.js'; /** What `libphonenumber-js` gives back, narrowed to the two calls the rules below need. */ export interface ParsedPhoneNumber { number: string; country?: string; isValid: () => boolean; } export type PhoneParser = (value: string, defaultCountry?: string) => ParsedPhoneNumber | undefined; export interface NormalizedPhone { /** The number in E.164, present only when it parsed and validated. */ e164?: string; /** Country the number resolved to, present as soon as it parsed. */ country?: string; valid: boolean; /** Set when the number is valid but its country is not in `countries`. */ countryNotAllowed?: boolean; /** Set when the parser was not loaded yet, so `valid` is a guess rather than an answer. */ pending?: boolean; } /** What a phone field accepts, with the parser handed in rather than imported. */ export declare function normalizePhoneWith(parse: PhoneParser, value: unknown, options?: PhoneFieldOptions): NormalizedPhone; /** * The value to store: E.164 whenever the number is understood, and the input untouched when it is not, so * validation can report it and the editor can still see what was typed. */ export declare function toPhoneValueWith(parse: PhoneParser, value: unknown, options?: PhoneFieldOptions): unknown; /** Says nothing rather than the wrong thing, for the moment before the parser has arrived. */ export declare function pendingPhone(value: unknown): NormalizedPhone;