import EventBus from './EventBus'; export interface I18nConfig { types?: Record | false; format?: any; }>; splitByDot?: boolean | 'auto'; defaultType?: string; fallback?: I18n[] | Record; translateFallback?: ((keys: any, options: any) => any) | any; } export default class I18n { static instances: any[]; static language: any; static documentEventName: string; static get lng(): any; static eventBus: EventBus; /** * [template 简易字符串模板函数] * e.g: template('hello {{name}}', { name: 'CJY' }) ==> 'hello CJY' * @param {[字符串]} str [description] * @param {[type]} data [description] * @return {[type]} [description] */ static template: (str?: string, data?: {}, { split, fallback }?: { split?: boolean; fallback?: string; }) => string | any[]; static load: (...loaders: any[]) => import("./memoize").CachedFunction; static applyLanguage: (language: any) => Promise; static applyLng: (language: any) => Promise; resources: {}; language: any; key: number; documentEventSilent: boolean; get lng(): any; eventBus: EventBus; config: I18nConfig; constructor(config: I18nConfig); applyConfig: (config: I18nConfig) => Promise; applyLanguage: (language: any) => Promise; applyLng: (language: any) => Promise; translate: (str: any, rawOptions?: { [key: string]: any; '@namespace'?: string; '@type'?: string; '@splitByDot'?: I18nConfig['splitByDot']; }) => any; fallbackTranslate: (str: any, options: any, namespace: any) => any; t: (str: any, rawOptions?: { [key: string]: any; '@namespace'?: string; '@type'?: string; '@splitByDot'?: I18nConfig['splitByDot']; }) => any; }