import type { Charity, LocaleMessages } from './types.js'; import { type SupportedLocale } from './locales/index.js'; export type { SupportedLocale } from './locales/index.js'; /** * Detect the user's preferred locale from browser APIs. * * Resolution order: * 1. Explicit `locale` option * 2. First match from `navigator.languages[]` (user-ordered preference list) * 3. `navigator.language` base tag (e.g. "es" from "es-MX") * 4. Fallback: "en" */ export declare function detectLocale(preferred?: string): SupportedLocale; /** * Load locale messages for the given language code. * Returns cached result on repeat calls. Falls back to 'en' on error. */ export declare function loadLocale(lang: string): Promise; /** * Merge base charities with locale-specific translations. * * For each charity: use the locale tagline if available, otherwise keep * the English default from the base data. */ export declare function mergeCharities(base: readonly Charity[], locale: LocaleMessages): Charity[]; /** Returns true if the locale uses right-to-left script. */ export declare function isRTL(lang: string): boolean; /** * Build a translated banner text line for a charity. * * @returns The formatted string "UA_FLAG supportUkraine name: tagline" */ export declare function formatBannerText(charity: Charity, messages: LocaleMessages): string; /** * Eagerly pre-load the English locale so it is always available synchronously. * Other locales are loaded on demand via `loadLocale()`. */ export declare function preloadDefault(): Promise;