import { type Locale } from './types.js'; export type { Locale } from './types.js'; export { isLocale, SUPPORTED_LOCALES } from './types.js'; export declare function getDefaultLocale(): Locale; export declare function setDefaultLocale(loc: Locale): void; /** Resolve the locale for a given bot's config (used by per-bot code paths). */ export declare function botLocale(botCfg: { lang?: string; } | undefined | null): Locale; type BotConfigLike = { lang?: string; }; type BotLookup = (larkAppId: string) => { config: BotConfigLike; } | undefined; /** * Register a bot-config lookup so `localeForBot()` can resolve a per-bot * locale without creating an import cycle between `i18n` and `bot-registry`. * Called once by `bot-registry.ts` at module load. */ export declare function setBotLookup(lookup: BotLookup): void; /** * Resolve the locale for a bot by its larkAppId. Falls back to the process * default when the bot is not registered (e.g. CLI tools without a daemon). */ export declare function localeForBot(larkAppId: string | undefined | null): Locale; /** * Optional user-override resolver for built-in prompt copy. Registered by the * customization store (via a thin adapter) so i18n stays pure — no filesystem * import, no dependency cycle (same DI shape as {@link setBotLookup}). * * Returns the override string for (key, locale) when the user has customized it * AND customization is enabled, else `undefined` to fall through to the shipped * dictionary. Returning `undefined` for every key when there are no overrides is * what keeps the prompt byte-identical to the pre-feature baseline. */ export type PromptOverrideResolver = (key: string, locale: Locale) => string | undefined; export declare function setPromptOverrideResolver(resolver: PromptOverrideResolver | undefined): void; /** * The SHIPPED (factory) dictionary value for a key, bypassing any registered * override resolver. Used by the customization UI/CLI to show "factory vs your * override" and to prefill editors — where consulting the override (as `t()` * does) would be circular. Same fallback chain as `t()` minus the override step. */ export declare function shippedText(key: string, locale?: Locale): string; /** * Translate a key. Resolution order: * 1. a user override for (key, resolved-locale), when registered * 2. the active-locale dictionary * 3. the Chinese dictionary (fallback) * 4. the key itself (so missing keys are loud, not empty) * * The override lookup is wrapped so a faulty resolver can never break prompt * building — any throw falls through to the shipped string. */ export declare function t(key: string, params?: Record, locale?: Locale): string; //# sourceMappingURL=index.d.ts.map