-
Notifications
You must be signed in to change notification settings - Fork 62
/
index.d.ts
31 lines (28 loc) · 970 Bytes
/
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
declare module 'lang.js' {
interface Messages {
[key: string]: {
[name: string]: string
}
}
interface Replacements {
[key: string]: string
}
export interface LangOptions {
locale?: string;
fallback?: string;
messages?: any;
}
export default class Lang {
constructor(options: LangOptions);
setMessages(messages: Messages): void;
getLocale(): string;
setLocale(locale: string): void;
getFallback(): string;
setFallback(fallback: string): void;
has(key: string, locale?: string): boolean;
get(key: string, replacements?: Replacements, locale?: string): string;
trans(key: string, replacements?: Replacements): string;
choice(key: string, number: number, replacements?: Replacements, locale?: string): string;
transChoice(key: string, count: number, replacements?: Replacements): string;
}
}