/** * ISO 3166-1 alpha-2 shape: exactly two ASCII letters, case-insensitive. * Shared by `flag.ts` (validating `country`) and `languageToCountry` below * (validating a language tag's region subtag), because both values end up * passed to the peer package `@aceshooting/lyra-flags`' `flagUrl()`, which * naively interpolates its `code` argument into a `new URL('./flags/${code}.svg', * ...)` with no validation of its own -- an unvalidated value containing `../` * segments can escape the intended flags/ directory. Anything that doesn't * match this shape is treated the same as an unknown/missing flag. */ export declare const ALPHA2_RE:RegExp; /** ISO 3166-1 alpha-3 shape: exactly three ASCII letters, case-insensitive. Length alone * disambiguates the two code spaces, so no explicit format hint is needed. */ export declare const ALPHA3_RE:RegExp; /** * The alpha-2 code for an ISO 3166-1 alpha-3 code, or `undefined` when it isn't one. Case * insensitive. Deliberately excludes user-assigned and withdrawn codes: a historical or defunct * state has no current flag to resolve, so it takes the component's unresolved path rather than * silently mapping to a successor state's flag. */ export declare function alpha3ToAlpha2(code:string):string|undefined; /** * Default mapping from a language subtag to a representative country flag * (ISO 3166-1 alpha-2). Languages don't map 1:1 to countries; these are the * conventional choices for language pickers. Override per-app as needed. */ export declare const LANGUAGE_TO_COUNTRY:Record; /** * Resolve a BCP-47-ish language tag to a flag country code. * A region subtag wins (`en-US` → `us`); otherwise the base language is mapped. The region subtag * isn't always in the second position -- a script subtag (e.g. `zh-Hant-TW`, ISO 15924, always 4 * letters) can sit between the base language and the region, so every subtag after the base is * scanned for the first 2-letter alpha match rather than assuming it's always `parts[1]`. Base * language fallback accepts only the lookup table's own entries, never inherited object members. */ export declare function languageToCountry(language:string):string|undefined; /** * The endonym of a BCP-47 language tag — the locale's name written in that locale itself * (`'fr'` → `français`, `'pt-BR'` → `português (Brasil)`), which is what a language switcher should * list so a reader who understands none of the current UI language can still find their own. * * Derived from `Intl.DisplayNames`, so no name table ships with the library and the result follows * the browser's own ICU data; the instance comes from the shared memoized cache, since a picker * renders one lookup per offered locale on every render pass. A tag with no display name resolves * to the tag itself, and so does a structurally invalid one — `Intl.DisplayNames` throws a * `RangeError` on those rather than falling back, and a language picker should degrade to showing * the raw tag rather than tearing down the render. * * Pair it with {@link languageToCountry} for the flag half of the same row. */ export declare function localeNativeName(tag:string):string;