@umijs/plugins
Version:
34 lines (33 loc) • 1.15 kB
TypeScript
export declare type IAddAntdLocales = (args: {
lang: string;
country: string;
}) => Promise<string[]>;
export interface IGetLocaleFileListOpts {
localeFolder: string;
separator?: string;
absSrcPath?: string;
absPagesPath?: string;
addAntdLocales: IAddAntdLocales;
resolveKey: string;
}
/**
* 获取 moment 包的 locale 名称
* @param lang 语言
* @param country 国家
* @param resolveKey 用来resolve的key,moment 或者 dayjs,为了使 dayjs 可以替换 moment
*/
export declare const getMomentLocale: (lang: string, country: string, resolveKey: string) => {
momentLocale: string;
};
export declare const getAntdLocale: (lang: string, country: string) => string;
export interface IGetLocaleFileListResult {
lang: string;
country: string;
name: string;
paths: string[];
antdLocale: string[];
momentLocale: string;
}
export declare const getLocaleList: (opts: IGetLocaleFileListOpts) => Promise<IGetLocaleFileListResult[]>;
export declare const exactLocalePaths: (data: IGetLocaleFileListResult[]) => string[];
export declare function isNeedPolyfill(targets?: {}): boolean;