forked from NaitLee/Cat-Printer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathi18n.d.ts
43 lines (40 loc) · 1.12 KB
/
i18n.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
type DictOf<T> = { [key: string]: T };
type Conditions = DictOf<string>;
type ConditionsOf<K extends Languages> = AllConditions[K];
type LanguageData = DictOf<Conditions | string>;
type Things = { [index: number | string]: number | string | boolean | null } | Array<number | string>;
interface Extension {
(things: Things, conditions: Conditions): string;
}
interface ExtensionOf<K extends Languages> {
(things: Things, conditions: ConditionsOf<K> | string): string;
}
type Languages = keyof AllConditions;
/**
* All known possible condition keys, per language
× These are what will be used in langauge files
* Please add more as you do in extensions
*/
type AllConditions = {
'en-US': {
'single': string,
'multiple': string,
'nth': string,
'a': string,
'an': string
},
'de-DE': {
'single': string,
'multiple': string
},
'nl-NL': {
'single': string,
'multiple': string
},
'zh-CN': {
'measure': string
}
};
interface I18nCallable extends I18n {
(text: string, things: Things, can_change_things: boolean): string;
}