{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { ReachabilityResult } from './reachability.js';\n\nexport enum ParseErrorCode {\n  INVALID_COUNTRY_CODE = 'INVALID_COUNTRY_CODE',\n  TOO_SHORT = 'TOO_SHORT',\n  TOO_LONG = 'TOO_LONG',\n  NOT_A_NUMBER = 'NOT_A_NUMBER',\n}\n\nexport interface PhoneNumber {\n  e164: string;\n  countryCode: number;\n  // ISO 3166-1 alpha-2, e.g. \"US\". `null` when no injected metadata\n  // resolved a specific region for this number (format-only validation).\n  region: string | null;\n  nationalNumber: string;\n  // 'FIXED_LINE_OR_MOBILE' is a distinct, honest value - not a fallback -\n  // for when a region's fixed-line and mobile patterns are identical\n  // upstream (e.g. the US) and there's no way to statically tell them\n  // apart. 'UNKNOWN' means no type-specific data was available at all.\n  type:\n    | 'MOBILE'\n    | 'FIXED'\n    | 'FIXED_LINE_OR_MOBILE'\n    | 'TOLL_FREE'\n    | 'PREMIUM_RATE'\n    | 'SHARED_COST'\n    | 'PERSONAL_NUMBER'\n    | 'VOIP'\n    | 'PAGER'\n    | 'UAN'\n    | 'VOICEMAIL'\n    | 'UNKNOWN';\n}\n\nexport type ParseResult =\n  | { success: true; data: PhoneNumber }\n  | { success: false; error: ParseErrorCode; message: string };\n\n// `reachability` is `null` when no provider is configured (see\n// reachability.ts) or when the provider's lookup failed - asyncParse()\n// never throws on a provider error, so this is the only signal.\nexport type AsyncParseResult =\n  | { success: true; data: PhoneNumber; reachability: ReachabilityResult | null }\n  | { success: false; error: ParseErrorCode; message: string };"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,0BAAuB;AACvB,EAAAA,gBAAA,eAAY;AACZ,EAAAA,gBAAA,cAAW;AACX,EAAAA,gBAAA,kBAAe;AAJL,SAAAA;AAAA,GAAA;","names":["ParseErrorCode"]}