-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
63 lines (55 loc) · 1.33 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
54
55
56
57
58
59
60
61
62
63
declare module "grackle" {
namespace grackle {
interface Lang {
[key: string]: string;
}
interface LangGroup {
[locale: string]: Lang;
}
interface Translate {
/**
* translate message
* @param {string|string[]} message
* @param {string} [namespace]
* @param {Object} [values]
* @param {Object} [formats]
*/
(
message: string | string[],
namespace?: string,
values?: Object,
formats?: any
): string;
(message: string | string[], values?: Object, formats?: any): string;
}
interface Grackle extends Translate {
/**
* learn (set) languages
* @param {Object} langs languages group
* @param {string} [namespace]
*/
learn(langs: LangGroup, namespace?: string): void;
/**
* Set current locale
* @param {string} locale locale name
*/
setLocale(locale: string): void;
/**
* Get current locale
* @returns {string}
*/
getLocale(): string;
/**
* translate message with locale
* @param {string} locale
*/
locale(locale: string): Translate;
/**
* Create a new grackle instance
*/
create(): Grackle;
}
}
const grackle: grackle.Grackle;
export = grackle;
}