import { Ref } from 'vue'; import { CountryCode as CountryCode$1 } from 'libphonenumber-js/min'; export { CountryCode } from 'libphonenumber-js/min'; import { CountryCode } from 'libphonenumber-js'; /** * Configuration options for MaskDial */ interface MaskDialOptions { /** ISO 3166-1 alpha-2 country code (e.g., 'US', 'GB', 'IN') */ country?: CountryCode; /** Fallback country when auto-detection fails */ defaultCountry?: CountryCode; /** Show international format with country code prefix */ international?: boolean; /** Placeholder character for unfilled digits (default: none) */ placeholder?: string; /** Called after each format operation */ onFormat?: (data: FormatData) => void; /** Called when validation state changes */ onValidate?: (isValid: boolean, isPossible: boolean) => void; /** Called when detected country changes */ onCountryChange?: (country: CountryCode | undefined) => void; } /** * Data returned after formatting a phone number */ interface FormatData { /** Formatted display value */ formatted: string; /** E.164 format (e.g., +12025551234) */ e164: string | undefined; /** National format without country code */ national: string; /** Raw digits only */ digits: string; /** Detected or specified country ISO code */ country: CountryCode | undefined; /** Is the number valid for the detected country */ isValid: boolean; /** Is the number possibly valid (less strict) */ isPossible: boolean; /** Format template (e.g., "(xxx) xxx-xxxx") */ template: string | undefined; /** Country calling code (e.g., "1" for US) */ countryCallingCode: string | undefined; } /** * Validation result with detailed information */ interface ValidationResult { isValid: boolean; isPossible: boolean; error?: string; } /** * Options for useMaskDial composable */ interface UseMaskDialOptions extends Omit { /** Model value (for v-model support) */ modelValue?: Ref | string; } /** * Return type for useMaskDial composable */ interface UseMaskDialReturn { /** Current formatted value (reactive) */ value: Ref; /** Set the raw value (will be formatted) */ setValue: (value: string) => void; /** Current country code (reactive) */ country: Ref; /** Set the country */ setCountry: (country: CountryCode$1) => void; /** Whether the number is valid (reactive) */ isValid: Ref; /** Whether the number is possible (reactive) */ isPossible: Ref; /** E.164 formatted number (computed) */ e164: Ref; /** National formatted number (computed) */ national: Ref; /** International formatted number (computed) */ international: Ref; /** Digits only (computed) */ digits: Ref; /** Format data from last format operation (reactive) */ formatData: Ref; /** Handle input event */ onInput: (event: Event) => void; /** Handle keydown event */ onKeydown: (event: KeyboardEvent) => void; /** Bind to input element (for template ref) */ inputRef: Ref; /** Reset to initial state */ reset: () => void; /** v-model binding object */ vModel: { value: Ref; onInput: (event: Event) => void; }; } /** * Vue 3 composable for phone number formatting and validation * * @example * ```vue * * * * ``` * * @example * ```vue * * * * * ``` */ declare function useMaskDial(options?: UseMaskDialOptions): UseMaskDialReturn; /** * Country data with dial codes and flag emoji */ interface Country { /** Country name in English */ name: string; /** ISO 3166-1 alpha-2 country code */ iso: CountryCode$1; /** International dial code (without +) */ dialCode: string; /** Flag emoji */ flag: string; /** Priority for sorting (lower = higher priority) */ priority?: number; } /** * Comprehensive list of countries with dial codes * Sorted alphabetically by name */ declare const countries: Country[]; /** * Get country by ISO code */ declare function getCountryByIso(iso: CountryCode$1): Country | undefined; /** * Get countries by dial code (may return multiple for shared codes like +1) */ declare function getCountriesByDialCode(dialCode: string): Country[]; /** * Search countries by name or dial code */ declare function searchCountries(query: string): Country[]; /** * Get sorted countries with priority countries first */ declare function getSortedCountries(priorityCountries?: CountryCode$1[]): Country[]; export { type Country, type FormatData, type MaskDialOptions, type UseMaskDialOptions, type UseMaskDialReturn, type ValidationResult, countries, getCountriesByDialCode, getCountryByIso, getSortedCountries, searchCountries, useMaskDial };