/** * Accepts `zh-TW`, `zh-tw`, `zh_TW`, `zhTW`, `ZH-tw`, `en` etc. Returns * canonical BCP 47 form (`zh-TW`, `en`). Throws `InvalidLocaleError` for * anything that doesn't shape up. */ export declare function toCanonicalLocale(input: string): string; /** Canonical → URL form (always lowercase). */ export declare function toUrlLocale(canonical: string): string; /** * Best-effort canonicalization. Unlike `toCanonicalLocale`, never * throws — returns the original input unchanged when it's malformed. * Used for query-side comparisons where a malformed filter value * should simply match nothing rather than error. */ export declare function safeCanonicalLocale(input: string): string; /** * Canonicalize an array of locale strings, separating valid from * invalid in one pass. The caller decides whether to reject (write * paths) or warn (read paths) on `invalid.length > 0`. * * Preserves input order in `valid`; canonicalizes each entry; dedupes * the result so `["zh-tw", "zh-TW"]` collapses to `["zh-TW"]`. */ export declare function canonicalizeLocaleList(inputs: ReadonlyArray): { readonly valid: string[]; readonly invalid: string[]; }; export declare function containsScriptSubtagLocale(inputs: ReadonlyArray): boolean; //# sourceMappingURL=LocaleCanonicalizer.d.ts.map