import { S as Subdivision, a as SubdivisionInfo } from '../types-hSi1rgb5.cjs'; /** * Lookup subdivision by full ISO 3166-2 code * * @param code - Full subdivision code (e.g., "US-CA", "SE-O") * @returns Subdivision object or null if not found * * @example * whereCode('US-CA') // { code: 'US-CA', name: 'California', type: 'State', ... } * whereCode('XX-YY') // null */ declare function whereCode(code: string): Subdivision | null; /** * Lookup subdivision by country code and region code * * @param countryCode - Country code (alpha-2 or alpha-3) * @param regionCode - Region/subdivision code (e.g., "CA", "O") * @returns Subdivision object or null if not found * * @example * where('US', 'CA') // { code: 'US-CA', name: 'California', ... } * where('USA', 'CA') // { code: 'US-CA', name: 'California', ... } * where('US', 'XX') // null */ declare function where(countryCode: string, regionCode: string): Subdivision | null; /** * Lookup subdivision by country code and subdivision name * * @param countryCode - Country code (alpha-2 or alpha-3) * @param name - Subdivision name (case-insensitive) * @returns Subdivision object or null if not found * * @example * whereName('US', 'California') // { code: 'US-CA', name: 'California', ... } * whereName('US', 'california') // { code: 'US-CA', ... } (case-insensitive) * whereName('US', 'Narnia') // null */ declare function whereName(countryCode: string, name: string): Subdivision | null; /** * Get all subdivisions for a country * * @param countryCode - Country code (alpha-2 or alpha-3) * @returns Array of Subdivision objects (empty if country not found or has no subdivisions) * * @example * forCountry('US') // [{ code: 'US-AL', ... }, { code: 'US-AK', ... }, ...] * forCountry('XX') // [] */ declare function forCountry(countryCode: string): Subdivision[]; /** * Get all subdivisions (from all registered countries) * * @returns Array of all Subdivision objects * * @example * all() // [{ code: 'AD-02', ... }, { code: 'AD-03', ... }, ...] */ declare function all(): Subdivision[]; /** * Check if a country has registered subdivisions * * @param countryCode - Country code (alpha-2 or alpha-3) * @returns true if country has subdivisions registered * * @example * hasSubdivisions('US') // true (if US data is imported) * hasSubdivisions('XX') // false */ declare function hasSubdivisions$1(countryCode: string): boolean; /** * Extract region code from full subdivision code * * @param code - Full subdivision code (e.g., "US-CA") * @returns Region code (e.g., "CA") or null if invalid * * @example * toRegionCode('US-CA') // 'CA' * toRegionCode('GB-EAW') // 'EAW' * toRegionCode('invalid') // null */ declare function toRegionCode(code: string): string | null; /** * Build full subdivision code from country and region * * @param countryCode - Country code (alpha-2 or alpha-3) * @param regionCode - Region code * @returns Full code (e.g., "US-CA") or null if country invalid * * @example * toFullCode('US', 'CA') // 'US-CA' * toFullCode('USA', 'CA') // 'US-CA' (normalizes alpha-3) * toFullCode('XX', 'YY') // null */ declare function toFullCode(countryCode: string, regionCode: string): string | null; /** * Get subdivision name from full code * * @param code - Full subdivision code (e.g., "US-CA") * @returns Subdivision name or null if not found * * @example * toName('US-CA') // 'California' * toName('XX-YY') // null */ declare function toName(code: string): string | null; /** * Get subdivision name from country and region code * * @param countryCode - Country code (alpha-2 or alpha-3) * @param regionCode - Region code * @returns Subdivision name or null if not found * * @example * toNameFrom('US', 'CA') // 'California' * toNameFrom('USA', 'CA') // 'California' * toNameFrom('US', 'XX') // null */ declare function toNameFrom(countryCode: string, regionCode: string): string | null; /** * Extract country code from full subdivision code * * @param code - Full subdivision code (e.g., "US-CA") * @returns Alpha-2 country code or null if invalid * * @example * toCountryCode('US-CA') // 'US' * toCountryCode('USA-CA') // 'US' (normalizes alpha-3) * toCountryCode('XX-YY') // null */ declare function toCountryCode(code: string): string | null; /** * Check if string is a valid full subdivision code * * @param code - Code to validate (e.g., "US-CA") * @returns true if valid subdivision code * * @example * isValidCode('US-CA') // true * isValidCode('XX-YY') // false */ declare function isValidCode(code: string): boolean; /** * Check if region code is valid for a specific country * * @param countryCode - Country code (alpha-2 or alpha-3) * @param regionCode - Region code to validate * @returns true if valid region for the country * * @example * isValidRegion('US', 'CA') // true * isValidRegion('US', 'XX') // false */ declare function isValidRegion(countryCode: string, regionCode: string): boolean; /** * Check if subdivision name exists in a country * * @param countryCode - Country code (alpha-2 or alpha-3) * @param name - Subdivision name to validate (case-insensitive) * @returns true if name exists for the country * * @example * isValidName('US', 'California') // true * isValidName('US', 'Narnia') // false */ declare function isValidName(countryCode: string, name: string): boolean; /** * Check if a country has any subdivisions registered * * @param countryCode - Country code (alpha-2 or alpha-3) * @returns true if country has subdivisions * * @example * hasSubdivisions('US') // true (if US data imported) * hasSubdivisions('XX') // false */ declare function hasSubdivisions(countryCode: string): boolean; /** * Register a country's subdivisions * Called automatically when importing subdivision data files */ declare function register(countryCode: string, countryName: string, data: Record): void; /** * Get subdivisions for a country */ declare function getSubdivisions(countryCode: string): Record | undefined; /** * Get country name from registry */ declare function getCountryName(countryCode: string): string | undefined; /** * Get all registered subdivisions */ declare function getAllSubdivisions(): Record>; /** * Get all registered country names */ declare function getAllCountryNames(): Record; /** * Get list of registered country codes */ declare function getRegisteredCountries(): string[]; export { all, forCountry, getAllCountryNames, getAllSubdivisions, getCountryName, getRegisteredCountries, getSubdivisions, hasSubdivisions$1 as hasSubdivisions, hasSubdivisions as isRegistered, isValidCode, isValidName, isValidRegion, register, toCountryCode, toFullCode, toName, toNameFrom, toRegionCode, where, whereCode, whereName };