-
Notifications
You must be signed in to change notification settings - Fork 16
/
index.d.ts
53 lines (46 loc) · 1.38 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
44
45
46
47
48
49
50
51
52
53
declare module 'frenchkiss' {
type pluralRule = (count: number) => string;
type missingVariableHandler = (
variable: string,
key: string,
language: string
) => string;
type missingKeyHandler = (
key: string,
params: string,
language: string
) => string;
interface StoreData {
[key: string]: string | number | StoreData;
}
interface CacheData {
[key: string]: (
params?: object,
pluralRule?: pluralRule,
key?: string,
language?: string,
missingVariableHandler?: missingVariableHandler
) => string;
}
interface CacheItems {
[key: string]: CacheData;
}
interface StoreItems {
[key: string]: string | number;
}
export const cache: CacheItems;
export const store: StoreItems;
export function t(key: string, params?: object, language?: string): string;
export function onMissingKey(
missingKeyHandler: missingKeyHandler
): void;
export function onMissingVariable(
missingVariableHandler: missingVariableHandler
): void;
export function locale(language?: string): string;
export function fallback(language?: string): string;
export function unset(language: string): void;
export function set(language: string, table: StoreData): void;
export function extend(language: string, table: StoreData): void;
export function plural(language: string, pluralRule: pluralRule): void;
}