/** * @shopplus/membership-i18n 入口 * 会员中台共享国际化 - 语言包 + 格式化函数 + RTL 支持 */ export { formatCurrency } from './format/currency'; export type { FormatCurrencyOptions } from './format/currency'; export { formatDate, formatRelativeTime } from './format/date'; export type { FormatDateOptions } from './format/date'; export { formatNumber } from './format/number'; export type { FormatNumberOptions } from './format/number'; export { isRtl, getRtlLocales } from './rtl'; import type zhCN from './locales/zh-CN.json'; /** 语言包类型(基于 zh-CN 推导) */ export type LocaleMessages = typeof zhCN; /** 支持的语言(12 种 = PRD §10.3 双 CN + 主流欧美亚 + 阿拉伯/希伯来 RTL + LATAM 葡 + 泰) */ export type SupportedLocale = 'zh-CN' | 'zh-TW' | 'en-US' | 'ja-JP' | 'ko-KR' | 'fr-FR' | 'de-DE' | 'es-ES' | 'pt-BR' | 'ar-SA' | 'he-IL' | 'th-TH'; /** 翻译函数参数 */ export interface TranslateParams { [key: string]: string | number; } /** * 注册语言包 */ export declare function registerLocale(locale: string, messages: LocaleMessages): void; /** * 设置当前语言 */ export declare function setLocale(locale: string): void; /** * 获取当前语言 */ export declare function getLocale(): string; /** * 翻译函数 * 支持插值:t('points.earn', { amount: 100 }) => "获得 100 积分" * * @param key - 翻译键(点分隔,如 'common.points') * @param params - 插值参数 * @returns 翻译后的文本 */ export declare function t(key: string, params?: TranslateParams): string; /** * 初始化内置语言包 * 延迟加载,避免打包体积过大 * 不支持的 locale 自动回退到 en-US 并打印 warning */ export declare function loadBuiltinLocale(locale: SupportedLocale | string): Promise; //# sourceMappingURL=index.d.ts.map