UNPKG

plus-pro-components

Version:

Page level components developed based on Element Plus.

17 lines (15 loc) 752 B
import { Language } from 'plus-pro-components/es/locale'; import { Ref } from 'vue'; type MaybeRef<T> = T | Ref<T>; export type TranslatorOption = Record<string, string | number>; export type Translator = (path: string, option?: TranslatorOption) => string; export type LocaleContext = { locale: Ref<Language>; lang: Ref<string>; t: Translator; }; export declare const buildTranslator: (locale: MaybeRef<Language>) => Translator; export declare const translate: (path: string, option: undefined | TranslatorOption, locale: Language) => string; export declare const buildLocaleContext: (locale: MaybeRef<Language>) => LocaleContext; export declare const useLocale: (localeOverrides?: Ref<Language | undefined>) => LocaleContext; export {};