forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dojox.html.d.ts
570 lines (563 loc) · 22.9 KB
/
dojox.html.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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html.html
*
* Deprecated. Should require dojox/html modules directly rather than trying to access them through
* this module.
*
*/
interface html {
}
module html {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/ellipsis.html
*
* offers cross-browser support for text-overflow: ellipsis
* Add "dojoxEllipsis" on any node that you want to ellipsis-ize. In order to function properly,
* the node with the dojoxEllipsis class set on it should be a child of a node with a defined width.
* It should also be a block-level element (i.e. <div>) - it will not work on td elements.
* NOTE: When using the dojoxEllipsis class within tables, the table needs to have the table-layout: fixed style
*
*/
interface ellipsis {
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/entities.html
*
*
*/
interface entities {
/**
*
*/
html: any[];
/**
*
*/
latin: any[];
/**
* Function to obtain an entity encoding for a specified character
*
* @param str The string to process for possible entity encoding to decode.
* @param m An optional list of character to entity name mappings (array ofarrays). If not provided, it uses the HTML and Latin entities as theset to map and decode.
*/
decode(str: any, m: any): void;
/**
* Function to obtain an entity encoding for a specified character
*
* @param str The string to process for possible entity encoding.
* @param m An optional list of character to entity name mappings (array ofarrays). If not provided, it uses the and Latin entities as theset to map and escape.
*/
encode(str: any, m: any): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/metrics.html
*
*
*/
interface metrics {
/**
*
* @param recalculate
*/
getCachedFontMeasurements(recalculate: any): any;
/**
* Returns an object that has pixel equivilents of standard font size values.
*
*/
getFontMeasurements(): Object;
/**
*
*/
getScrollbar(): Object;
/**
*
* @param text
* @param style
* @param className Optional
*/
getTextBox(text: String, style: Object, className: String): void;
/**
*
*/
initOnFontResize(): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/styles.html
*
*
*/
interface styles {
/**
*
*/
entities: Object;
/**
*
*/
"ext-dojo": Object;
/**
*
*/
metrics: Object;
/**
* Getter/Setter
* If passed a title, enables a that style sheet. All other
* toggle-able style sheets are disabled.
* If no argument is passed, returns currently enabled
* style sheet.
*
* @param title Optional
*/
activeStyleSheet(title: String): void;
/**
* Disables the dynamic style sheet with the name passed in the
* argument. If no arg is passed, defaults to the default style sheet.
*
* @param styleSheetName
*/
disableStyleSheet(styleSheetName: String): void;
/**
* Enables the style sheet with the name passed in the
* argument. Deafults to the default style sheet.
*
* @param styleSheetName
*/
enableStyleSheet(styleSheetName: String): void;
/**
* Creates and returns a dynamically created style sheet
* used for dynamic styles
*
* @param styleSheetName OptionalThe name given the style sheet so that multiplestyle sheets can be created and referenced. Ifno argument is given, the name "default" is used.
*/
getDynamicStyleSheet(styleSheetName: String): any;
/**
* Returns the style sheet that was initially enabled
* on document launch.
* TODO, does not work.
*
*/
getPreferredStyleSheet(): void;
/**
* Returns a style sheet based on the argument.
* Searches dynamic style sheets first. If no matches,
* searches document style sheets.
*
* @param styleSheetName OptionalA title or an href to a style sheet. Title can bean attribute in a tag, or a dynamic style sheetreference. Href can be the name of the file.If no argument, the assumed created dynamic stylesheet is used.
*/
getStyleSheet(styleSheetName: String): void;
/**
* Collects all the style sheets referenced in the HTML page,
* including any included via @import.
*
*/
getStyleSheets(): any;
/**
* Searches HTML for style sheets that are "toggle-able" -
* can be enabled and disabled. These would include sheets
* with the title attribute, as well as the REL attribute.
*
*/
getToggledStyleSheets(): any;
/**
* Creates a style and attaches it to a dynamically created stylesheet
*
* @param selector A fully qualified class name, as it would appear ina CSS dojo.doc. Start classes with periods, targetnodes with '#'. Large selectors can also be createdlike:"#myDiv.myClass span input"
* @param declaration A single string that would make up a style block, notincluding the curly braces. Include semi-colons betweenstatements. Do not use JavaScript style declarationsin camel case, use as you would in a CSS dojo.doc:"color:#ffoooo;font-size:12px;margin-left:5px;"
* @param styleSheetName OptionalName of the dynamic style sheet this rule should beinserted into. If is not found by that name, it iscreated. If no name is passed, the name "default" isused.
*/
insertCssRule(selector: String, declaration: String, styleSheetName: String): String;
/**
* Not implemented - it seems to have some merit for changing some complex
* selectors. It's not much use for changing simple ones like "span".
* For now, simply write a new rule which will cascade over the first.
*
* Modifies an existing cssRule
*
* @param selector
* @param declaration
* @param styleSheetName
*/
modifyCssRule(selector: any, declaration: any, styleSheetName: any): void;
/**
* Removes a cssRule base on the selector and declaration passed
* The declaration is needed for cases of dupe selectors
* Only removes DYNAMICALLY created cssRules. If you
* created it with dh.insertCssRule, it can be removed.
*
* @param selector
* @param declaration
* @param styleSheetName
*/
removeCssRule(selector: String, declaration: String, styleSheetName: String): void;
}
module styles {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/styles._ContentSetter.html
*
*
* @param params
* @param node
*/
class _ContentSetter {
constructor(params: Object, node: String);
/**
* Adjust relative paths in html string content to point to this page
* Only useful if you grab content from a another folder than the current one
*
*/
"adjustPaths": boolean;
/**
* Should the content be treated as a full html document,
* and the real content stripped of , wrapper before injection
*
*/
"cleanContent": boolean;
/**
* The content to be placed in the node. Can be an HTML string, a node reference, or a enumerable list of nodes
*
*/
"content": string;
/**
*
*/
"executeScripts": boolean;
/**
* Should the content be treated as a full html document,
* and the real content stripped of <html> <body> wrapper before injection
*
*/
"extractContent": boolean;
/**
* Usually only used internally, and auto-generated with each instance
*
*/
"id": Object;
/**
* An node which will be the parent element that we set content into
*
*/
"node": HTMLElement;
/**
* Should the node by passed to the parser after the new content is set
*
*/
"parseContent": boolean;
/**
* Flag passed to parser. Root for attribute names to search for. If scopeName is dojo,
* will search for data-dojo-type (or dojoType). For backwards compatibility
* reasons defaults to dojo._scopeName (which is "dojo" except when
* multi-version support is used, when it will be something like dojo16, dojo20, etc.)
*
*/
"parserScope": string;
/**
*
*/
"referencePath": string;
/**
*
*/
"renderStyles": boolean;
/**
*
*/
"scriptHasHooks": boolean;
/**
*
*/
"scriptHookReplacement": Object;
/**
* Start the child widgets after parsing them. Only obeyed if parseContent is true.
*
*/
"startup": boolean;
/**
*
*/
empty(): void;
/**
* front-end to the set-content sequence
*
* @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used
* @param params Optional
*/
set(cont: String, params: Object): any;
/**
* front-end to the set-content sequence
*
* @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used
* @param params Optional
*/
set(cont: HTMLElement, params: Object): any;
/**
* front-end to the set-content sequence
*
* @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used
* @param params Optional
*/
set(cont: NodeList, params: Object): any;
/**
* sets the content on the node
*
*/
setContent(): void;
/**
*
*/
tearDown(): void;
/**
* Called after instantiation, but before set();
* It allows modification of any of the object properties - including the node and content
* provided - before the set operation actually takes place
* This implementation extends that of dojo.html._ContentSetter
* to add handling for adjustPaths, renderStyles on the html string content before it is set
*
*/
onBegin(): void;
/**
*
* @param err
*/
onContentError(err: any): String;
/**
* Called after set(), when the new content has been pushed into the node
* It provides an opportunity for post-processing before handing back the node to the caller
* This implementation extends that of dojo.html._ContentSetter
*
*/
onEnd(): any;
/**
*
* @param err
*/
onExecError(err: any): String;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/styles.entities.html
*
*
*/
interface entities {
/**
*
*/
html: any[];
/**
*
*/
latin: any[];
/**
* Function to obtain an entity encoding for a specified character
*
* @param str The string to process for possible entity encoding to decode.
* @param m An optional list of character to entity name mappings (array ofarrays). If not provided, it uses the HTML and Latin entities as theset to map and decode.
*/
decode(str: any, m: any): void;
/**
* Function to obtain an entity encoding for a specified character
*
* @param str The string to process for possible entity encoding.
* @param m An optional list of character to entity name mappings (array ofarrays). If not provided, it uses the and Latin entities as theset to map and escape.
*/
encode(str: any, m: any): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/styles.ext-dojo.html
*
*
*/
interface ext_dojo {
/**
*
*/
style: Object;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/styles.metrics.html
*
*
*/
interface metrics {
/**
*
* @param recalculate
*/
getCachedFontMeasurements(recalculate: any): any;
/**
* Returns an object that has pixel equivilents of standard font size values.
*
*/
getFontMeasurements(): Object;
/**
*
*/
getScrollbar(): Object;
/**
*
* @param text
* @param style
* @param className Optional
*/
getTextBox(text: String, style: Object, className: String): void;
/**
*
*/
initOnFontResize(): void;
}
}
module _base {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/_base._ContentSetter.html
*
*
* @param params
* @param node
*/
class _ContentSetter {
constructor(params: Object, node: String);
/**
* Adjust relative paths in html string content to point to this page
* Only useful if you grab content from a another folder than the current one
*
*/
"adjustPaths": boolean;
/**
* Should the content be treated as a full html document,
* and the real content stripped of , wrapper before injection
*
*/
"cleanContent": boolean;
/**
* The content to be placed in the node. Can be an HTML string, a node reference, or a enumerable list of nodes
*
*/
"content": string;
/**
*
*/
"executeScripts": boolean;
/**
* Should the content be treated as a full html document,
* and the real content stripped of <html> <body> wrapper before injection
*
*/
"extractContent": boolean;
/**
* Usually only used internally, and auto-generated with each instance
*
*/
"id": Object;
/**
* An node which will be the parent element that we set content into
*
*/
"node": HTMLElement;
/**
* Should the node by passed to the parser after the new content is set
*
*/
"parseContent": boolean;
/**
* Flag passed to parser. Root for attribute names to search for. If scopeName is dojo,
* will search for data-dojo-type (or dojoType). For backwards compatibility
* reasons defaults to dojo._scopeName (which is "dojo" except when
* multi-version support is used, when it will be something like dojo16, dojo20, etc.)
*
*/
"parserScope": string;
/**
*
*/
"referencePath": string;
/**
*
*/
"renderStyles": boolean;
/**
*
*/
"scriptHasHooks": boolean;
/**
*
*/
"scriptHookReplacement": Object;
/**
* Start the child widgets after parsing them. Only obeyed if parseContent is true.
*
*/
"startup": boolean;
/**
*
*/
empty(): void;
/**
* front-end to the set-content sequence
*
* @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used
* @param params Optional
*/
set(cont: String, params: Object): any;
/**
* front-end to the set-content sequence
*
* @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used
* @param params Optional
*/
set(cont: HTMLElement, params: Object): any;
/**
* front-end to the set-content sequence
*
* @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used
* @param params Optional
*/
set(cont: NodeList, params: Object): any;
/**
* sets the content on the node
*
*/
setContent(): void;
/**
*
*/
tearDown(): void;
/**
* Called after instantiation, but before set();
* It allows modification of any of the object properties - including the node and content
* provided - before the set operation actually takes place
* This implementation extends that of dojo.html._ContentSetter
* to add handling for adjustPaths, renderStyles on the html string content before it is set
*
*/
onBegin(): void;
/**
*
* @param err
*/
onContentError(err: any): String;
/**
* Called after set(), when the new content has been pushed into the node
* It provides an opportunity for post-processing before handing back the node to the caller
* This implementation extends that of dojo.html._ContentSetter
*
*/
onEnd(): any;
/**
*
* @param err
*/
onExecError(err: any): String;
}
}
module ext_dojo {
module style {
}
}
module format {
}
}
}