forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobalize.d.ts
125 lines (109 loc) · 3.16 KB
/
globalize.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// Type definitions for Globalize
// Project: https://github.com/jquery/globalize
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface GlobalizePercent {
pattern: string[];
decimals: number;
groupSizes: number[];
//",": string;
//".": string;
symbol: string;
}
interface GlobalizeCurrency {
pattern: string[];
decimals: number;
groupSizes: number[];
//",": string;
//".": string;
symbol: string;
}
interface GlobalizeNumberFormat {
pattern: string[];
decimals: string;
//",": string;
//".": string;
groupSizes: number[];
//"+": string;
//"-": string;
NaN: string;
negativeInfinity: string;
positiveInfinity: string;
percent: GlobalizePercent;
currency: GlobalizeCurrency;
}
interface GlobalizeEra {
name: string;
start: any;
offset: number;
}
interface GlobalizeDays {
names: string[];
namesAbbr: string[];
namesShort: string[];
}
interface GlobalizeMonths {
names: string[];
namesAbbr: string[];
}
interface GlobalizePatterns {
d: string;
D: string;
t: string;
T: string;
f: string;
F: string;
M: string;
Y: string;
S: string;
}
interface GlobalizeCalendar {
name: string;
// "/": string,
// ":": string,
firstDay: number;
days: GlobalizeDays;
months: GlobalizeMonths;
AM: string[];
PM: string[];
eras: GlobalizeEra[];
twoDigitYearMax: number;
patterns: GlobalizePatterns;
}
interface GlobalizeCalendars {
standard: GlobalizeCalendar;
}
interface GlobalizeCulture {
name: string;
englishName: string;
nativeName: string;
isRTL: boolean;
language: string;
numberFormat: GlobalizeNumberFormat;
calendar: GlobalizeCalendar;
calendars: GlobalizeCalendars;
messages: any;
}
interface GlobalizeCultures {
[index: number]: GlobalizeCulture;
}
interface GlobalizeStatic {
cultures: GlobalizeCultures;
init(cultureSelector: string): GlobalizeStatic;
cultureSelector: string;
culture(): GlobalizeCulture;
culture(cultureSelector: string): GlobalizeCulture;
culture(cultureSelector: string[]): GlobalizeCulture;
addCultureInfo(cultureName: string, baseCultureName: string, info: Object): void;
addCultureInfo(cultureName: string, info: Object): void;
addCultureInfo(info: Object): void;
findClosestCulture(cultureSelector: string): GlobalizeStatic;
format(value: number, format: string, cultureSelector?: string): string;
format(value: Date, format: string, cultureSelector?: string): string;
localize(key: string, cultureSelector?: string): string;
parseDate(value: string, format?: string, cultureSelector?: string): Date;
parseDate(value: string, formats?: string[], cultureSelector?: string): Date;
parseInt(value: string, radix?: number, cultureSelector?: string): number;
parseFloat(value: string, radix?: number, cultureSelector?: string): number;
}
declare var Globalize: GlobalizeStatic;