@lxlib/theme
Version:
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1.
35 lines (34 loc) • 1.07 kB
TypeScript
import { InjectionToken } from '@angular/core';
import { Observable } from 'rxjs';
export interface LxlibI18NService {
[key: string]: any;
/**
* 调用 `use` 触发变更通知
*/
readonly change: Observable<string>;
/**
* 变更语言
* @param lang 语言代码
* @param emit 是否触发 `change`,默认:true
*/
use(lang: string, emit?: boolean): void;
/**
* 返回当前语言列表
*/
getLangs(): any[];
/**
* 翻译
* - `params` 模板所需要的参数对象
* - `isSafe` 是否返回安全字符,自动调用 `bypassSecurityTrustHtml`
*/
fanyi(key: string, params?: {}, isSafe?: boolean): string;
}
export declare const LXLIB_I18N_TOKEN: InjectionToken<LxlibI18NService>;
export declare function LXLIB_I18N_TOKEN_FACTORY(): LxlibI18NServiceFake;
export declare class LxlibI18NServiceFake implements LxlibI18NService {
private change$;
get change(): Observable<string>;
use(lang: string): void;
getLangs(): any[];
fanyi(key: string): string;
}