refactor(project): re-adjust the overall folder
This commit is contained in:
32
packages/locales/src/typing.ts
Normal file
32
packages/locales/src/typing.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import type { SupportedLanguagesType } from '@vben-core/typings';
|
||||
|
||||
type ImportLocaleFn = () => Promise<{ default: Record<string, string> }>;
|
||||
|
||||
type LoadMessageFn = (
|
||||
lang: SupportedLanguagesType,
|
||||
) => Promise<Record<string, string>>;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
export type {
|
||||
ImportLocaleFn,
|
||||
LoadMessageFn,
|
||||
LocaleSetupOptions,
|
||||
SupportedLanguagesType,
|
||||
};
|
Reference in New Issue
Block a user