/** * UI18n 简化版核心类 - RC.3修复版本 * 专注于基础字典装载和翻译功能 */ import { UI18nConfig } from './types'; /** * UI18n 核心类 * 提供标准化的国际化翻译功能 */ export declare class UI18n { private _messages; private _lang; private _fallback?; constructor(opts?: UI18nConfig); /** * 批量添加字典 * @param dicts 字典映射对象 */ addAll(dicts: Record>): void; /** * 添加翻译字典 - 核心API * @param lang 语言代码 * @param dict 字典对象 */ addTranslations(lang: string, dict: Record): void; /** * 装载翻译字典 - addTranslations的别名 * @param lang 语言代码 * @param dict 字典对象 */ loadTranslations(lang: string, dict: Record): void; /** * 设置当前语言 * @param lang 语言代码 */ setLanguage(lang: string): void; /** * 获取当前语言 * @returns 当前语言代码 */ getLanguage(): string; /** * 翻译方法 - 标准三参数设计 * @param key 翻译键 * @param params 插值参数 * @param opts 选项 (to: 目标语言) * @returns 翻译结果 */ t(key: string, params?: Record, opts?: { to?: string; }): string; /** * 内部查找方法 * @param lang 语言代码 * @param key 翻译键 * @returns 翻译值或undefined */ private _lookup; /** * 字符串插值 - 支持 {{key}} 格式 * @param str 模板字符串 * @param params 参数对象 * @returns 插值后的字符串 */ private _interpolate; } /** * 创建UI18n实例的工厂函数 * @param opts 配置选项 * @returns UI18n实例 */ export declare function createUI18n(opts?: UI18nConfig): UI18n; //# sourceMappingURL=ui18n-simple.d.ts.map