移动目录
This commit is contained in:
32
mdui_patched/internal/localize.d.ts
vendored
Normal file
32
mdui_patched/internal/localize.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import { targetLocales } from './localeCodes.js';
|
||||
import type { allLocales } from './localeCodes.js';
|
||||
import type { LocaleModule, LocaleStatusEventDetail } from '@lit/localize';
|
||||
export type LocaleTargetCode = (typeof targetLocales)[number];
|
||||
export type LocaleCode = (typeof allLocales)[number];
|
||||
export type LoadFunc = (locale: LocaleTargetCode) => Promise<LocaleModule>;
|
||||
export type GetLocal = () => LocaleCode;
|
||||
export type SetLocal = (locale: LocaleCode) => Promise<void>;
|
||||
declare global {
|
||||
interface WindowEventMap {
|
||||
'mdui-localize-status': CustomEvent<LocaleStatusEventDetail>;
|
||||
}
|
||||
}
|
||||
export declare const uninitializedError = "You must call `loadLocale` first to set up the localized template.";
|
||||
export declare let getLocale: GetLocal | undefined;
|
||||
export declare let setLocale: SetLocal | undefined;
|
||||
/**
|
||||
* 初始化 localization
|
||||
* @param loadFunc
|
||||
*/
|
||||
export declare const initializeLocalize: (loadFunc: LoadFunc) => void;
|
||||
/**
|
||||
* 监听 localize ready 事件
|
||||
* @param target
|
||||
* @param callback
|
||||
*/
|
||||
export declare const onLocaleReady: (target: HTMLElement, callback: () => void) => void;
|
||||
/**
|
||||
* 取消监听 localize ready 事件
|
||||
* @param target
|
||||
*/
|
||||
export declare const offLocaleReady: (target: HTMLElement) => void;
|
||||
Reference in New Issue
Block a user