- 删除根目录中重复的 NestJS 配置文件 - 删除 tsconfig.json, tsconfig.build.json, eslint.config.mjs, .prettierrc - 保留 wwjcloud-nest/ 目录中的完整配置 - 避免配置冲突,确保项目结构清晰
26 lines
574 B
TypeScript
26 lines
574 B
TypeScript
export type SupportedLanguagesType = 'en-US' | 'zh-CN';
|
|
|
|
export type ImportLocaleFn = () => Promise<{ default: Record<string, string> }>;
|
|
|
|
export type LoadMessageFn = (
|
|
lang: SupportedLanguagesType,
|
|
) => Promise<Record<string, string> | undefined>;
|
|
|
|
export interface LocaleSetupOptions {
|
|
/**
|
|
* Default language
|
|
* @default zh-CN
|
|
*/
|
|
defaultLocale?: SupportedLanguagesType;
|
|
/**
|
|
* Load message function
|
|
* @param lang
|
|
* @returns
|
|
*/
|
|
loadMessages?: LoadMessageFn;
|
|
/**
|
|
* Whether to warn when the key is not found
|
|
*/
|
|
missingWarn?: boolean;
|
|
}
|