forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
node-polyglot.d.ts
43 lines (29 loc) · 883 Bytes
/
node-polyglot.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
// Type definitions for node-polyglot v0.4.1
// Project: https://github.com/airbnb/polyglot.js
// Definitions by: Tim Jackson-Kiely <https://github.com/timjk>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "node-polyglot" {
module Polyglot {
interface InterpolationOptions {
smart_count?: number | { length: number };
_?: string;
[interpolationKey: string]: any;
}
interface PolyglotOptions {
phrases?: any;
locale?: string;
}
}
class Polyglot {
constructor(options?: Polyglot.PolyglotOptions);
extend(phrases: any): void;
t(phrase: string): string;
t(phrase: string, smartCount: number): string;
t(phrase: string, interpolationOptions: Polyglot.InterpolationOptions): string;
clear(): void;
replace(phrases: any): void;
locale(): string;
locale(locale: string): void;
}
export = Polyglot;
}