supMDX-page/dist/i18n.d.ts

10 lines
538 B
TypeScript
Raw Normal View History

2023-02-16 00:03:53 +09:00
export type NonRecordType = boolean | number | bigint | string | symbol | any[];
export type I18N<T> = (T & NonRecordType) | Record<string, T>;
export type LocaleInfo = {
locale?: string;
defaultLocale?: string;
};
export declare function translate<T>(data: I18N<T>, { locale, defaultLocale }: LocaleInfo): T;
export declare function translate<T>(data: I18N<T> | null, { locale, defaultLocale }: LocaleInfo): null;
export declare function translate<T>(data: I18N<T> | undefined, { locale, defaultLocale }: LocaleInfo): undefined;