##// END OF EJS Templates
Maintenance release...
cin -
r8:b71d8639b457 v1.0.1 default
parent child
Show More
@@ -0,0 +1,33
1 # dojo-typings
2
3 This project is forked from the original `dojo-typings` package to
4 improve it with more tight and customizable type definitions.
5
6 The primary aims are
7
8 * Parametrize collections with items type.
9 * Distinguish sync and async methods in stores.
10 * Parametrize widget typings with event and attribute maps.
11
12 ## Changes
13
14 ### 1.0.1
15
16 Maintenance release
17
18 * `NodeList-fx` added overloads to all methods to distinguish returned values
19 of different types (`Animation | this`).
20 * Added missing signatures to `NodeList` constructor
21 * Improved `dijit.form._FormWidgetMixin`
22 * Added module declarations `dijit/form/_FormWidgetMixin`,
23 `dijit/form/_FormValueMixin`, `dijit/_HasDropDown`
24
25 ### 1.0.0
26
27 Initial release
28
29 * Parametrized `dojo/Stateful`, `diji/_WidgetBase`
30 * split `dojo.store.api.Store` in two `SyncStore` and `AsyncStore` interfaces
31 * `dojo/store/Memory` implements `SyncStore` and can be used synchronously,
32 * `dojo/store/Rest` implements `AsyncStore` and all its methods are
33 returning explicit promises.
@@ -0,0 +1,8
1 import "dojo/NodeList-fx";
2
3 declare const nl: dojo.NodeList<Node>;
4
5 const anim: dojo._base.Animation = nl.fadeIn();
6 const anim2: dojo._base.Animation = nl.fadeIn({duration: 500});
7 const nl2: typeof nl = nl.fadeOut({auto: true, onEnd: () => {}});
8 const other = nl.fadeOut({auto: false}); No newline at end of file
This diff has been collapsed as it changes many lines, (3103 lines changed) Show them Hide them
@@ -1,1889 +1,1868
1 declare namespace dijit {
1 declare namespace dijit {
2
2
3 namespace form {
3 namespace form {
4
4
5 /* implied */
5 /* implied */
6
6
7 interface Constraints {
7 interface Constraints {
8 [prop: string]: any;
8 [prop: string]: any;
9 }
9 }
10
10
11 interface ConstrainedValueFunction<V = any, C extends Constraints = Constraints, T = any> {
11 interface ConstrainedValueFunction<V = any, C extends Constraints = Constraints, T = any> {
12 /**
12 /**
13 * Returns a value that has been constrained by the constraints
13 * Returns a value that has been constrained by the constraints
14 * @param value The value to constrain
14 * @param value The value to constrain
15 * @param constraints The constraints to use
15 * @param constraints The constraints to use
16 * @returns The constrained value
16 * @returns The constrained value
17 */
17 */
18 (value: V, constraints: C): T;
18 (value: V, constraints: C): T;
19 }
19 }
20
20
21 interface ConstrainedValidFunction<C extends Constraints = Constraints> {
21 interface ConstrainedValidFunction<C extends Constraints = Constraints> {
22 /**
22 /**
23 * Returns true if the value is valid based on the constraints, otherwise
23 * Returns true if the value is valid based on the constraints, otherwise
24 * returns false.
24 * returns false.
25 * @param value The value to check
25 * @param value The value to check
26 * @param constraints The constraints to use
26 * @param constraints The constraints to use
27 * @returns true if valid, otherwise false
27 * @returns true if valid, otherwise false
28 */
28 */
29 (value: any, constraints: C): boolean;
29 (value: any, constraints: C): boolean;
30 }
30 }
31
31
32 interface ConstraintsToRegExpString<C extends Constraints = Constraints> {
32 interface ConstraintsToRegExpString<C extends Constraints = Constraints> {
33 /**
33 /**
34 * Takes a set of constraints and returns a RegExpString that can be used
34 * Takes a set of constraints and returns a RegExpString that can be used
35 * to match values against
35 * to match values against
36 * @param constraints The constraints to use
36 * @param constraints The constraints to use
37 * @returns The RegExpString that represents the constraints
37 * @returns The RegExpString that represents the constraints
38 */
38 */
39 (constraints: C): string;
39 (constraints: C): string;
40 }
40 }
41
41
42 interface SerializationFunction {
42 interface SerializationFunction {
43 (val: any, options?: Object): string;
43 (val: any, options?: Object): string;
44 }
44 }
45
45
46 /* dijit/form/_AutoCompleterMixin */
46 /* dijit/form/_AutoCompleterMixin */
47
47
48 /* tslint:disable:class-name */
48 /* tslint:disable:class-name */
49 interface _AutoCompleterMixin<T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> extends _SearchMixin<T, Q, O> {
49 interface _AutoCompleterMixin<T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> extends _SearchMixin<T, Q, O> {
50 /**
50 /**
51 * This is the item returned by the dojo/store/api/Store implementation that
51 * This is the item returned by the dojo/store/api/Store implementation that
52 * provides the data for this ComboBox, it's the currently selected item.
52 * provides the data for this ComboBox, it's the currently selected item.
53 */
53 */
54 item: T;
54 item: T;
55
55
56 /**
56 /**
57 * If user types in a partial string, and then tab out of the `<input>` box,
57 * If user types in a partial string, and then tab out of the `<input>` box,
58 * automatically copy the first entry displayed in the drop down list to
58 * automatically copy the first entry displayed in the drop down list to
59 * the `<input>` field
59 * the `<input>` field
60 */
60 */
61 autoComplete: boolean;
61 autoComplete: boolean;
62
62
63 /**
63 /**
64 * One of: "first", "all" or "none".
64 * One of: "first", "all" or "none".
65 */
65 */
66 highlightMatch: string;
66 highlightMatch: string;
67 /* TODO: Uncomment for TS 1.8 and remove above */
67 /* TODO: Uncomment for TS 1.8 and remove above */
68 /* highlightMatch: 'fisrt' | 'all' | 'none'; */
68 /* highlightMatch: 'fisrt' | 'all' | 'none'; */
69
69
70 /**
70 /**
71 * The entries in the drop down list come from this attribute in the
71 * The entries in the drop down list come from this attribute in the
72 * dojo.data items.
72 * dojo.data items.
73 * If not specified, the searchAttr attribute is used instead.
73 * If not specified, the searchAttr attribute is used instead.
74 */
74 */
75 labelAttr: string;
75 labelAttr: string;
76
76
77 /**
77 /**
78 * Specifies how to interpret the labelAttr in the data store items.
78 * Specifies how to interpret the labelAttr in the data store items.
79 * Can be "html" or "text".
79 * Can be "html" or "text".
80 */
80 */
81 labelType: string;
81 labelType: string;
82
82
83 /**
83 /**
84 * Flags to _HasDropDown to limit height of drop down to make it fit in viewport
84 * Flags to _HasDropDown to limit height of drop down to make it fit in viewport
85 */
85 */
86 maxHeight: number;
86 maxHeight: number;
87
87
88 /**
88 /**
89 * For backwards compatibility let onClick events propagate, even clicks on the down arrow button
89 * For backwards compatibility let onClick events propagate, even clicks on the down arrow button
90 */
90 */
91 _stopClickEvents: boolean;
91 _stopClickEvents: boolean;
92
92
93 _getCaretPos(element: HTMLElement): number;
93 _getCaretPos(element: HTMLElement): number;
94 _setCaretPos(element: HTMLElement, location: number): void;
94 _setCaretPos(element: HTMLElement, location: number): void;
95
95
96 /**
96 /**
97 * Overrides _HasDropDown.loadDropDown().
97 * Overrides _HasDropDown.loadDropDown().
98 */
98 */
99 loadDropDown(loadCallback: () => void): void;
99 loadDropDown(loadCallback: () => void): void;
100
100
101 /**
101 /**
102 * signal to _HasDropDown that it needs to call loadDropDown() to load the
102 * signal to _HasDropDown that it needs to call loadDropDown() to load the
103 * drop down asynchronously before displaying it
103 * drop down asynchronously before displaying it
104 */
104 */
105 isLoaded(): boolean;
105 isLoaded(): boolean;
106
106
107 /**
107 /**
108 * Overrides _HasDropDown.closeDropDown(). Closes the drop down (assuming that it's open).
108 * Overrides _HasDropDown.closeDropDown(). Closes the drop down (assuming that it's open).
109 * This method is the callback when the user types ESC or clicking
109 * This method is the callback when the user types ESC or clicking
110 * the button icon while the drop down is open. It's also called by other code.
110 * the button icon while the drop down is open. It's also called by other code.
111 */
111 */
112 closeDropDown(focus?: boolean): void;
112 closeDropDown(focus?: boolean): void;
113
113
114 postMixInProperties(): void;
114 postMixInProperties(): void;
115 postCreate(): void;
115 postCreate(): void;
116
116
117 /**
117 /**
118 * Highlights the string entered by the user in the menu. By default this
118 * Highlights the string entered by the user in the menu. By default this
119 * highlights the first occurrence found. Override this method
119 * highlights the first occurrence found. Override this method
120 * to implement your custom highlighting.
120 * to implement your custom highlighting.
121 */
121 */
122 doHighlight(label: string, find: string): string;
122 doHighlight(label: string, find: string): string;
123 reset(): void;
123 reset(): void;
124 labelFunc(item: T, store: dojo.store.api.Store<T, Q, O>): string;
124 labelFunc(item: T, store: dojo.store.api.Store<T, Q, O>): string;
125
125
126 // set(name: 'value', value: string): this;
126 // set(name: 'value', value: string): this;
127 // set(name: 'item', value: T): this;
127 // set(name: 'item', value: T): this;
128 // set(name: 'disabled', value: boolean): this;
128 // set(name: 'disabled', value: boolean): this;
129 // set(name: string, value: any): this;
129 // set(name: string, value: any): this;
130 // set(values: Object): this;
130 // set(values: Object): this;
131 }
131 }
132
132
133 /* dijit/form/_ButtonMixin */
133 /* dijit/form/_ButtonMixin */
134
134
135 interface _ButtonMixin {
135 interface _ButtonMixin {
136 /**
136 /**
137 * A mixin to add a thin standard API wrapper to a normal HTML button
137 * A mixin to add a thin standard API wrapper to a normal HTML button
138 */
138 */
139 label: string;
139 label: string;
140
140
141 /**
141 /**
142 * Type of button (submit, reset, button, checkbox, radio)
142 * Type of button (submit, reset, button, checkbox, radio)
143 */
143 */
144 type: string;
144 type: string;
145 postCreate(): void;
145 postCreate(): void;
146
146
147 /**
147 /**
148 * Callback for when button is clicked.
148 * Callback for when button is clicked.
149 * If type="submit", return true to perform submit, or false to cancel it.
149 * If type="submit", return true to perform submit, or false to cancel it.
150 */
150 */
151 onClick(e: MouseEvent): boolean | void;
151 onClick(e: MouseEvent): boolean | void;
152 onSetLabel(e: Event): void;
152 onSetLabel(e: Event): void;
153 }
153 }
154
154
155 /* dijit/form/_CheckBoxMixin */
155 /* dijit/form/_CheckBoxMixin */
156
156
157 interface _CheckBoxMixin {
157 interface _CheckBoxMixin {
158 /**
158 /**
159 * type attribute on `<input>` node.
159 * type attribute on `<input>` node.
160 * Overrides `dijit/form/Button.type`. Users should not change this value.
160 * Overrides `dijit/form/Button.type`. Users should not change this value.
161 */
161 */
162 type: string;
162 type: string;
163
163
164 /**
164 /**
165 * As an initialization parameter, equivalent to value field on normal checkbox
165 * As an initialization parameter, equivalent to value field on normal checkbox
166 * (if checked, the value is passed as the value when form is submitted).
166 * (if checked, the value is passed as the value when form is submitted).
167 */
167 */
168 value: string;
168 value: string;
169
169
170 /**
170 /**
171 * Should this widget respond to user input?
171 * Should this widget respond to user input?
172 * In markup, this is specified as "readOnly".
172 * In markup, this is specified as "readOnly".
173 * Similar to disabled except readOnly form values are submitted.
173 * Similar to disabled except readOnly form values are submitted.
174 */
174 */
175 readOnly: boolean;
175 readOnly: boolean;
176
176
177 reset: () => void;
177 reset: () => void;
178 }
178 }
179
179
180 /* dijit/form/_ComboBoxMenu */
180 /* dijit/form/_ComboBoxMenu */
181
181
182 interface _ComboBoxMenu<T = any> extends _WidgetBase, _TemplatedMixin, _ListMouseMixin, _ComboBoxMenuMixin<T> {
182 interface _ComboBoxMenu<T = any> extends _WidgetBase, _TemplatedMixin, _ListMouseMixin, _ComboBoxMenuMixin<T> {
183 templateString: string;
183 templateString: string;
184 baseClass: string;
184 baseClass: string;
185
185
186 /**
186 /**
187 * Add hover CSS
187 * Add hover CSS
188 */
188 */
189 onHover(node: HTMLElement): void;
189 onHover(node: HTMLElement): void;
190
190
191 /**
191 /**
192 * Remove hover CSS
192 * Remove hover CSS
193 */
193 */
194 onUnhover(node: HTMLElement): void;
194 onUnhover(node: HTMLElement): void;
195
195
196 /**
196 /**
197 * Add selected CSS
197 * Add selected CSS
198 */
198 */
199 onSelect(node: HTMLElement): void;
199 onSelect(node: HTMLElement): void;
200
200
201 /**
201 /**
202 * Remove selected CSS
202 * Remove selected CSS
203 */
203 */
204 onDeselect(node: HTMLElement): void;
204 onDeselect(node: HTMLElement): void;
205
205
206 /**
206 /**
207 * Handles page-up and page-down keypresses
207 * Handles page-up and page-down keypresses
208 */
208 */
209 _page(up?: boolean): void;
209 _page(up?: boolean): void;
210
210
211 /**
211 /**
212 * Handle keystroke event forwarded from ComboBox, returning false if it's
212 * Handle keystroke event forwarded from ComboBox, returning false if it's
213 * a keystroke I recognize and process, true otherwise.
213 * a keystroke I recognize and process, true otherwise.
214 */
214 */
215 handleKey(evt: KeyboardEvent): boolean;
215 handleKey(evt: KeyboardEvent): boolean;
216
216
217 // set(name: string, value: any): this;
217 // set(name: string, value: any): this;
218 // set(values: Object): this;
218 // set(values: Object): this;
219 }
219 }
220
220
221 interface _ComboBoxMenuConstructor extends _WidgetBaseConstructor<_ComboBoxMenu<any>> {
221 interface _ComboBoxMenuConstructor extends _WidgetBaseConstructor<_ComboBoxMenu<any>> {
222 new <T = any>(params: Object, srcNodeRef: dojo.NodeOrString): _ComboBoxMenu<T>;
222 new <T = any>(params: Object, srcNodeRef: dojo.NodeOrString): _ComboBoxMenu<T>;
223 }
223 }
224
224
225 /* dijit/form/_ComboBoxMenuMixin */
225 /* dijit/form/_ComboBoxMenuMixin */
226
226
227 interface _ComboBoxMenuMixin<T = any> {
227 interface _ComboBoxMenuMixin<T = any> {
228 /**
228 /**
229 * Holds "next" and "previous" text for paging buttons on drop down
229 * Holds "next" and "previous" text for paging buttons on drop down
230 */
230 */
231 _messages: { next: string; previous: string; };
231 _messages: { next: string; previous: string; };
232
233 onClick(node: HTMLElement): void;
234
232
235 /**
233 onClick(node: HTMLElement): void;
236 * Notifies ComboBox/FilteringSelect that user selected an option.
237 */
238 onChange(direction: number): void;
239
234
240 /**
235 /**
241 * Notifies ComboBox/FilteringSelect that user clicked to advance to next/previous page.
236 * Notifies ComboBox/FilteringSelect that user selected an option.
242 */
237 */
243 onPage(direction: number): void;
238 onChange(direction: number): void;
244
239
245 /**
240 /**
246 * Callback from dijit.popup code to this widget, notifying it that it closed
241 * Notifies ComboBox/FilteringSelect that user clicked to advance to next/previous page.
247 */
242 */
248 onClose(): void;
243 onPage(direction: number): void;
249
244
250 /**
245 /**
251 * Fills in the items in the drop down list
246 * Callback from dijit.popup code to this widget, notifying it that it closed
252 */
247 */
253 createOptions(results: T[], options: dojo.store.api.QueryOptions, labelFunc: (item: T) => { html: boolean; label: string; }): void;
248 onClose(): void;
254
249
255 /**
250 /**
256 * Clears the entries in the drop down list, but of course keeps the previous and next buttons.
251 * Fills in the items in the drop down list
257 */
252 */
258 clearResultList(): void;
253 createOptions(results: T[], options: dojo.store.api.QueryOptions, labelFunc: (item: T) => { html: boolean; label: string; }): void;
259
254
260 /**
255 /**
261 * Highlight the first real item in the list (not Previous Choices).
256 * Clears the entries in the drop down list, but of course keeps the previous and next buttons.
262 */
257 */
263 highlightFirstOption(): void;
258 clearResultList(): void;
264
259
265 /**
260 /**
266 * Highlight the last real item in the list (not More Choices).
261 * Highlight the first real item in the list (not Previous Choices).
267 */
262 */
268 highlightLastOption(): void;
263 highlightFirstOption(): void;
264
265 /**
266 * Highlight the last real item in the list (not More Choices).
267 */
268 highlightLastOption(): void;
269
269
270 selectFirstNode(): void;
270 selectFirstNode(): void;
271 selectLastNode(): void;
271 selectLastNode(): void;
272 getHighlightedOption(): HTMLElement;
272 getHighlightedOption(): HTMLElement;
273
273
274 // set(name: 'value', value: Object): this;
274 // set(name: 'value', value: Object): this;
275 // set(name: string, value: any): this;
275 // set(name: string, value: any): this;
276 // set(values: Object): this;
276 // set(values: Object): this;
277 }
277 }
278
278
279 /* dijit/form/_DateTimeTextBox */
279 /* dijit/form/_DateTimeTextBox */
280
280
281 interface DateTimeConstraints extends Constraints, dojo.date.DateLocaleFormatOptions { }
281 interface DateTimeConstraints extends Constraints, dojo.date.DateLocaleFormatOptions { }
282
282
283 interface _DateTimeTextBox<T extends _WidgetBase> extends RangeBoundTextBox, _HasDropDown<T> {
283 interface _DateTimeTextBox<T extends _WidgetBase> extends RangeBoundTextBox, _HasDropDown<T> {
284 templateString: string;
284 templateString: string;
285
285
286 /**
286 /**
287 * Set this textbox to display a down arrow button, to open the drop down list.
287 * Set this textbox to display a down arrow button, to open the drop down list.
288 */
288 */
289 hasDownArrow: boolean;
289 hasDownArrow: boolean;
290 cssStateNodes: CSSStateNodes;
290 cssStateNodes: CSSStateNodes;
291
291
292 /**
292 /**
293 * Despite the name, this parameter specifies both constraints on the input
293 * Despite the name, this parameter specifies both constraints on the input
294 * (including starting/ending dates/times allowed) as well as
294 * (including starting/ending dates/times allowed) as well as
295 * formatting options like whether the date is displayed in long (ex: December 25, 2005)
295 * formatting options like whether the date is displayed in long (ex: December 25, 2005)
296 * or short (ex: 12/25/2005) format. See `dijit/form/_DateTimeTextBox.__Constraints` for details.
296 * or short (ex: 12/25/2005) format. See `dijit/form/_DateTimeTextBox.__Constraints` for details.
297 */
297 */
298 constraints: DateTimeConstraints;
298 constraints: DateTimeConstraints;
299
299
300 /**
300 /**
301 * The constraints without the min/max properties. Used by the compare() method
301 * The constraints without the min/max properties. Used by the compare() method
302 */
302 */
303 _unboundedConstraints: DateTimeConstraints;
303 _unboundedConstraints: DateTimeConstraints;
304
304
305 pattern: (options?: dojo.date.DateLocaleFormatOptions | RangeBoundTextBoxConstraints) => string;
305 pattern: (options?: dojo.date.DateLocaleFormatOptions | RangeBoundTextBoxConstraints) => string;
306
306
307 /**
307 /**
308 * JavaScript namespace to find calendar routines. If unspecified, uses Gregorian calendar routines
308 * JavaScript namespace to find calendar routines. If unspecified, uses Gregorian calendar routines
309 * at dojo/date and dojo/date/locale.
309 * at dojo/date and dojo/date/locale.
310 */
310 */
311 datePackage: string;
311 datePackage: string;
312
312
313 postMixInProperties(): void;
313 postMixInProperties(): void;
314 compare(val1: Date, val2: Date): number;
314 compare(val1: Date, val2: Date): number;
315 autoWidth: boolean;
315 autoWidth: boolean;
316
316
317 /**
317 /**
318 * Formats the value as a Date, according to specified locale (second argument)
318 * Formats the value as a Date, according to specified locale (second argument)
319 */
319 */
320 format: ConstrainedValueFunction<Date, DateTimeConstraints, string>;
320 format: ConstrainedValueFunction<Date, DateTimeConstraints, string>;
321
321
322 /**
322 /**
323 * Parses as string as a Date, according to constraints
323 * Parses as string as a Date, according to constraints
324 */
324 */
325 parse: ConstrainedValueFunction<string, DateTimeConstraints, Date>;
325 parse: ConstrainedValueFunction<string, DateTimeConstraints, Date>;
326
326
327 serialize(val: any, options?: dojo.date.StampFormatOptions): string;
327 serialize(val: any, options?: dojo.date.StampFormatOptions): string;
328
328
329 /**
329 /**
330 * The default value to focus in the popupClass widget when the textbox value is empty.
330 * The default value to focus in the popupClass widget when the textbox value is empty.
331 */
331 */
332 dropDownDefaultValue: Date;
332 dropDownDefaultValue: Date;
333
333
334 /**
334 /**
335 * The value of this widget as a JavaScript Date object. Use get("value") / set("value", val) to manipulate.
335 * The value of this widget as a JavaScript Date object. Use get("value") / set("value", val) to manipulate.
336 * When passed to the parser in markup, must be specified according to `dojo/date/stamp.fromISOString()`
336 * When passed to the parser in markup, must be specified according to `dojo/date/stamp.fromISOString()`
337 */
337 */
338 value: Date;
338 value: Date;
339
339
340 _blankValue: string;
340 _blankValue: string;
341
341
342 /**
342 /**
343 * Name of the popup widget class used to select a date/time.
343 * Name of the popup widget class used to select a date/time.
344 * Subclasses should specify this.
344 * Subclasses should specify this.
345 */
345 */
346 popupClass: string | _WidgetBaseConstructor<T>;
346 popupClass: string | _WidgetBaseConstructor<T>;
347
347
348 /**
348 /**
349 * Specifies constraints.selector passed to dojo.date functions, should be either
349 * Specifies constraints.selector passed to dojo.date functions, should be either
350 * "date" or "time".
350 * "date" or "time".
351 * Subclass must specify this.
351 * Subclass must specify this.
352 */
352 */
353 _selector: string;
353 _selector: string;
354 /* TODO: uncomment for TS 1.8 */
354 /* TODO: uncomment for TS 1.8 */
355 /* _selector: 'data' | 'time'; */
355 /* _selector: 'data' | 'time'; */
356
356
357 buildRendering(): void;
357 buildRendering(): void;
358
358
359 /**
359 /**
360 * Runs various tests on the value, checking for invalid conditions
360 * Runs various tests on the value, checking for invalid conditions
361 */
361 */
362 _isInvalidDate(value: Date): boolean;
362 _isInvalidDate(value: Date): boolean;
363
363
364 // get(name: 'displayedValue'): string;
364 // get(name: 'displayedValue'): string;
365 // get(name: string): any;
365 // get(name: string): any;
366
366
367 // set(name: 'displayedValue', value: string): this;
367 // set(name: 'displayedValue', value: string): this;
368 // set(name: 'dropDownDefaultValue', value: Date): this;
368 // set(name: 'dropDownDefaultValue', value: Date): this;
369 // set(name: 'value', value: Date | string): this;
369 // set(name: 'value', value: Date | string): this;
370 // set(name: 'constraints', value: DateTimeConstraints): this;
370 // set(name: 'constraints', value: DateTimeConstraints): this;
371 // set(name: string, value: any): this;
371 // set(name: string, value: any): this;
372 // set(values: Object): this;
372 // set(values: Object): this;
373 }
373 }
374
375 interface _DateTimeTextBoxConstructor<T extends _WidgetBase> extends _WidgetBaseConstructor<_DateTimeTextBox<T>> { }
376
374
377 /* dijit/form/_ExpandingTextAreaMixin */
375 interface _DateTimeTextBoxConstructor<T extends _WidgetBase> extends _WidgetBaseConstructor<_DateTimeTextBox<T>> { }
376
377 /* dijit/form/_ExpandingTextAreaMixin */
378
378
379 interface _ExpandingTextAreaMixin {
379 interface _ExpandingTextAreaMixin {
380 postCreate(): void;
380 postCreate(): void;
381 startup(): void;
381 startup(): void;
382 resize(): void;
382 resize(): void;
383 }
383 }
384
384
385 /* dijit/form/_FormMixin */
385 /* dijit/form/_FormMixin */
386
387 interface OnValidStateChange {
388 (isValid?: boolean): void;
389 }
390
386
391 interface _FormMixin {
387 interface OnValidStateChange {
388 (isValid?: boolean): void;
389 }
390
391 interface _FormMixin {
392
392
393 /**
393 /**
394 * Will be "Error" if one or more of the child widgets has an invalid value,
394 * Will be "Error" if one or more of the child widgets has an invalid value,
395 * "Incomplete" if not all of the required child widgets are filled in. Otherwise, "",
395 * "Incomplete" if not all of the required child widgets are filled in. Otherwise, "",
396 * which indicates that the form is ready to be submitted.
396 * which indicates that the form is ready to be submitted.
397 */
397 */
398 state: '' | 'Error' | 'Incomplete';
398 state: '' | 'Error' | 'Incomplete';
399
399
400 /**
400 /**
401 * Returns all form widget descendants, searching through non-form child widgets like BorderContainer
401 * Returns all form widget descendants, searching through non-form child widgets like BorderContainer
402 */
402 */
403 _getDescendantFormWidgets(children?: _WidgetBase[]): _FormWidget[];
403 _getDescendantFormWidgets(children?: _WidgetBase[]): _FormWidget[];
404
405 reset(): void;
406
404
407 /**
405 reset(): void;
408 * returns if the form is valid - same as isValid - but
409 * provides a few additional (ui-specific) features:
410 *
411 * 1. it will highlight any sub-widgets that are not valid
412 * 2. it will call focus() on the first invalid sub-widget
413 */
414 validate(): boolean;
415
406
416 setValues(val: any): _FormMixin;
407 /**
417 getValues(): any;
408 * returns if the form is valid - same as isValid - but
409 * provides a few additional (ui-specific) features:
410 *
411 * 1. it will highlight any sub-widgets that are not valid
412 * 2. it will call focus() on the first invalid sub-widget
413 */
414 validate(): boolean;
415
416 setValues(val: any): _FormMixin;
417 getValues(): any;
418
418
419 /**
419 /**
420 * Returns true if all of the widgets are valid.
420 * Returns true if all of the widgets are valid.
421 * Deprecated, will be removed in 2.0. Use get("state") instead.
421 * Deprecated, will be removed in 2.0. Use get("state") instead.
422 */
422 */
423 isValid(): boolean;
423 isValid(): boolean;
424
424
425 /**
425 /**
426 * Stub function to connect to if you want to do something
426 * Stub function to connect to if you want to do something
427 * (like disable/enable a submit button) when the valid
427 * (like disable/enable a submit button) when the valid
428 * state changes on the form as a whole.
428 * state changes on the form as a whole.
429 *
429 *
430 * Deprecated. Will be removed in 2.0. Use watch("state", ...) instead.
430 * Deprecated. Will be removed in 2.0. Use watch("state", ...) instead.
431 */
431 */
432 onValidStateChange: OnValidStateChange;
432 onValidStateChange: OnValidStateChange;
433
434 /**
435 * Compute what this.state should be based on state of children
436 */
437 _getState(): '' | 'Error' | 'Incomplete';
438
433
439 /**
434 /**
440 * Deprecated method. Applications no longer need to call this. Remove for 2.0.
435 * Compute what this.state should be based on state of children
441 */
436 */
442 disconnectChildren(): void;
437 _getState(): '' | 'Error' | 'Incomplete';
443
438
444 /**
439 /**
445 * You can call this function directly, ex. in the event that you
440 * Deprecated method. Applications no longer need to call this. Remove for 2.0.
446 * programmatically add a widget to the form *after* the form has been
441 */
447 * initialized.
442 disconnectChildren(): void;
448 */
449 connectChildren(inStartup?: boolean): void;
450
443
451 /**
444 /**
452 * Called when child's value or disabled state changes
445 * You can call this function directly, ex. in the event that you
453 */
446 * programmatically add a widget to the form *after* the form has been
454 _onChildChange(attr?: string): void;
447 * initialized.
455
448 */
456 startup(): void;
449 connectChildren(inStartup?: boolean): void;
457 destroy(preserveDom?: boolean): void;
458 }
459
450
460 interface _FormMixinConstructor extends dojo._base.DeclareConstructor<_FormMixin> { }
451 /**
461
452 * Called when child's value or disabled state changes
462 /* dijit/form/_FormSelectWidget */
453 */
454 _onChildChange(attr?: string): void;
463
455
464 interface SelectOption {
456 startup(): void;
465 value?: string;
457 destroy(preserveDom?: boolean): void;
466 label: string;
458 }
467 selected?: boolean;
459
468 disabled?: boolean;
460 interface _FormMixinConstructor extends dojo._base.DeclareConstructor<_FormMixin> { }
469 }
461
462 /* dijit/form/_FormSelectWidget */
470
463
471 interface _FormSelectWidget<T extends Object, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> extends _FormValueWidget {
464 interface SelectOption {
472 /**
465 value?: string;
473 * Whether or not we are multi-valued
466 label: string;
474 */
467 selected?: boolean;
475 multiple: boolean;
468 disabled?: boolean;
469 }
476
470
477 /**
471 interface _FormSelectWidget<T extends Object, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> extends _FormValueWidget {
478 * The set of options for our select item. Roughly corresponds to
472 /**
479 * the html `<option>` tag.
473 * Whether or not we are multi-valued
480 */
474 */
481 options: SelectOption[];
475 multiple: boolean;
482
476
483 /**
477 /**
484 * A store to use for getting our list of options - rather than reading them
478 * The set of options for our select item. Roughly corresponds to
485 * from the `<option>` html tags. Should support getIdentity().
479 * the html `<option>` tag.
486 * For back-compat store can also be a dojo/data/api/Identity.
480 */
487 */
481 options: SelectOption[];
488 store: dojo.store.api.Store<T, Q, O>;
489
482
490 /**
483 /**
491 * A query to use when fetching items from our store
484 * A store to use for getting our list of options - rather than reading them
492 */
485 * from the `<option>` html tags. Should support getIdentity().
493 query: Q;
486 * For back-compat store can also be a dojo/data/api/Identity.
487 */
488 store: dojo.store.api.Store<T, Q, O>;
494
489
495 /**
490 /**
496 * Query options to use when fetching from the store
491 * A query to use when fetching items from our store
497 */
492 */
498 queryOptions: O;
493 query: Q;
499
494
500 /**
495 /**
501 * The entries in the drop down list come from this attribute in the dojo.store items.
496 * Query options to use when fetching from the store
502 * If ``store`` is set, labelAttr must be set too, unless store is an old-style
497 */
503 * dojo.data store rather than a new dojo/store.
498 queryOptions: O;
504 */
505 labelAttr: string;
506
499
507 /**
500 /**
508 * A callback to do with an onFetch - but before any items are actually
501 * The entries in the drop down list come from this attribute in the dojo.store items.
509 * iterated over (i.e. to filter even further what you want to add)
502 * If ``store`` is set, labelAttr must be set too, unless store is an old-style
510 */
503 * dojo.data store rather than a new dojo/store.
511 onFetch: (items: T[]) => void;
504 */
505 labelAttr: string;
512
506
513 /**
507 /**
514 * Flag to sort the options returned from a store by the label of
508 * A callback to do with an onFetch - but before any items are actually
515 * the store.
509 * iterated over (i.e. to filter even further what you want to add)
516 */
510 */
517 sortByLabel: boolean;
511 onFetch: (items: T[]) => void;
512
513 /**
514 * Flag to sort the options returned from a store by the label of
515 * the store.
516 */
517 sortByLabel: boolean;
518
518
519 /**
519 /**
520 * By default loadChildren is called when the items are fetched from the
520 * By default loadChildren is called when the items are fetched from the
521 * store. This property allows delaying loadChildren (and the creation
521 * store. This property allows delaying loadChildren (and the creation
522 * of the options/menuitems) until the user clicks the button to open the
522 * of the options/menuitems) until the user clicks the button to open the
523 * dropdown.
523 * dropdown.
524 */
524 */
525 loadChildrenOnOpen: boolean;
525 loadChildrenOnOpen: boolean;
526
526
527 /**
527 /**
528 * This is the `dojo.Deferred` returned by setStore().
528 * This is the `dojo.Deferred` returned by setStore().
529 * Calling onLoadDeferred.then() registers your
529 * Calling onLoadDeferred.then() registers your
530 * callback to be called only once, when the prior setStore completes.
530 * callback to be called only once, when the prior setStore completes.
531 */
531 */
532 onLoadDeferred: dojo.Deferred<void>;
532 onLoadDeferred: dojo.Deferred<void>;
533
533
534 /**
534 /**
535 * Returns a given option (or options).
535 * Returns a given option (or options).
536 */
536 */
537 getOptions(valueOrIdx: string): SelectOption;
537 getOptions(valueOrIdx: string): SelectOption;
538 getOptions(valueOrIdx: number): SelectOption;
538 getOptions(valueOrIdx: number): SelectOption;
539 getOptions(valueOrIdx: SelectOption): SelectOption;
539 getOptions(valueOrIdx: SelectOption): SelectOption;
540 getOptions(valueOrIdx: (string | number | SelectOption)[]): SelectOption[];
540 getOptions(valueOrIdx: (string | number | SelectOption)[]): SelectOption[];
541 getOptions(): SelectOption[];
541 getOptions(): SelectOption[];
542
542
543 /**
543 /**
544 * Adds an option or options to the end of the select. If value
544 * Adds an option or options to the end of the select. If value
545 * of the option is empty or missing, a separator is created instead.
545 * of the option is empty or missing, a separator is created instead.
546 * Passing in an array of options will yield slightly better performance
546 * Passing in an array of options will yield slightly better performance
547 * since the children are only loaded once.
547 * since the children are only loaded once.
548 */
548 */
549 addOption(option: SelectOption | SelectOption[]): void;
549 addOption(option: SelectOption | SelectOption[]): void;
550
550
551 /**
551 /**
552 * Removes the given option or options. You can remove by string
552 * Removes the given option or options. You can remove by string
553 * (in which case the value is removed), number (in which case the
553 * (in which case the value is removed), number (in which case the
554 * index in the options array is removed), or select option (in
554 * index in the options array is removed), or select option (in
555 * which case, the select option with a matching value is removed).
555 * which case, the select option with a matching value is removed).
556 * You can also pass in an array of those values for a slightly
556 * You can also pass in an array of those values for a slightly
557 * better performance since the children are only loaded once.
557 * better performance since the children are only loaded once.
558 * For numeric option values, specify {value: number} as the argument.
558 * For numeric option values, specify {value: number} as the argument.
559 */
559 */
560 removeOption(option: string | number | SelectOption | (string | number | SelectOption)[]): void;
560 removeOption(option: string | number | SelectOption | (string | number | SelectOption)[]): void;
561
561
562 /**
562 /**
563 * Updates the values of the given option. The option to update
563 * Updates the values of the given option. The option to update
564 * is matched based on the value of the entered option. Passing
564 * is matched based on the value of the entered option. Passing
565 * in an array of new options will yield better performance since
565 * in an array of new options will yield better performance since
566 * the children will only be loaded once.
566 * the children will only be loaded once.
567 */
567 */
568 updateOption(newOption: SelectOption | SelectOption[]): void;
568 updateOption(newOption: SelectOption | SelectOption[]): void;
569
569
570 /**
570 /**
571 * Deprecated!
571 * Deprecated!
572 */
572 */
573 setStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
573 setStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
574 query: Q;
574 query: Q;
575 queryOptions: O;
575 queryOptions: O;
576 onFetch: (items: T[], fetchArgs?: any) => void;
576 onFetch: (items: T[], fetchArgs?: any) => void;
577 }): dojo.store.api.Store<T, Q, O>;
577 }): dojo.store.api.Store<T, Q, O>;
578
578
579 /**
579 /**
580 * Sets the store you would like to use with this select widget.
580 * Sets the store you would like to use with this select widget.
581 * The selected value is the value of the new store to set. This
581 * The selected value is the value of the new store to set. This
582 * function returns the original store, in case you want to reuse
582 * function returns the original store, in case you want to reuse
583 * it or something.
583 * it or something.
584 */
584 */
585 _deprecatedSetStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
585 _deprecatedSetStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
586 query: Q;
586 query: Q;
587 queryOptions: O;
587 queryOptions: O;
588 onFetch: (items: T[], fetchArgs?: any) => void;
588 onFetch: (items: T[], fetchArgs?: any) => void;
589 }): dojo.store.api.Store<T, Q, O>;
589 }): dojo.store.api.Store<T, Q, O>;
590
590
591 /**
591 /**
592 * Loads the children represented by this widget's options.
592 * Loads the children represented by this widget's options.
593 * reset the menu to make it populatable on the next click
593 * reset the menu to make it populatable on the next click
594 */
594 */
595 _loadChildren(): void;
595 _loadChildren(): void;
596
596
597 /**
597 /**
598 * Sets the "selected" class on the item for styling purposes
598 * Sets the "selected" class on the item for styling purposes
599 */
599 */
600 _updateSelection(): void;
600 _updateSelection(): void;
601
601
602 /**
602 /**
603 * Returns the value of the widget by reading the options for
603 * Returns the value of the widget by reading the options for
604 * the selected flag
604 * the selected flag
605 */
605 */
606 _getValueFromOpts(): string;
606 _getValueFromOpts(): string;
607
607
608 buildRendering(): void;
608 buildRendering(): void;
609
609
610 /**
610 /**
611 * Loads our options and sets up our dropdown correctly. We
611 * Loads our options and sets up our dropdown correctly. We
612 * don't want any content, so we don't call any inherit chain
612 * don't want any content, so we don't call any inherit chain
613 * function.
613 * function.
614 */
614 */
615 _fillContent(): void;
615 _fillContent(): void;
616
616
617 /**
617 /**
618 * sets up our event handling that we need for functioning
618 * sets up our event handling that we need for functioning
619 * as a select
619 * as a select
620 */
620 */
621 postCreate(): void;
621 postCreate(): void;
622
622
623 startup(): void;
623 startup(): void;
624
624
625 /**
625 /**
626 * Clean up our connections
626 * Clean up our connections
627 */
627 */
628 destroy(preserveDom?: boolean): void;
628 destroy(preserveDom?: boolean): void;
629
629
630 /**
630 /**
631 * User-overridable function which, for the given option, adds an
631 * User-overridable function which, for the given option, adds an
632 * item to the select. If the option doesn't have a value, then a
632 * item to the select. If the option doesn't have a value, then a
633 * separator is added in that place. Make sure to store the option
633 * separator is added in that place. Make sure to store the option
634 * in the created option widget.
634 * in the created option widget.
635 */
635 */
636 _addOptionItem(option: SelectOption): void;
636 _addOptionItem(option: SelectOption): void;
637
637
638 /**
638 /**
639 * User-overridable function which, for the given option, removes
639 * User-overridable function which, for the given option, removes
640 * its item from the select.
640 * its item from the select.
641 */
641 */
642 _removeOptionItem(option: SelectOption): void;
642 _removeOptionItem(option: SelectOption): void;
643
643
644 /**
644 /**
645 * Overridable function which will set the display for the
645 * Overridable function which will set the display for the
646 * widget. newDisplay is either a string (in the case of
646 * widget. newDisplay is either a string (in the case of
647 * single selects) or array of strings (in the case of multi-selects)
647 * single selects) or array of strings (in the case of multi-selects)
648 */
648 */
649 _setDisplay(newDisplay: string | string[]): void;
649 _setDisplay(newDisplay: string | string[]): void;
650
650
651 /**
651 /**
652 * Overridable function to return the children that this widget contains.
652 * Overridable function to return the children that this widget contains.
653 */
653 */
654 _getChildren(): any[];
654 _getChildren(): any[];
655
655
656 /**
656 /**
657 * hooks into this.attr to provide a mechanism for getting the
657 * hooks into this.attr to provide a mechanism for getting the
658 * option items for the current value of the widget.
658 * option items for the current value of the widget.
659 */
659 */
660 _getSelectedOptionsAttr(): SelectOption[];
660 _getSelectedOptionsAttr(): SelectOption[];
661
661
662 /**
662 /**
663 * a function that will "fake" loading children, if needed, and
663 * a function that will "fake" loading children, if needed, and
664 * if we have set to not load children until the widget opens.
664 * if we have set to not load children until the widget opens.
665 */
665 */
666 _pseudoLoadChildren(items: T[]): void;
666 _pseudoLoadChildren(items: T[]): void;
667
667
668 /**
668 /**
669 * a function that can be connected to in order to receive a
669 * a function that can be connected to in order to receive a
670 * notification that the store has finished loading and all options
670 * notification that the store has finished loading and all options
671 * from that store are available
671 * from that store are available
672 */
672 */
673 onSetStore(): void;
673 onSetStore(): void;
674 }
674 }
675
675
676 /* dijit/form/_FormValueMixin */
676 /* dijit/form/_FormValueMixin */
677
677
678 interface _FormValueMixin extends _FormWidgetMixin {
678 interface _FormValueMixin extends _FormWidgetMixin {
679
679
680 /**
680 /**
681 * Should this widget respond to user input?
681 * Should this widget respond to user input?
682 * In markup, this is specified as "readOnly".
682 * In markup, this is specified as "readOnly".
683 * Similar to disabled except readOnly form values are submitted.
683 * Similar to disabled except readOnly form values are submitted.
684 */
684 */
685 readOnly: boolean;
685 readOnly: boolean;
686
686
687 postCreate(): void;
687 postCreate(): void;
688
688
689 /**
689 /**
690 * Restore the value to the last value passed to onChange
690 * Restore the value to the last value passed to onChange
691 */
691 */
692 undo(): void;
692 undo(): void;
693
693
694 /**
694 /**
695 * Reset the widget's value to what it was at initialization time
695 * Reset the widget's value to what it was at initialization time
696 */
696 */
697 reset(): void;
697 reset(): void;
698
699 _hasBeenBlurred?: boolean;
700 }
701
702 /* dijit/form/_FormValueWidget */
703
698
704 interface _FormValueWidget extends _FormWidget, _FormValueMixin {
699 _hasBeenBlurred?: boolean;
705 /**
700 }
706 * Work around table sizing bugs on IE7 by forcing redraw
701
707 */
702 /* dijit/form/_FormValueWidget */
708 _layoutHackIE7(): void;
709
703
710 // set(name: string, value: any): this;
704 interface _FormValueWidget extends _FormWidget, _FormValueMixin {
711 // set(values: Object): this;
705 /**
712 }
706 * Work around table sizing bugs on IE7 by forcing redraw
713
707 */
714 interface _FormValueWidgetConstructor extends _WidgetBaseConstructor<_FormValueWidget> { }
708 _layoutHackIE7(): void;
715
716 /* dijit/form/_FormWidget */
717
709
718 interface _FormWidget extends _Widget, _TemplatedMixin, _CssStateMixin, _FormWidgetMixin {
710 // set(name: string, value: any): this;
719 setDisabled(disabled: boolean): void;
711 // set(values: Object): this;
720 setValue(value: string): void;
712 }
721 postMixInProperties(): void;
713
714 interface _FormValueWidgetConstructor extends _WidgetBaseConstructor<_FormValueWidget> { }
722
715
723 // set(name: 'value', value: string): this;
716 /* dijit/form/_FormWidget */
724 // set(name: string, value: any): this;
725 // set(values: Object): this;
726 }
727
717
728 interface _FormWidgetConstructor extends _WidgetBaseConstructor<_FormWidget> { }
718 interface _FormWidget extends _Widget, _TemplatedMixin, _CssStateMixin, _FormWidgetMixin {
729
719 setDisabled(disabled: boolean): void;
730 /* dijit/form/_FormWidgetMixin */
720 setValue(value: string): void;
721 postMixInProperties(): void;
731
722
732 interface _FormWidgetMixin {
723 // set(name: 'value', value: string): this;
733 /**
724 // set(name: string, value: any): this;
734 * Name used when submitting form; same as "name" attribute or plain HTML elements
725 // set(values: Object): this;
735 */
726 }
736 name: string;
737
727
738 /**
728 interface _FormWidgetConstructor extends _WidgetBaseConstructor<_FormWidget> { }
739 * Corresponds to the native HTML `<input>` element's attribute.
729
740 */
730 /* dijit/form/_FormWidgetMixin */
741 alt: string;
742
731
743 /**
732 /**
744 * Corresponds to the native HTML `<input>` element's attribute.
733 * Mixin for widgets corresponding to native HTML elements such as `<checkbox>` or `<button>`,
745 */
734 * which can be children of a `<form>` node or a `dijit/form/Form` widget.
746 value: any;
735 *
747
736 * Represents a single HTML element.
748 /**
737 * All these widgets should have these attributes just like native HTML input elements.
749 * Corresponds to the native HTML `<input>` element's attribute.
738 * You can set them during widget construction or afterwards, via `dijit/_WidgetBase.set()`.
750 */
739 *
751 type: string;
740 * They also share some common methods.
741 */
742 interface _FormWidgetMixin {
743 /**
744 * Name used when submitting form; same as "name" attribute or plain HTML elements
745 */
746 name: string;
752
747
753 /**
754 * Apply aria-label in markup to the widget's focusNode
755 */
756 'aria-label': string;
757
748
758 /**
749 /** Corresponds to the native HTML `<input>` element's attribute. */
759 * Order fields are traversed when user hits the tab key
750 alt: string;
760 */
751
761 tabIndex: number;
752 /** Corresponds to the native HTML `<input>` element's attribute. */
753 value: any;
762
754
763 /**
755 /** Corresponds to the native HTML `<input>` element's attribute. */
764 * Should this widget respond to user input?
756 type: string;
765 * In markup, this is specified as "disabled='disabled'", or just "disabled".
757
766 */
758 /** Apply aria-label in markup to the widget's focusNode */
767 disabled: boolean;
759 "aria-label": "focusNode";
768
760
769 /**
761 /** Order fields are traversed when user hits the tab key */
770 * Fires onChange for each value change or only on demand
762 tabIndex: number;
771 */
763
772 intermediateChanges: boolean;
764 /** Should this widget respond to user input?
765 * In markup, this is specified as "disabled='disabled'", or just "disabled".
766 */
767 disabled: boolean;
773
768
774 /**
769 /** Fires onChange for each value change or only on demand */
775 * On focus, should this widget scroll into view?
770 intermediateChanges: boolean;
776 */
771
777 scrollOnFocus: boolean;
772 /** On focus, should this widget scroll into view? */
773 scrollOnFocus: boolean;
778
774
779 /**
775 _setDisabledAttr(value: boolean): void;
780 * Tells if this widget is focusable or not. Used internally by dijit.
776
781 */
777 _onFocus(by: string): void;
782 isFocusable(): boolean;
783
778
784 /**
779 /** Tells if this widget is focusable or not. Used internally by dijit.
785 * Put focus on this widget
780 * @protected
786 */
781 */
787 focus(): void;
782 isFocusable(): boolean;
788
783
789 /**
784 /** Put focus on this widget */
790 * Compare 2 values (as returned by get('value') for this widget).
785 focus(): void;
791 */
792 compare(val1: any, val2: any): number;
793
786
794 /**
787 /** Compare 2 values (as returned by get('value') for this widget).
795 * Callback when this widget's value is changed.
788 * @protected
796 */
789 */
797 onChange(value: string): void;
790 compare(val1: any, val2: any): number;
798
791
799 /**
792 onChange(newValue: any): void;
800 * Overrides _Widget.create()
801 */
802 create(params?: any, srcNodeRef?: HTMLElement): void;
803
804 destroy(preserveDom?: boolean): void;
805
793
806 // set(name: 'disabled', value: boolean): this;
794 /**
807 // set(name: string, value: any): this;
795 * Hook so set('value', value) works.
808 // set(values: Object): this;
796 *
809 }
797 * Sets the value of the widget.
810
798 * If the value has changed, then fire onChange event, unless priorityChange
811 /* dijit/form/_ListBase */
799 * is specified as null (or false?)
800 *
801 * @param value
802 * @param priorityChange
803 */
804 _setValueAttr(value: any, priorityChange?: boolean);
812
805
813 interface _ListBase {
806 /**
814 /**
807 * Called when the value of the widget has changed. Saves the new value in this.value,
815 * currently selected node
808 * and calls onChange() if appropriate. See _FormWidget._handleOnChange() for details.
816 */
809 *
817 selected: HTMLElement;
810 * @param newValue
818
811 * @param priorityChange
819 /**
812 */
820 * Select the first displayed item in the list.
813 _handleOnChange(newValue: any, priorityChange?: boolean);
821 */
814 }
822 selectFirstNode(): void;
823
815
824 /**
816 /* dijit/form/_ListBase */
825 * Select the last displayed item in the list
826 */
827 selectLastNode(): void;
828
817
829 /**
818 interface _ListBase {
830 * Select the item just below the current selection.
819 /**
831 * If nothing selected, select first node.
820 * currently selected node
832 */
821 */
833 selectNextNode(): void;
822 selected: HTMLElement;
834
823
835 /**
824 /**
836 * Select the item just above the current selection.
825 * Select the first displayed item in the list.
837 * If nothing selected, select last node (if
826 */
838 * you select Previous and try to keep scrolling up the list).
827 selectFirstNode(): void;
839 */
840 selectPreviousNode(): void;
841
828
842 // set(name: 'selected', value: HTMLElement): this;
829 /**
843 // set(name: string, value: any): this;
830 * Select the last displayed item in the list
844 // set(values: Object): this;
831 */
845 }
832 selectLastNode(): void;
846
833
847 /* dijit/form/_ListMouseMixin */
834 /**
835 * Select the item just below the current selection.
836 * If nothing selected, select first node.
837 */
838 selectNextNode(): void;
848
839
849 interface _ListMouseMixin extends _ListBase {
840 /**
850 postCreate(): void;
841 * Select the item just above the current selection.
851 }
842 * If nothing selected, select last node (if
852
843 * you select Previous and try to keep scrolling up the list).
853 /* dijit/form/_RadioButtonMixin */
844 */
845 selectPreviousNode(): void;
854
846
855 interface _RadioButtonMixin {
847 // set(name: 'selected', value: HTMLElement): this;
856 /**
848 // set(name: string, value: any): this;
857 * type attribute on `<input>` node.
849 // set(values: Object): this;
858 * Users should not change this value.
850 }
859 */
851
860 type: string;
852 /* dijit/form/_ListMouseMixin */
861 }
862
853
863 /* dijit/form/_SearchMixin */
854 interface _ListMouseMixin extends _ListBase {
855 postCreate(): void;
856 }
857
858 /* dijit/form/_RadioButtonMixin */
864
859
865 interface _SearchMixin<T extends Object, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> {
860 interface _RadioButtonMixin {
866 /**
861 /**
867 * Argument to data provider.
862 * type attribute on `<input>` node.
868 * Specifies maximum number of search results to return per query
863 * Users should not change this value.
869 */
864 */
870 pageSize: number;
865 type: string;
866 }
871
867
872 /**
868 /* dijit/form/_SearchMixin */
873 * Reference to data provider object used by this ComboBox.
874 * The store must accept an object hash of properties for its query. See `query` and `queryExpr` for details.
875 */
876 store: dojo.store.api.Store<T, Q, O>;
877
869
878 /**
870 interface _SearchMixin<T extends Object, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> {
879 * Mixin to the store's fetch.
871 /**
880 * For example, to set the sort order of the ComboBox menu, pass:
872 * Argument to data provider.
881 * { sort: [{attribute:"name",descending: true}] }
873 * Specifies maximum number of search results to return per query
882 * To override the default queryOptions so that deep=false, do:
874 */
883 * { queryOptions: {ignoreCase: true, deep: false} }
875 pageSize: number;
884 */
885 fetchProperties: { [property: string]: any };
886
876
887 /**
877 /**
888 * A query that can be passed to `store` to initially filter the items.
878 * Reference to data provider object used by this ComboBox.
889 * ComboBox overwrites any reference to the `searchAttr` and sets it to the `queryExpr` with the user's input substituted.
879 * The store must accept an object hash of properties for its query. See `query` and `queryExpr` for details.
890 */
880 */
891 query: Q;
881 store: dojo.store.api.Store<T, Q, O>;
892
882
893 /**
883 /**
894 * Alternate to specifying a store. Id of a dijit/form/DataList widget.
884 * Mixin to the store's fetch.
895 */
885 * For example, to set the sort order of the ComboBox menu, pass:
896 list: string;
886 * { sort: [{attribute:"name",descending: true}] }
887 * To override the default queryOptions so that deep=false, do:
888 * { queryOptions: {ignoreCase: true, deep: false} }
889 */
890 fetchProperties: { [property: string]: any };
897
891
898 /**
892 /**
899 * Delay in milliseconds between when user types something and we start
893 * A query that can be passed to `store` to initially filter the items.
900 * searching based on that value
894 * ComboBox overwrites any reference to the `searchAttr` and sets it to the `queryExpr` with the user's input substituted.
901 */
895 */
902 searchDelay: number;
896 query: Q;
903
897
904 /**
898 /**
905 * Search for items in the data store where this attribute (in the item)
899 * Alternate to specifying a store. Id of a dijit/form/DataList widget.
906 * matches what the user typed
900 */
907 */
901 list: string;
908 searchAttr: string;
909
902
910 /**
903 /**
911 * This specifies what query is sent to the data store,
904 * Delay in milliseconds between when user types something and we start
912 * based on what the user has typed. Changing this expression will modify
905 * searching based on that value
913 * whether the results are only exact matches, a "starting with" match,
906 */
914 * etc.
907 searchDelay: number;
915 * `${0}` will be substituted for the user text.
916 * `*` is used for wildcards.
917 * `${0}*` means "starts with", `*${0}*` means "contains", `${0}` means "is"
918 */
919 queryExpr: string;
920
908
921 /**
909 /**
922 * Set true if the query should ignore case when matching possible items
910 * Search for items in the data store where this attribute (in the item)
923 */
911 * matches what the user typed
924 ignoreCase: boolean;
912 */
913 searchAttr: string;
925
914
926 /**
915 /**
927 * Helper function to convert a simple pattern to a regular expression for matching.
916 * This specifies what query is sent to the data store,
928 */
917 * based on what the user has typed. Changing this expression will modify
929 _patternToRegExp(pattern: string): RegExp;
918 * whether the results are only exact matches, a "starting with" match,
930
919 * etc.
931 _abortQuery(): void;
920 * `${0}` will be substituted for the user text.
921 * `*` is used for wildcards.
922 * `${0}*` means "starts with", `*${0}*` means "contains", `${0}` means "is"
923 */
924 queryExpr: string;
932
925
933 /**
926 /**
934 * Handles input (keyboard/paste) events
927 * Set true if the query should ignore case when matching possible items
935 */
928 */
936 _processInput(e: KeyboardEvent): void;
929 ignoreCase: boolean;
937
930
938 /**
931 /**
939 * Callback when a search completes.
932 * Helper function to convert a simple pattern to a regular expression for matching.
940 */
933 */
941 onSearch(results: T[], query: Q, options: O): void;
934 _patternToRegExp(pattern: string): RegExp;
942
943 _startSearchFromInput(): void;
944
935
945 /**
936 _abortQuery(): void;
946 * Starts a search for elements matching text (text=="" means to return all items
947 * and calls onSearch(...) when the search completes, to display the results.
948 */
949 _startSearch(text: string): void;
950
937
951 postMixInProperties(): void;
938 /**
939 * Handles input (keyboard/paste) events
940 */
941 _processInput(e: KeyboardEvent): void;
952
942
953 // set(name: 'list', value: string): this;
943 /**
954 // set(name: string, value: any): this;
944 * Callback when a search completes.
955 // set(values: Object): this;
945 */
956 }
946 onSearch(results: T[], query: Q, options: O): void;
957
947
958 /* dijit/form/_Spinner */
948 _startSearchFromInput(): void;
959
949
960 interface AdjustFunction {
950 /**
961 (val: any, delta: number): any;
951 * Starts a search for elements matching text (text=="" means to return all items
962 }
952 * and calls onSearch(...) when the search completes, to display the results.
953 */
954 _startSearch(text: string): void;
963
955
964 interface _Spinner extends RangeBoundTextBox {
956 postMixInProperties(): void;
965 /**
966 * Number of milliseconds before a held arrow key or up/down button becomes typematic
967 */
968 defaultTimeout: number;
969
957
970 /**
958 // set(name: 'list', value: string): this;
971 * minimum number of milliseconds that typematic event fires when held key or button is held
959 // set(name: string, value: any): this;
972 */
960 // set(values: Object): this;
973 minimumTimeout: number;
961 }
974
962
975 /**
963 /* dijit/form/_Spinner */
976 * Fraction of time used to change the typematic timer between events.
964
977 * 1.0 means that each typematic event fires at defaultTimeout intervals.
965 interface AdjustFunction {
978 * Less than 1.0 means that each typematic event fires at an increasing faster rate.
966 (val: any, delta: number): any;
979 */
967 }
980 timeoutChangeRate: number;
981
968
982 /**
969 interface _Spinner extends RangeBoundTextBox {
983 * Adjust the value by this much when spinning using the arrow keys/buttons
970 /**
984 */
971 * Number of milliseconds before a held arrow key or up/down button becomes typematic
985 smallDelta: number;
972 */
986
973 defaultTimeout: number;
987 /**
988 * Adjust the value by this much when spinning using the PgUp/Dn keys
989 */
990 largeDelta: number;
991
974
992 templateString: string;
975 /**
993 baseClass: string;
976 * minimum number of milliseconds that typematic event fires when held key or button is held
994 cssStateNodes: CSSStateNodes;
977 */
978 minimumTimeout: number;
995
979
996 /**
980 /**
997 * Overridable function used to adjust a primitive value(Number/Date/...) by the delta amount specified.
981 * Fraction of time used to change the typematic timer between events.
998 * The val is adjusted in a way that makes sense to the object type.
982 * 1.0 means that each typematic event fires at defaultTimeout intervals.
999 */
983 * Less than 1.0 means that each typematic event fires at an increasing faster rate.
1000 adjust: AdjustFunction;
984 */
985 timeoutChangeRate: number;
1001
986
1002 postCreate(): void;
987 /**
1003 }
988 * Adjust the value by this much when spinning using the arrow keys/buttons
1004
989 */
1005 interface _SpinnerConstrctor extends _WidgetBaseConstructor<_Spinner> { }
990 smallDelta: number;
1006
991
1007 /* dijit/form/_TextBoxMixin */
992 /**
1008
993 * Adjust the value by this much when spinning using the PgUp/Dn keys
1009 interface _TextBoxMixin<C extends Constraints = Constraints> {
994 */
1010 /**
995 largeDelta: number;
1011 * Removes leading and trailing whitespace if true. Default is false.
1012 */
1013 trim: boolean;
1014
996
1015 /**
997 templateString: string;
1016 * Converts all characters to uppercase if true. Default is false.
998 baseClass: string;
1017 */
999 cssStateNodes: CSSStateNodes;
1018 uppercase: boolean;
1019
1000
1020 /**
1001 /**
1021 * Converts all characters to lowercase if true. Default is false.
1002 * Overridable function used to adjust a primitive value(Number/Date/...) by the delta amount specified.
1022 */
1003 * The val is adjusted in a way that makes sense to the object type.
1023 lowercase: boolean;
1004 */
1005 adjust: AdjustFunction;
1024
1006
1025 /**
1007 postCreate(): void;
1026 * Converts the first character of each word to uppercase if true.
1008 }
1027 */
1009
1028 propercase: boolean;
1010 interface _SpinnerConstrctor extends _WidgetBaseConstructor<_Spinner> { }
1011
1012 /* dijit/form/_TextBoxMixin */
1029
1013
1030 /**
1014 interface _TextBoxMixin<C extends Constraints = Constraints> {
1031 * HTML INPUT tag maxLength declaration.
1015 /**
1032 */
1016 * Removes leading and trailing whitespace if true. Default is false.
1033 maxLength: string;
1017 */
1018 trim: boolean;
1034
1019
1035 /**
1020 /**
1036 * If true, all text will be selected when focused with mouse
1021 * Converts all characters to uppercase if true. Default is false.
1037 */
1022 */
1038 selectOnClick: boolean;
1023 uppercase: boolean;
1039
1040 /**
1041 * Defines a hint to help users fill out the input field (as defined in HTML 5).
1042 * This should only contain plain text (no html markup).
1043 */
1044 placeHolder: string;
1045
1024
1046 /**
1025 /**
1047 * For subclasses like ComboBox where the displayed value
1026 * Converts all characters to lowercase if true. Default is false.
1048 * (ex: Kentucky) and the serialized value (ex: KY) are different,
1027 */
1049 * this represents the displayed value.
1028 lowercase: boolean;
1050 *
1029
1051 * Setting 'displayedValue' through set('displayedValue', ...)
1030 /**
1052 * updates 'value', and vice-versa. Otherwise 'value' is updated
1031 * Converts the first character of each word to uppercase if true.
1053 * from 'displayedValue' periodically, like onBlur etc.
1032 */
1054 */
1033 propercase: boolean;
1055 displayedValue: string;
1056
1034
1057 /**
1035 /**
1058 * Replaceable function to convert a value to a properly formatted string.
1036 * HTML INPUT tag maxLength declaration.
1059 */
1037 */
1060 format: ConstrainedValueFunction<any, C, any>;
1038 maxLength: string;
1039
1040 /**
1041 * If true, all text will be selected when focused with mouse
1042 */
1043 selectOnClick: boolean;
1061
1044
1062 /**
1045 /**
1063 * Replaceable function to convert a formatted string to a value
1046 * Defines a hint to help users fill out the input field (as defined in HTML 5).
1064 */
1047 * This should only contain plain text (no html markup).
1065 parse: ConstrainedValueFunction<any, C, any>;
1048 */
1066
1049 placeHolder: string;
1067 /**
1068 * Connect to this function to receive notifications of various user data-input events.
1069 * Return false to cancel the event and prevent it from being processed.
1070 * Note that although for historical reasons this method is called `onInput()`, it doesn't
1071 * correspond to the standard DOM "input" event, because it occurs before the input has been processed.
1072 */
1073 onInput(e: InputEvent): void;
1074
1050
1075 postCreate(): void;
1051 /**
1076
1052 * For subclasses like ComboBox where the displayed value
1077 /**
1053 * (ex: Kentucky) and the serialized value (ex: KY) are different,
1078 * if the textbox is blank, what value should be reported
1054 * this represents the displayed value.
1079 */
1055 *
1080 _blankValue: string;
1056 * Setting 'displayedValue' through set('displayedValue', ...)
1057 * updates 'value', and vice-versa. Otherwise 'value' is updated
1058 * from 'displayedValue' periodically, like onBlur etc.
1059 */
1060 displayedValue: string;
1081
1061
1082 /**
1062 /**
1083 * Auto-corrections (such as trimming) that are applied to textbox
1063 * Replaceable function to convert a value to a properly formatted string.
1084 * value on blur or form submit.
1064 */
1085 */
1065 format: ConstrainedValueFunction<any, C, any>;
1086 filter<T>(val: T): T;
1066
1087 filter<T extends number>(value: T): T;
1067 /**
1068 * Replaceable function to convert a formatted string to a value
1069 */
1070 parse: ConstrainedValueFunction<any, C, any>;
1088
1071
1089 _setBlurValue(): void;
1072 /**
1073 * Connect to this function to receive notifications of various user data-input events.
1074 * Return false to cancel the event and prevent it from being processed.
1075 * Note that although for historical reasons this method is called `onInput()`, it doesn't
1076 * correspond to the standard DOM "input" event, because it occurs before the input has been processed.
1077 */
1078 onInput(e: InputEvent): void;
1090
1079
1091 reset(): void;
1080 postCreate(): void;
1092 }
1093
1094 /* dijit/form/_ToggleButtonMixin */
1095
1081
1096 interface _ToggleButtonMixin {
1082 /**
1097 /**
1083 * if the textbox is blank, what value should be reported
1098 * Corresponds to the native HTML `<input>` element's attribute.
1084 */
1099 * In markup, specified as "checked='checked'" or just "checked".
1085 _blankValue: string;
1100 * True if the button is depressed, or the checkbox is checked,
1101 * or the radio button is selected, etc.
1102 */
1103 checked: boolean;
1104
1086
1105 postCreate(): void;
1087 /**
1088 * Auto-corrections (such as trimming) that are applied to textbox
1089 * value on blur or form submit.
1090 */
1091 filter<T>(val: T): T;
1092 filter<T extends number>(value: T): T;
1106
1093
1107 /**
1094 _setBlurValue(): void;
1108 * Reset the widget's value to what it was at initialization time
1109 */
1110 reset(): void;
1111
1095
1112 _hasBeenBlurred?: boolean;
1096 reset(): void;
1113 }
1097 }
1114
1098
1115 /* dijit/form/Button */
1099 /* dijit/form/_ToggleButtonMixin */
1116
1100
1117 interface Button extends _FormWidget, _ButtonMixin {
1101 interface _ToggleButtonMixin {
1118 /**
1102 /**
1119 * Set this to true to hide the label text and display only the icon.
1103 * Corresponds to the native HTML `<input>` element's attribute.
1120 * (If showLabel=false then iconClass must be specified.)
1104 * In markup, specified as "checked='checked'" or just "checked".
1121 * Especially useful for toolbars.
1105 * True if the button is depressed, or the checkbox is checked,
1122 * If showLabel=true, the label will become the title (a.k.a. tooltip/hint)
1106 * or the radio button is selected, etc.
1123 */
1107 */
1124 showLabel: boolean;
1108 checked: boolean;
1125
1109
1126 /**
1110 postCreate(): void;
1127 * Class to apply to DOMNode in button to make it display an icon
1128 */
1129 iconClass: string;
1130
1111
1131 baseClass: string;
1112 /**
1132 templateString: string;
1113 * Reset the widget's value to what it was at initialization time
1133 postCreate(): void;
1114 */
1134 setLabel(content: string): void;
1115 reset(): void;
1135 onLabelSet(e: Event): void;
1136
1116
1137 onClick(e: MouseEvent): boolean | void;
1117 _hasBeenBlurred?: boolean;
1118 }
1138
1119
1139 // set(name: 'showLabel', value: boolean): this;
1120 /* dijit/form/Button */
1140 // set(name: 'value', value: string): this;
1121
1141 // set(name: 'name', value: string): this;
1122 interface Button extends _FormWidget, _ButtonMixin {
1142 // set(name: 'label', value: string): this;
1123 /**
1143 // set(name: string, value: any): this;
1124 * Set this to true to hide the label text and display only the icon.
1144 // set(values: Object): this;
1125 * (If showLabel=false then iconClass must be specified.)
1145 }
1126 * Especially useful for toolbars.
1127 * If showLabel=true, the label will become the title (a.k.a. tooltip/hint)
1128 */
1129 showLabel: boolean;
1146
1130
1147 interface ButtonConstructor extends _WidgetBaseConstructor<Button> { }
1131 /**
1148
1132 * Class to apply to DOMNode in button to make it display an icon
1149 /* dijit/form/CheckBox */
1133 */
1134 iconClass: string;
1150
1135
1151 interface CheckBox extends ToggleButton, _CheckBoxMixin {
1136 baseClass: string;
1152 templateString: string;
1137 templateString: string;
1153 baseClass: string;
1138 postCreate(): void;
1154 postMixInProperties(): void;
1139 setLabel(content: string): void;
1155 value: string;
1140 onLabelSet(e: Event): void;
1156
1141
1157 // set(name: 'value', value: string | boolean): this;
1142 onClick(e: MouseEvent): boolean | void;
1158 // set(name: string, value: any): this;
1159 // set(values: Object): this;
1160 }
1161
1143
1162 interface CheckBoxConstructor extends _WidgetBaseConstructor<CheckBox> { }
1144 // set(name: 'showLabel', value: boolean): this;
1163
1145 // set(name: 'value', value: string): this;
1164 /* dijit/form/ComboBox */
1146 // set(name: 'name', value: string): this;
1147 // set(name: 'label', value: string): this;
1148 // set(name: string, value: any): this;
1149 // set(values: Object): this;
1150 }
1165
1151
1166 interface ComboBox<T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions, C extends Constraints = Constraints> extends ValidationTextBox<C>, ComboBoxMixin<T, Q, O> {
1152 interface ButtonConstructor extends _WidgetBaseConstructor<Button> { }
1167 // set(name: string, value: any): this;
1153
1168 // set(values: Object): this;
1154 /* dijit/form/CheckBox */
1169 }
1170
1155
1171 interface ComboBoxConstructor extends _WidgetBaseConstructor<ComboBox<any>> {
1156 interface CheckBox extends ToggleButton, _CheckBoxMixin {
1172 new <T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions, C extends Constraints = Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): ComboBox<T, Q, O, C>;
1157 templateString: string;
1173 }
1158 baseClass: string;
1174
1159 postMixInProperties(): void;
1175 /* dijit/form/ComboBoxMixin */
1160 value: string;
1176
1177 interface ComboBoxMixin<T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> extends _HasDropDown<_ComboBoxMenu<T>>, _AutoCompleterMixin<T, Q, O> {
1178
1161
1179 /**
1162 // set(name: 'value', value: string | boolean): this;
1180 * Dropdown widget class used to select a date/time.
1163 // set(name: string, value: any): this;
1181 * Subclasses should specify this.
1164 // set(values: Object): this;
1182 */
1165 }
1183 dropDownClass: _ComboBoxMenu<T>;
1166
1167 interface CheckBoxConstructor extends _WidgetBaseConstructor<CheckBox> { }
1168
1169 /* dijit/form/ComboBox */
1170
1171 interface ComboBox<T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions, C extends Constraints = Constraints> extends ValidationTextBox<C>, ComboBoxMixin<T, Q, O> {
1172 // set(name: string, value: any): this;
1173 // set(values: Object): this;
1174 }
1184
1175
1185 /**
1176 interface ComboBoxConstructor extends _WidgetBaseConstructor<ComboBox<any>> {
1186 * Set this textbox to have a down arrow button, to display the drop down list.
1177 new <T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions, C extends Constraints = Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): ComboBox<T, Q, O, C>;
1187 * Defaults to true.
1178 }
1188 */
1179
1189 hasDownArrow: boolean;
1180 /* dijit/form/ComboBoxMixin */
1190
1181
1191 templateString: string;
1182 interface ComboBoxMixin<T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> extends _HasDropDown<_ComboBoxMenu<T>>, _AutoCompleterMixin<T, Q, O> {
1192 baseClass: string;
1193
1183
1194 /**
1184 /**
1195 * Reference to data provider object used by this ComboBox.
1185 * Dropdown widget class used to select a date/time.
1196 *
1186 * Subclasses should specify this.
1197 * Should be dojo/store/api/Store, but dojo/data/api/Read supported
1187 */
1198 * for backwards compatibility.
1188 dropDownClass: _ComboBoxMenu<T>;
1199 */
1200 store: dojo.store.api.Store<T, Q, O>;
1201
1189
1202 cssStateNodes: CSSStateNodes;
1190 /**
1203 postMixInProperties(): void;
1191 * Set this textbox to have a down arrow button, to display the drop down list.
1204 buildRendering(): void;
1192 * Defaults to true.
1205 }
1193 */
1194 hasDownArrow: boolean;
1206
1195
1207 interface ComboBoxMixinConstructor<T = any, U extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, V = any> extends _WidgetBaseConstructor<ComboBoxMixin<T, U, V>> { }
1196 templateString: string;
1208
1197 baseClass: string;
1209 /* dijit/form/CurrencyTextBox */
1210
1211 interface CurrencyTextBoxConstraints extends NumberTextBoxConstraints, dojo.CurrencyFormatOptions, dojo.CurrencyParseOptions {
1212 }
1213
1198
1214 interface CurrencyTextBox extends NumberTextBox {
1199 /**
1215 /**
1200 * Reference to data provider object used by this ComboBox.
1216 * the [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD"
1201 *
1217 */
1202 * Should be dojo/store/api/Store, but dojo/data/api/Read supported
1218 currency: string;
1203 * for backwards compatibility.
1204 */
1205 store: dojo.store.api.Store<T, Q, O>;
1219
1206
1220 /**
1207 cssStateNodes: CSSStateNodes;
1221 * Despite the name, this parameter specifies both constraints on the input
1208 postMixInProperties(): void;
1222 * (including minimum/maximum allowed values) as well as
1209 buildRendering(): void;
1223 * formatting options. See `dijit/form/CurrencyTextBox.__Constraints` for details.
1210 }
1224 */
1225 constraints: CurrencyTextBoxConstraints;
1226
1211
1227 baseClass: string;
1212 interface ComboBoxMixinConstructor<T = any, U extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, V = any> extends _WidgetBaseConstructor<ComboBoxMixin<T, U, V>> { }
1228
1213
1229 _formatter: (value: number, options?: dojo.CurrencyFormatOptions) => string;
1214 /* dijit/form/CurrencyTextBox */
1230 _parser: (expression: string, options?: dojo.CurrencyParseOptions) => number;
1215
1231 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1216 interface CurrencyTextBoxConstraints extends NumberTextBoxConstraints, dojo.CurrencyFormatOptions, dojo.CurrencyParseOptions {
1217 }
1232
1218
1233 /**
1219 interface CurrencyTextBox extends NumberTextBox {
1234 * Parses string value as a Currency, according to the constraints object
1220 /**
1235 */
1221 * the [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD"
1236 parse(value: string, constraints: CurrencyTextBoxConstraints): string;
1222 */
1237 }
1223 currency: string;
1238
1224
1239 interface CurrencyTextBoxConstructor extends _WidgetBaseConstructor<CurrencyTextBox> { }
1225 /**
1240
1226 * Despite the name, this parameter specifies both constraints on the input
1241 /* dijit/form/DataList */
1227 * (including minimum/maximum allowed values) as well as
1228 * formatting options. See `dijit/form/CurrencyTextBox.__Constraints` for details.
1229 */
1230 constraints: CurrencyTextBoxConstraints;
1242
1231
1243 interface DataList<T extends Object> extends dojo.store.Memory<T> {
1232 baseClass: string;
1244 /**
1233
1245 * Get the option marked as selected, like `<option selected>`.
1234 _formatter: (value: number, options?: dojo.CurrencyFormatOptions) => string;
1246 * Not part of dojo.data API.
1235 _parser: (expression: string, options?: dojo.CurrencyParseOptions) => number;
1247 */
1236 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1248 fetchSelectedItem(): T;
1249 }
1250
1237
1251 interface DataListConstructor {
1238 /**
1252 new <T extends Object>(params: Object, srcNodeRef: dojo.NodeOrString): DataList<T>;
1239 * Parses string value as a Currency, according to the constraints object
1253 }
1240 */
1241 parse(value: string, constraints: CurrencyTextBoxConstraints): string;
1242 }
1254
1243
1255 /* dijit/form/DateTextBox */
1244 interface CurrencyTextBoxConstructor extends _WidgetBaseConstructor<CurrencyTextBox> { }
1245
1246 /* dijit/form/DataList */
1256
1247
1257 interface DateTextBox extends _DateTimeTextBox<Calendar> {
1248 interface DataList<T extends Object> extends dojo.store.Memory<T> {
1258 baseClass: string;
1249 /**
1259 popupClass: CalendarConstructor;
1250 * Get the option marked as selected, like `<option selected>`.
1260 _selector: string;
1251 * Not part of dojo.data API.
1261 maxHeight: number;
1252 */
1253 fetchSelectedItem(): T;
1254 }
1262
1255
1263 /**
1256 interface DataListConstructor {
1264 * The value of this widget as a JavaScript Date object, with only year/month/day specified.`
1257 new <T extends Object>(params: Object, srcNodeRef: dojo.NodeOrString): DataList<T>;
1265 */
1258 }
1266 value: Date;
1267 }
1268
1259
1269 interface DateTextBoxConstructor extends _WidgetBaseConstructor<DateTextBox> { }
1260 /* dijit/form/DateTextBox */
1270
1271 /* dijit/form/DropDownButton */
1272
1261
1273 interface DropDownButton<T extends _WidgetBase> extends Button, _Container, _HasDropDown<T> {
1262 interface DateTextBox extends _DateTimeTextBox<Calendar> {
1274 baseClass: string;
1263 baseClass: string;
1275 templateString: string;
1264 popupClass: CalendarConstructor;
1265 _selector: string;
1266 maxHeight: number;
1276
1267
1277 /**
1268 /**
1278 * Overrides _TemplatedMixin#_fillContent().
1269 * The value of this widget as a JavaScript Date object, with only year/month/day specified.`
1279 * My inner HTML possibly contains both the button label and/or a drop down widget, like
1270 */
1280 * <DropDownButton> <span>push me</span> <Menu> ... </Menu> </DropDownButton>
1271 value: Date;
1281 */
1272 }
1282 _fillContent(): void;
1283 startup(): void;
1284
1273
1285 /**
1274 interface DateTextBoxConstructor extends _WidgetBaseConstructor<DateTextBox> { }
1286 * Returns whether or not we are loaded - if our dropdown has an href,
1275
1287 * then we want to check that.
1276 /* dijit/form/DropDownButton */
1288 */
1289 isLoaded(): boolean;
1290
1277
1291 /**
1278 interface DropDownButton<T extends _WidgetBase> extends Button, _Container, _HasDropDown<T> {
1292 * Default implementation assumes that drop down already exists,
1279 baseClass: string;
1293 * but hasn't loaded it's data (ex: ContentPane w/href).
1280 templateString: string;
1294 * App must override if the drop down is lazy-created.
1281
1295 */
1282 /**
1296 loadDropDown(callback: () => void): void;
1283 * Overrides _TemplatedMixin#_fillContent().
1284 * My inner HTML possibly contains both the button label and/or a drop down widget, like
1285 * <DropDownButton> <span>push me</span> <Menu> ... </Menu> </DropDownButton>
1286 */
1287 _fillContent(): void;
1288 startup(): void;
1297
1289
1298 /**
1290 /**
1299 * Overridden so that focus is handled by the _HasDropDown mixin, not by
1291 * Returns whether or not we are loaded - if our dropdown has an href,
1300 * the _FormWidget mixin.
1292 * then we want to check that.
1301 */
1293 */
1302 isFocusable(): boolean;
1294 isLoaded(): boolean;
1303 }
1304
1295
1305 interface DropDownButtonConstructor extends _WidgetBaseConstructor<DropDownButton<any>> {
1296 /**
1306 new <T extends _WidgetBase>(params: Object, srcNodeRef: dojo.NodeOrString): DropDownButton<T>;
1297 * Default implementation assumes that drop down already exists,
1307 }
1298 * but hasn't loaded it's data (ex: ContentPane w/href).
1308
1299 * App must override if the drop down is lazy-created.
1309 /* dijit/form/FilteringSelect */
1300 */
1310
1301 loadDropDown(callback: () => void): void;
1311 interface FilteringSelect<C extends Constraints, T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions> extends MappedTextBox<C>, ComboBoxMixin<T, Q, O> {
1312 /**
1313 * True (default) if user is required to enter a value into this field.
1314 */
1315 required: boolean;
1316
1302
1317 _lastDisplayedValue: string;
1303 /**
1318 _isValidSubset(): boolean;
1304 * Overridden so that focus is handled by the _HasDropDown mixin, not by
1319 isValid(): boolean;
1305 * the _FormWidget mixin.
1320 _refreshState(): void;
1306 */
1307 isFocusable(): boolean;
1308 }
1321
1309
1322 /**
1310 interface DropDownButtonConstructor extends _WidgetBaseConstructor<DropDownButton<any>> {
1323 * Callback from dojo.store after lookup of user entered value finishes
1311 new <T extends _WidgetBase>(params: Object, srcNodeRef: dojo.NodeOrString): DropDownButton<T>;
1324 */
1312 }
1325 _callbackSetLabel(result: T[], query: Q, options: O, priorityChange?: boolean): void;
1326
1313
1327 _openResultList(results: T[], query: Q, options: O): void;
1314 /* dijit/form/FilteringSelect */
1328 undo(): void;
1329
1315
1330 // set(name: 'displayedValue', value: string): this;
1316 interface FilteringSelect<C extends Constraints, T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions> extends MappedTextBox<C>, ComboBoxMixin<T, Q, O> {
1331 // set(name: 'item', value: T): this;
1317 /**
1332 // set(name: string, value: any): this;
1318 * True (default) if user is required to enter a value into this field.
1333 // set(values: Object): this;
1319 */
1334 }
1320 required: boolean;
1335
1336 interface FilteringSelectConstructor extends _WidgetBaseConstructor<FilteringSelect<any, any, any, any>> {
1337 new <C extends Constraints, T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions>(params: Object, srcNodeRef: dojo.NodeOrString): FilteringSelect<C, T, Q, O>;
1338 }
1339
1321
1340 /* dijit/form/Form */
1322 _lastDisplayedValue: string;
1323 _isValidSubset(): boolean;
1324 isValid(): boolean;
1325 _refreshState(): void;
1341
1326
1342 interface Form extends _Widget, _TemplatedMixin, _FormMixin, layout._ContentPaneResizeMixin {
1327 /**
1343 name?: string;
1328 * Callback from dojo.store after lookup of user entered value finishes
1344 action?: string;
1329 */
1345 method?: string;
1330 _callbackSetLabel(result: T[], query: Q, options: O, priorityChange?: boolean): void;
1346 encType?: string;
1331
1347 'accept-charset'?: string;
1332 _openResultList(results: T[], query: Q, options: O): void;
1348 accept?: string;
1333 undo(): void;
1349 target?: string;
1350 templateString: string;
1351
1334
1352 /**
1335 // set(name: 'displayedValue', value: string): this;
1353 * Deprecated: use submit()
1336 // set(name: 'item', value: T): this;
1354 */
1337 // set(name: string, value: any): this;
1355 execute(formContents: Object): void;
1338 // set(values: Object): this;
1339 }
1356
1340
1357 /**
1341 interface FilteringSelectConstructor extends _WidgetBaseConstructor<FilteringSelect<any, any, any, any>> {
1358 * Deprecated: use onSubmit()
1342 new <C extends Constraints, T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions>(params: Object, srcNodeRef: dojo.NodeOrString): FilteringSelect<C, T, Q, O>;
1359 */
1343 }
1360 onExecute(): void;
1344
1345 /* dijit/form/Form */
1361
1346
1362 /**
1347 interface Form extends _Widget, _TemplatedMixin, _FormMixin, layout._ContentPaneResizeMixin {
1363 * restores all widget values back to their init values,
1348 name?: string;
1364 * calls onReset() which can cancel the reset by returning false
1349 action?: string;
1365 */
1350 method?: string;
1366 reset(e?: Event): void;
1351 encType?: string;
1352 'accept-charset'?: string;
1353 accept?: string;
1354 target?: string;
1355 templateString: string;
1367
1356
1368 /**
1357 /**
1369 * Callback when user resets the form. This method is intended
1358 * Deprecated: use submit()
1370 * to be over-ridden. When the `reset` method is called
1359 */
1371 * programmatically, the return value from `onReset` is used
1360 execute(formContents: Object): void;
1372 * to compute whether or not resetting should proceed
1373 */
1374 onReset(e?: Event): boolean;
1375
1376 /**
1377 * Callback when user submits the form.
1378 */
1379 onSubmit(e?: Event): boolean;
1380
1361
1381 /**
1362 /**
1382 * programmatically submit form if and only if the `onSubmit` returns true
1363 * Deprecated: use onSubmit()
1383 */
1364 */
1384 submit(): void;
1365 onExecute(): void;
1385 }
1386
1366
1387 interface FormConstructor extends _WidgetBaseConstructor<Form> { }
1367 /**
1388
1368 * restores all widget values back to their init values,
1389 /* dijit/form/HorizontalRule */
1369 * calls onReset() which can cancel the reset by returning false
1370 */
1371 reset(e?: Event): void;
1390
1372
1391 /**
1373 /**
1392 * Hash marks for `dijit/form/HorizontalSlider`
1374 * Callback when user resets the form. This method is intended
1393 */
1375 * to be over-ridden. When the `reset` method is called
1394 interface HorizontalRule extends _Widget, _TemplatedMixin {
1376 * programmatically, the return value from `onReset` is used
1395 /**
1377 * to compute whether or not resetting should proceed
1396 * Number of hash marks to generate
1378 */
1397 */
1379 onReset(e?: Event): boolean;
1398 count: number;
1399
1380
1400 /**
1381 /**
1401 * For HorizontalSlider, this is either "topDecoration" or "bottomDecoration", and indicates whether this rule goes above or below the slider.
1382 * Callback when user submits the form.
1402 */
1383 */
1403 container: string;
1384 onSubmit(e?: Event): boolean;
1404
1385
1405 /**
1386 /**
1406 * CSS style to apply to individual hash marks
1387 * programmatically submit form if and only if the `onSubmit` returns true
1407 */
1388 */
1408 ruleStyle: string;
1389 submit(): void;
1390 }
1409
1391
1410 _positionPrefix: string;
1392 interface FormConstructor extends _WidgetBaseConstructor<Form> { }
1411 _positionSuffix: string;
1412 _suffix: string;
1413
1393
1414 _genHTML(pos: number): string;
1394 /* dijit/form/HorizontalRule */
1415
1395
1416 /**
1396 /**
1417 * VerticalRule will override this...
1397 * Hash marks for `dijit/form/HorizontalSlider`
1418 */
1398 */
1419 _isHorizontal: boolean;
1399 interface HorizontalRule extends _Widget, _TemplatedMixin {
1420 }
1400 /**
1421
1401 * Number of hash marks to generate
1422 interface HorizontalRuleConstructor extends _WidgetBaseConstructor<HorizontalRule> { }
1402 */
1423
1403 count: number;
1424 /* dijit/form/HorizontalRuleLabels */
1425
1404
1426 /**
1405 /**
1427 * Labels for `dijit/form/HorizontalSlider`
1406 * For HorizontalSlider, this is either "topDecoration" or "bottomDecoration", and indicates whether this rule goes above or below the slider.
1428 */
1407 */
1429 interface HorizontalRuleLabels extends HorizontalRule {
1408 container: string;
1430 /**
1431 * CSS style to apply to individual text labels
1432 */
1433 labelStyle: string;
1434
1409
1435 /**
1410 /**
1436 * Array of text labels to render - evenly spaced from left-to-right or bottom-to-top.
1411 * CSS style to apply to individual hash marks
1437 * Alternately, minimum and maximum can be specified, to get numeric labels.
1412 */
1438 */
1413 ruleStyle: string;
1439 labels: string[];
1414
1415 _positionPrefix: string;
1416 _positionSuffix: string;
1417 _suffix: string;
1418
1419 _genHTML(pos: number): string;
1440
1420
1441 /**
1421 /**
1442 * Number of generated numeric labels that should be rendered as '' on the ends when labels[] are not specified
1422 * VerticalRule will override this...
1443 */
1423 */
1444 numericMargin: number;
1424 _isHorizontal: boolean;
1425 }
1445
1426
1446 /**
1427 interface HorizontalRuleConstructor extends _WidgetBaseConstructor<HorizontalRule> { }
1447 * Leftmost label value for generated numeric labels when labels[] are not specified
1448 */
1449 minimum: number;
1450
1428
1451 /**
1429 /* dijit/form/HorizontalRuleLabels */
1452 * Rightmost label value for generated numeric labels when labels[] are not specified
1453 */
1454 maximum: number;
1455
1430
1456 /**
1431 /**
1457 * pattern, places, lang, et al (see dojo.number) for generated numeric labels when labels[] are not specified
1432 * Labels for `dijit/form/HorizontalSlider`
1458 */
1433 */
1459 constraints: { pattern: string };
1434 interface HorizontalRuleLabels extends HorizontalRule {
1435 /**
1436 * CSS style to apply to individual text labels
1437 */
1438 labelStyle: string;
1460
1439
1461 /**
1440 /**
1462 * Returns the value to be used in HTML for the label as part of the left: attribute
1441 * Array of text labels to render - evenly spaced from left-to-right or bottom-to-top.
1463 */
1442 * Alternately, minimum and maximum can be specified, to get numeric labels.
1464 _calcPosition(pos: number): number;
1443 */
1444 labels: string[];
1465
1445
1466 _genHTML(pos: number, ndx?: number): string;
1446 /**
1467
1447 * Number of generated numeric labels that should be rendered as '' on the ends when labels[] are not specified
1468 /**
1448 */
1469 * extension point for bidi code
1449 numericMargin: number;
1470 */
1471 _genDirectionHTML(label: string): string;
1472
1450
1473 /**
1451 /**
1474 * Overridable function to return array of labels to use for this slider.
1452 * Leftmost label value for generated numeric labels when labels[] are not specified
1475 * Can specify a getLabels() method instead of a labels[] array, or min/max attributes.
1453 */
1476 */
1454 minimum: number;
1477 getLabels(): string[];
1478 }
1479
1455
1480 interface HorizontalRuleLabelsConstructor extends _WidgetBaseConstructor<HorizontalRuleLabels> { }
1456 /**
1481
1457 * Rightmost label value for generated numeric labels when labels[] are not specified
1482 /* dijit/form/HorizontalSlider */
1458 */
1483
1459 maximum: number;
1484 interface _SliderMover extends dojo.dnd.Mover { }
1485
1460
1486 /**
1461 /**
1487 * A form widget that allows one to select a value with a horizontally draggable handle
1462 * pattern, places, lang, et al (see dojo.number) for generated numeric labels when labels[] are not specified
1488 */
1463 */
1489 interface HorizontalSlider extends _FormValueWidget, _Container {
1464 constraints: { pattern: string };
1490 /**
1491 * Show increment/decrement buttons at the ends of the slider?
1492 */
1493 showButtons: boolean;
1494
1465
1495 /**
1466 /**
1496 * The minimum value the slider can be set to.
1467 * Returns the value to be used in HTML for the label as part of the left: attribute
1497 */
1468 */
1498 minimum: number;
1469 _calcPosition(pos: number): number;
1470
1471 _genHTML(pos: number, ndx?: number): string;
1472
1473 /**
1474 * extension point for bidi code
1475 */
1476 _genDirectionHTML(label: string): string;
1499
1477
1500 /**
1478 /**
1501 * The maximum value the slider can be set to.
1479 * Overridable function to return array of labels to use for this slider.
1502 */
1480 * Can specify a getLabels() method instead of a labels[] array, or min/max attributes.
1503 maximum: number;
1481 */
1482 getLabels(): string[];
1483 }
1504
1484
1505 /**
1485 interface HorizontalRuleLabelsConstructor extends _WidgetBaseConstructor<HorizontalRuleLabels> { }
1506 * If specified, indicates that the slider handle has only 'discreteValues' possible positions, and that after dragging the handle, it will snap to the nearest possible position.
1486
1507 * Thus, the slider has only 'discreteValues' possible values.
1487 /* dijit/form/HorizontalSlider */
1508 *
1488
1509 * For example, if minimum=10, maxiumum=30, and discreteValues=3, then the slider handle has three possible positions, representing values 10, 20, or 30.
1489 interface _SliderMover extends dojo.dnd.Mover { }
1510 *
1511 * If discreteValues is not specified or if it's value is higher than the number of pixels in the slider bar, then the slider handle can be moved freely, and the slider's value will be computed/reported based on pixel position (in this case it will likely be fractional, such as 123.456789).
1512 */
1513 discreteValues: number;
1514
1490
1515 /**
1491 /**
1516 * If discreteValues is also specified, this indicates the amount of clicks (ie, snap positions) that the slider handle is moved via pageup/pagedown keys.
1492 * A form widget that allows one to select a value with a horizontally draggable handle
1517 * If discreteValues is not specified, it indicates the number of pixels.
1493 */
1518 */
1494 interface HorizontalSlider extends _FormValueWidget, _Container {
1519 pageIncrement: number;
1495 /**
1496 * Show increment/decrement buttons at the ends of the slider?
1497 */
1498 showButtons: boolean;
1520
1499
1521 /**
1500 /**
1522 * If clicking the slider bar changes the value or not
1501 * The minimum value the slider can be set to.
1523 */
1502 */
1524 clickSelect: boolean;
1503 minimum: number;
1525
1504
1526 /**
1505 /**
1527 * The time in ms to take to animate the slider handle from 0% to 100%, when clicking the slider bar to make the handle move.
1506 * The maximum value the slider can be set to.
1528 */
1507 */
1529 slideDuration: number;
1508 maximum: number;
1530
1509
1531 _mousePixelCoord: string;
1510 /**
1532 _pixelCount: string;
1511 * If specified, indicates that the slider handle has only 'discreteValues' possible positions, and that after dragging the handle, it will snap to the nearest possible position.
1533 _startingPixelCoord: string;
1512 * Thus, the slider has only 'discreteValues' possible values.
1534 _handleOffsetCoord: string;
1513 *
1535 _progressPixelSize: string;
1514 * For example, if minimum=10, maxiumum=30, and discreteValues=3, then the slider handle has three possible positions, representing values 10, 20, or 30.
1536
1515 *
1537 _onKeyUp(e: Event): void;
1516 * If discreteValues is not specified or if it's value is higher than the number of pixels in the slider bar, then the slider handle can be moved freely, and the slider's value will be computed/reported based on pixel position (in this case it will likely be fractional, such as 123.456789).
1538 _onKeyDown(e: Event): void;
1517 */
1539 _onHandleClick(e: Event): void;
1518 discreteValues: number;
1540
1519
1541 /**
1520 /**
1542 * Returns true if direction is from right to left
1521 * If discreteValues is also specified, this indicates the amount of clicks (ie, snap positions) that the slider handle is moved via pageup/pagedown keys.
1543 */
1522 * If discreteValues is not specified, it indicates the number of pixels.
1544 _isReversed(): boolean;
1523 */
1545
1524 pageIncrement: number;
1546 _onBarClick(e: Event): void;
1547
1525
1548 _setPixelValue(pixelValue: number, maxPixels: number, priorityChange?: boolean): void;
1526 /**
1549
1527 * If clicking the slider bar changes the value or not
1550 _setValueAttr(value: number, priorityChange?: boolean): void;
1528 */
1529 clickSelect: boolean;
1551
1530
1552 _bumpValue(signedChange: number, priorityChange: boolean): void;
1531 /**
1553
1532 * The time in ms to take to animate the slider handle from 0% to 100%, when clicking the slider bar to make the handle move.
1554 _onClkBumper(val: any): void;
1533 */
1555 _onClkIncBumper(): void;
1534 slideDuration: number;
1556 _onClkDecBumper(): void;
1557
1535
1558 decrement(e: Event): void;
1536 _mousePixelCoord: string;
1559 increment(e: Event): void;
1537 _pixelCount: string;
1560
1538 _startingPixelCoord: string;
1561 _mouseWheeled(evt: Event): void;
1539 _handleOffsetCoord: string;
1540 _progressPixelSize: string;
1562
1541
1563 _typematicCallback(count: number, button: Element, e: Event): void;
1542 _onKeyUp(e: Event): void;
1564 }
1543 _onKeyDown(e: Event): void;
1544 _onHandleClick(e: Event): void;
1565
1545
1566 interface HorizontalSliderConstructor extends _WidgetBaseConstructor<HorizontalSlider> {
1546 /**
1567 /**
1547 * Returns true if direction is from right to left
1568 * for monkey patching
1548 */
1569 */
1549 _isReversed(): boolean;
1570 _Mover: _SliderMover;
1550
1571 }
1551 _onBarClick(e: Event): void;
1572
1552
1573 /* dijit/form/MappedTextBox */
1553 _setPixelValue(pixelValue: number, maxPixels: number, priorityChange?: boolean): void;
1554
1555 _setValueAttr(value: number, priorityChange?: boolean): void;
1556
1557 _bumpValue(signedChange: number, priorityChange: boolean): void;
1574
1558
1575 interface MappedTextBox<C extends Constraints> extends ValidationTextBox<C> {
1559 _onClkBumper(val: any): void;
1576 postMixInProperties(): void;
1560 _onClkIncBumper(): void;
1577 serialize: SerializationFunction;
1561 _onClkDecBumper(): void;
1578 toString(): string;
1579 validate(isFocused?: boolean): boolean;
1580 buildRendering(): void;
1581 reset(): void;
1582 }
1583
1562
1584 interface MappedTextBoxConstructor extends _WidgetBaseConstructor<MappedTextBox<Constraints>> {
1563 decrement(e: Event): void;
1585 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): MappedTextBox<C>;
1564 increment(e: Event): void;
1586 }
1587
1565
1588 /* dijit/form/NumberSpinner */
1566 _mouseWheeled(evt: Event): void;
1567
1568 _typematicCallback(count: number, button: Element, e: Event): void;
1569 }
1589
1570
1590 interface NumberSpinner extends _Spinner, NumberTextBoxMixin {
1571 interface HorizontalSliderConstructor extends _WidgetBaseConstructor<HorizontalSlider> {
1591 constraints: NumberTextBoxConstraints;
1572 /**
1592 baseClass: string;
1573 * for monkey patching
1593 adjust(val: any, delta: number): any;
1574 */
1575 _Mover: _SliderMover;
1576 }
1577
1578 /* dijit/form/MappedTextBox */
1594
1579
1595 /* overrides */
1580 interface MappedTextBox<C extends Constraints> extends ValidationTextBox<C> {
1596 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1581 postMixInProperties(): void;
1597 parse(value: string, constraints: NumberTextBoxConstraints): string;
1582 serialize: SerializationFunction;
1598 format(value: number, constraints: NumberTextBoxConstraints): string;
1583 toString(): string;
1599 filter(value: number): number;
1584 validate(isFocused?: boolean): boolean;
1600 value: number;
1585 buildRendering(): void;
1601 }
1586 reset(): void;
1587 }
1602
1588
1603 interface NumberSpinnerConstructor extends _WidgetBaseConstructor<NumberSpinner> { }
1589 interface MappedTextBoxConstructor extends _WidgetBaseConstructor<MappedTextBox<Constraints>> {
1590 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): MappedTextBox<C>;
1591 }
1604
1592
1605 /* dijit/form/NumberTextBox */
1593 /* dijit/form/NumberSpinner */
1606
1594
1607 interface NumberTextBoxConstraints extends RangeBoundTextBoxConstraints, dojo.NumberFormatOptions, dojo.NumberParseOptions { }
1595 interface NumberSpinner extends _Spinner, NumberTextBoxMixin {
1596 constraints: NumberTextBoxConstraints;
1597 baseClass: string;
1598 adjust(val: any, delta: number): any;
1608
1599
1609 interface NumberTextBoxMixin {
1600 /* overrides */
1610 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1601 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1611 constraints: NumberTextBoxConstraints;
1602 parse(value: string, constraints: NumberTextBoxConstraints): string;
1612 value: number;
1603 format(value: number, constraints: NumberTextBoxConstraints): string;
1613 editOptions: { pattern: string };
1604 filter(value: number): number;
1614 _formatter: (value: number, options?: dojo.NumberFormatOptions) => string;
1605 value: number;
1615 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1606 }
1616 _decimalInfo: (constraints: Constraints) => { sep: string; places: number; };
1617 postMixInProperties(): void;
1618 format(value: number, constraints: NumberTextBoxConstraints): string;
1619 _parser: (expression: string, options?: dojo.NumberParseOptions) => number;
1620 parse(value: string, constraints: dojo.NumberParseOptions): string;
1621 filter(value: number): number;
1622 serialize: SerializationFunction;
1623 isValid(isFocused: boolean): boolean;
1624 }
1625
1607
1626 interface NumberTextBoxMixinConstructor extends _WidgetBaseConstructor<NumberTextBoxMixin> { }
1608 interface NumberSpinnerConstructor extends _WidgetBaseConstructor<NumberSpinner> { }
1609
1610 /* dijit/form/NumberTextBox */
1611
1612 interface NumberTextBoxConstraints extends RangeBoundTextBoxConstraints, dojo.NumberFormatOptions, dojo.NumberParseOptions { }
1627
1613
1628 interface NumberTextBox extends RangeBoundTextBox, NumberTextBoxMixin {
1614 interface NumberTextBoxMixin {
1629 constraints: NumberTextBoxConstraints;
1615 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1630 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1616 constraints: NumberTextBoxConstraints;
1631 parse(value: string, constraints: dojo.NumberParseOptions): string;
1617 value: number;
1632 format(value: number, constraints: dojo.NumberFormatOptions): string;
1618 editOptions: { pattern: string };
1633 value: number;
1619 _formatter: (value: number, options?: dojo.NumberFormatOptions) => string;
1634 filter(value: number): number;
1620 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1635 }
1621 _decimalInfo: (constraints: Constraints) => { sep: string; places: number; };
1622 postMixInProperties(): void;
1623 format(value: number, constraints: NumberTextBoxConstraints): string;
1624 _parser: (expression: string, options?: dojo.NumberParseOptions) => number;
1625 parse(value: string, constraints: dojo.NumberParseOptions): string;
1626 filter(value: number): number;
1627 serialize: SerializationFunction;
1628 isValid(isFocused: boolean): boolean;
1629 }
1636
1630
1637 interface NumberTextBoxConstructor extends _WidgetBaseConstructor<NumberTextBox> {
1631 interface NumberTextBoxMixinConstructor extends _WidgetBaseConstructor<NumberTextBoxMixin> { }
1638 Mixin: NumberTextBoxMixinConstructor;
1639 }
1640
1641 /* dijit/form/RadioButton */
1642
1643 interface RadioButton extends CheckBox, _RadioButtonMixin {
1644 baseClass: string;
1645 }
1646
1647 interface RadioButtonConstructor extends _WidgetBaseConstructor<RadioButton> { }
1648
1649 /* dijit/form/RangeBoundTextBox */
1650
1632
1651 interface RangeBoundTextBoxConstraints extends Constraints {
1633 interface NumberTextBox extends RangeBoundTextBox, NumberTextBoxMixin {
1652 min?: number;
1634 constraints: NumberTextBoxConstraints;
1653 max?: number;
1635 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1654 }
1636 parse(value: string, constraints: dojo.NumberParseOptions): string;
1637 format(value: number, constraints: dojo.NumberFormatOptions): string;
1638 value: number;
1639 filter(value: number): number;
1640 }
1655
1641
1656 interface RangeBoundTextBox extends MappedTextBox<RangeBoundTextBoxConstraints> {
1642 interface NumberTextBoxConstructor extends _WidgetBaseConstructor<NumberTextBox> {
1657 /**
1643 Mixin: NumberTextBoxMixinConstructor;
1658 * The message to display if value is out-of-range
1644 }
1659 */
1660 rangeMessage: string;
1661
1645
1662 /**
1646 /* dijit/form/RadioButton */
1663 * Overridable function used to validate the range of the numeric input value.
1647
1664 */
1648 interface RadioButton extends CheckBox, _RadioButtonMixin {
1665 rangeCheck(primative: number, constraints: RangeBoundTextBoxConstraints): boolean;
1649 baseClass: string;
1650 }
1666
1651
1667 /**
1652 interface RadioButtonConstructor extends _WidgetBaseConstructor<RadioButton> { }
1668 * Tests if the value is in the min/max range specified in constraints
1653
1669 */
1654 /* dijit/form/RangeBoundTextBox */
1670 isInRange(isFocused: boolean): boolean;
1671
1655
1672 /**
1656 interface RangeBoundTextBoxConstraints extends Constraints {
1673 * Returns true if the value is out of range and will remain
1657 min?: number;
1674 * out of range even if the user types more characters
1658 max?: number;
1675 */
1659 }
1676 _isDefinitelyOutOfRange(): boolean;
1677
1660
1678 isValid(isFocused: boolean): boolean;
1661 interface RangeBoundTextBox extends MappedTextBox<RangeBoundTextBoxConstraints> {
1679 getErrorMessage(isFocused: boolean): string;
1662 /**
1680 postMixInProperties(): void;
1663 * The message to display if value is out-of-range
1681 }
1664 */
1665 rangeMessage: string;
1682
1666
1683 interface RangeBoundTextBoxConstructor extends _WidgetBaseConstructor<RangeBoundTextBox> { }
1667 /**
1684
1668 * Overridable function used to validate the range of the numeric input value.
1685 /* dijit/form/Select */
1669 */
1686
1670 rangeCheck(primative: number, constraints: RangeBoundTextBoxConstraints): boolean;
1687 interface Select<T extends Object, Q extends dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions, U extends dijit._WidgetBase> extends _FormSelectWidget<T, Q, O>, _HasDropDown<U>, _KeyNavMixin {
1688 baseClass: string;
1689
1671
1690 /**
1672 /**
1691 * What to display in an "empty" drop down.
1673 * Tests if the value is in the min/max range specified in constraints
1692 */
1674 */
1693 emptyLabel: string;
1675 isInRange(isFocused: boolean): boolean;
1694
1676
1695 /**
1677 /**
1696 * Specifies how to interpret the labelAttr in the data store items.
1678 * Returns true if the value is out of range and will remain
1697 */
1679 * out of range even if the user types more characters
1698 labelType: string;
1680 */
1681 _isDefinitelyOutOfRange(): boolean;
1699
1682
1700 /**
1683 isValid(isFocused: boolean): boolean;
1701 * Currently displayed error/prompt message
1684 getErrorMessage(isFocused: boolean): string;
1702 */
1685 postMixInProperties(): void;
1703 message: string;
1686 }
1687
1688 interface RangeBoundTextBoxConstructor extends _WidgetBaseConstructor<RangeBoundTextBox> { }
1704
1689
1705 /**
1690 /* dijit/form/Select */
1706 * Can be true or false, default is false.
1691
1707 */
1692 interface Select<T extends Object, Q extends dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions, U extends dijit._WidgetBase> extends _FormSelectWidget<T, Q, O>, _HasDropDown<U>, _KeyNavMixin {
1708 required: boolean;
1693 baseClass: string;
1709
1694
1710 /**
1695 /**
1711 * "Incomplete" if this select is required but unset (i.e. blank value), "" otherwise
1696 * What to display in an "empty" drop down.
1712 */
1697 */
1713 state: string;
1698 emptyLabel: string;
1714
1699
1715 /**
1700 /**
1716 * Order fields are traversed when user hits the tab key
1701 * Specifies how to interpret the labelAttr in the data store items.
1717 */
1702 */
1718 tabIndex: any;
1703 labelType: string;
1719 templateString: any;
1720
1704
1721 /**
1705 /**
1722 * See the description of dijit/Tooltip.defaultPosition for details on this parameter.
1706 * Currently displayed error/prompt message
1723 */
1707 */
1724 tooltipPosition: any;
1708 message: string;
1725
1709
1726 childSelector(node: Element | Node): boolean;
1710 /**
1727 destroy(preserveDom: boolean): void;
1711 * Can be true or false, default is false.
1728 focus(): void;
1712 */
1713 required: boolean;
1729
1714
1730 /**
1715 /**
1731 * Sets the value to the given option, used during search by letter.
1716 * "Incomplete" if this select is required but unset (i.e. blank value), "" otherwise
1732 * @param widget Reference to option's widget
1717 */
1733 */
1718 state: string;
1734 focusChild(widget: dijit._WidgetBase): void;
1735 isLoaded(): boolean;
1736
1719
1737 /**
1720 /**
1738 * Whether or not this is a valid value.
1721 * Order fields are traversed when user hits the tab key
1739 * @param isFocused
1722 */
1740 */
1723 tabIndex: any;
1741 isValid(isFocused: boolean): boolean;
1724 templateString: any;
1725
1726 /**
1727 * See the description of dijit/Tooltip.defaultPosition for details on this parameter.
1728 */
1729 tooltipPosition: any;
1742
1730
1743 /**
1731 childSelector(node: Element | Node): boolean;
1744 * populates the menu
1732 destroy(preserveDom: boolean): void;
1745 * @param loadCallback
1733 focus(): void;
1746 */
1747 loadDropDown(loadCallback: () => any): void;
1748 postCreate(): void;
1749
1750 /**
1751 * set the missing message
1752 */
1753 postMixInProperties(): void;
1754
1734
1755 /**
1735 /**
1756 * Overridden so that the state will be cleared.
1736 * Sets the value to the given option, used during search by letter.
1757 */
1737 * @param widget Reference to option's widget
1758 reset(): void;
1738 */
1759 startup(): void;
1739 focusChild(widget: dijit._WidgetBase): void;
1740 isLoaded(): boolean;
1760
1741
1761 /**
1742 /**
1762 * Called by oninit, onblur, and onkeypress, and whenever required/disabled state changes
1743 * Whether or not this is a valid value.
1763 * @param isFocused
1744 * @param isFocused
1764 */
1745 */
1765 validate(isFocused: boolean): boolean;
1746 isValid(isFocused: boolean): boolean;
1766
1747
1767 /**
1748 /**
1768 * When a key is pressed that matches a child item,
1749 * populates the menu
1769 * this method is called so that a widget can take
1750 * @param loadCallback
1770 * appropriate action is necessary.
1751 */
1771 * @param item
1752 loadDropDown(loadCallback: () => any): void;
1772 * @param evt
1753 postCreate(): void;
1773 * @param searchString
1774 * @param numMatches
1775 */
1776 onKeyboardSearch(item: dijit._WidgetBase, evt: Event, searchString: string, numMatches: number): void;
1777 }
1778
1754
1779 interface SelectConstructor extends _WidgetBaseConstructor<Select<any, any, any, any>> { }
1755 /**
1756 * set the missing message
1757 */
1758 postMixInProperties(): void;
1780
1759
1781 /* dijit/form/SimpleTextarea */
1760 /**
1761 * Overridden so that the state will be cleared.
1762 */
1763 reset(): void;
1764 startup(): void;
1782
1765
1783 interface SimpleTextarea extends TextBox {
1766 /**
1784 baseClass: string;
1767 * Called by oninit, onblur, and onkeypress, and whenever required/disabled state changes
1785 rows: string;
1768 * @param isFocused
1786 cols: string;
1769 */
1787 templateString: string;
1770 validate(isFocused: boolean): boolean;
1788 postMixInProperties(): void;
1789 buildRendering(): void;
1790 filter(value: string): string;
1791 }
1792
1793 interface SimpleTextareaConstructor extends _WidgetBaseConstructor<SimpleTextarea> {
1794 new (params: Object, srcNodeRef: dojo.NodeOrString): SimpleTextarea;
1795 }
1796
1771
1797 /* dijit/form/Textarea */
1772 /**
1773 * When a key is pressed that matches a child item,
1774 * this method is called so that a widget can take
1775 * appropriate action is necessary.
1776 * @param item
1777 * @param evt
1778 * @param searchString
1779 * @param numMatches
1780 */
1781 onKeyboardSearch(item: dijit._WidgetBase, evt: Event, searchString: string, numMatches: number): void;
1782 }
1798
1783
1799 interface Textarea extends SimpleTextarea, _ExpandingTextAreaMixin {
1784 interface SelectConstructor extends _WidgetBaseConstructor<Select<any, any, any, any>> { }
1800 baseClass: string;
1801 cols: string;
1802 buildRendering(): void;
1803 }
1804
1785
1805 interface TextareaConstructor extends _WidgetBaseConstructor<Textarea> { }
1786 /* dijit/form/SimpleTextarea */
1806
1807 /* dijit/form/TextBox */
1808
1787
1809 interface TextBox extends _FormValueWidget, _TextBoxMixin<Constraints> {
1788 interface SimpleTextarea extends TextBox {
1810 // set(name: 'displayedValue', value: string): this;
1789 baseClass: string;
1811 // set(name: 'disabled', value: boolean): this;
1790 rows: string;
1812 // set(name: 'value', value: string): this;
1791 cols: string;
1813 // set(name: string, value: any): this;
1792 templateString: string;
1814 // set(values: Object): this;
1793 postMixInProperties(): void;
1794 buildRendering(): void;
1795 filter(value: string): string;
1796 }
1815
1797
1816 // get(name: 'displayedValue'): string;
1798 interface SimpleTextareaConstructor extends _WidgetBaseConstructor<SimpleTextarea> {
1817 // get(name: 'value'): string;
1799 new(params: Object, srcNodeRef: dojo.NodeOrString): SimpleTextarea;
1818 // get(name: string): any;
1800 }
1819 }
1820
1801
1821 interface TextBoxConstructor extends _WidgetBaseConstructor<TextBox> { }
1802 /* dijit/form/Textarea */
1822
1823 /* dijit/form/ToggleButton */
1824
1825 interface ToggleButton extends Button, _ToggleButtonMixin {
1826 baseClass: string;
1827
1803
1828 setChecked(checked: boolean): void;
1804 interface Textarea extends SimpleTextarea, _ExpandingTextAreaMixin {
1805 baseClass: string;
1806 cols: string;
1807 buildRendering(): void;
1808 }
1809
1810 interface TextareaConstructor extends _WidgetBaseConstructor<Textarea> { }
1829
1811
1830 // set(name: 'checked', value: boolean): this;
1812 /* dijit/form/TextBox */
1831 // set(name: string, value: any): this;
1813
1832 // set(values: Object): this;
1814 interface TextBox extends _FormValueWidget, _TextBoxMixin<Constraints> {
1833 }
1815
1816 }
1817
1818 interface TextBoxConstructor extends _WidgetBaseConstructor<TextBox> { }
1834
1819
1835 interface ToggleButtonConstructor extends _WidgetBaseConstructor<ToggleButton> { }
1820 /* dijit/form/ToggleButton */
1836
1821
1837 /* dijit/form/ValidationTextBox */
1822 interface ToggleButton extends Button, _ToggleButtonMixin {
1823 baseClass: string;
1824
1825 setChecked(checked: boolean): void;
1826 }
1838
1827
1839 interface IsValidFunction {
1828 interface ToggleButtonConstructor extends _WidgetBaseConstructor<ToggleButton> { }
1840 (isFocused?: boolean): boolean;
1829
1841 }
1830 /* dijit/form/ValidationTextBox */
1831
1832 interface IsValidFunction {
1833 (isFocused?: boolean): boolean;
1834 }
1842
1835
1843 interface ValidationTextBox<C extends Constraints = Constraints> extends TextBox {
1836 interface ValidationTextBox<C extends Constraints = Constraints> extends TextBox {
1844 templateString: string;
1837 templateString: string;
1845 required: boolean;
1838 required: boolean;
1846 promptMessage: string;
1839 promptMessage: string;
1847 invalidMessage: string;
1840 invalidMessage: string;
1848 missingMessage: string;
1841 missingMessage: string;
1849 message: string;
1842 message: string;
1850 constraints: C;
1843 constraints: C;
1851 pattern: string | ConstraintsToRegExpString<C>;
1844 pattern: string | ConstraintsToRegExpString<C>;
1852 regExp: string;
1845 regExp: string;
1853 regExpGen(constraints: C): void;
1846 regExpGen(constraints: C): void;
1854 state: string;
1847 state: string;
1855 tooltipPosition: string[];
1848 tooltipPosition: string[];
1856 validator: ConstrainedValidFunction<C>;
1849 validator: ConstrainedValidFunction<C>;
1857 isValid: IsValidFunction;
1850 isValid: IsValidFunction;
1858 getErrorMessage(isFocused: boolean): string;
1851 getErrorMessage(isFocused: boolean): string;
1859 getPromptMessage(isFocused: boolean): string;
1852 getPromptMessage(isFocused: boolean): string;
1860 validate(isFocused: boolean): boolean;
1853 validate(isFocused: boolean): boolean;
1861 displayMessage(message: string): void;
1854 displayMessage(message: string): void;
1862
1863 startup(): void;
1864 postMixInProperties(): void;
1865
1855
1866 reset(): void;
1856 startup(): void;
1857 postMixInProperties(): void;
1867
1858
1868 destroy(preserveDom?: boolean): void;
1859 reset(): void;
1869
1860
1870 // set(name: 'constraints', value: Constraints): this;
1861 destroy(preserveDom?: boolean): void;
1871 // set(name: 'disabled', value: boolean): this;
1862 }
1872 // set(name: 'message', value: string): this;
1873 // set(name: 'pattern', value: string | ConstraintsToRegExpString<C>): this;
1874 // set(name: 'regExp', value: string): this;
1875 // set(name: 'regExpGen', value: Constraints): this;
1876 // set(name: 'required', value: boolean): this;
1877 // set(name: 'value', value: string): this;
1878 // set(name: string, value: any): this;
1879 // set(values: Object): this;
1880
1863
1881 // get(name: 'pattern'): string | ConstraintsToRegExpString<C>;
1864 interface ValidationTextBoxConstructor extends _WidgetBaseConstructor<ValidationTextBox<Constraints>> {
1882 // get(name: string): any;
1865 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): ValidationTextBox<C>;
1883 }
1866 }
1884
1867 }
1885 interface ValidationTextBoxConstructor extends _WidgetBaseConstructor<ValidationTextBox<Constraints>> {
1886 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): ValidationTextBox<C>;
1887 }
1888 }
1889 }
1868 }
@@ -1,487 +1,506
1 /// <reference path="index.d.ts" />
1 /// <reference path="index.d.ts" />
2
2
3 declare module 'dijit/_Widget' {
3 declare module 'dijit/_Widget' {
4 type _Widget = dijit._Widget;
4 type _Widget = dijit._Widget;
5 const _Widget: dijit._WidgetBaseConstructor<_Widget>;
5 const _Widget: dijit._WidgetBaseConstructor<_Widget>;
6 export = _Widget;
6 export = _Widget;
7 }
7 }
8
8
9 declare module 'dijit/_WidgetBase' {
9 declare module 'dijit/_WidgetBase' {
10 type _WidgetBase<E extends { [k in keyof E]: Event } = {}> = dijit._WidgetBase<E & GlobalEventHandlersEventMap>;
10 type _WidgetBase<E extends { [k in keyof E]: Event } = {}> = dijit._WidgetBase<E & GlobalEventHandlersEventMap>;
11
11
12 // individual _WidgetBase constructor to keep type parameters
12 // individual _WidgetBase constructor to keep type parameters
13 interface _WidgetBaseConstructor {
13 interface _WidgetBaseConstructor {
14 new <A = {}, E extends { [k in keyof E]: Event } = {}>(params?: Partial<_WidgetBase<E> & A>, srcNodeRef?: dojo.NodeOrString): _WidgetBase<E> & dojo._base.DeclareCreatedObject;
14 new <A = {}, E extends { [k in keyof E]: Event } = {}>(params?: Partial<_WidgetBase<E> & A>, srcNodeRef?: dojo.NodeOrString): _WidgetBase<E> & dojo._base.DeclareCreatedObject;
15 prototype: _WidgetBase<any>;
15 prototype: _WidgetBase<any>;
16 }
16 }
17 const _WidgetBase: _WidgetBaseConstructor;
17 const _WidgetBase: _WidgetBaseConstructor;
18 export = _WidgetBase;
18 export = _WidgetBase;
19 }
19 }
20
20
21 declare module 'dijit/_AttachMixin' {
21 declare module 'dijit/_AttachMixin' {
22 type _AttachMixin = dijit._AttachMixin;
22 type _AttachMixin = dijit._AttachMixin;
23 const _AttachMixin: dijit._AttachMixinConstructor;
23 const _AttachMixin: dijit._AttachMixinConstructor;
24 export = _AttachMixin;
24 export = _AttachMixin;
25 }
25 }
26
26
27 declare module 'dijit/_CssStateMixin' {
27 declare module 'dijit/_CssStateMixin' {
28 type _CssStateMixin = dijit._CssStateMixin;
28 type _CssStateMixin = dijit._CssStateMixin;
29 const _CssStateMixin: dijit._CssStateMixinConstructor;
29 const _CssStateMixin: dijit._CssStateMixinConstructor;
30 export = _CssStateMixin;
30 export = _CssStateMixin;
31 }
31 }
32
32
33 declare module 'dijit/_Contained' {
33 declare module 'dijit/_Contained' {
34 type _Contained = dijit._Contained;
34 type _Contained = dijit._Contained;
35 const _Contained: dijit._ContainedConstructor;
35 const _Contained: dijit._ContainedConstructor;
36 export = _Contained;
36 export = _Contained;
37 }
37 }
38
38
39 declare module 'dijit/_Container' {
39 declare module 'dijit/_Container' {
40 type _Container = dijit._Container;
40 type _Container = dijit._Container;
41 const _Container: dijit._ContainerConstructor;
41 const _Container: dijit._ContainerConstructor;
42 export = _Container;
42 export = _Container;
43 }
43 }
44
44
45 declare module 'dijit/_KeyNavContainer' {
45 declare module 'dijit/_KeyNavContainer' {
46 type _KeyNavContainer = dijit._KeyNavContainer;
46 type _KeyNavContainer = dijit._KeyNavContainer;
47 const _KeyNavContainer: dijit._KeyNavContainerConstructor;
47 const _KeyNavContainer: dijit._KeyNavContainerConstructor;
48 export = _KeyNavContainer;
48 export = _KeyNavContainer;
49 }
49 }
50
50
51 declare module 'dijit/_KeyNavMixin' {
51 declare module 'dijit/_KeyNavMixin' {
52 type _KeyNavMixin = dijit._KeyNavMixin;
52 type _KeyNavMixin = dijit._KeyNavMixin;
53 const _KeyNavMixin: dijit._KeyNavMixinConstructor;
53 const _KeyNavMixin: dijit._KeyNavMixinConstructor;
54 export = _KeyNavMixin;
54 export = _KeyNavMixin;
55 }
55 }
56
56
57 declare module 'dijit/_MenuBase' {
57 declare module 'dijit/_MenuBase' {
58 type _MenuBase = dijit._MenuBase;
58 type _MenuBase = dijit._MenuBase;
59 const _MenuBase: dijit._MenuBaseConstructor;
59 const _MenuBase: dijit._MenuBaseConstructor;
60 export = _MenuBase;
60 export = _MenuBase;
61 }
61 }
62
62
63 declare module 'dijit/_TemplatedMixin' {
63 declare module 'dijit/_TemplatedMixin' {
64 type _TemplatedMixin = dijit._TemplatedMixin;
64 type _TemplatedMixin = dijit._TemplatedMixin;
65 const _TemplatedMixin: dijit._TemplatedMixinConstructor;
65 const _TemplatedMixin: dijit._TemplatedMixinConstructor;
66 export = _TemplatedMixin;
66 export = _TemplatedMixin;
67 }
67 }
68
68
69 declare module 'dijit/_WidgetsInTemplateMixin' {
69 declare module 'dijit/_WidgetsInTemplateMixin' {
70 type _WidgetsInTemplateMixin = dijit._WidgetsInTemplateMixin;
70 type _WidgetsInTemplateMixin = dijit._WidgetsInTemplateMixin;
71 const _WidgetsInTemplateMixin: dijit._WidgetsInTemplateMixinConstructor;
71 const _WidgetsInTemplateMixin: dijit._WidgetsInTemplateMixinConstructor;
72 export = _WidgetsInTemplateMixin;
72 export = _WidgetsInTemplateMixin;
73 }
73 }
74
74
75 declare module 'dijit/ConfirmDialog' {
75 declare module 'dijit/ConfirmDialog' {
76 type ConfirmDialog = dijit.ConfirmDialog;
76 type ConfirmDialog = dijit.ConfirmDialog;
77 const ConfirmDialog: dijit.ConfirmDialogConstructor;
77 const ConfirmDialog: dijit.ConfirmDialogConstructor;
78 export = ConfirmDialog;
78 export = ConfirmDialog;
79 }
79 }
80
80
81 declare module 'dijit/Calendar' {
81 declare module 'dijit/Calendar' {
82 type Calendar = dijit.Calendar;
82 type Calendar = dijit.Calendar;
83 const Calendar: dijit.CalendarConstructor;
83 const Calendar: dijit.CalendarConstructor;
84 export = Calendar;
84 export = Calendar;
85 }
85 }
86
86
87 declare module 'dijit/CalendarLite' {
87 declare module 'dijit/CalendarLite' {
88 type CalendarLite = dijit.CalendarLite;
88 type CalendarLite = dijit.CalendarLite;
89 const CalendarLite: dijit.CalendarLiteConstructor;
89 const CalendarLite: dijit.CalendarLiteConstructor;
90 export = CalendarLite;
90 export = CalendarLite;
91 }
91 }
92
92
93 declare module 'dijit/Destroyable' {
93 declare module 'dijit/Destroyable' {
94 type Destroyable = dijit.Destroyable;
94 type Destroyable = dijit.Destroyable;
95 const Destroyable: dijit.DestroyableConstructor;
95 const Destroyable: dijit.DestroyableConstructor;
96 export = Destroyable;
96 export = Destroyable;
97 }
97 }
98
98
99 declare module 'dijit/Dialog' {
99 declare module 'dijit/Dialog' {
100 type Dialog = dijit.Dialog;
100 type Dialog = dijit.Dialog;
101 const Dialog: dijit.DialogConstructor;
101 const Dialog: dijit.DialogConstructor;
102 export = Dialog;
102 export = Dialog;
103 }
103 }
104
104
105 declare module "dijit/_HasDropDown" {
106 type _HasDropDown<T extends dijit._WidgetBase = dijit._WidgetBase> = dijit._HasDropDown<T>;
107 const _HasDropDown: dijit._WidgetBaseConstructor<_HasDropDown>;
108
109 export = _HasDropDown;
110 }
111
105 declare module 'dijit/DropDownMenu' {
112 declare module 'dijit/DropDownMenu' {
106 type DropDownMenu = dijit.DropDownMenu;
113 type DropDownMenu = dijit.DropDownMenu;
107 const DropDownMenu: dijit.DropDownMenuConstructor;
114 const DropDownMenu: dijit.DropDownMenuConstructor;
108 export = DropDownMenu;
115 export = DropDownMenu;
109 }
116 }
110
117
111 declare module 'dijit/Fieldset' {
118 declare module 'dijit/Fieldset' {
112 type Fieldset = dijit.Fieldset;
119 type Fieldset = dijit.Fieldset;
113 const Fieldset: dijit.FieldsetConstructor;
120 const Fieldset: dijit.FieldsetConstructor;
114 export = Fieldset;
121 export = Fieldset;
115 }
122 }
116
123
117 declare module 'dijit/Menu' {
124 declare module 'dijit/Menu' {
118 type Menu = dijit.Menu;
125 type Menu = dijit.Menu;
119 const Menu: dijit.MenuConstructor;
126 const Menu: dijit.MenuConstructor;
120 export = Menu;
127 export = Menu;
121 }
128 }
122
129
123 declare module 'dijit/MenuBar' {
130 declare module 'dijit/MenuBar' {
124 type MenuBar = dijit.MenuBar;
131 type MenuBar = dijit.MenuBar;
125 const MenuBar: dijit.MenuBarConstructor;
132 const MenuBar: dijit.MenuBarConstructor;
126 export = MenuBar;
133 export = MenuBar;
127 }
134 }
128
135
129 declare module 'dijit/MenuBarItem' {
136 declare module 'dijit/MenuBarItem' {
130 type MenuBarItem = dijit.MenuBarItem;
137 type MenuBarItem = dijit.MenuBarItem;
131 const MenuBarItem: dijit.MenuBarItemConstructor;
138 const MenuBarItem: dijit.MenuBarItemConstructor;
132 export = MenuBarItem;
139 export = MenuBarItem;
133 }
140 }
134
141
135 declare module 'dijit/MenuItem' {
142 declare module 'dijit/MenuItem' {
136 type MenuItem = dijit.MenuItem;
143 type MenuItem = dijit.MenuItem;
137 const MenuItem: dijit.MenuItemConstructor;
144 const MenuItem: dijit.MenuItemConstructor;
138 export = MenuItem;
145 export = MenuItem;
139 }
146 }
140
147
141 declare module 'dijit/MenuSeparator' {
148 declare module 'dijit/MenuSeparator' {
142 type MenuSeparator = dijit.MenuSeparator;
149 type MenuSeparator = dijit.MenuSeparator;
143 const MenuSeparator: dijit.MenuSeparatorConstructor;
150 const MenuSeparator: dijit.MenuSeparatorConstructor;
144 export = MenuSeparator;
151 export = MenuSeparator;
145 }
152 }
146
153
147 declare module 'dijit/place' {
154 declare module 'dijit/place' {
148 const place: dijit.Place;
155 const place: dijit.Place;
149 export = place;
156 export = place;
150 }
157 }
151
158
152 declare module 'dijit/popup' {
159 declare module 'dijit/popup' {
153 const popup: dijit.PopupManager;
160 const popup: dijit.PopupManager;
154 export = popup;
161 export = popup;
155 }
162 }
156
163
157 declare module 'dijit/PopupMenuBarItem' {
164 declare module 'dijit/PopupMenuBarItem' {
158 type PopupMenuBarItem = dijit.PopupMenuBarItem;
165 type PopupMenuBarItem = dijit.PopupMenuBarItem;
159 const PopupMenuBarItem: dijit.PopupMenuBarItemConstructor;
166 const PopupMenuBarItem: dijit.PopupMenuBarItemConstructor;
160 export = PopupMenuBarItem;
167 export = PopupMenuBarItem;
161 }
168 }
162
169
163 declare module 'dijit/PopupMenuItem' {
170 declare module 'dijit/PopupMenuItem' {
164 type PopupMenuItem = dijit.PopupMenuItem;
171 type PopupMenuItem = dijit.PopupMenuItem;
165 const PopupMenuItem: dijit.PopupMenuItemConstructor;
172 const PopupMenuItem: dijit.PopupMenuItemConstructor;
166 export = PopupMenuItem;
173 export = PopupMenuItem;
167 }
174 }
168
175
169 declare module 'dijit/registry' {
176 declare module 'dijit/registry' {
170 const registry: dijit.Registry;
177 const registry: dijit.Registry;
171 export = registry;
178 export = registry;
172 }
179 }
173
180
174 declare module 'dijit/TitlePane' {
181 declare module 'dijit/TitlePane' {
175 type TitlePane = dijit.TitlePane;
182 type TitlePane = dijit.TitlePane;
176 const TitlePane: dijit.TitlePaneConstructor;
183 const TitlePane: dijit.TitlePaneConstructor;
177 export = TitlePane;
184 export = TitlePane;
178 }
185 }
179
186
180 declare module 'dijit/Toolbar' {
187 declare module 'dijit/Toolbar' {
181 type Toolbar = dijit.Toolbar;
188 type Toolbar = dijit.Toolbar;
182 const Toolbar: dijit.ToolbarConstructor;
189 const Toolbar: dijit.ToolbarConstructor;
183 export = Toolbar;
190 export = Toolbar;
184 }
191 }
185
192
186 declare module 'dijit/ToolbarSeparator' {
193 declare module 'dijit/ToolbarSeparator' {
187 type ToolbarSeparator = dijit.ToolbarSeparator;
194 type ToolbarSeparator = dijit.ToolbarSeparator;
188 const ToolbarSeparator: dijit.ToolbarSeparatorConstructor;
195 const ToolbarSeparator: dijit.ToolbarSeparatorConstructor;
189 export = ToolbarSeparator;
196 export = ToolbarSeparator;
190 }
197 }
191
198
192 declare module 'dijit/Tooltip' {
199 declare module 'dijit/Tooltip' {
193 type Tooltip = dijit.Tooltip;
200 type Tooltip = dijit.Tooltip;
194 const Tooltip: dijit.TooltipConstructor;
201 const Tooltip: dijit.TooltipConstructor;
195 export = Tooltip;
202 export = Tooltip;
196 }
203 }
197
204
198 declare module 'dijit/TooltipDialog' {
205 declare module 'dijit/TooltipDialog' {
199 type TooltipDialog = dijit.TooltipDialog;
206 type TooltipDialog = dijit.TooltipDialog;
200 const TooltipDialog: dijit.TooltipDialogConstructor;
207 const TooltipDialog: dijit.TooltipDialogConstructor;
201 export = TooltipDialog;
208 export = TooltipDialog;
202 }
209 }
203
210
204 declare module 'dijit/_base/focus' {
211 declare module 'dijit/_base/focus' {
205 const focus: dijit._base.Focus;
212 const focus: dijit._base.Focus;
206 export = focus;
213 export = focus;
207 }
214 }
208
215
209 declare module 'dijit/_base/manager' {
216 declare module 'dijit/_base/manager' {
210 const manager: dijit._base.Manager;
217 const manager: dijit._base.Manager;
211 export = manager;
218 export = manager;
212 }
219 }
213
220
214 declare module 'dijit/_base/place' {
221 declare module 'dijit/_base/place' {
215 const place: dijit._base.Place;
222 const place: dijit._base.Place;
216 export = place;
223 export = place;
217 }
224 }
218
225
219 declare module 'dijit/_base/popup' {
226 declare module 'dijit/_base/popup' {
220 const popup: dijit._base.Popup;
227 const popup: dijit._base.Popup;
221 export = popup;
228 export = popup;
222 }
229 }
223
230
224 declare module 'dijit/_base/scroll' {
231 declare module 'dijit/_base/scroll' {
225 const scroll: dijit._base.Scroll;
232 const scroll: dijit._base.Scroll;
226 export = scroll;
233 export = scroll;
227 }
234 }
228
235
229 declare module 'dijit/_base/sniff' {
236 declare module 'dijit/_base/sniff' {
230 const sniff: dijit._base.Sniff;
237 const sniff: dijit._base.Sniff;
231 export = sniff;
238 export = sniff;
232 }
239 }
233
240
234 declare module 'dijit/_base/typematic' {
241 declare module 'dijit/_base/typematic' {
235 const typematic: dijit._base.Typematic;
242 const typematic: dijit._base.Typematic;
236 export = typematic;
243 export = typematic;
237 }
244 }
238
245
239 declare module 'dijit/_base/wai' {
246 declare module 'dijit/_base/wai' {
240 const wai: dijit._base.Wai;
247 const wai: dijit._base.Wai;
241 export = wai;
248 export = wai;
242 }
249 }
243
250
244 declare module 'dijit/_base/window' {
251 declare module 'dijit/_base/window' {
245 const window: dijit._base.Window;
252 const window: dijit._base.Window;
246 export = window;
253 export = window;
247 }
254 }
248
255
249 declare module 'dijit/form/_FormMixin' {
256 declare module 'dijit/form/_FormMixin' {
250 type _FormMixin = dijit.form._FormMixin;
257 type _FormMixin = dijit.form._FormMixin;
251 const _FormMixin: dijit.form._FormMixinConstructor;
258 const _FormMixin: dijit.form._FormMixinConstructor;
252 export = _FormMixin;
259 export = _FormMixin;
253 }
260 }
254
261
262 declare module "dijit/form/_FormWidgetMixin" {
263 type _FormWidgetMixin = dijit.form._FormWidgetMixin;
264 const _FormWidgetMixin: dijit._WidgetBaseConstructor<_FormWidgetMixin>;
265 export = _FormWidgetMixin;
266 }
267
268 declare module "dijit/form/_FormValueMixin" {
269 type _FormValueMixin = dijit.form._FormValueMixin;
270 const _FormValueMixin: dijit._WidgetBaseConstructor<_FormValueMixin>;
271 export = _FormValueMixin;
272 }
273
255 declare module 'dijit/form/_FormValueWidget' {
274 declare module 'dijit/form/_FormValueWidget' {
256 type _FormValueWidget = dijit.form._FormValueWidget;
275 type _FormValueWidget = dijit.form._FormValueWidget;
257 const _FormValueWidget: dijit.form._FormValueWidgetConstructor;
276 const _FormValueWidget: dijit.form._FormValueWidgetConstructor;
258 export = _FormValueWidget;
277 export = _FormValueWidget;
259 }
278 }
260
279
261 declare module 'dijit/form/_FormWidget' {
280 declare module 'dijit/form/_FormWidget' {
262 type _FormWidget = dijit.form._FormWidget;
281 type _FormWidget = dijit.form._FormWidget;
263 const _FormWidget: dijit.form._FormWidgetConstructor;
282 const _FormWidget: dijit.form._FormWidgetConstructor;
264 export = _FormWidget;
283 export = _FormWidget;
265 }
284 }
266
285
267 declare module 'dijit/form/Button' {
286 declare module 'dijit/form/Button' {
268 type Button = dijit.form.Button;
287 type Button = dijit.form.Button;
269 const Button: dijit.form.ButtonConstructor;
288 const Button: dijit.form.ButtonConstructor;
270 export = Button;
289 export = Button;
271 }
290 }
272
291
273 declare module 'dijit/form/CheckBox' {
292 declare module 'dijit/form/CheckBox' {
274 type CheckBox = dijit.form.CheckBox;
293 type CheckBox = dijit.form.CheckBox;
275 const CheckBox: dijit.form.CheckBoxConstructor;
294 const CheckBox: dijit.form.CheckBoxConstructor;
276 export = CheckBox;
295 export = CheckBox;
277 }
296 }
278
297
279 declare module 'dijit/form/ComboBox' {
298 declare module 'dijit/form/ComboBox' {
280 type ComboBox = dijit.form.TextBox;
299 type ComboBox = dijit.form.TextBox;
281 const ComboBox: dijit.form.ComboBoxConstructor;
300 const ComboBox: dijit.form.ComboBoxConstructor;
282 export = ComboBox;
301 export = ComboBox;
283 }
302 }
284
303
285 declare module 'dijit/form/ComboBoxMixin' {
304 declare module 'dijit/form/ComboBoxMixin' {
286 type ComboBoxMixin<T = any, U extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, V = any> = dijit.form.ComboBoxMixin<T, U, V>;
305 type ComboBoxMixin<T = any, U extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, V = any> = dijit.form.ComboBoxMixin<T, U, V>;
287 const ComboBoxMixin: dijit.form.ComboBoxConstructor;
306 const ComboBoxMixin: dijit.form.ComboBoxConstructor;
288 export = ComboBoxMixin;
307 export = ComboBoxMixin;
289 }
308 }
290
309
291 declare module 'dijit/form/CurrencyTextBox' {
310 declare module 'dijit/form/CurrencyTextBox' {
292 type CurrencyTextBox = dijit.form.CurrencyTextBox;
311 type CurrencyTextBox = dijit.form.CurrencyTextBox;
293 const CurrencyTextBox: dijit.form.CurrencyTextBoxConstructor;
312 const CurrencyTextBox: dijit.form.CurrencyTextBoxConstructor;
294 export = CurrencyTextBox;
313 export = CurrencyTextBox;
295 }
314 }
296
315
297 declare module 'dijit/form/DataList' {
316 declare module 'dijit/form/DataList' {
298 type DataList<T> = dijit.form.DataList<T>;
317 type DataList<T> = dijit.form.DataList<T>;
299 const DataList: dijit.form.DataListConstructor;
318 const DataList: dijit.form.DataListConstructor;
300 export = DataList;
319 export = DataList;
301 }
320 }
302
321
303 declare module 'dijit/form/DateTextBox' {
322 declare module 'dijit/form/DateTextBox' {
304 type DateTextBox = dijit.form.DateTextBox;
323 type DateTextBox = dijit.form.DateTextBox;
305 const DateTextBox: dijit.form.DateTextBoxConstructor;
324 const DateTextBox: dijit.form.DateTextBoxConstructor;
306 export = DateTextBox;
325 export = DateTextBox;
307 }
326 }
308
327
309 declare module 'dijit/form/DropDownButton' {
328 declare module 'dijit/form/DropDownButton' {
310 type DropDownButton<T extends dijit._WidgetBase> = dijit.form.DropDownButton<T>;
329 type DropDownButton<T extends dijit._WidgetBase> = dijit.form.DropDownButton<T>;
311 const DropDownButton: dijit.form.DropDownButtonConstructor;
330 const DropDownButton: dijit.form.DropDownButtonConstructor;
312 export = DropDownButton;
331 export = DropDownButton;
313 }
332 }
314
333
315 declare module 'dijit/form/FilteringSelect' {
334 declare module 'dijit/form/FilteringSelect' {
316 type FilteringSelect<C extends dijit.form.Constraints = dijit.form.Constraints, T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> = dijit.form.FilteringSelect<C, T, Q, O>;
335 type FilteringSelect<C extends dijit.form.Constraints = dijit.form.Constraints, T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> = dijit.form.FilteringSelect<C, T, Q, O>;
317 const FilteringSelect: dijit.form.FilteringSelectConstructor;
336 const FilteringSelect: dijit.form.FilteringSelectConstructor;
318 export = FilteringSelect;
337 export = FilteringSelect;
319 }
338 }
320
339
321 declare module 'dijit/form/Form' {
340 declare module 'dijit/form/Form' {
322 type Form = dijit.form.Form;
341 type Form = dijit.form.Form;
323 const Form: dijit.form.FormConstructor;
342 const Form: dijit.form.FormConstructor;
324 export = Form;
343 export = Form;
325 }
344 }
326
345
327 declare module 'dijit/form/HorizontalRule' {
346 declare module 'dijit/form/HorizontalRule' {
328 type HorizontalRule = dijit.form.HorizontalRule;
347 type HorizontalRule = dijit.form.HorizontalRule;
329 const HorizontalRule: dijit.form.HorizontalRuleConstructor;
348 const HorizontalRule: dijit.form.HorizontalRuleConstructor;
330 export = HorizontalRule;
349 export = HorizontalRule;
331 }
350 }
332
351
333 declare module 'dijit/form/HorizontalRuleLabels' {
352 declare module 'dijit/form/HorizontalRuleLabels' {
334 type HorizontalRuleLabels = dijit.form.HorizontalRuleLabels;
353 type HorizontalRuleLabels = dijit.form.HorizontalRuleLabels;
335 const HorizontalRuleLabels: dijit.form.HorizontalRuleLabelsConstructor;
354 const HorizontalRuleLabels: dijit.form.HorizontalRuleLabelsConstructor;
336 export = HorizontalRuleLabels;
355 export = HorizontalRuleLabels;
337 }
356 }
338
357
339 declare module 'dijit/form/HorizontalSlider' {
358 declare module 'dijit/form/HorizontalSlider' {
340 type HorizontalSlider = dijit.form.HorizontalSlider;
359 type HorizontalSlider = dijit.form.HorizontalSlider;
341 const HorizontalSlider: dijit.form.HorizontalSliderConstructor;
360 const HorizontalSlider: dijit.form.HorizontalSliderConstructor;
342 export = HorizontalSlider;
361 export = HorizontalSlider;
343 }
362 }
344
363
345 declare module 'dijit/form/MappedTextBox' {
364 declare module 'dijit/form/MappedTextBox' {
346 type MappedTextBox<C extends dijit.form.Constraints = dijit.form.Constraints> = dijit.form.MappedTextBox<C>;
365 type MappedTextBox<C extends dijit.form.Constraints = dijit.form.Constraints> = dijit.form.MappedTextBox<C>;
347 const MappedTextBox: dijit.form.MappedTextBoxConstructor;
366 const MappedTextBox: dijit.form.MappedTextBoxConstructor;
348 export = MappedTextBox;
367 export = MappedTextBox;
349 }
368 }
350
369
351 declare module 'dijit/form/NumberSpinner' {
370 declare module 'dijit/form/NumberSpinner' {
352 type NumberSpinner = dijit.form.NumberSpinner;
371 type NumberSpinner = dijit.form.NumberSpinner;
353 const NumberSpinner: dijit.form.NumberSpinnerConstructor;
372 const NumberSpinner: dijit.form.NumberSpinnerConstructor;
354 export = NumberSpinner;
373 export = NumberSpinner;
355 }
374 }
356
375
357 declare module 'dijit/form/NumberTextBox' {
376 declare module 'dijit/form/NumberTextBox' {
358 type NumberTextBox = dijit.form.NumberTextBox;
377 type NumberTextBox = dijit.form.NumberTextBox;
359 const NumberTextBox: dijit.form.NumberTextBoxConstructor;
378 const NumberTextBox: dijit.form.NumberTextBoxConstructor;
360 export = NumberTextBox;
379 export = NumberTextBox;
361 }
380 }
362
381
363 declare module 'dijit/form/RadioButton' {
382 declare module 'dijit/form/RadioButton' {
364 type RadioButton = dijit.form.RadioButton;
383 type RadioButton = dijit.form.RadioButton;
365 const RadioButton: dijit.form.RadioButtonConstructor;
384 const RadioButton: dijit.form.RadioButtonConstructor;
366 export = RadioButton;
385 export = RadioButton;
367 }
386 }
368
387
369 declare module 'dijit/form/RangeBoundTextBox' {
388 declare module 'dijit/form/RangeBoundTextBox' {
370 type RangeBoundTextBox = dijit.form.RangeBoundTextBox;
389 type RangeBoundTextBox = dijit.form.RangeBoundTextBox;
371 const RangeBoundTextBox: dijit.form.RangeBoundTextBoxConstructor;
390 const RangeBoundTextBox: dijit.form.RangeBoundTextBoxConstructor;
372 export = RangeBoundTextBox;
391 export = RangeBoundTextBox;
373 }
392 }
374
393
375 declare module 'dijit/form/Select' {
394 declare module 'dijit/form/Select' {
376 type Select<T, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O = any, U extends dijit._WidgetBase = dijit._WidgetBase> = dijit.form.Select<T, Q, O, U>;
395 type Select<T, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O = any, U extends dijit._WidgetBase = dijit._WidgetBase> = dijit.form.Select<T, Q, O, U>;
377 const Select: dijit.form.SelectConstructor;
396 const Select: dijit.form.SelectConstructor;
378 export = Select;
397 export = Select;
379 }
398 }
380
399
381 declare module 'dijit/form/SimpleTextarea' {
400 declare module 'dijit/form/SimpleTextarea' {
382 type SimpleTextarea = dijit.form.SimpleTextarea;
401 type SimpleTextarea = dijit.form.SimpleTextarea;
383 const SimpleTextarea: dijit.form.SimpleTextareaConstructor;
402 const SimpleTextarea: dijit.form.SimpleTextareaConstructor;
384 export = SimpleTextarea;
403 export = SimpleTextarea;
385 }
404 }
386
405
387 declare module 'dijit/form/Textarea' {
406 declare module 'dijit/form/Textarea' {
388 type Textarea = dijit.form.Textarea;
407 type Textarea = dijit.form.Textarea;
389 const Textarea: dijit.form.TextareaConstructor;
408 const Textarea: dijit.form.TextareaConstructor;
390 export = Textarea;
409 export = Textarea;
391 }
410 }
392
411
393 declare module 'dijit/form/TextBox' {
412 declare module 'dijit/form/TextBox' {
394 type TextBox = dijit.form.TextBox;
413 type TextBox = dijit.form.TextBox;
395 const TextBox: dijit.form.TextBoxConstructor;
414 const TextBox: dijit.form.TextBoxConstructor;
396 export = TextBox;
415 export = TextBox;
397 }
416 }
398
417
399 declare module 'dijit/form/ToggleButton' {
418 declare module 'dijit/form/ToggleButton' {
400 type ToggleButton = dijit.form.ToggleButton;
419 type ToggleButton = dijit.form.ToggleButton;
401 const ToggleButton: dijit.form.ToggleButtonConstructor;
420 const ToggleButton: dijit.form.ToggleButtonConstructor;
402 export = ToggleButton;
421 export = ToggleButton;
403 }
422 }
404
423
405 declare module 'dijit/form/ValidationTextBox' {
424 declare module 'dijit/form/ValidationTextBox' {
406 type ValidationTextBox<C extends dijit.form.Constraints = dijit.form.Constraints> = dijit.form.ValidationTextBox<C>;
425 type ValidationTextBox<C extends dijit.form.Constraints = dijit.form.Constraints> = dijit.form.ValidationTextBox<C>;
407 const ValidationTextBox: dijit.form.ValidationTextBoxConstructor;
426 const ValidationTextBox: dijit.form.ValidationTextBoxConstructor;
408 export = ValidationTextBox;
427 export = ValidationTextBox;
409 }
428 }
410
429
411 declare module 'dijit/layout/_LayoutWidget' {
430 declare module 'dijit/layout/_LayoutWidget' {
412 type _LayoutWidget = dijit.layout._LayoutWidget;
431 type _LayoutWidget = dijit.layout._LayoutWidget;
413 const _LayoutWidget: dijit.layout._LayoutWidgetConstructor;
432 const _LayoutWidget: dijit.layout._LayoutWidgetConstructor;
414 export = _LayoutWidget;
433 export = _LayoutWidget;
415 }
434 }
416
435
417 declare module 'dijit/layout/AccordionContainer' {
436 declare module 'dijit/layout/AccordionContainer' {
418 type AccordionContainer = dijit.layout.AccordionContainer;
437 type AccordionContainer = dijit.layout.AccordionContainer;
419 const AccordionContainer: dijit.layout.AccordionContainerConstructor;
438 const AccordionContainer: dijit.layout.AccordionContainerConstructor;
420 export = AccordionContainer;
439 export = AccordionContainer;
421 }
440 }
422
441
423 declare module 'dijit/layout/AccordionPane' {
442 declare module 'dijit/layout/AccordionPane' {
424 type AccordionPane = dijit.layout.AccordionPane;
443 type AccordionPane = dijit.layout.AccordionPane;
425 const AccordionPane: dijit.layout.AccordionPaneConstructor;
444 const AccordionPane: dijit.layout.AccordionPaneConstructor;
426 export = AccordionPane;
445 export = AccordionPane;
427 }
446 }
428
447
429 declare module 'dijit/layout/ContentPane' {
448 declare module 'dijit/layout/ContentPane' {
430 type ContentPane = dijit.layout.ContentPane;
449 type ContentPane = dijit.layout.ContentPane;
431 const ContentPane: dijit.layout.ContentPaneConstructor;
450 const ContentPane: dijit.layout.ContentPaneConstructor;
432 export = ContentPane;
451 export = ContentPane;
433 }
452 }
434
453
435 declare module 'dijit/layout/_ContentPaneResizeMixin' {
454 declare module 'dijit/layout/_ContentPaneResizeMixin' {
436 type _ContentPaneResizeMixin = dijit.layout._ContentPaneResizeMixin;
455 type _ContentPaneResizeMixin = dijit.layout._ContentPaneResizeMixin;
437 const _ContentPaneResizeMixin: dijit.layout._ContentPaneResizeMixinConstructor;
456 const _ContentPaneResizeMixin: dijit.layout._ContentPaneResizeMixinConstructor;
438 export = _ContentPaneResizeMixin;
457 export = _ContentPaneResizeMixin;
439 }
458 }
440
459
441 declare module 'dijit/layout/BorderContainer' {
460 declare module 'dijit/layout/BorderContainer' {
442 type BorderContainer = dijit.layout.BorderContainer;
461 type BorderContainer = dijit.layout.BorderContainer;
443 const BorderContainer: dijit.layout.BorderContainerConstructor;
462 const BorderContainer: dijit.layout.BorderContainerConstructor;
444 export = BorderContainer;
463 export = BorderContainer;
445 }
464 }
446
465
447 declare module 'dijit/layout/LayoutContainer' {
466 declare module 'dijit/layout/LayoutContainer' {
448 type LayoutContainer = dijit.layout.LayoutContainer;
467 type LayoutContainer = dijit.layout.LayoutContainer;
449 const LayoutContainer: dijit.layout.LayoutContainerConstructor;
468 const LayoutContainer: dijit.layout.LayoutContainerConstructor;
450 export = LayoutContainer;
469 export = LayoutContainer;
451 }
470 }
452
471
453 declare module 'dijit/layout/LinkPane' {
472 declare module 'dijit/layout/LinkPane' {
454 type LinkPane = dijit.layout.LinkPane;
473 type LinkPane = dijit.layout.LinkPane;
455 const LinkPane: dijit.layout.LinkPaneConstructor;
474 const LinkPane: dijit.layout.LinkPaneConstructor;
456 export = LinkPane;
475 export = LinkPane;
457 }
476 }
458
477
459 declare module 'dijit/layout/ScrollingTabController' {
478 declare module 'dijit/layout/ScrollingTabController' {
460 type ScrollingTabController = dijit.layout.ScrollingTabController;
479 type ScrollingTabController = dijit.layout.ScrollingTabController;
461 const ScrollingTabController: dijit.layout.ScrollingTabControllerConstructor;
480 const ScrollingTabController: dijit.layout.ScrollingTabControllerConstructor;
462 export = ScrollingTabController;
481 export = ScrollingTabController;
463 }
482 }
464
483
465 declare module 'dijit/layout/StackContainer' {
484 declare module 'dijit/layout/StackContainer' {
466 type StackContainer = dijit.layout.StackContainer;
485 type StackContainer = dijit.layout.StackContainer;
467 const StackContainer: dijit.layout.StackContainerConstructor;
486 const StackContainer: dijit.layout.StackContainerConstructor;
468 export = StackContainer;
487 export = StackContainer;
469 }
488 }
470
489
471 declare module 'dijit/layout/StackController' {
490 declare module 'dijit/layout/StackController' {
472 type StackController = dijit.layout.StackController;
491 type StackController = dijit.layout.StackController;
473 const StackController: dijit.layout.StackControllerConstructor;
492 const StackController: dijit.layout.StackControllerConstructor;
474 export = StackController;
493 export = StackController;
475 }
494 }
476
495
477 declare module 'dijit/layout/TabContainer' {
496 declare module 'dijit/layout/TabContainer' {
478 type TabContainer = dijit.layout.TabContainer;
497 type TabContainer = dijit.layout.TabContainer;
479 const TabContainer: dijit.layout.TabContainerConstructor;
498 const TabContainer: dijit.layout.TabContainerConstructor;
480 export = TabContainer;
499 export = TabContainer;
481 }
500 }
482
501
483 declare module 'dijit/layout/TabController' {
502 declare module 'dijit/layout/TabController' {
484 type TabController = dijit.layout.TabController;
503 type TabController = dijit.layout.TabController;
485 const TabController: dijit.layout.TabControllerConstructor;
504 const TabController: dijit.layout.TabControllerConstructor;
486 export = TabController;
505 export = TabController;
487 }
506 }
@@ -1,58 +1,70
1 /// <reference path="dojo.d.ts" />
1 /// <reference path="dojo.d.ts" />
2 /// <reference path="_base.d.ts" />
2 /// <reference path="_base.d.ts" />
3 /// <reference path="fx.d.ts" />
3 /// <reference path="fx.d.ts" />
4
4
5 declare namespace dojo {
5 declare namespace dojo {
6
6
7 interface NodeListAnimationArgs extends _base.AnimationArguments {
7 interface NodeListAnimationArgs extends Omit<_base.AnimationArguments, "node"> {
8 auto?: boolean;
8 auto?: false;
9 }
9 }
10
10
11 interface NodeList<T extends Node> {
11 interface NodeListAutoAnimationArgs extends Omit<_base.AnimationArguments, "node"> {
12 _anim(obj: any, method: string, args?: NodeListAnimationArgs): _base.Animation | this;
12 auto: true;
13 }
14
15 interface NodeList<T extends Node> {
13
16
14 /**
17 _anim(obj: any, method: string, args?: NodeListAnimationArgs): _base.Animation;
15 * wipe in all elements of this NodeList via `dojo/fx.wipeIn()`
18 _anim(obj: any, method: string, args: NodeListAutoAnimationArgs): this;
16 */
17 wipeIn(args: NodeListAnimationArgs): _base.Animation | this;
18
19
19 /**
20 /**
20 * wipe out all elements of this NodeList via `dojo/fx.wipeOut()`
21 * wipe in all elements of this NodeList via `dojo/fx.wipeIn()`
21 */
22 */
22 wipeOut(args: NodeListAnimationArgs): _base.Animation | this;
23 wipeIn(args?: NodeListAnimationArgs): _base.Animation;
24 wipeIn(args: NodeListAutoAnimationArgs): this;
23
25
24 /**
26 /**
25 * slide all elements of the node list to the specified place via `dojo/fx.slideTo()`
27 * wipe out all elements of this NodeList via `dojo/fx.wipeOut()`
26 */
28 */
27 slideTo(args: NodeListAnimationArgs): _base.Animation | this;
29 wipeOut(args?: NodeListAnimationArgs): _base.Animation;
30 wipeOut(args: NodeListAutoAnimationArgs): this;
28
31
29 /**
32 /**
30 * fade in all elements of this NodeList via `dojo.fadeIn`
33 * slide all elements of the node list to the specified place via `dojo/fx.slideTo()`
31 */
34 */
32 fadeIn(args: NodeListAnimationArgs): _base.Animation | this;
35 slideTo(args?: NodeListAnimationArgs): _base.Animation;
36 slideTo(args: NodeListAutoAnimationArgs): this;
33
37
34 /**
38 /**
35 * fade out all elements of this NodeList via `dojo.fadeOut`
39 * fade in all elements of this NodeList via `dojo.fadeIn`
36 */
40 */
37 fadeOut(args: NodeListAnimationArgs): _base.Animation | this;
41 fadeIn(args?: NodeListAnimationArgs): _base.Animation;
42 fadeIn(args: NodeListAutoAnimationArgs): this;
38
43
39 /**
44 /**
40 * Animate all elements of this NodeList across the properties specified.
45 * fade out all elements of this NodeList via `dojo.fadeOut`
41 * syntax identical to `dojo.animateProperty`
46 */
42 */
47 fadeOut(args?: NodeListAnimationArgs): _base.Animation;
43 animateProperty(args: NodeListAnimationArgs): _base.Animation | this;
48 fadeOut(args: NodeListAutoAnimationArgs): this;
44
49
45 /**
50 /**
46 * Animate one or more CSS properties for all nodes in this list.
51 * Animate all elements of this NodeList across the properties specified.
47 * The returned animation object will already be playing when it
52 * syntax identical to `dojo.animateProperty`
48 * is returned. See the docs for `dojo.anim` for full details.
53 */
49 */
54 animateProperty(args?: NodeListAnimationArgs): _base.Animation;
50 anim(properties: _base.AnimationArgumentsProperties, duration?: number, easing?: (n?: number) => number, onEnd?: Function, delay?: number): _base.Animation;
55 animateProperty(args: NodeListAutoAnimationArgs): this;
51 }
56
57 /**
58 * Animate one or more CSS properties for all nodes in this list.
59 * The returned animation object will already be playing when it
60 * is returned. See the docs for `dojo.anim` for full details.
61 */
62 anim(properties: _base.AnimationArgumentsProperties, duration?: number, easing?: (n?: number) => number, onEnd?: Function, delay?: number): _base.Animation;
63 }
52 }
64 }
53
65
54 declare module 'dojo/NodeList-fx' {
66 declare module 'dojo/NodeList-fx' {
55 type NodeList<T extends Node> = dojo.NodeList<T>;
67 type NodeList<T extends Node> = dojo.NodeList<T>;
56 const NodeList: dojo.NodeListConstructor;
68 const NodeList: dojo.NodeListConstructor;
57 export = NodeList;
69 export = NodeList;
58 }
70 }
@@ -1,2101 +1,2104
1 /// <reference path="index.d.ts" />
1 /// <reference path="index.d.ts" />
2 /// <reference path="../doh/doh.d.ts" />
2 /// <reference path="../doh/doh.d.ts" />
3
3
4 declare namespace dojo {
4 declare namespace dojo {
5 /* general implied types */
5 /* general implied types */
6
6
7 type NodeOrString = Node | string;
7 type NodeOrString = Node | string;
8 type ElementOrString = Element | string;
8 type ElementOrString = Element | string;
9 type NodeFragmentOrString = NodeOrString | DocumentFragment;
9 type NodeFragmentOrString = NodeOrString | DocumentFragment;
10
10
11 interface GenericConstructor<T> {
11 interface GenericConstructor<T> {
12 new (...args: any[]): T;
12 new (...args: any[]): T;
13 prototype: T;
13 prototype: T;
14 }
14 }
15
15
16 interface GenericObject {
16 interface GenericObject {
17 [id: string]: any;
17 [id: string]: any;
18 }
18 }
19
19
20 interface GenericFunction<T> {
20 interface GenericFunction<T> {
21 (...args: any[]): T;
21 (...args: any[]): T;
22 }
22 }
23
23
24 interface Handle {
24 interface Handle {
25 remove(): void;
25 remove(): void;
26 }
26 }
27
27
28 interface EventListener {
28 interface EventListener {
29 (evt: any): void;
29 (evt: any): void;
30 }
30 }
31
31
32 interface BuildProfile {
32 interface BuildProfile {
33 resourceTags: { [tag: string]: (filename: string, mid?: string) => boolean; };
33 resourceTags: { [tag: string]: (filename: string, mid?: string) => boolean; };
34 }
34 }
35
35
36 interface Package {
36 interface Package {
37 location?: string;
37 location?: string;
38 main?: string;
38 main?: string;
39 name?: string;
39 name?: string;
40 }
40 }
41
41
42 export interface ModuleMap extends ModuleMapItem {
42 export interface ModuleMap extends ModuleMapItem {
43 [ sourceMid: string ]: ModuleMapReplacement;
43 [ sourceMid: string ]: ModuleMapReplacement;
44 }
44 }
45
45
46 export interface ModuleMapItem {
46 export interface ModuleMapItem {
47 [ mid: string ]: /* ModuleMapReplacement | ModuleMap */ any;
47 [ mid: string ]: /* ModuleMapReplacement | ModuleMap */ any;
48 }
48 }
49
49
50 export interface ModuleMapReplacement extends ModuleMapItem {
50 export interface ModuleMapReplacement extends ModuleMapItem {
51 [ findMid: string ]: /* replaceMid */ string;
51 [ findMid: string ]: /* replaceMid */ string;
52 }
52 }
53
53
54 /* dojo/AdapterRegistry */
54 /* dojo/AdapterRegistry */
55
55
56 interface AdapterRegistry {
56 interface AdapterRegistry {
57 /**
57 /**
58 * register a check function to determine if the wrap function or
58 * register a check function to determine if the wrap function or
59 * object gets selected
59 * object gets selected
60 */
60 */
61 register(name: string, check: (...args: any[]) => boolean, wrap: Function, directReturn?: boolean, override?: boolean): void;
61 register(name: string, check: (...args: any[]) => boolean, wrap: Function, directReturn?: boolean, override?: boolean): void;
62
62
63 /**
63 /**
64 * Find an adapter for the given arguments. If no suitable adapter
64 * Find an adapter for the given arguments. If no suitable adapter
65 * is found, throws an exception. match() accepts any number of
65 * is found, throws an exception. match() accepts any number of
66 * arguments, all of which are passed to all matching functions
66 * arguments, all of which are passed to all matching functions
67 * from the registered pairs.
67 * from the registered pairs.
68 */
68 */
69 match(...args: any[]): any;
69 match(...args: any[]): any;
70
70
71 /**
71 /**
72 * Remove a named adapter from the registry
72 * Remove a named adapter from the registry
73 */
73 */
74 unregister(name: string): boolean;
74 unregister(name: string): boolean;
75 }
75 }
76
76
77 interface AdapterRegistryConstructor {
77 interface AdapterRegistryConstructor {
78 new (returnWrappers?: boolean): AdapterRegistry;
78 new (returnWrappers?: boolean): AdapterRegistry;
79 prototype: AdapterRegistry;
79 prototype: AdapterRegistry;
80 }
80 }
81
81
82 /* dojo/aspect */
82 /* dojo/aspect */
83
83
84 interface AfterAdvice<T> {
84 interface AfterAdvice<T> {
85 (result: T, ...args: any[]): T;
85 (result: T, ...args: any[]): T;
86 }
86 }
87
87
88 interface AroundAdvice<T> {
88 interface AroundAdvice<T> {
89 (origFn: GenericFunction<T>): (...args: any[]) => T;
89 (origFn: GenericFunction<T>): (...args: any[]) => T;
90 }
90 }
91
91
92 interface BeforeAdvice {
92 interface BeforeAdvice {
93 (...args: any[]): any[] | void;
93 (...args: any[]): any[] | void;
94 }
94 }
95
95
96 interface Aspect {
96 interface Aspect {
97 /**
97 /**
98 * The "before" export of the aspect module is a function that can be used to attach
98 * The "before" export of the aspect module is a function that can be used to attach
99 * "before" advice to a method. This function will be executed before the original attach
99 * "before" advice to a method. This function will be executed before the original attach
100 * is executed. This function will be called with the arguments used to call the mattach
100 * is executed. This function will be called with the arguments used to call the mattach
101 * This function may optionally return an array as the new arguments to use tattach
101 * This function may optionally return an array as the new arguments to use tattach
102 * the original method (or the previous, next-to-execute before advice, if one exattach
102 * the original method (or the previous, next-to-execute before advice, if one exattach
103 * If the before method doesn't return anything (returns undefined) the original argattach
103 * If the before method doesn't return anything (returns undefined) the original argattach
104 * will be presattach
104 * will be presattach
105 * If there are multiple "before" advisors, they are executed in the reverse order they were registered.
105 * If there are multiple "before" advisors, they are executed in the reverse order they were registered.
106 */
106 */
107 before<T>(target: GenericObject, methodName: string, advice: BeforeAdvice | Function): Handle;
107 before<T>(target: GenericObject, methodName: string, advice: BeforeAdvice | Function): Handle;
108
108
109 /**
109 /**
110 * The "around" export of the aspect module is a function that can be used to attach
110 * The "around" export of the aspect module is a function that can be used to attach
111 * "around" advice to a method. The advisor function is immediately executeattach
111 * "around" advice to a method. The advisor function is immediately executeattach
112 * the around() is called, is passed a single argument that is a function that attach
112 * the around() is called, is passed a single argument that is a function that attach
113 * called to continue execution of the original method (or the next around advattach
113 * called to continue execution of the original method (or the next around advattach
114 * The advisor function should return a function, and this function will be called whattach
114 * The advisor function should return a function, and this function will be called whattach
115 * the method is called. It will be called with the arguments used to call the mattach
115 * the method is called. It will be called with the arguments used to call the mattach
116 * Whatever this function returns will be returned as the result of the method call (unless after advise changes it).
116 * Whatever this function returns will be returned as the result of the method call (unless after advise changes it).
117 */
117 */
118 around<T>(target: GenericObject, methodName: string, advice: AroundAdvice<T> | Function): Handle;
118 around<T>(target: GenericObject, methodName: string, advice: AroundAdvice<T> | Function): Handle;
119
119
120 /**
120 /**
121 * The "after" export of the aspect module is a function that can be used to attach
121 * The "after" export of the aspect module is a function that can be used to attach
122 * "after" advice to a method. This function will be executed after the original method
122 * "after" advice to a method. This function will be executed after the original method
123 * is executed. By default the function will be called with a single argument, the return
123 * is executed. By default the function will be called with a single argument, the return
124 * value of the original method, or the the return value of the last executed advice (if a previous one exists).
124 * value of the original method, or the the return value of the last executed advice (if a previous one exists).
125 * The fourth (optional) argument can be set to true to so the function receives the original
125 * The fourth (optional) argument can be set to true to so the function receives the original
126 * arguments (from when the original method was called) rather than the return value.
126 * arguments (from when the original method was called) rather than the return value.
127 * If there are multiple "after" advisors, they are executed in the order they were registered.
127 * If there are multiple "after" advisors, they are executed in the order they were registered.
128 */
128 */
129 after<T>(target: GenericObject, methodName: string, advice: AfterAdvice<T> | Function, receiveArguments?: boolean): Handle;
129 after<T>(target: GenericObject, methodName: string, advice: AfterAdvice<T> | Function, receiveArguments?: boolean): Handle;
130 }
130 }
131
131
132 /* dojo/back */
132 /* dojo/back */
133
133
134 interface BackArgs {
134 interface BackArgs {
135 back?: GenericFunction<void>;
135 back?: GenericFunction<void>;
136 forward?: GenericFunction<void>;
136 forward?: GenericFunction<void>;
137 changeUrl?: boolean | string;
137 changeUrl?: boolean | string;
138 }
138 }
139
139
140 interface Back {
140 interface Back {
141 getHash(): string;
141 getHash(): string;
142 setHash(h: string): void;
142 setHash(h: string): void;
143
143
144 /**
144 /**
145 * private method. Do not call this directly.
145 * private method. Do not call this directly.
146 */
146 */
147 goBack(): void;
147 goBack(): void;
148
148
149 /**
149 /**
150 * private method. Do not call this directly.
150 * private method. Do not call this directly.
151 */
151 */
152 goForward(): void;
152 goForward(): void;
153
153
154 /**
154 /**
155 * Initializes the undo stack. This must be called from a <script>
155 * Initializes the undo stack. This must be called from a <script>
156 * block that lives inside the `<body>` tag to prevent bugs on IE.
156 * block that lives inside the `<body>` tag to prevent bugs on IE.
157 * Only call this method before the page's DOM is finished loading. Otherwise
157 * Only call this method before the page's DOM is finished loading. Otherwise
158 * it will not work. Be careful with xdomain loading or djConfig.debugAtAllCosts scenarios,
158 * it will not work. Be careful with xdomain loading or djConfig.debugAtAllCosts scenarios,
159 * in order for this method to work, dojo/back will need to be part of a build layer.
159 * in order for this method to work, dojo/back will need to be part of a build layer.
160 */
160 */
161 init(): void;
161 init(): void;
162
162
163 /**
163 /**
164 * Sets the state object and back callback for the very first page
164 * Sets the state object and back callback for the very first page
165 * that is loaded.
165 * that is loaded.
166 * It is recommended that you call this method as part of an event
166 * It is recommended that you call this method as part of an event
167 * listener that is registered via dojo/ready.
167 * listener that is registered via dojo/ready.
168 */
168 */
169 setInitialState(args: BackArgs): void;
169 setInitialState(args: BackArgs): void;
170
170
171 /**
171 /**
172 * adds a state object (args) to the history list.
172 * adds a state object (args) to the history list.
173 */
173 */
174 addToHistory(args: BackArgs): void;
174 addToHistory(args: BackArgs): void;
175
175
176 /**
176 /**
177 * private method. Do not call this directly.
177 * private method. Do not call this directly.
178 */
178 */
179 _iframeLoaded(evt: Event, ifrLoc: Location): void;
179 _iframeLoaded(evt: Event, ifrLoc: Location): void;
180 }
180 }
181
181
182 /* dojo/behavior */
182 /* dojo/behavior */
183
183
184 interface Behavior {
184 interface Behavior {
185 _behaviors: { [selector: string]: any };
185 _behaviors: { [selector: string]: any };
186
186
187 /**
187 /**
188 * Add the specified behavior to the list of behaviors, ignoring existing
188 * Add the specified behavior to the list of behaviors, ignoring existing
189 * matches.
189 * matches.
190 */
190 */
191 add(behaviorObject: { [selector: string]: any }): void;
191 add(behaviorObject: { [selector: string]: any }): void;
192
192
193 /**
193 /**
194 * Applies all currently registered behaviors to the document.
194 * Applies all currently registered behaviors to the document.
195 */
195 */
196 apply(): void;
196 apply(): void;
197 }
197 }
198
198
199 /* dojo/cookie */
199 /* dojo/cookie */
200
200
201 interface CookieProps {
201 interface CookieProps {
202 expires?: Date | string | number;
202 expires?: Date | string | number;
203 path?: string;
203 path?: string;
204 domain?: string;
204 domain?: string;
205 secure?: boolean;
205 secure?: boolean;
206 }
206 }
207
207
208 interface Cookie {
208 interface Cookie {
209 /* Get or set a cookie. */
209 /* Get or set a cookie. */
210 (name: string, value?: string, props?: CookieProps): string;
210 (name: string, value?: string, props?: CookieProps): string;
211
211
212 /**
212 /**
213 * Use to determine if the current browser supports cookies or not.
213 * Use to determine if the current browser supports cookies or not.
214 */
214 */
215 isSupported(): boolean;
215 isSupported(): boolean;
216 }
216 }
217
217
218 /* dojo/currency */
218 /* dojo/currency */
219
219
220 interface CurrencyFormatOptions extends NumberFormatOptions {
220 interface CurrencyFormatOptions extends NumberFormatOptions {
221
221
222 /**
222 /**
223 * Should not be set. Value is assumed to be "currency".
223 * Should not be set. Value is assumed to be "currency".
224 */
224 */
225 type?: string;
225 type?: string;
226
226
227 /**
227 /**
228 * localized currency symbol. The default will be looked up in table of supported currencies in `dojo.cldr`
228 * localized currency symbol. The default will be looked up in table of supported currencies in `dojo.cldr`
229 * A [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code will be used if not found.
229 * A [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code will be used if not found.
230 */
230 */
231 symbol?: string;
231 symbol?: string;
232
232
233 /**
233 /**
234 * an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD".
234 * an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD".
235 * For use with dojo.currency only.
235 * For use with dojo.currency only.
236 */
236 */
237 currency?: string;
237 currency?: string;
238
238
239 /**
239 /**
240 * number of decimal places to show. Default is defined based on which currency is used.
240 * number of decimal places to show. Default is defined based on which currency is used.
241 */
241 */
242 places?: number;
242 places?: number;
243 }
243 }
244
244
245 interface CurrencyParseOptions extends NumberParseOptions {
245 interface CurrencyParseOptions extends NumberParseOptions {
246
246
247 /**
247 /**
248 * Should not be set. Value is assumed to be "currency".
248 * Should not be set. Value is assumed to be "currency".
249 */
249 */
250 type?: string;
250 type?: string;
251
251
252 /**
252 /**
253 * localized currency symbol. The default will be looked up in table of supported currencies in `dojo.cldr`
253 * localized currency symbol. The default will be looked up in table of supported currencies in `dojo.cldr`
254 * A [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code will be used if not found.
254 * A [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code will be used if not found.
255 */
255 */
256 symbol?: string;
256 symbol?: string;
257
257
258 /**
258 /**
259 * an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD".
259 * an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD".
260 * For use with dojo.currency only.
260 * For use with dojo.currency only.
261 */
261 */
262 currency?: string;
262 currency?: string;
263
263
264 /**
264 /**
265 * number of decimal places to show. Default is defined based on which currency is used.
265 * number of decimal places to show. Default is defined based on which currency is used.
266 */
266 */
267 places?: number;
267 places?: number;
268
268
269 /**
269 /**
270 * Whether to include the fractional portion, where the number of decimal places are implied by the currency
270 * Whether to include the fractional portion, where the number of decimal places are implied by the currency
271 * or explicit 'places' parameter. The value [true,false] makes the fractional portion optional.
271 * or explicit 'places' parameter. The value [true,false] makes the fractional portion optional.
272 * By default for currencies, it the fractional portion is optional.
272 * By default for currencies, it the fractional portion is optional.
273 */
273 */
274 fractional?: boolean | [boolean, boolean];
274 fractional?: boolean | [boolean, boolean];
275 }
275 }
276
276
277 interface Currency {
277 interface Currency {
278 _mixInDefaults(options: NumberFormatOptions): CurrencyFormatOptions;
278 _mixInDefaults(options: NumberFormatOptions): CurrencyFormatOptions;
279
279
280 /**
280 /**
281 * Format a Number as a currency, using locale-specific settings
281 * Format a Number as a currency, using locale-specific settings
282 */
282 */
283 format(value: number, options?: CurrencyFormatOptions): string;
283 format(value: number, options?: CurrencyFormatOptions): string;
284
284
285 /**
285 /**
286 * Builds the regular needed to parse a currency value
286 * Builds the regular needed to parse a currency value
287 */
287 */
288 regexp(options?: NumberRegexpOptions): string;
288 regexp(options?: NumberRegexpOptions): string;
289
289
290 /**
290 /**
291 * Convert a properly formatted currency string to a primitive Number,
291 * Convert a properly formatted currency string to a primitive Number,
292 * using locale-specific settings.
292 * using locale-specific settings.
293 */
293 */
294 parse(expression: string, options?: CurrencyParseOptions): number;
294 parse(expression: string, options?: CurrencyParseOptions): number;
295 }
295 }
296
296
297 /* dojo/debounce */
297 /* dojo/debounce */
298
298
299 interface Debounce {
299 interface Debounce {
300 /**
300 /**
301 * Create a function that will only execute after `wait` milliseconds
301 * Create a function that will only execute after `wait` milliseconds
302 */
302 */
303 <T extends Function>(cb: T, wait: number): T;
303 <T extends Function>(cb: T, wait: number): T;
304 <T extends Function>(cb: Function, wait: number, ...args: any[]): T;
304 <T extends Function>(cb: Function, wait: number, ...args: any[]): T;
305 }
305 }
306
306
307 /* dojo/Deferred */
307 /* dojo/Deferred */
308
308
309 interface Deferred<T> {
309 interface Deferred<T> {
310
310
311 /**
311 /**
312 * The public promise object that clients can add callbacks to.
312 * The public promise object that clients can add callbacks to.
313 */
313 */
314 promise: promise.Promise<T>;
314 promise: promise.Promise<T>;
315
315
316 /**
316 /**
317 * Checks whether the deferred has been resolved.
317 * Checks whether the deferred has been resolved.
318 */
318 */
319 isResolved(): boolean;
319 isResolved(): boolean;
320
320
321 /**
321 /**
322 * Checks whether the deferred has been rejected.
322 * Checks whether the deferred has been rejected.
323 */
323 */
324 isRejected(): boolean;
324 isRejected(): boolean;
325
325
326 /**
326 /**
327 * Checks whether the deferred has been resolved or rejected.
327 * Checks whether the deferred has been resolved or rejected.
328 */
328 */
329 isFulfilled(): boolean;
329 isFulfilled(): boolean;
330
330
331 /**
331 /**
332 * Checks whether the deferred has been canceled.
332 * Checks whether the deferred has been canceled.
333 */
333 */
334 isCanceled(): boolean;
334 isCanceled(): boolean;
335
335
336 /**
336 /**
337 * Emit a progress update on the deferred.
337 * Emit a progress update on the deferred.
338 */
338 */
339 progress(update: any, strict?: boolean): promise.Promise<T>;
339 progress(update: any, strict?: boolean): promise.Promise<T>;
340
340
341 /**
341 /**
342 * Resolve the deferred.
342 * Resolve the deferred.
343 */
343 */
344 resolve(value?: T, strict?: boolean): promise.Promise<T>;
344 resolve(value?: T, strict?: boolean): promise.Promise<T>;
345
345
346 /**
346 /**
347 * Reject the deferred.
347 * Reject the deferred.
348 */
348 */
349 reject(error?: any, strict?: boolean): promise.Promise<T>;
349 reject(error?: any, strict?: boolean): promise.Promise<T>;
350
350
351 /**
351 /**
352 * Add new callbacks to the deferred.
352 * Add new callbacks to the deferred.
353 */
353 */
354 then<U>(callback?: promise.PromiseCallback<T, U>, errback?: promise.PromiseErrback<U>, progback?: promise.PromiseProgback): promise.Promise<U>;
354 then<U>(callback?: promise.PromiseCallback<T, U>, errback?: promise.PromiseErrback<U>, progback?: promise.PromiseProgback): promise.Promise<U>;
355
355
356 /**
356 /**
357 * Inform the deferred it may cancel its asynchronous operation.
357 * Inform the deferred it may cancel its asynchronous operation.
358 */
358 */
359 cancel(reason?: any, strict?: boolean): any;
359 cancel(reason?: any, strict?: boolean): any;
360
360
361 /**
361 /**
362 * Returns `[object Deferred]`.
362 * Returns `[object Deferred]`.
363 */
363 */
364 toString(): string;
364 toString(): string;
365 }
365 }
366
366
367 interface DeferredConstructor {
367 interface DeferredConstructor {
368 /**
368 /**
369 * Creates a new deferred. This API is preferred over
369 * Creates a new deferred. This API is preferred over
370 * `dojo/_base/Deferred`.
370 * `dojo/_base/Deferred`.
371 */
371 */
372 new <T>(canceller?: (reason: any) => void): Deferred<T>;
372 new <T>(canceller?: (reason: any) => void): Deferred<T>;
373 prototype: Deferred<any>;
373 prototype: Deferred<any>;
374 }
374 }
375
375
376 /* dojo/DeferredList */
376 /* dojo/DeferredList */
377
377
378 interface DeferredList<T> extends Deferred<T[]> {
378 interface DeferredList<T> extends Deferred<T[]> {
379 /**
379 /**
380 * Gathers the results of the deferreds for packaging
380 * Gathers the results of the deferreds for packaging
381 * as the parameters to the Deferred Lists' callback
381 * as the parameters to the Deferred Lists' callback
382 */
382 */
383 gatherResults<T>(deferredList: DeferredList<any>): DeferredList<T>;
383 gatherResults<T>(deferredList: DeferredList<any>): DeferredList<T>;
384 }
384 }
385
385
386 interface DeferredListConstructor {
386 interface DeferredListConstructor {
387 /**
387 /**
388 * Deprecated, use dojo/promise/all instead.
388 * Deprecated, use dojo/promise/all instead.
389 * Provides event handling for a group of Deferred objects.
389 * Provides event handling for a group of Deferred objects.
390 */
390 */
391 new <T>(list: T[], fireOnOneCallback?: boolean, fireOnOneErrback?: boolean, consumeErrors?: boolean, canceller?: (reason: any) => void): DeferredList<T>;
391 new <T>(list: T[], fireOnOneCallback?: boolean, fireOnOneErrback?: boolean, consumeErrors?: boolean, canceller?: (reason: any) => void): DeferredList<T>;
392 prototype: DeferredList<any>;
392 prototype: DeferredList<any>;
393 }
393 }
394
394
395 /* dojo/dojo */
395 /* dojo/dojo */
396
396
397 interface RequireTrace {
397 interface RequireTrace {
398 (group: string, args: any[]): void;
398 (group: string, args: any[]): void;
399 on: boolean | number;
399 on: boolean | number;
400 group: GenericObject;
400 group: GenericObject;
401 set(group: string | GenericObject, value: any): void;
401 set(group: string | GenericObject, value: any): void;
402 }
402 }
403
403
404 interface Require {
404 interface Require {
405 (config: GenericObject, dependencies: string[], callback?: GenericFunction<void>): Require;
405 (config: GenericObject, dependencies: string[], callback?: GenericFunction<void>): Require;
406 (dependencies: string[], callback: GenericFunction<void>): Require;
406 (dependencies: string[], callback: GenericFunction<void>): Require;
407 async: number| boolean;
407 async: number| boolean;
408 has: dojo.Has;
408 has: dojo.Has;
409 isXdurl(url: string): boolean;
409 isXdurl(url: string): boolean;
410 initSyncLoader(dojoRequirePlugin: any, checkDojoRequirePlugin: any, transformToAmd: any): GenericObject;
410 initSyncLoader(dojoRequirePlugin: any, checkDojoRequirePlugin: any, transformToAmd: any): GenericObject;
411 getXhr(): XMLHttpRequest | ActiveXObject;
411 getXhr(): XMLHttpRequest | ActiveXObject;
412 getText(url: string, async?: boolean, onLoad?: (responseText: string, async?: boolean) => void): string;
412 getText(url: string, async?: boolean, onLoad?: (responseText: string, async?: boolean) => void): string;
413 eval(text: string, hint?: string): any;
413 eval(text: string, hint?: string): any;
414 signal(type: string, args: any[]): void;
414 signal(type: string, args: any[]): void;
415 on(type: string, listener: (...args: any[]) => void): Handle;
415 on(type: string, listener: (...args: any[]) => void): Handle;
416 map: { [id: string]: any };
416 map: { [id: string]: any };
417 waitms?: number;
417 waitms?: number;
418 legacyMode: boolean;
418 legacyMode: boolean;
419 rawConfig: dojo._base.Config;
419 rawConfig: dojo._base.Config;
420 baseUrl: string;
420 baseUrl: string;
421 combo?: {
421 combo?: {
422 add: () => void;
422 add: () => void;
423 done(callback: (mids: string[], url?: string) => void, req: Require): void;
423 done(callback: (mids: string[], url?: string) => void, req: Require): void;
424 plugins?: GenericObject;
424 plugins?: GenericObject;
425 };
425 };
426 idle(): boolean;
426 idle(): boolean;
427 toAbsMid(mid: string, referenceModule?: string): string;
427 toAbsMid(mid: string, referenceModule?: string): string;
428 toUrl(name: string, referenceModule?: string): string;
428 toUrl(name: string, referenceModule?: string): string;
429 undef(moduleId: string, referenceModule?: string): void;
429 undef(moduleId: string, referenceModule?: string): void;
430 pageLoaded: number | boolean;
430 pageLoaded: number | boolean;
431 injectUrl(url: string, callback?: () => void, owner?: HTMLScriptElement): HTMLScriptElement;
431 injectUrl(url: string, callback?: () => void, owner?: HTMLScriptElement): HTMLScriptElement;
432 log(...args: any[]): void;
432 log(...args: any[]): void;
433 trace: RequireTrace;
433 trace: RequireTrace;
434 boot?: [string[], Function] | number;
434 boot?: [string[], Function] | number;
435 }
435 }
436
436
437 interface Define {
437 interface Define {
438 (mid: string, dependencies?: string[], factory?: any): void;
438 (mid: string, dependencies?: string[], factory?: any): void;
439 (dependencies: string[], factory?: any): void;
439 (dependencies: string[], factory?: any): void;
440 amd: string;
440 amd: string;
441 }
441 }
442
442
443 /* dojo/dom */
443 /* dojo/dom */
444
444
445 interface Dom {
445 interface Dom {
446 /**
446 /**
447 * Returns DOM node with matching `id` attribute or falsy value (ex: null or undefined)
447 * Returns DOM node with matching `id` attribute or falsy value (ex: null or undefined)
448 * if not found. Internally if `id` is not a string then `id` returned.
448 * if not found. Internally if `id` is not a string then `id` returned.
449 */
449 */
450 byId<E extends Element>(id: string | E, doc?: Document): E;
450 byId<E extends Element>(id: string | E, doc?: Document): E;
451
451
452 /**
452 /**
453 * Returns true if node is a descendant of ancestor
453 * Returns true if node is a descendant of ancestor
454 */
454 */
455 isDescendant(node: NodeOrString, ancestor: NodeOrString): boolean;
455 isDescendant(node: NodeOrString, ancestor: NodeOrString): boolean;
456
456
457 /**
457 /**
458 * Enable or disable selection on a node
458 * Enable or disable selection on a node
459 */
459 */
460 setSelectable(node: ElementOrString, selectable?: boolean): void;
460 setSelectable(node: ElementOrString, selectable?: boolean): void;
461 }
461 }
462
462
463 /* dojo/dom-attr */
463 /* dojo/dom-attr */
464
464
465 interface DomAttr {
465 interface DomAttr {
466 /**
466 /**
467 * Returns true if the requested attribute is specified on the
467 * Returns true if the requested attribute is specified on the
468 * given element, and false otherwise.
468 * given element, and false otherwise.
469 */
469 */
470 has(node: NodeOrString, name: string): boolean;
470 has(node: NodeOrString, name: string): boolean;
471
471
472 /**
472 /**
473 * Gets an attribute on an HTML element.
473 * Gets an attribute on an HTML element.
474 * Because sometimes this uses node.getAttribute, it should be a string,
474 * Because sometimes this uses node.getAttribute, it should be a string,
475 * but it can also get any other attribute on a node, therefore it is unsafe
475 * but it can also get any other attribute on a node, therefore it is unsafe
476 * to type just a string.
476 * to type just a string.
477 */
477 */
478 get(node: ElementOrString, name: string): any;
478 get(node: ElementOrString, name: string): any;
479
479
480 /**
480 /**
481 * Sets an attribute on an HTML element.
481 * Sets an attribute on an HTML element.
482 */
482 */
483 set(node: ElementOrString, name: string, value: any): Element;
483 set(node: ElementOrString, name: string, value: any): Element;
484 set(node: ElementOrString, map: GenericObject): Element;
484 set(node: ElementOrString, map: GenericObject): Element;
485
485
486 /**
486 /**
487 * Removes an attribute from an HTML element.
487 * Removes an attribute from an HTML element.
488 */
488 */
489 remove(node: NodeOrString, name: string): void;
489 remove(node: NodeOrString, name: string): void;
490
490
491 /**
491 /**
492 * Returns an effective value of a property or an attribute.
492 * Returns an effective value of a property or an attribute.
493 */
493 */
494 getNodeProp(node: NodeOrString, name: string): any;
494 getNodeProp(node: NodeOrString, name: string): any;
495 }
495 }
496
496
497 /* dojo/dom-class */
497 /* dojo/dom-class */
498
498
499 interface DomClass {
499 interface DomClass {
500
500
501 /**
501 /**
502 * Returns whether or not the specified classes are a portion of the
502 * Returns whether or not the specified classes are a portion of the
503 * class list currently applied to the node.
503 * class list currently applied to the node.
504 */
504 */
505 contains(node: NodeOrString, classStr: string): boolean;
505 contains(node: NodeOrString, classStr: string): boolean;
506
506
507 /**
507 /**
508 * Adds the specified classes to the end of the class list on the
508 * Adds the specified classes to the end of the class list on the
509 * passed node. Will not re-apply duplicate classes.
509 * passed node. Will not re-apply duplicate classes.
510 */
510 */
511 add(node: NodeOrString, classStr: string | string[]): void;
511 add(node: NodeOrString, classStr: string | string[]): void;
512
512
513 /**
513 /**
514 * Removes the specified classes from node. No `contains()`
514 * Removes the specified classes from node. No `contains()`
515 * check is required.
515 * check is required.
516 */
516 */
517 remove(node: NodeOrString, classStr?: string | string[]): void;
517 remove(node: NodeOrString, classStr?: string | string[]): void;
518
518
519 /**
519 /**
520 * Replaces one or more classes on a node if not present.
520 * Replaces one or more classes on a node if not present.
521 * Operates more quickly than calling dojo.removeClass and dojo.addClass
521 * Operates more quickly than calling dojo.removeClass and dojo.addClass
522 */
522 */
523 replace(node: NodeOrString, addClassStr: string | string[], removeClassStr?: string | string[]): void;
523 replace(node: NodeOrString, addClassStr: string | string[], removeClassStr?: string | string[]): void;
524
524
525 /**
525 /**
526 * Adds a class to node if not present, or removes if present.
526 * Adds a class to node if not present, or removes if present.
527 * Pass a boolean condition if you want to explicitly add or remove.
527 * Pass a boolean condition if you want to explicitly add or remove.
528 * Returns the condition that was specified directly or indirectly.
528 * Returns the condition that was specified directly or indirectly.
529 */
529 */
530 toggle(node: NodeOrString, classStr: string | string[], condition?: boolean): boolean;
530 toggle(node: NodeOrString, classStr: string | string[], condition?: boolean): boolean;
531 }
531 }
532
532
533 /* dojo/dom-construct */
533 /* dojo/dom-construct */
534
534
535 /* TODO implement for TS 1.8 */
535 /* TODO implement for TS 1.8 */
536 /* type PosString = 'first' | 'after' | 'before' | 'last' | 'replace' | 'only'; */
536 /* type PosString = 'first' | 'after' | 'before' | 'last' | 'replace' | 'only'; */
537
537
538 interface DomConstruct {
538 interface DomConstruct {
539
539
540 /**
540 /**
541 * instantiates an HTML fragment returning the corresponding DOM.
541 * instantiates an HTML fragment returning the corresponding DOM.
542 */
542 */
543 toDom(frag: string, doc?: Document): DocumentFragment | Node;
543 toDom(frag: string, doc?: Document): DocumentFragment | Node;
544
544
545 /**
545 /**
546 * Attempt to insert node into the DOM, choosing from various positioning options.
546 * Attempt to insert node into the DOM, choosing from various positioning options.
547 * Returns the first argument resolved to a DOM node.
547 * Returns the first argument resolved to a DOM node.
548 */
548 */
549 place(node: NodeFragmentOrString, refNode: NodeOrString, position?: string /* PosString */ | number): HTMLElement;
549 place(node: NodeFragmentOrString, refNode: NodeOrString, position?: string /* PosString */ | number): HTMLElement;
550
550
551 /**
551 /**
552 * Create an element, allowing for optional attribute decoration
552 * Create an element, allowing for optional attribute decoration
553 * and placement.
553 * and placement.
554 */
554 */
555 create(tag: NodeOrString, attrs?: GenericObject, refNode?: NodeOrString, pos?: string /* PosString */ | number): HTMLElement;
555 create(tag: NodeOrString, attrs?: GenericObject, refNode?: NodeOrString, pos?: string /* PosString */ | number): HTMLElement;
556
556
557 /**
557 /**
558 * safely removes all children of the node.
558 * safely removes all children of the node.
559 */
559 */
560 empty(node: NodeOrString): void;
560 empty(node: NodeOrString): void;
561
561
562 /**
562 /**
563 * Removes a node from its parent, clobbering it and all of its
563 * Removes a node from its parent, clobbering it and all of its
564 * children.
564 * children.
565 */
565 */
566 destroy(node: NodeOrString): void;
566 destroy(node: NodeOrString): void;
567 }
567 }
568
568
569 /* dojo/dom-form */
569 /* dojo/dom-form */
570
570
571 interface DomForm {
571 interface DomForm {
572 /**
572 /**
573 * Serialize a form field to a JavaScript object.
573 * Serialize a form field to a JavaScript object.
574 */
574 */
575 fieldToObject(inputNode: NodeOrString): GenericObject;
575 fieldToObject(inputNode: NodeOrString): GenericObject;
576
576
577 /**
577 /**
578 * Serialize a form node to a JavaScript object.
578 * Serialize a form node to a JavaScript object.
579 */
579 */
580 toObject(fromNode: HTMLFormElement | string): GenericObject;
580 toObject(fromNode: HTMLFormElement | string): GenericObject;
581
581
582 /**
582 /**
583 * Returns a URL-encoded string representing the form passed as either a
583 * Returns a URL-encoded string representing the form passed as either a
584 * node or string ID identifying the form to serialize
584 * node or string ID identifying the form to serialize
585 */
585 */
586 toQuery(fromNode: HTMLFormElement | string): string;
586 toQuery(fromNode: HTMLFormElement | string): string;
587
587
588 /**
588 /**
589 * Create a serialized JSON string from a form node or string
589 * Create a serialized JSON string from a form node or string
590 * ID identifying the form to serialize
590 * ID identifying the form to serialize
591 */
591 */
592 toJson(formNode: HTMLFormElement | string, prettyPrint?: boolean): string;
592 toJson(formNode: HTMLFormElement | string, prettyPrint?: boolean): string;
593 }
593 }
594
594
595 /* dojo/dom-geometry */
595 /* dojo/dom-geometry */
596
596
597 interface DomGeometryWidthHeight {
597 interface DomGeometryWidthHeight {
598 w?: number;
598 w?: number;
599 h?: number;
599 h?: number;
600 }
600 }
601
601
602 interface DomGeometryBox extends DomGeometryWidthHeight {
602 interface DomGeometryBox extends DomGeometryWidthHeight {
603 l?: number;
603 l?: number;
604 t?: number;
604 t?: number;
605 }
605 }
606
606
607 interface DomGeometryBoxExtents extends DomGeometryBox {
607 interface DomGeometryBoxExtents extends DomGeometryBox {
608 r?: number;
608 r?: number;
609 b?: number;
609 b?: number;
610 }
610 }
611
611
612 interface Point {
612 interface Point {
613 x: number;
613 x: number;
614 y: number;
614 y: number;
615 }
615 }
616
616
617 interface DomGeometryXYBox extends DomGeometryWidthHeight, Point {
617 interface DomGeometryXYBox extends DomGeometryWidthHeight, Point {
618 }
618 }
619
619
620 interface DomGeometry {
620 interface DomGeometry {
621 boxModel: string; /* TODO: string literal 'border-box' | 'content-box' */
621 boxModel: string; /* TODO: string literal 'border-box' | 'content-box' */
622
622
623 /**
623 /**
624 * Returns object with special values specifically useful for node
624 * Returns object with special values specifically useful for node
625 * fitting.
625 * fitting.
626 */
626 */
627 getPadExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
627 getPadExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
628
628
629 /**
629 /**
630 * returns an object with properties useful for noting the border
630 * returns an object with properties useful for noting the border
631 * dimensions.
631 * dimensions.
632 */
632 */
633 getBorderExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
633 getBorderExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
634
634
635 /**
635 /**
636 * Returns object with properties useful for box fitting with
636 * Returns object with properties useful for box fitting with
637 * regards to padding.
637 * regards to padding.
638 */
638 */
639 getPadBorderExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
639 getPadBorderExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
640
640
641 /**
641 /**
642 * returns object with properties useful for box fitting with
642 * returns object with properties useful for box fitting with
643 * regards to box margins (i.e., the outer-box).
643 * regards to box margins (i.e., the outer-box).
644 * - l/t = marginLeft, marginTop, respectively
644 * - l/t = marginLeft, marginTop, respectively
645 * - w = total width, margin inclusive
645 * - w = total width, margin inclusive
646 * - h = total height, margin inclusive
646 * - h = total height, margin inclusive
647 * The w/h are used for calculating boxes.
647 * The w/h are used for calculating boxes.
648 * Normally application code will not need to invoke this
648 * Normally application code will not need to invoke this
649 * directly, and will use the ...box... functions instead.
649 * directly, and will use the ...box... functions instead.
650 */
650 */
651 getMarginExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
651 getMarginExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
652
652
653 /**
653 /**
654 * returns an object that encodes the width, height, left and top
654 * returns an object that encodes the width, height, left and top
655 * positions of the node's margin box.
655 * positions of the node's margin box.
656 */
656 */
657 getMarginBox(node: Element, computedStyle?: DomComputedStyle): DomGeometryBox;
657 getMarginBox(node: Element, computedStyle?: DomComputedStyle): DomGeometryBox;
658
658
659 /**
659 /**
660 * Returns an object that encodes the width, height, left and top
660 * Returns an object that encodes the width, height, left and top
661 * positions of the node's content box, irrespective of the
661 * positions of the node's content box, irrespective of the
662 * current box model.
662 * current box model.
663 */
663 */
664 getContentBox(node: Element, computedStyle?: DomComputedStyle): DomGeometryBox;
664 getContentBox(node: Element, computedStyle?: DomComputedStyle): DomGeometryBox;
665
665
666 /**
666 /**
667 * Sets the size of the node's contents, irrespective of margins,
667 * Sets the size of the node's contents, irrespective of margins,
668 * padding, or borders.
668 * padding, or borders.
669 */
669 */
670 setContentSize(node: Element, box: DomGeometryWidthHeight, computedStyle?: DomComputedStyle): void;
670 setContentSize(node: Element, box: DomGeometryWidthHeight, computedStyle?: DomComputedStyle): void;
671
671
672 /**
672 /**
673 * sets the size of the node's margin box and placement
673 * sets the size of the node's margin box and placement
674 * (left/top), irrespective of box model. Think of it as a
674 * (left/top), irrespective of box model. Think of it as a
675 * passthrough to setBox that handles box-model vagaries for
675 * passthrough to setBox that handles box-model vagaries for
676 * you.
676 * you.
677 */
677 */
678 setMarginBox(node: Element, box: DomGeometryBox, computedStyle?: DomComputedStyle): void;
678 setMarginBox(node: Element, box: DomGeometryBox, computedStyle?: DomComputedStyle): void;
679
679
680 /**
680 /**
681 * Returns true if the current language is left-to-right, and false otherwise.
681 * Returns true if the current language is left-to-right, and false otherwise.
682 */
682 */
683 isBodyLtr(doc?: Document): boolean;
683 isBodyLtr(doc?: Document): boolean;
684
684
685 /**
685 /**
686 * Returns an object with {node, x, y} with corresponding offsets.
686 * Returns an object with {node, x, y} with corresponding offsets.
687 */
687 */
688 docScroll(doc?: Document): Point;
688 docScroll(doc?: Document): Point;
689
689
690 /**
690 /**
691 * Deprecated method previously used for IE6-IE7. Now, just returns `{x:0, y:0}`.
691 * Deprecated method previously used for IE6-IE7. Now, just returns `{x:0, y:0}`.
692 */
692 */
693 getIeDocumentElementOffset(doc: Document): Point;
693 getIeDocumentElementOffset(doc: Document): Point;
694
694
695 /**
695 /**
696 * In RTL direction, scrollLeft should be a negative value, but IE
696 * In RTL direction, scrollLeft should be a negative value, but IE
697 * returns a positive one. All codes using documentElement.scrollLeft
697 * returns a positive one. All codes using documentElement.scrollLeft
698 * must call this function to fix this error, otherwise the position
698 * must call this function to fix this error, otherwise the position
699 * will offset to right when there is a horizontal scrollbar.
699 * will offset to right when there is a horizontal scrollbar.
700 */
700 */
701 fixIeBiDiScrollLeft(scrollLeft: number, doc?: Document): number;
701 fixIeBiDiScrollLeft(scrollLeft: number, doc?: Document): number;
702
702
703 /**
703 /**
704 * Gets the position and size of the passed element relative to
704 * Gets the position and size of the passed element relative to
705 * the viewport (if includeScroll==false), or relative to the
705 * the viewport (if includeScroll==false), or relative to the
706 * document root (if includeScroll==true).
706 * document root (if includeScroll==true).
707 */
707 */
708 position(node: Element, includeScroll?: boolean): DomGeometryXYBox;
708 position(node: Element, includeScroll?: boolean): DomGeometryXYBox;
709
709
710 /**
710 /**
711 * returns an object that encodes the width and height of
711 * returns an object that encodes the width and height of
712 * the node's margin box
712 * the node's margin box
713 */
713 */
714 getMarginSize(node: Element, computedStyle?: DomComputedStyle): DomGeometryWidthHeight;
714 getMarginSize(node: Element, computedStyle?: DomComputedStyle): DomGeometryWidthHeight;
715
715
716 /**
716 /**
717 * Normalizes the geometry of a DOM event, normalizing the pageX, pageY,
717 * Normalizes the geometry of a DOM event, normalizing the pageX, pageY,
718 * offsetX, offsetY, layerX, and layerX properties
718 * offsetX, offsetY, layerX, and layerX properties
719 */
719 */
720 normalizeEvent(event: Event): void;
720 normalizeEvent(event: Event): void;
721 }
721 }
722
722
723 /* dojo/dom-prop */
723 /* dojo/dom-prop */
724
724
725 interface DomProp {
725 interface DomProp {
726 /**
726 /**
727 * Gets a property on an HTML element.
727 * Gets a property on an HTML element.
728 */
728 */
729 get(node: ElementOrString, name: string): any;
729 get(node: ElementOrString, name: string): any;
730
730
731 /**
731 /**
732 * Sets a property on an HTML element.
732 * Sets a property on an HTML element.
733 */
733 */
734 set(node: ElementOrString, name: string | GenericObject, value?: any): Element;
734 set(node: ElementOrString, name: string | GenericObject, value?: any): Element;
735 }
735 }
736
736
737 /* dojo/dom-style */
737 /* dojo/dom-style */
738
738
739 // TODO move over the most common properties from CSSStyleDeclaration
739 // TODO move over the most common properties from CSSStyleDeclaration
740 interface DomComputedStyle {
740 interface DomComputedStyle {
741 position?: string;
741 position?: string;
742 width?: string;
742 width?: string;
743 height?: string;
743 height?: string;
744 [id: string]: any;
744 [id: string]: any;
745 }
745 }
746
746
747 interface DomStyle {
747 interface DomStyle {
748 /**
748 /**
749 * Returns a "computed style" object.
749 * Returns a "computed style" object.
750 */
750 */
751 getComputedStyle(node: Node): DomComputedStyle;
751 getComputedStyle(node: Node): DomComputedStyle;
752
752
753 /**
753 /**
754 * Accesses styles on a node.
754 * Accesses styles on a node.
755 */
755 */
756 get(node: ElementOrString): DomComputedStyle;
756 get(node: ElementOrString): DomComputedStyle;
757 get(node: ElementOrString, name: string): string | number;
757 get(node: ElementOrString, name: string): string | number;
758
758
759 /**
759 /**
760 * Sets styles on a node.
760 * Sets styles on a node.
761 */
761 */
762 set(node: ElementOrString, name: DomComputedStyle): DomComputedStyle;
762 set(node: ElementOrString, name: DomComputedStyle): DomComputedStyle;
763 set(node: ElementOrString, name: string, value: string | number): DomComputedStyle;
763 set(node: ElementOrString, name: string, value: string | number): DomComputedStyle;
764
764
765 /**
765 /**
766 * converts style value to pixels on IE or return a numeric value.
766 * converts style value to pixels on IE or return a numeric value.
767 */
767 */
768 toPixelValue(element: Element, value: string): number;
768 toPixelValue(element: Element, value: string): number;
769 }
769 }
770
770
771 /* dojo/domReady */
771 /* dojo/domReady */
772
772
773 interface DomReady {
773 interface DomReady {
774 /**
774 /**
775 * Plugin to delay require()/define() callback from firing until the DOM has finished
775 * Plugin to delay require()/define() callback from firing until the DOM has finished
776 */
776 */
777 (callback: Function): void;
777 (callback: Function): void;
778
778
779 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
779 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
780 _Q: Function[];
780 _Q: Function[];
781 _onEmpty(): void;
781 _onEmpty(): void;
782 }
782 }
783
783
784 /* dojo/Evented */
784 /* dojo/Evented */
785
785
786 interface Evented {
786 interface Evented {
787 on(type: string | ExtensionEvent, listener: EventListener | Function): Handle;
787 on(type: string | ExtensionEvent, listener: EventListener | Function): Handle;
788 emit(type: string | ExtensionEvent, ...events: any[]): boolean;
788 emit(type: string | ExtensionEvent, ...events: any[]): boolean;
789 }
789 }
790
790
791 interface EventedConstructor extends _base.DeclareConstructor<Evented> {
791 interface EventedConstructor extends _base.DeclareConstructor<Evented> {
792 new (params?: Object): Evented;
792 new (params?: Object): Evented;
793 }
793 }
794
794
795 /* dojo/fx */
795 /* dojo/fx */
796
796
797 /* dojo/fx augments the dojo/_base/fx, therefore it is typed in fx.d.ts and not referenced from
797 /* dojo/fx augments the dojo/_base/fx, therefore it is typed in fx.d.ts and not referenced from
798 index.d.ts or module.d.ts and is self contained typings for dojo/fx and dojo/fx/* */
798 index.d.ts or module.d.ts and is self contained typings for dojo/fx and dojo/fx/* */
799
799
800 /* dojo/gears */
800 /* dojo/gears */
801
801
802 /* This is long-ago deprecated by Google, so just doing a minimal typing */
802 /* This is long-ago deprecated by Google, so just doing a minimal typing */
803
803
804 interface Gears {
804 interface Gears {
805 _gearsObject(): any;
805 _gearsObject(): any;
806 available: boolean;
806 available: boolean;
807 }
807 }
808
808
809 /* dojo/has */
809 /* dojo/has */
810
810
811 interface HasCache {
811 interface HasCache {
812 [feature: string]: any;
812 [feature: string]: any;
813 }
813 }
814
814
815 interface HasTestFunction {
815 interface HasTestFunction {
816 /* TypeScript has no way of referring to the global scope see Microsoft/TypeScript#983 */
816 /* TypeScript has no way of referring to the global scope see Microsoft/TypeScript#983 */
817 (global?: any, doc?: Document, element?: Element): any;
817 (global?: any, doc?: Document, element?: Element): any;
818 }
818 }
819
819
820 interface Has {
820 interface Has {
821 /**
821 /**
822 * Return the current value of the named feature.
822 * Return the current value of the named feature.
823 * @param {string | number} name The name (if a string) or identifier (if an integer) of the feature to test.
823 * @param {string | number} name The name (if a string) or identifier (if an integer) of the feature to test.
824 */
824 */
825 (name: string | number): any;
825 (name: string | number): any;
826 (name: 'host-browser'): boolean;
826 (name: 'host-browser'): boolean;
827 (name: 'host-node'): any;
827 (name: 'host-node'): any;
828 (name: 'host-rhino'): boolean;
828 (name: 'host-rhino'): boolean;
829 (name: 'dom'): boolean;
829 (name: 'dom'): boolean;
830 (name: 'dojo-dom-ready-api'): 1;
830 (name: 'dojo-dom-ready-api'): 1;
831 (name: 'dojo-sniff'): 1;
831 (name: 'dojo-sniff'): 1;
832 // if host-browser is true
832 // if host-browser is true
833 (name: 'dom-addeventlistener'): void | boolean;
833 (name: 'dom-addeventlistener'): void | boolean;
834 (name: 'touch'): void | boolean;
834 (name: 'touch'): void | boolean;
835 (name: 'touch-events'): void | boolean;
835 (name: 'touch-events'): void | boolean;
836 (name: 'pointer-events'): void | boolean;
836 (name: 'pointer-events'): void | boolean;
837 (name: 'MSPointer'): void | boolean;
837 (name: 'MSPointer'): void | boolean;
838 (name: 'device-width'): void | number;
838 (name: 'device-width'): void | number;
839 (name: 'dom-attributes-explicit'): void | boolean;
839 (name: 'dom-attributes-explicit'): void | boolean;
840 (name: 'dom-attributes-specified-flag'): void | boolean;
840 (name: 'dom-attributes-specified-flag'): void | boolean;
841 // dojo/_base/browser
841 // dojo/_base/browser
842 (name: 'config-selectorEngine'): string;
842 (name: 'config-selectorEngine'): string;
843
843
844 cache: HasCache;
844 cache: HasCache;
845
845
846 /**
846 /**
847 * Register a new feature test for some named feature.
847 * Register a new feature test for some named feature.
848 */
848 */
849 add(name: string | number, test: HasTestFunction, now?: boolean, force?: boolean): any;
849 add(name: string | number, test: HasTestFunction, now?: boolean, force?: boolean): any;
850 add<T extends (Object | string | number | boolean | null | void)>(name: string | number, test: T, now?: boolean, force?: boolean): any;
850 add<T extends (Object | string | number | boolean | null | void)>(name: string | number, test: T, now?: boolean, force?: boolean): any;
851
851
852 /**
852 /**
853 * Deletes the contents of the element passed to test functions.
853 * Deletes the contents of the element passed to test functions.
854 */
854 */
855 clearElement(element: HTMLElement): HTMLElement;
855 clearElement(element: HTMLElement): HTMLElement;
856
856
857 /**
857 /**
858 * Resolves id into a module id based on possibly-nested tenary expression that branches on has feature test value(s).
858 * Resolves id into a module id based on possibly-nested tenary expression that branches on has feature test value(s).
859 */
859 */
860 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
860 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
861
861
862 /**
862 /**
863 * Conditional loading of AMD modules based on a has feature test value.
863 * Conditional loading of AMD modules based on a has feature test value.
864 */
864 */
865 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
865 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
866 }
866 }
867
867
868 /* dojo/hash */
868 /* dojo/hash */
869
869
870 interface Hash {
870 interface Hash {
871 (hash?: string, replace?: boolean): string;
871 (hash?: string, replace?: boolean): string;
872 }
872 }
873
873
874 /* dojo/hccss */
874 /* dojo/hccss */
875
875
876 /* this only does has.add and re-exports the has interface */
876 /* this only does has.add and re-exports the has interface */
877 interface Has {
877 interface Has {
878 (name: 'highcontrast'): void | boolean;
878 (name: 'highcontrast'): void | boolean;
879 }
879 }
880
880
881 /* dojo/html */
881 /* dojo/html */
882
882
883 type ContentSetterContent = string | Node | ArrayLike<Node>;
883 type ContentSetterContent = string | Node | ArrayLike<Node>;
884
884
885 interface ContentSetterParams {
885 interface ContentSetterParams {
886 node?: NodeOrString;
886 node?: NodeOrString;
887 content?: ContentSetterContent;
887 content?: ContentSetterContent;
888 id?: string;
888 id?: string;
889 cleanContent?: boolean;
889 cleanContent?: boolean;
890 extractContent?: boolean;
890 extractContent?: boolean;
891 parseContent?: boolean;
891 parseContent?: boolean;
892 parserScope?: boolean;
892 parserScope?: boolean;
893 startup?: boolean;
893 startup?: boolean;
894 onBegin?: Function;
894 onBegin?: Function;
895 onEnd?: Function;
895 onEnd?: Function;
896 tearDown?: Function;
896 tearDown?: Function;
897 onContentError?: Function;
897 onContentError?: Function;
898 onExecError?: Function;
898 onExecError?: Function;
899 }
899 }
900
900
901 interface ContentSetter {
901 interface ContentSetter {
902
902
903 /**
903 /**
904 * An node which will be the parent element that we set content into
904 * An node which will be the parent element that we set content into
905 */
905 */
906 node: NodeOrString;
906 node: NodeOrString;
907
907
908 /**
908 /**
909 * The content to be placed in the node. Can be an HTML string, a node reference, or a enumerable list of nodes
909 * The content to be placed in the node. Can be an HTML string, a node reference, or a enumerable list of nodes
910 */
910 */
911 content: ContentSetterContent;
911 content: ContentSetterContent;
912
912
913 /**
913 /**
914 * Usually only used internally, and auto-generated with each instance
914 * Usually only used internally, and auto-generated with each instance
915 */
915 */
916 id: string;
916 id: string;
917
917
918 /**
918 /**
919 * Should the content be treated as a full html document,
919 * Should the content be treated as a full html document,
920 * and the real content stripped of <html>, <body> wrapper before injection
920 * and the real content stripped of <html>, <body> wrapper before injection
921 */
921 */
922 cleanContent: boolean;
922 cleanContent: boolean;
923
923
924 /**
924 /**
925 * Should the content be treated as a full html document,
925 * Should the content be treated as a full html document,
926 * and the real content stripped of `<html> <body>` wrapper before injection
926 * and the real content stripped of `<html> <body>` wrapper before injection
927 */
927 */
928 extractContent: boolean;
928 extractContent: boolean;
929
929
930 /**
930 /**
931 * Should the node by passed to the parser after the new content is set
931 * Should the node by passed to the parser after the new content is set
932 */
932 */
933 parseContent: boolean;
933 parseContent: boolean;
934
934
935 /**
935 /**
936 * Flag passed to parser. Root for attribute names to search for. If scopeName is dojo,
936 * Flag passed to parser. Root for attribute names to search for. If scopeName is dojo,
937 * will search for data-dojo-type (or dojoType). For backwards compatibility
937 * will search for data-dojo-type (or dojoType). For backwards compatibility
938 * reasons defaults to dojo._scopeName (which is "dojo" except when
938 * reasons defaults to dojo._scopeName (which is "dojo" except when
939 * multi-version support is used, when it will be something like dojo16, dojo20, etc.)
939 * multi-version support is used, when it will be something like dojo16, dojo20, etc.)
940 */
940 */
941 parserScope: string;
941 parserScope: string;
942
942
943 /**
943 /**
944 * Start the child widgets after parsing them. Only obeyed if parseContent is true.
944 * Start the child widgets after parsing them. Only obeyed if parseContent is true.
945 */
945 */
946 startup: boolean;
946 startup: boolean;
947
947
948 /**
948 /**
949 * front-end to the set-content sequence
949 * front-end to the set-content sequence
950 */
950 */
951 set(cont?: ContentSetterContent, params?: ContentSetterParams): promise.Promise<Node> | Node;
951 set(cont?: ContentSetterContent, params?: ContentSetterParams): promise.Promise<Node> | Node;
952
952
953 /**
953 /**
954 * sets the content on the node
954 * sets the content on the node
955 */
955 */
956 setContent(): void;
956 setContent(): void;
957
957
958 /**
958 /**
959 * cleanly empty out existing content
959 * cleanly empty out existing content
960 */
960 */
961 empty(): void;
961 empty(): void;
962
962
963 /**
963 /**
964 * Called after instantiation, but before set();
964 * Called after instantiation, but before set();
965 * It allows modification of any of the object properties -
965 * It allows modification of any of the object properties -
966 * including the node and content provided - before the set operation actually takes place
966 * including the node and content provided - before the set operation actually takes place
967 */
967 */
968 onBegin(): Node;
968 onBegin(): Node;
969
969
970 /**
970 /**
971 * Called after set(), when the new content has been pushed into the node
971 * Called after set(), when the new content has been pushed into the node
972 * It provides an opportunity for post-processing before handing back the node to the caller
972 * It provides an opportunity for post-processing before handing back the node to the caller
973 * This default implementation checks a parseContent flag to optionally run the dojo parser over the new content
973 * This default implementation checks a parseContent flag to optionally run the dojo parser over the new content
974 */
974 */
975 onEnd(): Node;
975 onEnd(): Node;
976
976
977 /**
977 /**
978 * manually reset the Setter instance if its being re-used for example for another set()
978 * manually reset the Setter instance if its being re-used for example for another set()
979 */
979 */
980 tearDown(): void;
980 tearDown(): void;
981
981
982 onContentError(): string;
982 onContentError(): string;
983 onExecError(): string;
983 onExecError(): string;
984 _mixin(params: ContentSetterParams): void;
984 _mixin(params: ContentSetterParams): void;
985 parseDeferred: Deferred<any[]>;
985 parseDeferred: Deferred<any[]>;
986
986
987 /**
987 /**
988 * runs the dojo parser over the node contents, storing any results in this.parseResults
988 * runs the dojo parser over the node contents, storing any results in this.parseResults
989 */
989 */
990 _parse(): void;
990 _parse(): void;
991
991
992 /**
992 /**
993 * shows user the string that is returned by on[type]Error
993 * shows user the string that is returned by on[type]Error
994 * override/implement on[type]Error and return your own string to customize
994 * override/implement on[type]Error and return your own string to customize
995 */
995 */
996 _onError(type: string, err: Error, consoleText?: string): void;
996 _onError(type: string, err: Error, consoleText?: string): void;
997 }
997 }
998
998
999 interface ContentSetterConstructor extends _base.DeclareConstructor<ContentSetter> {
999 interface ContentSetterConstructor extends _base.DeclareConstructor<ContentSetter> {
1000 new (params?: ContentSetterParams, node?: NodeOrString): ContentSetter;
1000 new (params?: ContentSetterParams, node?: NodeOrString): ContentSetter;
1001 }
1001 }
1002
1002
1003 interface Html {
1003 interface Html {
1004 /**
1004 /**
1005 * removes !DOCTYPE and title elements from the html string.
1005 * removes !DOCTYPE and title elements from the html string.
1006 *
1006 *
1007 * khtml is picky about dom faults, you can't attach a style or `<title>` node as child of body
1007 * khtml is picky about dom faults, you can't attach a style or `<title>` node as child of body
1008 * must go into head, so we need to cut out those tags
1008 * must go into head, so we need to cut out those tags
1009 */
1009 */
1010 _secureForInnerHtml(cont: string): string;
1010 _secureForInnerHtml(cont: string): string;
1011
1011
1012 /**
1012 /**
1013 * Deprecated, should use dojo/dom-constuct.empty() directly, remove in 2.0.
1013 * Deprecated, should use dojo/dom-constuct.empty() directly, remove in 2.0.
1014 */
1014 */
1015 _emptyNode(node: NodeOrString): void;
1015 _emptyNode(node: NodeOrString): void;
1016
1016
1017 /**
1017 /**
1018 * inserts the given content into the given node
1018 * inserts the given content into the given node
1019 */
1019 */
1020 _setNodeContent<T extends Node>(node: Node, cont: string | Node | ArrayLike<T>): Node;
1020 _setNodeContent<T extends Node>(node: Node, cont: string | Node | ArrayLike<T>): Node;
1021
1021
1022 _ContentSetter: ContentSetterConstructor;
1022 _ContentSetter: ContentSetterConstructor;
1023
1023
1024 /**
1024 /**
1025 * inserts (replaces) the given content into the given node. dojo/dom-construct.place(cont, node, "only")
1025 * inserts (replaces) the given content into the given node. dojo/dom-construct.place(cont, node, "only")
1026 * may be a better choice for simple HTML insertion.
1026 * may be a better choice for simple HTML insertion.
1027 */
1027 */
1028 set(node: Node, cont?: ContentSetterContent, params?: ContentSetterParams): promise.Promise<Node> | Node;
1028 set(node: Node, cont?: ContentSetterContent, params?: ContentSetterParams): promise.Promise<Node> | Node;
1029 }
1029 }
1030
1030
1031 /* dojo/i18n */
1031 /* dojo/i18n */
1032
1032
1033 interface I18n {
1033 interface I18n {
1034 getLocalization(moduleName: string, bundleName: string, locale?: string): any;
1034 getLocalization(moduleName: string, bundleName: string, locale?: string): any;
1035
1035
1036 dynamic: boolean;
1036 dynamic: boolean;
1037
1037
1038 /**
1038 /**
1039 * Resolves id into a module id based on possibly-nested tenary expression that branches on has feature test value(s).
1039 * Resolves id into a module id based on possibly-nested tenary expression that branches on has feature test value(s).
1040 */
1040 */
1041 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
1041 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
1042
1042
1043 normalizeLocale(locale?: string): string;
1043 normalizeLocale(locale?: string): string;
1044
1044
1045 /**
1045 /**
1046 * Conditional loading of AMD modules based on a has feature test value.
1046 * Conditional loading of AMD modules based on a has feature test value.
1047 */
1047 */
1048 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
1048 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
1049
1049
1050 cache: { [bundle: string]: any };
1050 cache: { [bundle: string]: any };
1051
1051
1052 getL10nName(moduleName: string, bundleName: string, locale?: string): string;
1052 getL10nName(moduleName: string, bundleName: string, locale?: string): string;
1053 }
1053 }
1054
1054
1055 /* dojo/io-query */
1055 /* dojo/io-query */
1056
1056
1057 interface IoQuery {
1057 interface IoQuery {
1058 /**
1058 /**
1059 * takes a name/value mapping object and returns a string representing
1059 * takes a name/value mapping object and returns a string representing
1060 * a URL-encoded version of that object.
1060 * a URL-encoded version of that object.
1061 */
1061 */
1062 objectToQuery(map: GenericObject): string;
1062 objectToQuery(map: GenericObject): string;
1063
1063
1064 /**
1064 /**
1065 * Create an object representing a de-serialized query section of a
1065 * Create an object representing a de-serialized query section of a
1066 * URL. Query keys with multiple values are returned in an array.
1066 * URL. Query keys with multiple values are returned in an array.
1067 */
1067 */
1068 queryToObject(str: string): GenericObject;
1068 queryToObject(str: string): GenericObject;
1069 }
1069 }
1070
1070
1071 /* dojo/json */
1071 /* dojo/json */
1072
1072
1073 interface Json {
1073 interface Json {
1074
1074
1075 /**
1075 /**
1076 * Parses a [JSON](http://json.org) string to return a JavaScript object.
1076 * Parses a [JSON](http://json.org) string to return a JavaScript object.
1077 */
1077 */
1078 parse(str: string, strict?: boolean): any;
1078 parse(str: string, strict?: boolean): any;
1079
1079
1080 /**
1080 /**
1081 * Returns a [JSON](http://json.org) serialization of an object.
1081 * Returns a [JSON](http://json.org) serialization of an object.
1082 */
1082 */
1083 stringify(value: any, replacer?: (key: string, value: any) => any| any[], space?: string | number): string;
1083 stringify(value: any, replacer?: (key: string, value: any) => any| any[], space?: string | number): string;
1084 }
1084 }
1085
1085
1086 /* dojo/keys */
1086 /* dojo/keys */
1087
1087
1088 interface Keys {
1088 interface Keys {
1089 BACKSPACE: number;
1089 BACKSPACE: number;
1090 TAB: number;
1090 TAB: number;
1091 CLEAR: number;
1091 CLEAR: number;
1092 ENTER: number;
1092 ENTER: number;
1093 SHIFT: number;
1093 SHIFT: number;
1094 CTRL: number;
1094 CTRL: number;
1095 ALT: number;
1095 ALT: number;
1096 META: number;
1096 META: number;
1097 PAUSE: number;
1097 PAUSE: number;
1098 CAPS_LOCK: number;
1098 CAPS_LOCK: number;
1099 ESCAPE: number;
1099 ESCAPE: number;
1100 SPACE: number;
1100 SPACE: number;
1101 PAGE_UP: number;
1101 PAGE_UP: number;
1102 PAGE_DOWN: number;
1102 PAGE_DOWN: number;
1103 END: number;
1103 END: number;
1104 HOME: number;
1104 HOME: number;
1105 LEFT_ARROW: number;
1105 LEFT_ARROW: number;
1106 UP_ARROW: number;
1106 UP_ARROW: number;
1107 RIGHT_ARROW: number;
1107 RIGHT_ARROW: number;
1108 DOWN_ARROW: number;
1108 DOWN_ARROW: number;
1109 INSERT: number;
1109 INSERT: number;
1110 DELETE: number;
1110 DELETE: number;
1111 HELP: number;
1111 HELP: number;
1112 LEFT_WINDOW: number;
1112 LEFT_WINDOW: number;
1113 RIGHT_WINDOW: number;
1113 RIGHT_WINDOW: number;
1114 SELECT: number;
1114 SELECT: number;
1115 NUMPAD_0: number;
1115 NUMPAD_0: number;
1116 NUMPAD_1: number;
1116 NUMPAD_1: number;
1117 NUMPAD_2: number;
1117 NUMPAD_2: number;
1118 NUMPAD_3: number;
1118 NUMPAD_3: number;
1119 NUMPAD_4: number;
1119 NUMPAD_4: number;
1120 NUMPAD_5: number;
1120 NUMPAD_5: number;
1121 NUMPAD_6: number;
1121 NUMPAD_6: number;
1122 NUMPAD_7: number;
1122 NUMPAD_7: number;
1123 NUMPAD_8: number;
1123 NUMPAD_8: number;
1124 NUMPAD_9: number;
1124 NUMPAD_9: number;
1125 NUMPAD_MULTIPLY: number;
1125 NUMPAD_MULTIPLY: number;
1126 NUMPAD_PLUS: number;
1126 NUMPAD_PLUS: number;
1127 NUMPAD_ENTER: number;
1127 NUMPAD_ENTER: number;
1128 NUMPAD_MINUS: number;
1128 NUMPAD_MINUS: number;
1129 NUMPAD_PERIOD: number;
1129 NUMPAD_PERIOD: number;
1130 NUMPAD_DIVIDE: number;
1130 NUMPAD_DIVIDE: number;
1131 F1: number;
1131 F1: number;
1132 F2: number;
1132 F2: number;
1133 F3: number;
1133 F3: number;
1134 F4: number;
1134 F4: number;
1135 F5: number;
1135 F5: number;
1136 F6: number;
1136 F6: number;
1137 F7: number;
1137 F7: number;
1138 F8: number;
1138 F8: number;
1139 F9: number;
1139 F9: number;
1140 F10: number;
1140 F10: number;
1141 F11: number;
1141 F11: number;
1142 F12: number;
1142 F12: number;
1143 F13: number;
1143 F13: number;
1144 F14: number;
1144 F14: number;
1145 F15: number;
1145 F15: number;
1146 NUM_LOCK: number;
1146 NUM_LOCK: number;
1147 SCROLL_LOCK: number;
1147 SCROLL_LOCK: number;
1148 UP_DPAD: number;
1148 UP_DPAD: number;
1149 DOWN_DPAD: number;
1149 DOWN_DPAD: number;
1150 LEFT_DPAD: number;
1150 LEFT_DPAD: number;
1151 RIGHT_DPAD: number;
1151 RIGHT_DPAD: number;
1152 copyKey: number;
1152 copyKey: number;
1153 }
1153 }
1154
1154
1155 /* dojo/loadInit */
1155 /* dojo/loadInit */
1156
1156
1157 interface LoadInit {
1157 interface LoadInit {
1158 dynamic: number;
1158 dynamic: number;
1159
1159
1160 /**
1160 /**
1161 * Resolves id into a module id based on possibly-nested tenary expression that branches on has feature test value(s).
1161 * Resolves id into a module id based on possibly-nested tenary expression that branches on has feature test value(s).
1162 */
1162 */
1163 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
1163 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
1164
1164
1165 /**
1165 /**
1166 * Conditional loading of AMD modules based on a has feature test value.
1166 * Conditional loading of AMD modules based on a has feature test value.
1167 */
1167 */
1168 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
1168 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
1169 }
1169 }
1170
1170
1171 /* dojo/mouse */
1171 /* dojo/mouse */
1172
1172
1173 interface Mouse {
1173 interface Mouse {
1174 _eventHandler(type: string, selectHandler?: (evt: MouseEvent, listener: EventListener) => void): MouseEvent;
1174 _eventHandler(type: string, selectHandler?: (evt: MouseEvent, listener: EventListener) => void): MouseEvent;
1175
1175
1176 /**
1176 /**
1177 * This is an extension event for the mouseenter that IE provides, emulating the
1177 * This is an extension event for the mouseenter that IE provides, emulating the
1178 * behavior on other browsers.
1178 * behavior on other browsers.
1179 */
1179 */
1180 enter: MouseEvent;
1180 enter: MouseEvent;
1181
1181
1182 /**
1182 /**
1183 * This is an extension event for the mouseleave that IE provides, emulating the
1183 * This is an extension event for the mouseleave that IE provides, emulating the
1184 * behavior on other browsers.
1184 * behavior on other browsers.
1185 */
1185 */
1186 leave: MouseEvent;
1186 leave: MouseEvent;
1187
1187
1188 /**
1188 /**
1189 * This is an extension event for the mousewheel that non-Mozilla browsers provide,
1189 * This is an extension event for the mousewheel that non-Mozilla browsers provide,
1190 * emulating the behavior on Mozilla based browsers.
1190 * emulating the behavior on Mozilla based browsers.
1191 */
1191 */
1192 wheel: string | ExtensionEvent;
1192 wheel: string | ExtensionEvent;
1193
1193
1194 /**
1194 /**
1195 * Test an event object (from a mousedown event) to see if the left button was pressed.
1195 * Test an event object (from a mousedown event) to see if the left button was pressed.
1196 */
1196 */
1197 isLeft(e: MouseEvent): boolean;
1197 isLeft(e: MouseEvent): boolean;
1198
1198
1199 /**
1199 /**
1200 * Test an event object (from a mousedown event) to see if the middle button was pressed.
1200 * Test an event object (from a mousedown event) to see if the middle button was pressed.
1201 */
1201 */
1202 isMiddle(e: MouseEvent): boolean;
1202 isMiddle(e: MouseEvent): boolean;
1203
1203
1204 /**
1204 /**
1205 * Test an event object (from a mousedown event) to see if the right button was pressed.
1205 * Test an event object (from a mousedown event) to see if the right button was pressed.
1206 */
1206 */
1207 isRight(e: MouseEvent): boolean;
1207 isRight(e: MouseEvent): boolean;
1208 }
1208 }
1209
1209
1210 /* dojo/node */
1210 /* dojo/node */
1211
1211
1212 /* should only be used for re-exporting CommonJS modules */
1212 /* should only be used for re-exporting CommonJS modules */
1213
1213
1214 /* dojo/NodeList */
1214 /* dojo/NodeList */
1215
1215
1216 /* Just proxies dojo/query::NodeList */
1216 /* Just proxies dojo/query::NodeList */
1217
1217
1218 /* dojo/NodeList-* are included as seperate .d.ts files */
1218 /* dojo/NodeList-* are included as seperate .d.ts files */
1219
1219
1220 /* dojo/number */
1220 /* dojo/number */
1221
1221
1222 interface NumberFormatOptions {
1222 interface NumberFormatOptions {
1223
1223
1224 /**
1224 /**
1225 * override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
1225 * override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
1226 * with this string. Default value is based on locale. Overriding this property will defeat
1226 * with this string. Default value is based on locale. Overriding this property will defeat
1227 * localization. Literal characters in patterns are not supported.
1227 * localization. Literal characters in patterns are not supported.
1228 */
1228 */
1229 pattern?: string;
1229 pattern?: string;
1230
1230
1231 /**
1231 /**
1232 * choose a format type based on the locale from the following:
1232 * choose a format type based on the locale from the following:
1233 * decimal, scientific (not yet supported), percent, currency. decimal by default.
1233 * decimal, scientific (not yet supported), percent, currency. decimal by default.
1234 */
1234 */
1235 type?: string;
1235 type?: string;
1236
1236
1237 /**
1237 /**
1238 * fixed number of decimal places to show. This overrides any
1238 * fixed number of decimal places to show. This overrides any
1239 * information in the provided pattern.
1239 * information in the provided pattern.
1240 */
1240 */
1241 places?: number;
1241 places?: number;
1242
1242
1243 /**
1243 /**
1244 * 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1
1244 * 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1
1245 * means do not round.
1245 * means do not round.
1246 */
1246 */
1247 round?: number;
1247 round?: number;
1248
1248
1249 /**
1249 /**
1250 * override the locale used to determine formatting rules
1250 * override the locale used to determine formatting rules
1251 */
1251 */
1252 locale?: string;
1252 locale?: string;
1253
1253
1254 /**
1254 /**
1255 * If false, show no decimal places, overriding places and pattern settings.
1255 * If false, show no decimal places, overriding places and pattern settings.
1256 */
1256 */
1257 fractional?: boolean | [ boolean, boolean ];
1257 fractional?: boolean | [ boolean, boolean ];
1258 }
1258 }
1259
1259
1260 interface NumberFormatAbsoluteOptions {
1260 interface NumberFormatAbsoluteOptions {
1261 /**
1261 /**
1262 * the decimal separator
1262 * the decimal separator
1263 */
1263 */
1264 decimal?: string;
1264 decimal?: string;
1265
1265
1266 /**
1266 /**
1267 * the group separator
1267 * the group separator
1268 */
1268 */
1269 group?: string;
1269 group?: string;
1270
1270
1271 /**
1271 /**
1272 * number of decimal places. the range "n,m" will format to m places.
1272 * number of decimal places. the range "n,m" will format to m places.
1273 */
1273 */
1274 places?: number | string;
1274 places?: number | string;
1275
1275
1276 /**
1276 /**
1277 * 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1
1277 * 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1
1278 * means don't round.
1278 * means don't round.
1279 */
1279 */
1280 round?: number;
1280 round?: number;
1281 }
1281 }
1282
1282
1283 interface NumberRegexpOptions {
1283 interface NumberRegexpOptions {
1284
1284
1285 /**
1285 /**
1286 * override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
1286 * override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
1287 * with this string. Default value is based on locale. Overriding this property will defeat
1287 * with this string. Default value is based on locale. Overriding this property will defeat
1288 * localization.
1288 * localization.
1289 */
1289 */
1290 pattern?: string;
1290 pattern?: string;
1291
1291
1292 /**
1292 /**
1293 * choose a format type based on the locale from the following:
1293 * choose a format type based on the locale from the following:
1294 * decimal, scientific (not yet supported), percent, currency. decimal by default.
1294 * decimal, scientific (not yet supported), percent, currency. decimal by default.
1295 */
1295 */
1296 type?: string;
1296 type?: string;
1297
1297
1298 /**
1298 /**
1299 * override the locale used to determine formatting rules
1299 * override the locale used to determine formatting rules
1300 */
1300 */
1301 locacle?: string;
1301 locacle?: string;
1302
1302
1303 /**
1303 /**
1304 * strict parsing, false by default. Strict parsing requires input as produced by the format() method.
1304 * strict parsing, false by default. Strict parsing requires input as produced by the format() method.
1305 * Non-strict is more permissive, e.g. flexible on white space, omitting thousands separators
1305 * Non-strict is more permissive, e.g. flexible on white space, omitting thousands separators
1306 */
1306 */
1307 strict?: boolean;
1307 strict?: boolean;
1308
1308
1309 /**
1309 /**
1310 * number of decimal places to accept: Infinity, a positive number, or
1310 * number of decimal places to accept: Infinity, a positive number, or
1311 * a range "n,m". Defined by pattern or Infinity if pattern not provided.
1311 * a range "n,m". Defined by pattern or Infinity if pattern not provided.
1312 */
1312 */
1313 places?: number | string;
1313 places?: number | string;
1314 }
1314 }
1315
1315
1316 interface NumberParseOptions {
1316 interface NumberParseOptions {
1317
1317
1318 /**
1318 /**
1319 * override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
1319 * override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
1320 * with this string. Default value is based on locale. Overriding this property will defeat
1320 * with this string. Default value is based on locale. Overriding this property will defeat
1321 * localization. Literal characters in patterns are not supported.
1321 * localization. Literal characters in patterns are not supported.
1322 */
1322 */
1323 pattern?: string;
1323 pattern?: string;
1324
1324
1325 /**
1325 /**
1326 * choose a format type based on the locale from the following:
1326 * choose a format type based on the locale from the following:
1327 * decimal, scientific (not yet supported), percent, currency. decimal by default.
1327 * decimal, scientific (not yet supported), percent, currency. decimal by default.
1328 */
1328 */
1329 type?: string;
1329 type?: string;
1330
1330
1331 /**
1331 /**
1332 * override the locale used to determine formatting rules
1332 * override the locale used to determine formatting rules
1333 */
1333 */
1334 locale?: string;
1334 locale?: string;
1335
1335
1336 /**
1336 /**
1337 * strict parsing, false by default. Strict parsing requires input as produced by the format() method.
1337 * strict parsing, false by default. Strict parsing requires input as produced by the format() method.
1338 * Non-strict is more permissive, e.g. flexible on white space, omitting thousands separators
1338 * Non-strict is more permissive, e.g. flexible on white space, omitting thousands separators
1339 */
1339 */
1340 strict?: boolean;
1340 strict?: boolean;
1341
1341
1342 /**
1342 /**
1343 * Whether to include the fractional portion, where the number of decimal places are implied by pattern
1343 * Whether to include the fractional portion, where the number of decimal places are implied by pattern
1344 * or explicit 'places' parameter. The value [true,false] makes the fractional portion optional.
1344 * or explicit 'places' parameter. The value [true,false] makes the fractional portion optional.
1345 */
1345 */
1346 fractional?: boolean | [boolean, boolean];
1346 fractional?: boolean | [boolean, boolean];
1347 }
1347 }
1348
1348
1349 interface RealNumberRegexpFlags {
1349 interface RealNumberRegexpFlags {
1350
1350
1351 /**
1351 /**
1352 * The integer number of decimal places or a range given as "n,m". If
1352 * The integer number of decimal places or a range given as "n,m". If
1353 * not given, the decimal part is optional and the number of places is
1353 * not given, the decimal part is optional and the number of places is
1354 * unlimited.
1354 * unlimited.
1355 */
1355 */
1356 places?: number;
1356 places?: number;
1357
1357
1358 /**
1358 /**
1359 * A string for the character used as the decimal point. Default
1359 * A string for the character used as the decimal point. Default
1360 * is ".".
1360 * is ".".
1361 */
1361 */
1362 decimal?: string;
1362 decimal?: string;
1363
1363
1364 /**
1364 /**
1365 * Whether decimal places are used. Can be true, false, or [true,
1365 * Whether decimal places are used. Can be true, false, or [true,
1366 * false]. Default is [true, false] which means optional.
1366 * false]. Default is [true, false] which means optional.
1367 */
1367 */
1368 fractional?: boolean | [boolean, boolean];
1368 fractional?: boolean | [boolean, boolean];
1369
1369
1370 /**
1370 /**
1371 * Express in exponential notation. Can be true, false, or [true,
1371 * Express in exponential notation. Can be true, false, or [true,
1372 * false]. Default is [true, false], (i.e. will match if the
1372 * false]. Default is [true, false], (i.e. will match if the
1373 * exponential part is present are not).
1373 * exponential part is present are not).
1374 */
1374 */
1375 exponent?: boolean | [boolean, boolean];
1375 exponent?: boolean | [boolean, boolean];
1376
1376
1377 /**
1377 /**
1378 * The leading plus-or-minus sign on the exponent. Can be true,
1378 * The leading plus-or-minus sign on the exponent. Can be true,
1379 * false, or [true, false]. Default is [true, false], (i.e. will
1379 * false, or [true, false]. Default is [true, false], (i.e. will
1380 * match if it is signed or unsigned). flags in regexp.integer can be
1380 * match if it is signed or unsigned). flags in regexp.integer can be
1381 * applied.
1381 * applied.
1382 */
1382 */
1383 eSigned?: boolean | [boolean, boolean];
1383 eSigned?: boolean | [boolean, boolean];
1384 }
1384 }
1385
1385
1386 interface IntegerRegexpFlags {
1386 interface IntegerRegexpFlags {
1387
1387
1388 /**
1388 /**
1389 * The leading plus-or-minus sign. Can be true, false, or `[true,false]`.
1389 * The leading plus-or-minus sign. Can be true, false, or `[true,false]`.
1390 * Default is `[true, false]`, (i.e. will match if it is signed
1390 * Default is `[true, false]`, (i.e. will match if it is signed
1391 * or unsigned).
1391 * or unsigned).
1392 */
1392 */
1393 signed?: boolean;
1393 signed?: boolean;
1394
1394
1395 /**
1395 /**
1396 * The character used as the thousands separator. Default is no
1396 * The character used as the thousands separator. Default is no
1397 * separator. For more than one symbol use an array, e.g. `[",", ""]`,
1397 * separator. For more than one symbol use an array, e.g. `[",", ""]`,
1398 * makes ',' optional.
1398 * makes ',' optional.
1399 */
1399 */
1400 separator?: string;
1400 separator?: string;
1401
1401
1402 /**
1402 /**
1403 * group size between separators
1403 * group size between separators
1404 */
1404 */
1405 groupSize?: number;
1405 groupSize?: number;
1406
1406
1407 /**
1407 /**
1408 * second grouping, where separators 2..n have a different interval than the first separator (for India)
1408 * second grouping, where separators 2..n have a different interval than the first separator (for India)
1409 */
1409 */
1410 groupSize2?: number;
1410 groupSize2?: number;
1411 }
1411 }
1412
1412
1413 interface Number {
1413 interface Number {
1414 /**
1414 /**
1415 * Format a Number as a String, using locale-specific settings
1415 * Format a Number as a String, using locale-specific settings
1416 */
1416 */
1417 format(value: number, options?: NumberFormatOptions): string;
1417 format(value: number, options?: NumberFormatOptions): string;
1418
1418
1419 /**
1419 /**
1420 * not precise, but good enough
1420 * not precise, but good enough
1421 */
1421 */
1422 _numberPatternRE: RegExp;
1422 _numberPatternRE: RegExp;
1423
1423
1424 /**
1424 /**
1425 * Apply pattern to format value as a string using options. Gives no
1425 * Apply pattern to format value as a string using options. Gives no
1426 * consideration to local customs.
1426 * consideration to local customs.
1427 */
1427 */
1428 _applyPattern(value: number, pattern: string, options?: NumberFormatOptions): string;
1428 _applyPattern(value: number, pattern: string, options?: NumberFormatOptions): string;
1429
1429
1430 /**
1430 /**
1431 * Rounds to the nearest value with the given number of decimal places, away from zero
1431 * Rounds to the nearest value with the given number of decimal places, away from zero
1432 */
1432 */
1433 round(value: number, places?: number, increment?: number): number;
1433 round(value: number, places?: number, increment?: number): number;
1434
1434
1435 /**
1435 /**
1436 * Apply numeric pattern to absolute value using options. Gives no
1436 * Apply numeric pattern to absolute value using options. Gives no
1437 * consideration to local customs.
1437 * consideration to local customs.
1438 */
1438 */
1439 _formatAbsolute(value: number, pattern: string, options?: NumberFormatAbsoluteOptions): string;
1439 _formatAbsolute(value: number, pattern: string, options?: NumberFormatAbsoluteOptions): string;
1440
1440
1441 /**
1441 /**
1442 * Builds the regular needed to parse a number
1442 * Builds the regular needed to parse a number
1443 */
1443 */
1444 regexp(options?: NumberRegexpOptions): string;
1444 regexp(options?: NumberRegexpOptions): string;
1445
1445
1446 _parseInfo(options?: any): { regexp: string, group: string, decimal: string, factor: number };
1446 _parseInfo(options?: any): { regexp: string, group: string, decimal: string, factor: number };
1447
1447
1448 /**
1448 /**
1449 * Convert a properly formatted string to a primitive Number, using
1449 * Convert a properly formatted string to a primitive Number, using
1450 * locale-specific settings.
1450 * locale-specific settings.
1451 */
1451 */
1452 parse(expression: string, options?: NumberParseOptions): number;
1452 parse(expression: string, options?: NumberParseOptions): number;
1453
1453
1454 /**
1454 /**
1455 * Builds a regular expression to match a real number in exponential
1455 * Builds a regular expression to match a real number in exponential
1456 * notation
1456 * notation
1457 */
1457 */
1458 _realNumberRegexp(flags: RealNumberRegexpFlags): string;
1458 _realNumberRegexp(flags: RealNumberRegexpFlags): string;
1459
1459
1460 /**
1460 /**
1461 * Builds a regular expression that matches an integer
1461 * Builds a regular expression that matches an integer
1462 */
1462 */
1463 _integerRegexp(flags: IntegerRegexpFlags): string;
1463 _integerRegexp(flags: IntegerRegexpFlags): string;
1464 }
1464 }
1465
1465
1466 /* dojo/on */
1466 /* dojo/on */
1467
1467
1468 interface ExtensionEvent {
1468 interface ExtensionEvent {
1469 (target: Element | GenericObject, listener: EventListener): Handle;
1469 (target: Element | GenericObject, listener: EventListener): Handle;
1470 }
1470 }
1471
1471
1472 interface PauseHandle extends Handle {
1472 interface PauseHandle extends Handle {
1473 pause(): void;
1473 pause(): void;
1474 resume(): void;
1474 resume(): void;
1475 }
1475 }
1476
1476
1477 interface MatchesTarget {
1477 interface MatchesTarget {
1478 matches(node: Element, selector: string, context?: any): any[];
1478 matches(node: Element, selector: string, context?: any): any[];
1479 [id: string]: any;
1479 [id: string]: any;
1480 }
1480 }
1481
1481
1482 interface On {
1482 interface On {
1483 /**
1483 /**
1484 * A function that provides core event listening functionality. With this function
1484 * A function that provides core event listening functionality. With this function
1485 * you can provide a target, event type, and listener to be notified of
1485 * you can provide a target, event type, and listener to be notified of
1486 * future matching events that are fired.
1486 * future matching events that are fired.
1487 */
1487 */
1488 (target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): Handle;
1488 (target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): Handle;
1489
1489
1490 /**
1490 /**
1491 * This function acts the same as on(), but with pausable functionality. The
1491 * This function acts the same as on(), but with pausable functionality. The
1492 * returned signal object has pause() and resume() functions. Calling the
1492 * returned signal object has pause() and resume() functions. Calling the
1493 * pause() method will cause the listener to not be called for future events.
1493 * pause() method will cause the listener to not be called for future events.
1494 */
1494 */
1495 pausable(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): PauseHandle;
1495 pausable(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): PauseHandle;
1496
1496
1497 /**
1497 /**
1498 * This function acts the same as on(), but will only call the listener once. The
1498 * This function acts the same as on(), but will only call the listener once. The
1499 * listener will be called for the first
1499 * listener will be called for the first
1500 * event that takes place and then listener will automatically be removed.
1500 * event that takes place and then listener will automatically be removed.
1501 */
1501 */
1502 once(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): Handle;
1502 once(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): Handle;
1503
1503
1504 parse(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix: boolean, matchesTarget: Element | GenericObject): Handle;
1504 parse(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix: boolean, matchesTarget: Element | GenericObject): Handle;
1505
1505
1506 /**
1506 /**
1507 * Check if a node match the current selector within the constraint of a context
1507 * Check if a node match the current selector within the constraint of a context
1508 */
1508 */
1509 matches(node: Element, selector: string, context: Element, children: boolean, matchesTarget?: MatchesTarget): Element | boolean;
1509 matches(node: Element, selector: string, context: Element, children: boolean, matchesTarget?: MatchesTarget): Element | boolean;
1510
1510
1511 /**
1511 /**
1512 * Creates a new extension event with event delegation. This is based on
1512 * Creates a new extension event with event delegation. This is based on
1513 * the provided event type (can be extension event) that
1513 * the provided event type (can be extension event) that
1514 * only calls the listener when the CSS selector matches the target of the event.
1514 * only calls the listener when the CSS selector matches the target of the event.
1515 *
1515 *
1516 * The application must require() an appropriate level of dojo/query to handle the selector.
1516 * The application must require() an appropriate level of dojo/query to handle the selector.
1517 */
1517 */
1518 selector(selector: string, type: string | ExtensionEvent, children?: boolean): ExtensionEvent;
1518 selector(selector: string, type: string | ExtensionEvent, children?: boolean): ExtensionEvent;
1519
1519
1520 /**
1520 /**
1521 * Fires an event on the target object.
1521 * Fires an event on the target object.
1522 */
1522 */
1523 emit(target: Element | GenericObject, type: string | ExtensionEvent, event?: any): boolean;
1523 emit(target: Element | GenericObject, type: string | ExtensionEvent, event?: any): boolean;
1524
1524
1525 /**
1525 /**
1526 * normalizes properties on the event object including event
1526 * normalizes properties on the event object including event
1527 * bubbling methods, keystroke normalization, and x/y positions
1527 * bubbling methods, keystroke normalization, and x/y positions
1528 */
1528 */
1529 _fixEvent(evt: any, sender: any): any;
1529 _fixEvent(evt: any, sender: any): any;
1530 }
1530 }
1531
1531
1532 /* dojo/parser */
1532 /* dojo/parser */
1533
1533
1534 interface ParserOptions { }
1534 interface ParserOptions { }
1535
1535
1536 interface ParserObjects {
1536 interface ParserObjects {
1537 ctor?: GenericConstructor<any>;
1537 ctor?: GenericConstructor<any>;
1538 types?: string[];
1538 types?: string[];
1539 node: Node;
1539 node: Node;
1540 scripts?: HTMLScriptElement[];
1540 scripts?: HTMLScriptElement[];
1541 inherited?: { [prop: string]: any; };
1541 inherited?: { [prop: string]: any; };
1542 }
1542 }
1543
1543
1544 interface InstancesArray extends Array<any>, promise.Promise<any> {}
1544 interface InstancesArray extends Array<any>, promise.Promise<any> {}
1545
1545
1546 interface Parser {
1546 interface Parser {
1547 /**
1547 /**
1548 * Clear cached data. Used mainly for benchmarking.
1548 * Clear cached data. Used mainly for benchmarking.
1549 */
1549 */
1550 _clearCache(): void;
1550 _clearCache(): void;
1551
1551
1552 /**
1552 /**
1553 * Convert a `<script type="dojo/method" args="a, b, c"> ... </script>`
1553 * Convert a `<script type="dojo/method" args="a, b, c"> ... </script>`
1554 * into a function
1554 * into a function
1555 */
1555 */
1556 _functionFromScript(node: HTMLScriptElement, attrData: string): Function;
1556 _functionFromScript(node: HTMLScriptElement, attrData: string): Function;
1557
1557
1558 /**
1558 /**
1559 * Takes array of nodes, and turns them into class instances and
1559 * Takes array of nodes, and turns them into class instances and
1560 * potentially calls a startup method to allow them to connect with
1560 * potentially calls a startup method to allow them to connect with
1561 * any children.
1561 * any children.
1562 */
1562 */
1563 instantiate(nodes: Node[], mixin?: Object, options?: ParserOptions): any[];
1563 instantiate(nodes: Node[], mixin?: Object, options?: ParserOptions): any[];
1564
1564
1565 /**
1565 /**
1566 * Takes array of objects representing nodes, and turns them into class instances and
1566 * Takes array of objects representing nodes, and turns them into class instances and
1567 * potentially calls a startup method to allow them to connect with
1567 * potentially calls a startup method to allow them to connect with
1568 * any children.
1568 * any children.
1569 */
1569 */
1570 _instantiate(nodes: ParserObjects[], mixin?: Object, options?: ParserOptions, returnPromise?: boolean): any[] | promise.Promise<any[]>;
1570 _instantiate(nodes: ParserObjects[], mixin?: Object, options?: ParserOptions, returnPromise?: boolean): any[] | promise.Promise<any[]>;
1571
1571
1572 /**
1572 /**
1573 * Calls new ctor(params, node), where params is the hash of parameters specified on the node,
1573 * Calls new ctor(params, node), where params is the hash of parameters specified on the node,
1574 * excluding data-dojo-type and data-dojo-mixins. Does not call startup().
1574 * excluding data-dojo-type and data-dojo-mixins. Does not call startup().
1575 */
1575 */
1576 construct<T>(
1576 construct<T>(
1577 ctor: GenericConstructor<T>,
1577 ctor: GenericConstructor<T>,
1578 node: Node, mixin?: Object,
1578 node: Node, mixin?: Object,
1579 options?: ParserOptions,
1579 options?: ParserOptions,
1580 scripts?: HTMLScriptElement[],
1580 scripts?: HTMLScriptElement[],
1581 inherited?: { [prop: string]: any; }
1581 inherited?: { [prop: string]: any; }
1582 ): promise.Promise<T> | T;
1582 ): promise.Promise<T> | T;
1583
1583
1584 /**
1584 /**
1585 * Scan a DOM tree and return an array of objects representing the DOMNodes
1585 * Scan a DOM tree and return an array of objects representing the DOMNodes
1586 * that need to be turned into widgets.
1586 * that need to be turned into widgets.
1587 */
1587 */
1588 scan(root?: Node, options?: ParserOptions): promise.Promise<ParserObjects[]>;
1588 scan(root?: Node, options?: ParserOptions): promise.Promise<ParserObjects[]>;
1589
1589
1590 /**
1590 /**
1591 * Helper for _scanAMD(). Takes a `<script type=dojo/require>bar: "acme/bar", ...</script>` node,
1591 * Helper for _scanAMD(). Takes a `<script type=dojo/require>bar: "acme/bar", ...</script>` node,
1592 * calls require() to load the specified modules and (asynchronously) assign them to the specified global
1592 * calls require() to load the specified modules and (asynchronously) assign them to the specified global
1593 * variables, and returns a Promise for when that operation completes.
1593 * variables, and returns a Promise for when that operation completes.
1594 *
1594 *
1595 * In the example above, it is effectively doing a require(["acme/bar", ...], function(a){ bar = a; }).
1595 * In the example above, it is effectively doing a require(["acme/bar", ...], function(a){ bar = a; }).
1596 */
1596 */
1597 _require(script: HTMLScriptElement, options: ParserOptions): promise.Promise<any>;
1597 _require(script: HTMLScriptElement, options: ParserOptions): promise.Promise<any>;
1598
1598
1599 /**
1599 /**
1600 * Scans the DOM for any declarative requires and returns their values.
1600 * Scans the DOM for any declarative requires and returns their values.
1601 */
1601 */
1602 _scanAmd(root?: Node, options?: ParserOptions): promise.Promise<boolean>;
1602 _scanAmd(root?: Node, options?: ParserOptions): promise.Promise<boolean>;
1603
1603
1604 /**
1604 /**
1605 * Scan the DOM for class instances, and instantiate them.
1605 * Scan the DOM for class instances, and instantiate them.
1606 */
1606 */
1607 parse(rootNode?: Node, options?: ParserOptions): InstancesArray;
1607 parse(rootNode?: Node, options?: ParserOptions): InstancesArray;
1608 }
1608 }
1609
1609
1610 /* dojo/query */
1610 /* dojo/query */
1611
1611
1612 interface NodeListFilterCallback<T extends Node> {
1612 interface NodeListFilterCallback<T extends Node> {
1613 (item: T, idx: number, nodeList: this): boolean;
1613 (item: T, idx: number, nodeList: this): boolean;
1614 }
1614 }
1615
1615
1616 type NodeListFilter<T extends Node> = string | NodeListFilterCallback<T>;
1616 type NodeListFilter<T extends Node> = string | NodeListFilterCallback<T>;
1617
1617
1618 interface NodeList<T extends Node> extends ArrayLike<T> {
1618 interface NodeList<T extends Node> extends ArrayLike<T> {
1619 /**
1619 /**
1620 * decorate an array to make it look like a `dojo/NodeList`.
1620 * decorate an array to make it look like a `dojo/NodeList`.
1621 */
1621 */
1622 _wrap<U extends Node, V extends Node>(a: U[], parent?: NodeList<V>, NodeListCtor?: NodeListConstructor): NodeList<U>;
1622 _wrap<U extends Node, V extends Node>(a: U[], parent?: NodeList<V>, NodeListCtor?: NodeListConstructor): NodeList<U>;
1623
1623
1624 _NodeListCtor: NodeListConstructor;
1624 _NodeListCtor: NodeListConstructor;
1625 toString(): string;
1625 toString(): string;
1626
1626
1627 /**
1627 /**
1628 * private function to hold to a parent NodeList. end() to return the parent NodeList.
1628 * private function to hold to a parent NodeList. end() to return the parent NodeList.
1629 */
1629 */
1630 _stash(parent: Node): this;
1630 _stash(parent: Node): this;
1631
1631
1632 /**
1632 /**
1633 * Listen for events on the nodes in the NodeList.
1633 * Listen for events on the nodes in the NodeList.
1634 */
1634 */
1635 on(eventName: string, listener: EventListener): Handle[];
1635 on(eventName: string, listener: EventListener): Handle[];
1636
1636
1637 /**
1637 /**
1638 * Ends use of the current `NodeList` by returning the previous NodeList
1638 * Ends use of the current `NodeList` by returning the previous NodeList
1639 * that generated the current NodeList.
1639 * that generated the current NodeList.
1640 */
1640 */
1641 end<U extends Node>(): NodeList<U>;
1641 end<U extends Node>(): NodeList<U>;
1642
1642
1643 /**
1643 /**
1644 * Returns a new NodeList, maintaining this one in place
1644 * Returns a new NodeList, maintaining this one in place
1645 */
1645 */
1646 slice(begin: number, end?: number): this;
1646 slice(begin: number, end?: number): this;
1647
1647
1648 /**
1648 /**
1649 * Returns a new NodeList, manipulating this NodeList based on
1649 * Returns a new NodeList, manipulating this NodeList based on
1650 * the arguments passed, potentially splicing in new elements
1650 * the arguments passed, potentially splicing in new elements
1651 * at an offset, optionally deleting elements
1651 * at an offset, optionally deleting elements
1652 */
1652 */
1653 splice(index: number, howmany?: number, ...items: T[]): this;
1653 splice(index: number, howmany?: number, ...items: T[]): this;
1654
1654
1655 /**
1655 /**
1656 * see `dojo/_base/array.indexOf()`. The primary difference is that the acted-on
1656 * see `dojo/_base/array.indexOf()`. The primary difference is that the acted-on
1657 * array is implicitly this NodeList
1657 * array is implicitly this NodeList
1658 */
1658 */
1659 indexOf(value: T, fromIndex?: number, findLast?: boolean): number;
1659 indexOf(value: T, fromIndex?: number, findLast?: boolean): number;
1660
1660
1661 /**
1661 /**
1662 * see `dojo/_base/array.lastIndexOf()`. The primary difference is that the
1662 * see `dojo/_base/array.lastIndexOf()`. The primary difference is that the
1663 * acted-on array is implicitly this NodeList
1663 * acted-on array is implicitly this NodeList
1664 */
1664 */
1665 lastIndexOf(value: T, fromIndex?: number): number;
1665 lastIndexOf(value: T, fromIndex?: number): number;
1666
1666
1667 /**
1667 /**
1668 * see `dojo/_base/array.every()` and the [Array.every
1668 * see `dojo/_base/array.every()` and the [Array.every
1669 * docs](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every).
1669 * docs](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every).
1670 * Takes the same structure of arguments and returns as
1670 * Takes the same structure of arguments and returns as
1671 * dojo/_base/array.every() with the caveat that the passed array is
1671 * dojo/_base/array.every() with the caveat that the passed array is
1672 * implicitly this NodeList
1672 * implicitly this NodeList
1673 */
1673 */
1674 every(callback: (item: T, idx: number, nodeList: this) => boolean | string, thisObj?: Object): boolean;
1674 every(callback: (item: T, idx: number, nodeList: this) => boolean | string, thisObj?: Object): boolean;
1675
1675
1676 /**
1676 /**
1677 * Takes the same structure of arguments and returns as
1677 * Takes the same structure of arguments and returns as
1678 * `dojo/_base/array.some()` with the caveat that the passed array as
1678 * `dojo/_base/array.some()` with the caveat that the passed array as
1679 * implicitly this NodeList. See `dojo/_base/array.some()` and Mozillaas
1679 * implicitly this NodeList. See `dojo/_base/array.some()` and Mozillaas
1680 * [Array.soas
1680 * [Array.soas
1681 * documentation](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some).
1681 * documentation](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some).
1682 */
1682 */
1683 some(callback: (item: T, idx: number, nodeList: this) => boolean | string, thisObj?: Object): boolean;
1683 some(callback: (item: T, idx: number, nodeList: this) => boolean | string, thisObj?: Object): boolean;
1684
1684
1685 /**
1685 /**
1686 * Returns a new NodeList comprised of items in this NodeList
1686 * Returns a new NodeList comprised of items in this NodeList
1687 * as well as items passed in as parameters
1687 * as well as items passed in as parameters
1688 */
1688 */
1689 concat(...items: T[]): this;
1689 concat(...items: T[]): this;
1690
1690
1691 /**
1691 /**
1692 * see `dojo/_base/array.map()`. The primary difference is that the acted-on
1692 * see `dojo/_base/array.map()`. The primary difference is that the acted-on
1693 * array is implicitly this NodeList and the return is a
1693 * array is implicitly this NodeList and the return is a
1694 * NodeList (a subclass of Array)
1694 * NodeList (a subclass of Array)
1695 */
1695 */
1696 map<U extends Node>(func: (item: T, idx: number, nodeList: this) => U, obj?: Object): NodeList<U>;
1696 map<U extends Node>(func: (item: T, idx: number, nodeList: this) => U, obj?: Object): NodeList<U>;
1697
1697
1698 /**
1698 /**
1699 * see `dojo/_base/array.forEach()`. The primary difference is that the acted-on
1699 * see `dojo/_base/array.forEach()`. The primary difference is that the acted-on
1700 * array is implicitly this NodeList. If you want the option to break out
1700 * array is implicitly this NodeList. If you want the option to break out
1701 * of the forEach loop, use every() or some() instead.
1701 * of the forEach loop, use every() or some() instead.
1702 */
1702 */
1703 forEach(callback: (item: T, idx: number, nodeList: this) => void, thisObj?: Object): this;
1703 forEach(callback: (item: T, idx: number, nodeList: this) => void, thisObj?: Object): this;
1704
1704
1705 /**
1705 /**
1706 * "masks" the built-in javascript filter() method (supported
1706 * "masks" the built-in javascript filter() method (supported
1707 * in Dojo via `dojo/_base/array.filter`) to support passing a simple
1707 * in Dojo via `dojo/_base/array.filter`) to support passing a simple
1708 * string filter in addition to supporting filtering function
1708 * string filter in addition to supporting filtering function
1709 * objects.
1709 * objects.
1710 */
1710 */
1711 filter<U extends Node>(filter: NodeListFilter<T>, thisObj?: Object): NodeList<U>;
1711 filter<U extends Node>(filter: NodeListFilter<T>, thisObj?: Object): NodeList<U>;
1712
1712
1713 /**
1713 /**
1714 * Create a new instance of a specified class, using the
1714 * Create a new instance of a specified class, using the
1715 * specified properties and each node in the NodeList as a
1715 * specified properties and each node in the NodeList as a
1716 * srcNodeRef.
1716 * srcNodeRef.
1717 */
1717 */
1718 instantiate(declaredClass: string | GenericConstructor<any>, properties?: Object): this;
1718 instantiate(declaredClass: string | GenericConstructor<any>, properties?: Object): this;
1719
1719
1720 /**
1720 /**
1721 * Returns a new NodeList comprised of items in this NodeList
1721 * Returns a new NodeList comprised of items in this NodeList
1722 * at the given index or indices.
1722 * at the given index or indices.
1723 */
1723 */
1724 at(...indices: number[]): this;
1724 at(...indices: number[]): this;
1725
1725
1726 }
1726 }
1727
1727
1728 interface NodeListConstructor {
1728 interface NodeListConstructor {
1729 new <T extends Node>(array: number | Array<T>): NodeList<T>;
1729 new <T extends Node>(array: number | Array<T> | NodeListOf<T>): NodeList<T>;
1730 new <T extends Node>(...args: T[]): NodeList<T>;
1730 new <T extends Node>(...args: T[]): NodeList<T>;
1731 <T extends Node>(array: number | Array<T>): NodeList<T>;
1731 <T extends Node>(array: number | Array<T> | NodeListOf<T>): NodeList<T>;
1732 <T extends Node>(...args: T[]): NodeList<T>;
1732 <T extends Node>(...args: T[]): NodeList<T>;
1733
1733
1734 prototype: NodeList<any>;
1734 prototype: NodeList<any>;
1735
1735
1736 /**
1736 /**
1737 * decorate an array to make it look like a `dojo/NodeList`.
1737 * decorate an array to make it look like a `dojo/NodeList`.
1738 */
1738 */
1739 _wrap<U extends Node, V extends Node>(a: U[], parent?: NodeList<V>, NodeListCtor?: NodeListConstructor): NodeList<U>;
1739 _wrap<U extends Node, V extends Node>(a: U[], parent?: NodeList<V>, NodeListCtor?: NodeListConstructor): NodeList<U>;
1740
1740
1741 /**
1741 /**
1742 * adapts a single node function to be used in the map-type
1742 * adapts a single node function to be used in the map-type
1743 * actions. The return is a new array of values, as via `dojo/_base/array.map`
1743 * actions. The return is a new array of values, as via `dojo/_base/array.map`
1744 */
1744 */
1745 _adaptAsMap<T extends Node, U extends Node>(f: (node: T) => U, o?: Object): NodeList<U>;
1745 _adaptAsMap<T extends Node, U extends Node>(f: (node: T) => U, o?: Object): NodeList<U>;
1746
1746
1747 /**
1747 /**
1748 * adapts a single node function to be used in the forEach-type
1748 * adapts a single node function to be used in the forEach-type
1749 * actions. The initial object is returned from the specialized
1749 * actions. The initial object is returned from the specialized
1750 * function.
1750 * function.
1751 */
1751 */
1752 _adaptAsForEach<T extends Node>(f: (node: T) => void, o?: Object): this;
1752 _adaptAsForEach<T extends Node>(f: (node: T) => void, o?: Object): this;
1753
1753
1754 /**
1754 /**
1755 * adapts a single node function to be used in the filter-type actions
1755 * adapts a single node function to be used in the filter-type actions
1756 */
1756 */
1757 _adaptAsFilter<T extends Node>(f: (node: T) => boolean, o?: Object): this;
1757 _adaptAsFilter<T extends Node>(f: (node: T) => boolean, o?: Object): this;
1758
1758
1759 /**
1759 /**
1760 * adapts a single node function to be used in the map-type
1760 * adapts a single node function to be used in the map-type
1761 * actions, behaves like forEach() or map() depending on arguments
1761 * actions, behaves like forEach() or map() depending on arguments
1762 */
1762 */
1763 _adaptWithCondition<T extends Node, U extends Node>(f: (node: T) => U | void, g: (...args: any[]) => boolean, o?: Object): NodeList<U> | this;
1763 _adaptWithCondition<T extends Node, U extends Node>(f: (node: T) => U | void, g: (...args: any[]) => boolean, o?: Object): NodeList<U> | this;
1764 }
1764 }
1765
1765
1766 interface Query {
1766 interface Query {
1767 /**
1767 /**
1768 * Returns nodes which match the given CSS selector, searching the
1768 * Returns nodes which match the given CSS selector, searching the
1769 * entire document by default but optionally taking a node to scope
1769 * entire document by default but optionally taking a node to scope
1770 * the search by. Returns an instance of NodeList.
1770 * the search by. Returns an instance of NodeList.
1771 */
1771 */
1772 <T extends Node>(query: string, root?: NodeOrString): NodeList<T>;
1772 <T extends Node>(query: string, root?: NodeOrString): NodeList<T>;
1773 <T extends Node>(root: Node): NodeList<T>;
1774
1775 NodeList: NodeListConstructor;
1773
1776
1774 /**
1777 /**
1775 * Test to see if a node matches a selector
1778 * Test to see if a node matches a selector
1776 */
1779 */
1777 matches(node: Node, selector: string, root?: NodeOrString): boolean;
1780 matches(node: Node, selector: string, root?: NodeOrString): boolean;
1778
1781
1779 /**
1782 /**
1780 * Filters an array of nodes. Note that this does not guarantee to return a NodeList, just an array.
1783 * Filters an array of nodes. Note that this does not guarantee to return a NodeList, just an array.
1781 */
1784 */
1782 filter<T extends Node>(nodes: NodeList<T> | T[], select: string, root?: NodeOrString): T[] | NodeList<T>;
1785 filter<T extends Node>(nodes: NodeList<T> | T[], select: string, root?: NodeOrString): T[] | NodeList<T>;
1783
1786
1784 /**
1787 /**
1785 * can be used as AMD plugin to conditionally load new query engine
1788 * can be used as AMD plugin to conditionally load new query engine
1786 */
1789 */
1787 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
1790 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
1788 }
1791 }
1789
1792
1790 /* dojo/ready */
1793 /* dojo/ready */
1791
1794
1792 interface Ready {
1795 interface Ready {
1793 /**
1796 /**
1794 * Add a function to execute on DOM content loaded and all requested modules have arrived and been evaluated.
1797 * Add a function to execute on DOM content loaded and all requested modules have arrived and been evaluated.
1795 * In most cases, the `domReady` plug-in should suffice and this method should not be needed.
1798 * In most cases, the `domReady` plug-in should suffice and this method should not be needed.
1796 *
1799 *
1797 * When called in a non-browser environment, just checks that all requested modules have arrived and been
1800 * When called in a non-browser environment, just checks that all requested modules have arrived and been
1798 * evaluated.
1801 * evaluated.
1799 */
1802 */
1800 (callback: Function): void;
1803 (callback: Function): void;
1801 (context: Object, callback: Function | string): void;
1804 (context: Object, callback: Function | string): void;
1802 (priority: number, callback: Function): void;
1805 (priority: number, callback: Function): void;
1803 (priority: number, context: Object, callback: Function | string): void;
1806 (priority: number, context: Object, callback: Function | string): void;
1804 }
1807 }
1805
1808
1806 /* dojo/regexp */
1809 /* dojo/regexp */
1807
1810
1808 interface RegExpModule {
1811 interface RegExpModule {
1809 /**
1812 /**
1810 * Adds escape sequences for special characters in regular expressions
1813 * Adds escape sequences for special characters in regular expressions
1811 */
1814 */
1812 escapeString(str: string, except?: string): string;
1815 escapeString(str: string, except?: string): string;
1813
1816
1814 /**
1817 /**
1815 * Builds a regular expression that groups subexpressions
1818 * Builds a regular expression that groups subexpressions
1816 */
1819 */
1817 buildGroupRE(arr: any[] | Object, re: (item: any) => string, nonCapture?: boolean): string;
1820 buildGroupRE(arr: any[] | Object, re: (item: any) => string, nonCapture?: boolean): string;
1818
1821
1819 /**
1822 /**
1820 * adds group match to expression
1823 * adds group match to expression
1821 */
1824 */
1822 group(expression: string, nonCapture?: boolean): string;
1825 group(expression: string, nonCapture?: boolean): string;
1823 }
1826 }
1824
1827
1825 /* dojo/request */
1828 /* dojo/request */
1826
1829
1827 /* This is contained in request.d.ts */
1830 /* This is contained in request.d.ts */
1828
1831
1829 /* dojo/require */
1832 /* dojo/require */
1830
1833
1831 interface RequirePlugin {
1834 interface RequirePlugin {
1832 dynamic: number;
1835 dynamic: number;
1833 normalize(id: string): string;
1836 normalize(id: string): string;
1834 load(mid: string, require: any, loaded: (...modules: any[]) => void): void;
1837 load(mid: string, require: any, loaded: (...modules: any[]) => void): void;
1835 }
1838 }
1836
1839
1837 /* dojo/robot */
1840 /* dojo/robot */
1838
1841
1839 interface Robot extends doh.Robot {
1842 interface Robot extends doh.Robot {
1840 _resolveNode(n: NodeOrString | (() => Node)): Node;
1843 _resolveNode(n: NodeOrString | (() => Node)): Node;
1841 _scrollIntoView(n: Node): void;
1844 _scrollIntoView(n: Node): void;
1842 _position(n: Node): DomGeometryBoxExtents;
1845 _position(n: Node): DomGeometryBoxExtents;
1843 _getWindowChain(n: Node): Window[];
1846 _getWindowChain(n: Node): Window[];
1844
1847
1845 /**
1848 /**
1846 * Scroll the passed node into view, if it is not.
1849 * Scroll the passed node into view, if it is not.
1847 */
1850 */
1848 scrollIntoView(node: NodeOrString | (() => Node), delay?: number): void;
1851 scrollIntoView(node: NodeOrString | (() => Node), delay?: number): void;
1849
1852
1850 /**
1853 /**
1851 * Moves the mouse over the specified node at the specified relative x,y offset.
1854 * Moves the mouse over the specified node at the specified relative x,y offset.
1852 */
1855 */
1853 mouseMoveAt(
1856 mouseMoveAt(
1854 node: NodeOrString | (() => Node),
1857 node: NodeOrString | (() => Node),
1855 delay?: number,
1858 delay?: number,
1856 duration?: number,
1859 duration?: number,
1857 offsetX?: number,
1860 offsetX?: number,
1858 offsetY?: number
1861 offsetY?: number
1859 ): void;
1862 ): void;
1860 }
1863 }
1861
1864
1862 /* dojo/robotx */
1865 /* dojo/robotx */
1863
1866
1864 interface RobotX extends Robot {
1867 interface RobotX extends Robot {
1865 /**
1868 /**
1866 * Called every time a new page is loaded into the iframe, to setup variables
1869 * Called every time a new page is loaded into the iframe, to setup variables
1867 * Point dojo.global, dojo.publish, etc. to refer to iframe.
1870 * Point dojo.global, dojo.publish, etc. to refer to iframe.
1868 * Remove for 2.0?
1871 * Remove for 2.0?
1869 */
1872 */
1870 _updateDocument(): void;
1873 _updateDocument(): void;
1871
1874
1872 /**
1875 /**
1873 * Opens the application at the specified URL for testing, redirecting dojo to point to the application
1876 * Opens the application at the specified URL for testing, redirecting dojo to point to the application
1874 * environment instead of the test environment.
1877 * environment instead of the test environment.
1875 */
1878 */
1876 initRobot(url: string): void;
1879 initRobot(url: string): void;
1877
1880
1878 /**
1881 /**
1879 * Notifies DOH that the doh.robot is about to make a page change in the application it is driving,
1882 * Notifies DOH that the doh.robot is about to make a page change in the application it is driving,
1880 * returning a doh.Deferred object the user should return in their runTest function as part of a DOH test.
1883 * returning a doh.Deferred object the user should return in their runTest function as part of a DOH test.
1881 */
1884 */
1882 waitForPageToLoad(submitActions: () => void): any;
1885 waitForPageToLoad(submitActions: () => void): any;
1883 }
1886 }
1884
1887
1885 /* dojo/router */
1888 /* dojo/router */
1886
1889
1887 /* Module just exports instance of dojo.router.BaseRouter */
1890 /* Module just exports instance of dojo.router.BaseRouter */
1888
1891
1889 /* dojo/sniff */
1892 /* dojo/sniff */
1890
1893
1891 interface Has {
1894 interface Has {
1892 (name: 'air'): boolean;
1895 (name: 'air'): boolean;
1893 (name: 'wp'): void | number;
1896 (name: 'wp'): void | number;
1894 (name: 'msapp'): void | number;
1897 (name: 'msapp'): void | number;
1895 (name: 'khtml'): void | number;
1898 (name: 'khtml'): void | number;
1896 (name: 'edge'): void | number;
1899 (name: 'edge'): void | number;
1897 (name: 'opr'): void | number;
1900 (name: 'opr'): void | number;
1898 (name: 'webkit'): void | number;
1901 (name: 'webkit'): void | number;
1899 (name: 'chrome'): void | number;
1902 (name: 'chrome'): void | number;
1900 (name: 'android'): void | number;
1903 (name: 'android'): void | number;
1901 (name: 'safari'): void | number;
1904 (name: 'safari'): void | number;
1902 (name: 'mac'): boolean;
1905 (name: 'mac'): boolean;
1903 (name: 'quirks'): boolean;
1906 (name: 'quirks'): boolean;
1904 (name: 'iphone'): void | number;
1907 (name: 'iphone'): void | number;
1905 (name: 'ipod'): void | number;
1908 (name: 'ipod'): void | number;
1906 (name: 'ipad'): void | number;
1909 (name: 'ipad'): void | number;
1907 (name: 'ios'): void | number;
1910 (name: 'ios'): void | number;
1908 (name: 'bb'): void | number | boolean;
1911 (name: 'bb'): void | number | boolean;
1909 (name: 'trident'): void | number;
1912 (name: 'trident'): void | number;
1910 (name: 'svg'): boolean;
1913 (name: 'svg'): boolean;
1911 (name: 'opera'): void | number;
1914 (name: 'opera'): void | number;
1912 (name: 'mozilla'): void | number;
1915 (name: 'mozilla'): void | number;
1913 (name: 'ff'): void | number;
1916 (name: 'ff'): void | number;
1914 (name: 'ie'): void | number;
1917 (name: 'ie'): void | number;
1915 (name: 'wii'): boolean | any;
1918 (name: 'wii'): boolean | any;
1916 }
1919 }
1917
1920
1918 /* Just rexports has after adding features */
1921 /* Just rexports has after adding features */
1919
1922
1920 /* dojo/Stateful */
1923 /* dojo/Stateful */
1921
1924
1922 interface WatchHandle extends Handle {
1925 interface WatchHandle extends Handle {
1923 unwatch(): void;
1926 unwatch(): void;
1924 }
1927 }
1925
1928
1926 interface Stateful<T = any> {
1929 interface Stateful<T = any> {
1927 /**
1930 /**
1928 * Used across all instances a hash to cache attribute names and their getter
1931 * Used across all instances a hash to cache attribute names and their getter
1929 * and setter names.
1932 * and setter names.
1930 */
1933 */
1931 _attrPairNames: { [attr: string]: string };
1934 _attrPairNames: { [attr: string]: string };
1932
1935
1933 /**
1936 /**
1934 * Helper function for get() and set().
1937 * Helper function for get() and set().
1935 * Caches attribute name values so we don't do the string ops every time.
1938 * Caches attribute name values so we don't do the string ops every time.
1936 */
1939 */
1937 _getAttrNames(name: string): string;
1940 _getAttrNames(name: string): string;
1938
1941
1939 /**
1942 /**
1940 * Automatic setting of params during construction
1943 * Automatic setting of params during construction
1941 */
1944 */
1942 postscript(params?: Object): void;
1945 postscript(params?: Object): void;
1943
1946
1944 /**
1947 /**
1945 * Get a property on a Stateful instance.
1948 * Get a property on a Stateful instance.
1946 */
1949 */
1947 get<K extends keyof T & string>(name: K): T[K];
1950 get<K extends keyof T & string>(name: K): T[K];
1948
1951
1949 /**
1952 /**
1950 * Set a property on a Stateful instance
1953 * Set a property on a Stateful instance
1951 */
1954 */
1952 set<K extends keyof T & string>(name: K, value: T[K]): this;
1955 set<K extends keyof T & string>(name: K, value: T[K]): this;
1953 set<K extends { [p in keyof T]: T[p] extends any[] ? p : never; }[keyof T & string] >(name: K, ...values: T[K]): this;
1956 set<K extends { [p in keyof T]: T[p] extends any[] ? p : never; }[keyof T & string] >(name: K, ...values: T[K]): this;
1954 set(values: Partial<T>): this;
1957 set(values: Partial<T>): this;
1955
1958
1956 /**
1959 /**
1957 * Internal helper for directly changing an attribute value.
1960 * Internal helper for directly changing an attribute value.
1958 */
1961 */
1959 _changeAttrValue(name: string, value: any): this;
1962 _changeAttrValue(name: string, value: any): this;
1960
1963
1961 /**
1964 /**
1962 * Watches a property for changes
1965 * Watches a property for changes
1963 */
1966 */
1964 watch(callback:(prop: keyof any, oldValue: any, newValue: any) => void): WatchHandle;
1967 watch(callback:(prop: keyof any, oldValue: any, newValue: any) => void): WatchHandle;
1965 watch<K extends keyof T>(name: K, callback: (prop: K, oldValue: T[K], newValue: T[K]) => void): WatchHandle;
1968 watch<K extends keyof T>(name: K, callback: (prop: K, oldValue: T[K], newValue: T[K]) => void): WatchHandle;
1966 }
1969 }
1967
1970
1968 interface StatefulConstructor extends _base.DeclareConstructor<Stateful> {
1971 interface StatefulConstructor extends _base.DeclareConstructor<Stateful> {
1969 new <T>(params?: Partial<T>): Stateful<T>;
1972 new <T>(params?: Partial<T>): Stateful<T>;
1970 }
1973 }
1971
1974
1972 /* dojo/string */
1975 /* dojo/string */
1973
1976
1974 interface String {
1977 interface String {
1975
1978
1976 /**
1979 /**
1977 * Efficiently escape a string for insertion into HTML (innerHTML or attributes), replacing &, <, >, ", ', and / characters.
1980 * Efficiently escape a string for insertion into HTML (innerHTML or attributes), replacing &, <, >, ", ', and / characters.
1978 */
1981 */
1979 escape(str: string): string;
1982 escape(str: string): string;
1980
1983
1981 /**
1984 /**
1982 * Efficiently replicate a string `n` times.
1985 * Efficiently replicate a string `n` times.
1983 */
1986 */
1984 rep(str: string, num: number): string;
1987 rep(str: string, num: number): string;
1985
1988
1986 /**
1989 /**
1987 * Pad a string to guarantee that it is at least `size` length by
1990 * Pad a string to guarantee that it is at least `size` length by
1988 * filling with the character `ch` at either the start or end of the
1991 * filling with the character `ch` at either the start or end of the
1989 * string. Pads at the start, by default.
1992 * string. Pads at the start, by default.
1990 */
1993 */
1991 pad(text: string, size: number, ch?: string, end?: boolean): string;
1994 pad(text: string, size: number, ch?: string, end?: boolean): string;
1992
1995
1993 /**
1996 /**
1994 * Performs parameterized substitutions on a string. Throws an
1997 * Performs parameterized substitutions on a string. Throws an
1995 * exception if any parameter is unmatched.
1998 * exception if any parameter is unmatched.
1996 */
1999 */
1997 substitute(template: string, map: Object | any[], transform?: (value: any, key: string) => any, thisObject?: Object): string;
2000 substitute(template: string, map: Object | any[], transform?: (value: any, key: string) => any, thisObject?: Object): string;
1998
2001
1999 /**
2002 /**
2000 * Trims whitespace from both sides of the string
2003 * Trims whitespace from both sides of the string
2001 */
2004 */
2002 trim(str: string): string;
2005 trim(str: string): string;
2003 }
2006 }
2004
2007
2005 /* dojo/text */
2008 /* dojo/text */
2006
2009
2007 /**
2010 /**
2008 * A getter and setter for storing the string content associated with the
2011 * A getter and setter for storing the string content associated with the
2009 * module and url arguments.
2012 * module and url arguments.
2010 */
2013 */
2011 interface Cache {
2014 interface Cache {
2012 (module: string | GenericObject, url: string, value?: string | { value: string, sanitize?: boolean }): string;
2015 (module: string | GenericObject, url: string, value?: string | { value: string, sanitize?: boolean }): string;
2013 }
2016 }
2014
2017
2015 interface Text {
2018 interface Text {
2016 /**
2019 /**
2017 * the dojo/text caches it's own resources because of dojo.cache
2020 * the dojo/text caches it's own resources because of dojo.cache
2018 */
2021 */
2019 dynamic: boolean;
2022 dynamic: boolean;
2020
2023
2021 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
2024 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
2022
2025
2023 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
2026 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
2024 }
2027 }
2025
2028
2026 /* dojo/throttle */
2029 /* dojo/throttle */
2027
2030
2028 interface Throttle {
2031 interface Throttle {
2029 <T extends Function>(cb: T, wait: number): T;
2032 <T extends Function>(cb: T, wait: number): T;
2030 }
2033 }
2031
2034
2032 /* dojo/topic */
2035 /* dojo/topic */
2033
2036
2034 interface Topic {
2037 interface Topic {
2035 /**
2038 /**
2036 * Publishes a message to a topic on the pub/sub hub. All arguments after
2039 * Publishes a message to a topic on the pub/sub hub. All arguments after
2037 * the first will be passed to the subscribers, so any number of arguments
2040 * the first will be passed to the subscribers, so any number of arguments
2038 * can be provided (not just event).
2041 * can be provided (not just event).
2039 */
2042 */
2040 publish(topic: string | ExtensionEvent, ...event: any[]): boolean;
2043 publish(topic: string | ExtensionEvent, ...event: any[]): boolean;
2041
2044
2042 /**
2045 /**
2043 * Subscribes to a topic on the pub/sub hub
2046 * Subscribes to a topic on the pub/sub hub
2044 */
2047 */
2045 subscribe(topic: string | ExtensionEvent, listener: EventListener | Function): Handle;
2048 subscribe(topic: string | ExtensionEvent, listener: EventListener | Function): Handle;
2046 }
2049 }
2047
2050
2048 /* dojo/touch */
2051 /* dojo/touch */
2049
2052
2050 interface Touch {
2053 interface Touch {
2051 press: ExtensionEvent;
2054 press: ExtensionEvent;
2052 move: ExtensionEvent;
2055 move: ExtensionEvent;
2053 release: ExtensionEvent;
2056 release: ExtensionEvent;
2054 cancel: ExtensionEvent;
2057 cancel: ExtensionEvent;
2055 over: ExtensionEvent;
2058 over: ExtensionEvent;
2056 out: ExtensionEvent;
2059 out: ExtensionEvent;
2057 enter: ExtensionEvent;
2060 enter: ExtensionEvent;
2058 leave: ExtensionEvent;
2061 leave: ExtensionEvent;
2059 }
2062 }
2060
2063
2061 /* dojo/uacss */
2064 /* dojo/uacss */
2062
2065
2063 /* rexports has after adding classes to dom */
2066 /* rexports has after adding classes to dom */
2064
2067
2065 /* dojo/when */
2068 /* dojo/when */
2066
2069
2067 interface When {
2070 interface When {
2068 /**
2071 /**
2069 * Transparently applies callbacks to values and/or promises.
2072 * Transparently applies callbacks to values and/or promises.
2070 */
2073 */
2071 <T>(value: T | dojo.promise.Promise<T>): dojo.promise.Promise<T>;
2074 <T>(value: T | dojo.promise.Promise<T>): dojo.promise.Promise<T>;
2072 <T>(value: T | dojo.promise.Promise<T>,
2075 <T>(value: T | dojo.promise.Promise<T>,
2073 callback?: dojo.promise.PromiseCallback<T, T>,
2076 callback?: dojo.promise.PromiseCallback<T, T>,
2074 errback?: dojo.promise.PromiseErrback<T>,
2077 errback?: dojo.promise.PromiseErrback<T>,
2075 progress?: dojo.promise.PromiseProgback): T | dojo.promise.Promise<T>;
2078 progress?: dojo.promise.PromiseProgback): T | dojo.promise.Promise<T>;
2076 <T, U>(value: T | dojo.promise.Promise<T>,
2079 <T, U>(value: T | dojo.promise.Promise<T>,
2077 callback?: dojo.promise.PromiseCallback<T, U>,
2080 callback?: dojo.promise.PromiseCallback<T, U>,
2078 errback?: dojo.promise.PromiseErrback<U>,
2081 errback?: dojo.promise.PromiseErrback<U>,
2079 progress?: dojo.promise.PromiseProgback): U | dojo.promise.Promise<U>;
2082 progress?: dojo.promise.PromiseProgback): U | dojo.promise.Promise<U>;
2080 }
2083 }
2081
2084
2082 /* dojo/window */
2085 /* dojo/window */
2083
2086
2084 interface WindowModule {
2087 interface WindowModule {
2085
2088
2086 /**
2089 /**
2087 * Returns the dimensions and scroll position of the viewable area of a browser window
2090 * Returns the dimensions and scroll position of the viewable area of a browser window
2088 */
2091 */
2089 getBox(doc?: Document): DomGeometryBox;
2092 getBox(doc?: Document): DomGeometryBox;
2090
2093
2091 /**
2094 /**
2092 * Get window object associated with document doc.
2095 * Get window object associated with document doc.
2093 */
2096 */
2094 get(doc?: Document): Window;
2097 get(doc?: Document): Window;
2095
2098
2096 /**
2099 /**
2097 * Scroll the passed node into view using minimal movement, if it is not already.
2100 * Scroll the passed node into view using minimal movement, if it is not already.
2098 */
2101 */
2099 scrollIntoView(node: Element, pos?: DomGeometryXYBox): void;
2102 scrollIntoView(node: Element, pos?: DomGeometryXYBox): void;
2100 }
2103 }
2101 }
2104 }
@@ -1,23 +1,24
1 {
1 {
2 "extends": "../tsconfig",
2 "extends": "../tsconfig",
3 "compilerOptions": {
3 "compilerOptions": {
4 "baseUrl": ".",
4 "baseUrl": ".",
5 "rootDir": "ts",
5 "rootDir": "ts",
6 "rootDirs": [
6 "rootDirs": [
7 "ts",
7 "ts",
8 "typings",
8 "typings",
9 "../main/ts"
9 "../main/ts"
10 ],
10 ],
11 "types": [
11 "types": [
12 "requirejs",
12 "requirejs",
13 "../main/typings"
13 "../main/typings",
14 "../main/typings/dojo/NodeList-fx"
14 ],
15 ],
15 "module": "ESNext",
16 "module": "ESNext",
16 "target": "ESNext"
17 "target": "ESNext"
17 },
18 },
18 "include": [
19 "include": [
19 "typings/**/*.ts",
20 "typings/**/*.ts",
20 "ts/**/*.ts",
21 "ts/**/*.ts",
21 "ts/**/*.tsx"
22 "ts/**/*.tsx"
22 ]
23 ]
23 } No newline at end of file
24 }
General Comments 0
You need to be logged in to leave comments. Login now