import { C as Country, b as CountryWithSubdivisions, c as CountryCodeFormat, d as CountryRecord } from '../types-hSi1rgb5.js'; /** * Lookup country by ISO 3166-1 alpha-2 code * * @param code - 2-letter country code (case-insensitive) * @returns Country object or null if not found * * @example * whereAlpha2('US') // { name: 'United States', alpha2: 'US', alpha3: 'USA', numeric: '840' } * whereAlpha2('us') // { name: 'United States', ... } (case-insensitive) * whereAlpha2('XX') // null */ declare function whereAlpha2(code: string): Country | null; /** * Lookup country by ISO 3166-1 alpha-3 code * * @param code - 3-letter country code (case-insensitive) * @returns Country object or null if not found * * @example * whereAlpha3('USA') // { name: 'United States', alpha2: 'US', alpha3: 'USA', numeric: '840' } * whereAlpha3('XXX') // null */ declare function whereAlpha3(code: string): Country | null; /** * Lookup country by ISO 3166-1 numeric code * * @param code - Numeric country code (string or number) * @returns Country object or null if not found * * @example * whereNumeric('840') // { name: 'United States', ... } * whereNumeric(840) // { name: 'United States', ... } * whereNumeric('999') // null */ declare function whereNumeric(code: string | number): Country | null; /** * Lookup country by name (case-insensitive) * * @param name - Country name * @returns Country object or null if not found * * @example * whereName('United States') // { name: 'United States', ... } * whereName('united states') // { name: 'United States', ... } (case-insensitive) * whereName('Narnia') // null */ declare function whereName(name: string): Country | null; /** * Get all countries * * @returns Array of all Country objects * * @example * all() // [{ name: 'Afghanistan', alpha2: 'AF', ... }, ...] */ declare function all(): Country[]; /** * Get country with all its subdivisions * Note: Requires subdivision data to be imported/registered * * @param code - Country code (alpha-2 or alpha-3) * @returns Country with subdivisions or null if not found * * @example * withSubdivisions('US') // { name: 'United States', ..., subdivisions: { 'US-CA': {...}, ... } } */ declare function withSubdivisions(code: string): CountryWithSubdivisions | null; /** * Resolve any country code format to alpha-2 * Internal helper used by other modules * * @param code - Country code in any format (alpha-2, alpha-3, or numeric) * @returns Alpha-2 code or null if not found */ declare function resolveAlpha2(code: string | number): string | null; /** * Convert alpha-2 code to alpha-3 * * @param code - Alpha-2 country code * @returns Alpha-3 code or null if not found * * @example * alpha2ToAlpha3('US') // 'USA' * alpha2ToAlpha3('XX') // null */ declare function alpha2ToAlpha3(code: string): string | null; /** * Convert alpha-3 code to alpha-2 * * @param code - Alpha-3 country code * @returns Alpha-2 code or null if not found * * @example * alpha3ToAlpha2('USA') // 'US' * alpha3ToAlpha2('XXX') // null */ declare function alpha3ToAlpha2(code: string): string | null; /** * Convert alpha-2 code to numeric * * @param code - Alpha-2 country code * @returns Numeric code or null if not found * * @example * alpha2ToNumeric('US') // '840' * alpha2ToNumeric('XX') // null */ declare function alpha2ToNumeric(code: string): string | null; /** * Convert alpha-3 code to numeric * * @param code - Alpha-3 country code * @returns Numeric code or null if not found * * @example * alpha3ToNumeric('USA') // '840' * alpha3ToNumeric('XXX') // null */ declare function alpha3ToNumeric(code: string): string | null; /** * Convert numeric code to alpha-2 * * @param code - Numeric country code * @returns Alpha-2 code or null if not found * * @example * numericToAlpha2('840') // 'US' * numericToAlpha2(840) // 'US' * numericToAlpha2('999') // null */ declare function numericToAlpha2(code: string | number): string | null; /** * Convert numeric code to alpha-3 * * @param code - Numeric country code * @returns Alpha-3 code or null if not found * * @example * numericToAlpha3('840') // 'USA' * numericToAlpha3(840) // 'USA' * numericToAlpha3('999') // null */ declare function numericToAlpha3(code: string | number): string | null; /** * Get country name from any code format * * @param code - Country code (alpha-2, alpha-3, or numeric) * @returns Country name or null if not found * * @example * toName('US') // 'United States' * toName('USA') // 'United States' * toName(840) // 'United States' * toName('XX') // null */ declare function toName(code: string | number): string | null; /** * Convert between any two country code formats * * @param code - Source country code * @param from - Source format * @param to - Target format * @returns Converted code or null if not found * * @example * convert('US', 'alpha2', 'alpha3') // 'USA' * convert('USA', 'alpha3', 'numeric') // '840' * convert('840', 'numeric', 'alpha2') // 'US' */ declare function convert(code: string | number, from: CountryCodeFormat, to: CountryCodeFormat): string | null; /** * Check if string is a valid ISO 3166-1 alpha-2 code * * @param code - Code to validate * @returns true if valid alpha-2 code * * @example * isAlpha2('US') // true * isAlpha2('USA') // false (this is alpha-3) * isAlpha2('XX') // false */ declare function isAlpha2(code: string): boolean; /** * Check if string is a valid ISO 3166-1 alpha-3 code * * @param code - Code to validate * @returns true if valid alpha-3 code * * @example * isAlpha3('USA') // true * isAlpha3('US') // false (this is alpha-2) * isAlpha3('XXX') // false */ declare function isAlpha3(code: string): boolean; /** * Check if value is a valid ISO 3166-1 numeric code * * @param code - Code to validate (string or number) * @returns true if valid numeric code * * @example * isNumeric('840') // true * isNumeric(840) // true * isNumeric('999') // false */ declare function isNumeric(code: string | number): boolean; /** * Check if string is a valid country name * * @param name - Name to validate * @returns true if valid country name * * @example * isCountryName('United States') // true * isCountryName('united states') // true (case-insensitive) * isCountryName('Narnia') // false */ declare function isCountryName(name: string): boolean; /** * Check if value is any valid country identifier * (alpha-2, alpha-3, numeric, or name) * * @param value - Value to validate * @returns true if valid country identifier * * @example * isValid('US') // true * isValid('USA') // true * isValid(840) // true * isValid('United States') // true * isValid('XX') // false */ declare function isValid(value: string | number): boolean; /** * Detect the format of a country code * * @param code - Code to detect format of * @returns Detected format or null if invalid * * @example * detectFormat('US') // 'alpha2' * detectFormat('USA') // 'alpha3' * detectFormat('840') // 'numeric' * detectFormat('United States') // 'name' * detectFormat('XX') // null */ declare function detectFormat(code: string | number): CountryCodeFormat | 'name' | null; /** * Country data indexed by alpha-2 code */ declare const countries: Record; /** * Alpha-3 to alpha-2 lookup index */ declare const alpha3Index: Record; /** * Numeric to alpha-2 lookup index */ declare const numericIndex: Record; /** * Country name (uppercase) to alpha-2 lookup index */ declare const nameIndex: Record; export { all, alpha2ToAlpha3, alpha2ToNumeric, alpha3Index, alpha3ToAlpha2, alpha3ToNumeric, convert, countries, detectFormat, isAlpha2, isAlpha3, isCountryName, isNumeric, isValid, nameIndex, numericIndex, numericToAlpha2, numericToAlpha3, resolveAlpha2, toName, whereAlpha2, whereAlpha3, whereName, whereNumeric, withSubdivisions };