forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cldr.js.d.ts
259 lines (241 loc) · 6.87 KB
/
cldr.js.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
// Type definitions for Cldr.js 0.4.4
// Project: https://github.com/rxaviers/cldrjs
// Definitions by: Raman But-Husaim <https://github.com/RamanBut-Husaim>, Grégoire Castre <https://github.com/gcastre/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace cldr {
/**
* @name Attributes
* @memberof cldr
* @kind interface
*
* @description
* The object created during instance initialization and used internally by .get()
* to replace dynamic parts of an item path.
*/
interface Attributes {
/**
* @name language
* @memberof cldr.Attributes
* @kind property
* @access public
*
* @type {any}
*
* @description
* Language subtag {@link http://www.unicode.org/reports/tr35/#Language_Locale_Field_Definitions}
*/
language: any;
/**
* @name script
* @memberof cldr.Attributes
* @kind property
* @access public
*
* @type {any}
*
* @description
* Script subtag {@link http://www.unicode.org/reports/tr35/#Language_Locale_Field_Definitions}
*/
script: any;
/**
* @name region
* @memberof cldr.Attributes
* @kind property
* @access public
*
* @type {any}
*
* @description
* Region subtag {@link http://www.unicode.org/reports/tr35/#Language_Locale_Field_Definitions}
*/
region: any;
/**
* @name territory
* @memberof cldr.Attributes
* @kind property
* @access public
*
* @type {any}
*
* @description
* Region subtag (territory variant) {@link http://www.unicode.org/reports/tr35/#Language_Locale_Field_Definitions}
*/
territory: any;
/**
* @name languageId
* @memberof cldr.Attributes
* @kind property
* @access public
*
* @type {any}
*
* @description
* Language Id {@link http://www.unicode.org/reports/tr35/#Unicode_language_identifier}
*/
languageId: any;
/**
* @name maxLanguageId
* @memberof cldr.Attributes
* @kind property
* @access public
*
* @type {any}
*
* @description
* Maximized Language Id {@link http://www.unicode.org/reports/tr35/#Likely_Subtags}
*/
maxLanguageId: any;
/**
* @name minLanguageId
* @memberof cldr.Attributes
* @kind property
* @access public
*
* @type {any}
*
* @description
* Minimized Language Id {@link http://www.unicode.org/reports/tr35/#Likely_Subtags}
*/
minLanguageId: any;
}
/**
* @name CldrStatic
* @memberof cldr
* @kind interface
*
* @description
* The cldr class definition.
*/
interface CldrStatic {
/**
* @name get
* @memberof cldr.CldrStatic
* @kind function
* @access public
*
* @description
* Get the item data given its path, or 'undefined' if missing.
*
* @param {string} path The path to the cldr member.
*
* @returns {any} The cldr member.
*/
get(path: string) : any;
/**
* @name get
* @memberof cldr.CldrStatic
* @kind function
* @access public
*
* @description
* Get the item data given its path, or 'undefined' if missing.
*
* @param {Array<string>} paths The array with path parts to the cldr member.
*
* @returns {any} The cldr member.
*/
get(paths: string[]): any;
/**
* @name main
* @memberof cldr.CldrStatic
* @kind function
* @access public
*
* @description
* It's an alias for .get(["main/{languageId}, ...])"
*
* @param {string} path The path to the cldr member.
*
* @returns {any} The cldr member.
*/
main(path: string): any;
/**
* @name main
* @memberof cldr.CldrStatic
* @kind function
* @access public
*
* @declaration
* It's an alias for .get(["main/{languageId}, ...])"
*
* @param {Array<string>} paths The array with path parts to the cldr member.
*
* @returns {any} The cldr member.
*/
main(paths: string[]): any;
/**
* @name locale
* @memberof cldr.CldrStatic
* @kind property
* @access public
*
* @type {string}
*
* @declaration
* The locale string.
*/
locale: string;
/**
* @name attributes
* @memberof cldr.CldrStatic
* @kind property
* @access public
*
* @type {cldr.Attributes}
*
* @declaration
* The object created during instance initialization and used internally by .get()
* to replace dynamic parts of an item path.
*/
attributes: Attributes;
}
/**
* @name CldrFactory
* @memberof cldr
* @kind inteface
*
* @description
* The factory for {@link cldr.CldrStatic} class.
*/
interface CldrFactory {
/**
* @name load
* @memberof cldr.CldrFactory
* @kind function
* @access public
*
* @description
* Load the CLDR content in the form of JSON.
*
* @param {any} json The json content.
* @param {Array<any>} otherJson Optional. The parts of the JSON.
*
* @returns {void}
*/
load(json: any, ...otherJson: any[]): void;
/**
* @name constructor
* @memberof cldr.CldrFactory
* @kind function
* @access public
*
* @description
* The constructor function for {@link cldr.CldrStatic} class.
*
* @param {string} locale The locale name that was previously loaded.
*
* @returns {cldr.CldrStatic} The instance of {@link cldr.CldrStatic} class.
*/
new (locale: string): CldrStatic;
/**
* Allow user to override locale separator "-" (default) | "_".
* According to http://www.unicode.org/reports/tr35/#Unicode_language_identifier, both "-" and "_" are valid locale separators (eg. "en_GB", "en-GB").
* According to http://unicode.org/cldr/trac/ticket/6786 its usage must be consistent throughout the data set.
*/
localeSep: "-" | "_";
}
}
declare module "cldr" {
export = cldr;
}
declare var Cldr: cldr.CldrFactory;