-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
43 lines (35 loc) · 1.09 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import {ComputedRef, Ref} from "vue";
type labelsObject = Record<string, string>
export type labelFuncPayload = {
key: string
params?: Record<string, string | number | undefined | null> | null
lang?: string | null
markdown?: boolean
}
export type labelFunc = (
keyOrArgsObj: string | labelFuncPayload,
params?: Record<string, string | number | undefined | null> | null,
lang?: string | null,
markdown?: boolean
) => string;
export type labelsFunc = (
key: string,
params?: Record<string, string | number | undefined | null> | null,
lang?: string | null,
markdown?: boolean
) => string[];
export type I36nConfig = {
load(ln: string):Promise<labelsObject>
showKey?: Ref<boolean>
}
export type I36nUseObject = {
language: Ref<string>
showKey: Ref<boolean>
$label: ComputedRef<labelFunc>
$labels: ComputedRef<labelsFunc>
loadTranslations: Function
}
export function provideI36n(lang: string, config: I36nConfig, app?: any): void;
export function useI36n(): I36nUseObject;
export function initI36n(lang: string, config: I36nConfig): void;
export function getI36n(): I36nUseObject