##// END OF EJS Templates
added type parameter to Evented<T>, T is the event map...
cin -
r10:641c326d4bb4 v1.0.2 default
parent child
Show More
@@ -0,0 +1,16
1 import * as Evented from "dojo/Evented";
2
3 interface DoorEvents {
4 open: { authorized: boolean }
5 close: void
6 }
7
8 const door = new Evented<DoorEvents>();
9
10 door.on("open", evt => evt.authorized);
11
12 door.on<any>("location-change", (x,y,z) => x+y+z);
13
14 door.emit("open", { authorized: false });
15 door.emit("close");
16 door.emit<any>("location-change");
@@ -1,70 +1,74
1 import org.gradle.internal.os.OperatingSystem;
1 import org.gradle.internal.os.OperatingSystem;
2
2
3 plugins {
3 plugins {
4 id "org.implab.gradle-typescript" version "1.3.4"
4 id "org.implab.gradle-typescript" version "1.3.4"
5 }
5 }
6
6
7 def isWindows = OperatingSystem.current().isWindows();
7 def isWindows = OperatingSystem.current().isWindows();
8
8
9 npm {
9 npm {
10 npmCmd = isWindows ? 'npm.cmd' : 'npm';
10 npmCmd = isWindows ? 'npm.cmd' : 'npm';
11 }
11 }
12
12
13 sources {
13 sources {
14 main { me ->
14 main { me ->
15 ts {
15 ts {
16 // to check typings with the compiler
16 // to check typings with the compiler
17 srcDir me.typings
17 srcDir me.typings
18 }
18 }
19 }
19 }
20 }
20 }
21
21
22 typescript {
22 typescript {
23 compilerOptions {
23 compilerOptions {
24 lib = ["es5", "dom", "scripthost", "es2015.promise", "es2015.symbol", "es2015.iterable"]
24 lib = ["es5", "dom", "scripthost", "es2015.promise", "es2015.symbol", "es2015.iterable"]
25 declaration = true
25 declaration = true
26 types = ["requirejs"]
26 types = ["requirejs"]
27 module = "amd"
27 module = "amd"
28 it.target = "es5"
28 it.target = "es5"
29 moduleResolution = "node"
29 moduleResolution = "node"
30 // traceResolution = true
30 // traceResolution = true
31
31
32 }
32 }
33
33
34 // для Π²Π°Ρ€ΠΈΠ°Π½Ρ‚Π° с Π»ΠΎΠΊΠ°Π»ΡŒΠ½Ρ‹ΠΌΠΈ tsc, eslint, tslint
34 // для Π²Π°Ρ€ΠΈΠ°Π½Ρ‚Π° с Π»ΠΎΠΊΠ°Π»ΡŒΠ½Ρ‹ΠΌΠΈ tsc, eslint, tslint
35 tscCmd = "${projectDir}/node_modules/.bin/" + (isWindows ? 'tsc.cmd' : 'tsc')
35 tscCmd = "${projectDir}/node_modules/.bin/" + (isWindows ? 'tsc.cmd' : 'tsc')
36 esLintCmd = "${projectDir}/node_modules/.bin/" + (isWindows ? 'eslint.cmd' : 'eslint')
36 esLintCmd = "${projectDir}/node_modules/.bin/" + (isWindows ? 'eslint.cmd' : 'eslint')
37 tsLintCmd = "${projectDir}/node_modules/.bin/" + (isWindows ? 'tslint.cmd' : 'tslint')
37 tsLintCmd = "${projectDir}/node_modules/.bin/" + (isWindows ? 'tslint.cmd' : 'tslint')
38 }
38 }
39
39
40 configureTsTest {
40 configureTsTest {
41 compilerOptions {
41 compilerOptions {
42 types = ["../main/typings/dojo/modules","../main/typings/dijit/modules"]
42 types = [
43 "../main/typings/dojo/modules",
44 "../main/typings/dijit/modules",
45 "../main/typings/dojo/NodeList-fx"
46 ]
43 module = "ESNext"
47 module = "ESNext"
44 it.target = "ESNext"
48 it.target = "ESNext"
45 }
49 }
46 }
50 }
47
51
48 npmPackMeta {
52 npmPackMeta {
49 meta {
53 meta {
50 name = "@$npmScope/$project.name"
54 name = "@$npmScope/$project.name"
51 }
55 }
52 }
56 }
53
57
54 task npmPackTypings(type: Copy) {
58 task npmPackTypings(type: Copy) {
55 dependsOn typings
59 dependsOn typings
56
60
57 npmPackContents.dependsOn it
61 npmPackContents.dependsOn it
58
62
59 from typescript.typingsDir
63 from typescript.typingsDir
60 into npm.packageDir
64 into npm.packageDir
61 }
65 }
62
66
63 task printVersion {
67 task printVersion {
64 doLast {
68 doLast {
65 println "packageName: ${npmPackMeta.metadata.get().name}";
69 println "packageName: ${npmPackMeta.metadata.get().name}";
66 println "version: $version";
70 println "version: $version";
67 println "target: $typescript.compilerOptions.target";
71 println "target: $typescript.compilerOptions.target";
68 println "module: $typescript.compilerOptions.module";
72 println "module: $typescript.compilerOptions.module";
69 }
73 }
70 } No newline at end of file
74 }
@@ -1,2384 +1,2369
1 /// <reference path="../dojo/index.d.ts" />
1 /// <reference path="../dojo/index.d.ts" />
2 /// <reference path="form.d.ts" />
2 /// <reference path="form.d.ts" />
3 /// <reference path="layout.d.ts" />
3 /// <reference path="layout.d.ts" />
4
4
5 declare namespace dijit {
5 declare namespace dijit {
6 /* Global Dijit Interface */
6 /* Global Dijit Interface */
7 interface Dijit { }
7 interface Dijit { }
8
8
9 /* dijit/_AttachMixin */
9 /* dijit/_AttachMixin */
10
10
11 /* tslint:disable:class-name */
11 /* tslint:disable:class-name */
12
12
13 interface _WidgetBase {
13 interface _WidgetBase {
14 dojoAttachEvent: string;
14 dojoAttachEvent: string;
15 dojoAttachPoint: string;
15 dojoAttachPoint: string;
16 }
16 }
17
17
18 interface _AttachMixin {
18 interface _AttachMixin {
19 /**
19 /**
20 * List of widget attribute names associated with data-dojo-attach-point=... in the template, ex: ["containerNode", "labelNode"]
20 * List of widget attribute names associated with data-dojo-attach-point=... in the template, ex: ["containerNode", "labelNode"]
21 */
21 */
22 _attachPoints: string[];
22 _attachPoints: string[];
23
23
24 /**
24 /**
25 * List of connections associated with data-dojo-attach-event=... in the template
25 * List of connections associated with data-dojo-attach-event=... in the template
26 */
26 */
27 _attachEvents: dojo.Handle[];
27 _attachEvents: dojo.Handle[];
28
28
29 /**
29 /**
30 * Object to which attach points and events will be scoped. Defaults to 'this'.
30 * Object to which attach points and events will be scoped. Defaults to 'this'.
31 */
31 */
32 attachScope: any;
32 attachScope: any;
33
33
34 /**
34 /**
35 * Search descendants of this.containerNode for data-dojo-attach-point and data-dojo-attach-event.
35 * Search descendants of this.containerNode for data-dojo-attach-point and data-dojo-attach-event.
36 *
36 *
37 * Should generally be left false (the default value) both for performance and to avoid failures when this.containerNode holds other _AttachMixin instances with their own attach points and events.
37 * Should generally be left false (the default value) both for performance and to avoid failures when this.containerNode holds other _AttachMixin instances with their own attach points and events.
38 */
38 */
39 searchContainerNode: boolean;
39 searchContainerNode: boolean;
40
40
41 /**
41 /**
42 * Attach to DOM nodes marked with special attributes.
42 * Attach to DOM nodes marked with special attributes.
43 */
43 */
44 buildRendering(): void;
44 buildRendering(): void;
45
45
46 /**
46 /**
47 * hook for _WidgetsInTemplateMixin
47 * hook for _WidgetsInTemplateMixin
48 */
48 */
49 _beforeFillContent(): void;
49 _beforeFillContent(): void;
50
50
51 /**
51 /**
52 * Iterate through the dom nodes and attach functions and nodes accordingly.
52 * Iterate through the dom nodes and attach functions and nodes accordingly.
53 *
53 *
54 * Map widget properties and functions to the handlers specified in the dom node and it's descendants. This function iterates over all nodes and looks for these properties:
54 * Map widget properties and functions to the handlers specified in the dom node and it's descendants. This function iterates over all nodes and looks for these properties:
55 * - dojoAttachPoint/data-dojo-attach-point
55 * - dojoAttachPoint/data-dojo-attach-point
56 * - dojoAttachEvent/data-dojo-attach-event
56 * - dojoAttachEvent/data-dojo-attach-event
57 */
57 */
58 _attachTemplateNodes(rootNode: Element | Node): void;
58 _attachTemplateNodes(rootNode: Element | Node): void;
59
59
60 /**
60 /**
61 * Process data-dojo-attach-point and data-dojo-attach-event for given node or widget.
61 * Process data-dojo-attach-point and data-dojo-attach-event for given node or widget.
62 *
62 *
63 * Returns true if caller should process baseNode's children too.
63 * Returns true if caller should process baseNode's children too.
64 */
64 */
65 _processTemplateNode<T extends (Element | Node | _WidgetBase)>(
65 _processTemplateNode<T extends (Element | Node | _WidgetBase)>(
66 baseNode: T,
66 baseNode: T,
67 getAttrFunc: (baseNode: T, attr: string) => string,
67 getAttrFunc: (baseNode: T, attr: string) => string,
68 attachFunc: (node: T, type: string, func?: Function) => dojo.Handle
68 attachFunc: (node: T, type: string, func?: Function) => dojo.Handle
69 ): boolean;
69 ): boolean;
70
70
71 /**
71 /**
72 * Roughly corresponding to dojo/on, this is the default function for processing a data-dojo-attach-event. Meant to attach to DOMNodes, not to widgets.
72 * Roughly corresponding to dojo/on, this is the default function for processing a data-dojo-attach-event. Meant to attach to DOMNodes, not to widgets.
73 */
73 */
74 _attach(node: Element | Node, type: string, func?: Function): dojo.Handle;
74 _attach(node: Element | Node, type: string, func?: Function): dojo.Handle;
75
75
76 /**
76 /**
77 * Detach and clean up the attachments made in _attachtempalteNodes.
77 * Detach and clean up the attachments made in _attachtempalteNodes.
78 */
78 */
79 _detachTemplateNodes(): void;
79 _detachTemplateNodes(): void;
80
80
81 destroyRendering(preserveDom?: boolean): void;
81 destroyRendering(preserveDom?: boolean): void;
82 }
82 }
83
83
84 interface _AttachMixinConstructor extends dojo._base.DeclareConstructor<_AttachMixin> { }
84 interface _AttachMixinConstructor extends dojo._base.DeclareConstructor<_AttachMixin> { }
85
85
86 /* dijit/_BidiMixin */
86 /* dijit/_BidiMixin */
87
87
88 interface _WidgetBase {
88 interface _WidgetBase {
89
89
90 /**
90 /**
91 * Gets the right direction of text.
91 * Gets the right direction of text.
92 */
92 */
93 getTextDir(text: string): string;
93 getTextDir(text: string): string;
94
94
95 /**
95 /**
96 * Set element.dir according to this.textDir, assuming this.textDir has a value.
96 * Set element.dir according to this.textDir, assuming this.textDir has a value.
97 */
97 */
98 applyTextDir(element: HTMLElement, text?: string): void;
98 applyTextDir(element: HTMLElement, text?: string): void;
99
99
100 /**
100 /**
101 * Wraps by UCC (Unicode control characters) option's text according to this.textDir
101 * Wraps by UCC (Unicode control characters) option's text according to this.textDir
102 */
102 */
103 enforceTextDirWithUcc(option: HTMLOptionElement, text: string): string;
103 enforceTextDirWithUcc(option: HTMLOptionElement, text: string): string;
104
104
105 /**
105 /**
106 * Restores the text of origObj, if needed, after enforceTextDirWithUcc, e.g. set("textDir", textDir).
106 * Restores the text of origObj, if needed, after enforceTextDirWithUcc, e.g. set("textDir", textDir).
107 */
107 */
108 restoreOriginalText(origObj: HTMLOptionElement): HTMLOptionElement;
108 restoreOriginalText(origObj: HTMLOptionElement): HTMLOptionElement;
109 }
109 }
110
110
111 /* dijit/_ConfirmDialogMixin */
111 /* dijit/_ConfirmDialogMixin */
112
112
113 interface _ConfirmDialogMixin extends _WidgetsInTemplateMixin {
113 interface _ConfirmDialogMixin extends _WidgetsInTemplateMixin {
114 /**
114 /**
115 * HTML snippet for action bar, overrides _DialogMixin.actionBarTemplate
115 * HTML snippet for action bar, overrides _DialogMixin.actionBarTemplate
116 */
116 */
117 actionBarTemplate: string;
117 actionBarTemplate: string;
118
118
119 /**
119 /**
120 * Label of OK button.
120 * Label of OK button.
121 */
121 */
122 buttonOk: string;
122 buttonOk: string;
123
123
124 /**
124 /**
125 * Label of cancel button.
125 * Label of cancel button.
126 */
126 */
127 buttonCancel: string;
127 buttonCancel: string;
128 }
128 }
129
129
130 /* dijit/_Contained */
130 /* dijit/_Contained */
131
131
132 interface _Contained {
132 interface _Contained {
133 /**
133 /**
134 * Returns the previous child of the parent or null if this is the
134 * Returns the previous child of the parent or null if this is the
135 * first child of the parent.
135 * first child of the parent.
136 */
136 */
137 getPreviousSibling<T extends _WidgetBase>(): T;
137 getPreviousSibling<T extends _WidgetBase>(): T;
138
138
139 /**
139 /**
140 * Returns the next child of the parent or null if this is the last
140 * Returns the next child of the parent or null if this is the last
141 * child of the parent.
141 * child of the parent.
142 */
142 */
143 getNextSibling<T extends _WidgetBase>(): T;
143 getNextSibling<T extends _WidgetBase>(): T;
144
144
145 /**
145 /**
146 * Returns the index of this widget within its container parent.
146 * Returns the index of this widget within its container parent.
147 * It returns -1 if the parent does not exist or if the parent is
147 * It returns -1 if the parent does not exist or if the parent is
148 * not a dijit/_Container.
148 * not a dijit/_Container.
149 */
149 */
150 getIndexInParent(): number;
150 getIndexInParent(): number;
151 }
151 }
152
152
153 interface _ContainedConstructor extends dojo._base.DeclareConstructor<_Contained> { }
153 interface _ContainedConstructor extends dojo._base.DeclareConstructor<_Contained> { }
154
154
155 /* dijit/_Container */
155 /* dijit/_Container */
156
156
157 interface _Container {
157 interface _Container {
158 buildRendering(): void;
158 buildRendering(): void;
159
159
160 /**
160 /**
161 * Makes the given widget a child of this widget.
161 * Makes the given widget a child of this widget.
162 */
162 */
163 addChild<T extends _WidgetBase>(widget: T, insertIndex?: number): void;
163 addChild<T extends _WidgetBase>(widget: T, insertIndex?: number): void;
164
164
165 /**
165 /**
166 * Removes the passed widget instance from this widget but does
166 * Removes the passed widget instance from this widget but does
167 * not destroy it. You can also pass in an integer indicating
167 * not destroy it. You can also pass in an integer indicating
168 * the index within the container to remove (ie, removeChild(5) removes the sixth widget)
168 * the index within the container to remove (ie, removeChild(5) removes the sixth widget)
169 */
169 */
170 removeChild<T extends _WidgetBase>(widget: T): void;
170 removeChild<T extends _WidgetBase>(widget: T): void;
171 removeChild<T extends number>(widget: number): void;
171 removeChild<T extends number>(widget: number): void;
172
172
173 /**
173 /**
174 * Returns true if widget has child widgets, i.e. if this.containerNode contains widgets.
174 * Returns true if widget has child widgets, i.e. if this.containerNode contains widgets.
175 */
175 */
176 hasChildren(): boolean;
176 hasChildren(): boolean;
177
177
178 /**
178 /**
179 * Gets the index of the child in this container or -1 if not found
179 * Gets the index of the child in this container or -1 if not found
180 */
180 */
181 getIndexOfChild<T extends _WidgetBase>(widget: T): number;
181 getIndexOfChild<T extends _WidgetBase>(widget: T): number;
182 }
182 }
183
183
184 interface _ContainerConstructor extends dojo._base.DeclareConstructor<_Container> { }
184 interface _ContainerConstructor extends dojo._base.DeclareConstructor<_Container> { }
185
185
186 /* dijit/_CssStateMixin */
186 /* dijit/_CssStateMixin */
187
187
188 interface CSSStateNodes {
188 interface CSSStateNodes {
189 [node: string]: string;
189 [node: string]: string;
190 }
190 }
191
191
192 interface _CssStateMixin {
192 interface _CssStateMixin {
193 /**
193 /**
194 * True if cursor is over this widget
194 * True if cursor is over this widget
195 */
195 */
196 hovering: boolean;
196 hovering: boolean;
197
197
198 /**
198 /**
199 * True if mouse was pressed while over this widget, and hasn't been released yet
199 * True if mouse was pressed while over this widget, and hasn't been released yet
200 */
200 */
201 active: boolean;
201 active: boolean;
202 }
202 }
203
203
204 interface _CssStateMixinConstructor extends dojo._base.DeclareConstructor<_CssStateMixin> { }
204 interface _CssStateMixinConstructor extends dojo._base.DeclareConstructor<_CssStateMixin> { }
205
205
206 /* dijit/_DialogMixin */
206 /* dijit/_DialogMixin */
207
207
208 interface _DialogMixin {
208 interface _DialogMixin {
209 /**
209 /**
210 * HTML snippet to show the action bar (gray bar with OK/cancel buttons).
210 * HTML snippet to show the action bar (gray bar with OK/cancel buttons).
211 * Blank by default, but used by ConfirmDialog/ConfirmTooltipDialog subclasses.
211 * Blank by default, but used by ConfirmDialog/ConfirmTooltipDialog subclasses.
212 */
212 */
213 actionBarTemplate: string;
213 actionBarTemplate: string;
214
214
215 /**
215 /**
216 * Callback when the user hits the submit button.
216 * Callback when the user hits the submit button.
217 * Override this method to handle Dialog execution.
217 * Override this method to handle Dialog execution.
218 */
218 */
219 execute(formContents?: any): void;
219 execute(formContents?: any): void;
220
220
221 /**
221 /**
222 * Called when user has pressed the Dialog's cancel button, to notify container.
222 * Called when user has pressed the Dialog's cancel button, to notify container.
223 */
223 */
224 onCancel(): void;
224 onCancel(): void;
225
225
226 /**
226 /**
227 * Called when user has pressed the dialog's OK button, to notify container.
227 * Called when user has pressed the dialog's OK button, to notify container.
228 */
228 */
229 onExecute(): void;
229 onExecute(): void;
230 }
230 }
231
231
232 /* dijit/_FocusMixin */
232 /* dijit/_FocusMixin */
233 interface _FocusMixin { }
233 interface _FocusMixin { }
234
234
235 interface _WidgetBase {
235 interface _WidgetBase {
236 /**
236 /**
237 * Called when the widget becomes "active" because
237 * Called when the widget becomes "active" because
238 * it or a widget inside of it either has focus, or has recently
238 * it or a widget inside of it either has focus, or has recently
239 * been clicked.
239 * been clicked.
240 */
240 */
241 onFocus(): void;
241 onFocus(): void;
242
242
243 /**
243 /**
244 * Called when the widget stops being "active" because
244 * Called when the widget stops being "active" because
245 * focus moved to something outside of it, or the user
245 * focus moved to something outside of it, or the user
246 * clicked somewhere outside of it, or the widget was
246 * clicked somewhere outside of it, or the widget was
247 * hidden.
247 * hidden.
248 */
248 */
249 onBlur(): void;
249 onBlur(): void;
250 }
250 }
251
251
252 /* dijit/_HasDropDown */
252 /* dijit/_HasDropDown */
253
253
254 interface _HasDropDown<T extends _WidgetBase> extends _FocusMixin {
254 interface _HasDropDown<T extends _WidgetBase> extends _FocusMixin {
255 /**
255 /**
256 * The button/icon/node to click to display the drop down.
256 * The button/icon/node to click to display the drop down.
257 * Can be set via a data-dojo-attach-point assignment.
257 * Can be set via a data-dojo-attach-point assignment.
258 * If missing, then either focusNode or domNode (if focusNode is also missing) will be used.
258 * If missing, then either focusNode or domNode (if focusNode is also missing) will be used.
259 */
259 */
260 _buttonNode: HTMLElement;
260 _buttonNode: HTMLElement;
261
261
262 /**
262 /**
263 * Will set CSS class dijitUpArrow, dijitDownArrow, dijitRightArrow etc. on this node depending
263 * Will set CSS class dijitUpArrow, dijitDownArrow, dijitRightArrow etc. on this node depending
264 * on where the drop down is set to be positioned.
264 * on where the drop down is set to be positioned.
265 * Can be set via a data-dojo-attach-point assignment.
265 * Can be set via a data-dojo-attach-point assignment.
266 * If missing, then _buttonNode will be used.
266 * If missing, then _buttonNode will be used.
267 */
267 */
268 _arrowWrapperNode: HTMLElement;
268 _arrowWrapperNode: HTMLElement;
269
269
270 /**
270 /**
271 * The node to set the aria-expanded class on.
271 * The node to set the aria-expanded class on.
272 * Also sets popupActive class but that will be removed in 2.0.
272 * Also sets popupActive class but that will be removed in 2.0.
273 * Can be set via a data-dojo-attach-point assignment.
273 * Can be set via a data-dojo-attach-point assignment.
274 * If missing, then focusNode or _buttonNode (if focusNode is missing) will be used.
274 * If missing, then focusNode or _buttonNode (if focusNode is missing) will be used.
275 */
275 */
276 _popupStateNode: HTMLElement;
276 _popupStateNode: HTMLElement;
277
277
278 /**
278 /**
279 * The node to display the popup around.
279 * The node to display the popup around.
280 * Can be set via a data-dojo-attach-point assignment.
280 * Can be set via a data-dojo-attach-point assignment.
281 * If missing, then domNode will be used.
281 * If missing, then domNode will be used.
282 */
282 */
283 _aroundNode: HTMLElement;
283 _aroundNode: HTMLElement;
284
284
285 /**
285 /**
286 * The widget to display as a popup. This widget *must* be
286 * The widget to display as a popup. This widget *must* be
287 * defined before the startup function is called.
287 * defined before the startup function is called.
288 */
288 */
289 dropDown: T;
289 dropDown: T;
290
290
291 /**
291 /**
292 * Set to true to make the drop down at least as wide as this
292 * Set to true to make the drop down at least as wide as this
293 * widget. Set to false if the drop down should just be its
293 * widget. Set to false if the drop down should just be its
294 * default width.
294 * default width.
295 */
295 */
296 autoWidth: boolean;
296 autoWidth: boolean;
297
297
298 /**
298 /**
299 * Set to true to make the drop down exactly as wide as this
299 * Set to true to make the drop down exactly as wide as this
300 * widget. Overrides autoWidth.
300 * widget. Overrides autoWidth.
301 */
301 */
302 forceWidth: boolean;
302 forceWidth: boolean;
303
303
304 /**
304 /**
305 * The max height for our dropdown.
305 * The max height for our dropdown.
306 * Any dropdown taller than this will have scrollbars.
306 * Any dropdown taller than this will have scrollbars.
307 * Set to 0 for no max height, or -1 to limit height to available space in viewport
307 * Set to 0 for no max height, or -1 to limit height to available space in viewport
308 */
308 */
309 maxHeight: number;
309 maxHeight: number;
310
310
311 /**
311 /**
312 * This variable controls the position of the drop down.
312 * This variable controls the position of the drop down.
313 * It's an array of strings
313 * It's an array of strings
314 */
314 */
315 dropDownPosition: string[];
315 dropDownPosition: string[];
316 /* TODO remove for TS 1.8 */
316 /* TODO remove for TS 1.8 */
317 /* dropDownPosition: ('before' | 'after' | 'above' | 'below')[]; */
317 /* dropDownPosition: ('before' | 'after' | 'above' | 'below')[]; */
318
318
319 /**
319 /**
320 * When set to false, the click events will not be stopped, in
320 * When set to false, the click events will not be stopped, in
321 * case you want to use them in your subclass
321 * case you want to use them in your subclass
322 */
322 */
323 _stopClickEvents: boolean;
323 _stopClickEvents: boolean;
324
324
325 /**
325 /**
326 * Callback when the user mousedown/touchstart on the arrow icon.
326 * Callback when the user mousedown/touchstart on the arrow icon.
327 */
327 */
328 _onDropDownMouseDown(e: MouseEvent): void;
328 _onDropDownMouseDown(e: MouseEvent): void;
329
329
330 /**
330 /**
331 * Callback on mouseup/touchend after mousedown/touchstart on the arrow icon.
331 * Callback on mouseup/touchend after mousedown/touchstart on the arrow icon.
332 * Note that this function is called regardless of what node the event occurred on (but only after
332 * Note that this function is called regardless of what node the event occurred on (but only after
333 * a mousedown/touchstart on the arrow).
333 * a mousedown/touchstart on the arrow).
334 */
334 */
335 _onDropDownMouseUp(e?: MouseEvent): void;
335 _onDropDownMouseUp(e?: MouseEvent): void;
336
336
337 /**
337 /**
338 * The drop down was already opened on mousedown/keydown; just need to stop the event
338 * The drop down was already opened on mousedown/keydown; just need to stop the event
339 */
339 */
340 _onDropDownClick(e: MouseEvent): void;
340 _onDropDownClick(e: MouseEvent): void;
341
341
342 buildRendering(): void;
342 buildRendering(): void;
343 postCreate(): void;
343 postCreate(): void;
344 destroy(preserveDom?: boolean): void;
344 destroy(preserveDom?: boolean): void;
345
345
346 /**
346 /**
347 * Returns true if the dropdown exists and it's data is loaded. This can
347 * Returns true if the dropdown exists and it's data is loaded. This can
348 * be overridden in order to force a call to loadDropDown().
348 * be overridden in order to force a call to loadDropDown().
349 */
349 */
350 isLoaded(): boolean;
350 isLoaded(): boolean;
351
351
352 /**
352 /**
353 * Creates the drop down if it doesn't exist, loads the data
353 * Creates the drop down if it doesn't exist, loads the data
354 * if there's an href and it hasn't been loaded yet, and then calls
354 * if there's an href and it hasn't been loaded yet, and then calls
355 * the given callback.
355 * the given callback.
356 */
356 */
357 loadDropDown(loadCallback: () => void): void;
357 loadDropDown(loadCallback: () => void): void;
358
358
359 /**
359 /**
360 * Creates the drop down if it doesn't exist, loads the data
360 * Creates the drop down if it doesn't exist, loads the data
361 * if there's an href and it hasn't been loaded yet, and
361 * if there's an href and it hasn't been loaded yet, and
362 * then opens the drop down. This is basically a callback when the
362 * then opens the drop down. This is basically a callback when the
363 * user presses the down arrow button to open the drop down.
363 * user presses the down arrow button to open the drop down.
364 */
364 */
365 loadAndOpenDropDown(): dojo.Deferred<T>;
365 loadAndOpenDropDown(): dojo.Deferred<T>;
366
366
367 /**
367 /**
368 * Callback when the user presses the down arrow button or presses
368 * Callback when the user presses the down arrow button or presses
369 * the down arrow key to open/close the drop down.
369 * the down arrow key to open/close the drop down.
370 * Toggle the drop-down widget; if it is up, close it, if not, open it
370 * Toggle the drop-down widget; if it is up, close it, if not, open it
371 */
371 */
372 toggleDropDown(): void;
372 toggleDropDown(): void;
373
373
374 /**
374 /**
375 * Opens the dropdown for this widget. To be called only when this.dropDown
375 * Opens the dropdown for this widget. To be called only when this.dropDown
376 * has been created and is ready to display (ie, it's data is loaded).
376 * has been created and is ready to display (ie, it's data is loaded).
377 */
377 */
378 openDropDown(): PlaceLocation;
378 openDropDown(): PlaceLocation;
379
379
380 /**
380 /**
381 * Closes the drop down on this widget
381 * Closes the drop down on this widget
382 */
382 */
383 closeDropDown(focus?: boolean): void;
383 closeDropDown(focus?: boolean): void;
384 }
384 }
385
385
386 /* dijit/_OnDijitClickMixin */
386 /* dijit/_OnDijitClickMixin */
387
387
388 interface _OnDijitClickMixin {
388 interface _OnDijitClickMixin {
389 /**
389 /**
390 * override _WidgetBase.connect() to make this.connect(node, "ondijitclick", ...) work
390 * override _WidgetBase.connect() to make this.connect(node, "ondijitclick", ...) work
391 */
391 */
392 connect(obj: any, event: string | dojo.ExtensionEvent, method: string | dojo.EventListener): dojo.WatchHandle;
392 connect(obj: any, event: string | dojo.ExtensionEvent, method: string | dojo.EventListener): dojo.WatchHandle;
393 }
393 }
394
394
395 interface _OnDijitClickMixinConstructor {
395 interface _OnDijitClickMixinConstructor {
396 /**
396 /**
397 * Deprecated. New code should access the dijit/a11yclick event directly, ex:
397 * Deprecated. New code should access the dijit/a11yclick event directly, ex:
398 * | this.own(on(node, a11yclick, function(){ ... }));
398 * | this.own(on(node, a11yclick, function(){ ... }));
399 *
399 *
400 * Mixing in this class will make _WidgetBase.connect(node, "ondijitclick", ...) work.
400 * Mixing in this class will make _WidgetBase.connect(node, "ondijitclick", ...) work.
401 * It also used to be necessary to make templates with ondijitclick work, but now you can just require
401 * It also used to be necessary to make templates with ondijitclick work, but now you can just require
402 * dijit/a11yclick.
402 * dijit/a11yclick.
403 */
403 */
404 new(): _OnDijitClickMixin;
404 new(): _OnDijitClickMixin;
405 a11yclick: A11yClick;
405 a11yclick: A11yClick;
406 }
406 }
407
407
408 /* dijit/_TemplatedMixin */
408 /* dijit/_TemplatedMixin */
409
409
410 interface _TemplatedMixin extends _AttachMixin {
410 interface _TemplatedMixin extends _AttachMixin {
411
411
412 /**
412 /**
413 * A string that represents the widget template.
413 * A string that represents the widget template.
414 * Use in conjunction with dojo.cache() to load from a file.
414 * Use in conjunction with dojo.cache() to load from a file.
415 */
415 */
416 templateString: string;
416 templateString: string;
417
417
418 /**
418 /**
419 * Path to template (HTML file) for this widget relative to dojo.baseUrl.
419 * Path to template (HTML file) for this widget relative to dojo.baseUrl.
420 * Deprecated: use templateString with require([... "dojo/text!..."], ...) instead
420 * Deprecated: use templateString with require([... "dojo/text!..."], ...) instead
421 */
421 */
422 templatePath: string;
422 templatePath: string;
423
423
424 /**
424 /**
425 * Set _AttachMixin.searchContainerNode to true for back-compat for widgets that have data-dojo-attach-point's
425 * Set _AttachMixin.searchContainerNode to true for back-compat for widgets that have data-dojo-attach-point's
426 * and events inside this.containerNode. Remove for 2.0.
426 * and events inside this.containerNode. Remove for 2.0.
427 */
427 */
428 searchContainerNode: boolean;
428 searchContainerNode: boolean;
429
429
430 /**
430 /**
431 * Construct the UI for this widget from a template, setting this.domNode.
431 * Construct the UI for this widget from a template, setting this.domNode.
432 */
432 */
433 buildRendering(): void;
433 buildRendering(): void;
434 }
434 }
435
435
436 interface _TemplatedMixinConstructor extends _WidgetBaseConstructor<_TemplatedMixin> {
436 interface _TemplatedMixinConstructor extends _WidgetBaseConstructor<_TemplatedMixin> {
437 /**
437 /**
438 * Static method to get a template based on the templatePath or
438 * Static method to get a template based on the templatePath or
439 * templateString key
439 * templateString key
440 */
440 */
441 getCachedTemplate(templateString: string, alwaysUseString: string, doc?: Document): string | HTMLElement;
441 getCachedTemplate(templateString: string, alwaysUseString: string, doc?: Document): string | HTMLElement;
442 }
442 }
443
443
444 /* dijit/_Widget */
444 /* dijit/_Widget */
445 interface _Widget extends _WidgetBase, _OnDijitClickMixin, _FocusMixin {
445 interface _Widget extends _WidgetBase, _OnDijitClickMixin, _FocusMixin {
446 /**
446 /**
447 * Connect to this function to receive notifications of mouse click events.
447 * Connect to this function to receive notifications of mouse click events.
448 */
448 */
449 onClick(event: MouseEvent): void;
449 onClick(event: MouseEvent): void;
450
450
451 /**
451 /**
452 * Connect to this function to receive notifications of mouse double click events.
452 * Connect to this function to receive notifications of mouse double click events.
453 */
453 */
454 onDblClick(event: MouseEvent): void;
454 onDblClick(event: MouseEvent): void;
455
455
456 /**
456 /**
457 * Connect to this function to receive notifications of keys being pressed down.
457 * Connect to this function to receive notifications of keys being pressed down.
458 */
458 */
459 onKeyDown(event: KeyboardEvent): void;
459 onKeyDown(event: KeyboardEvent): void;
460
460
461 /**
461 /**
462 * Connect to this function to receive notifications of printable keys being typed.
462 * Connect to this function to receive notifications of printable keys being typed.
463 */
463 */
464 onKeyPress(event: KeyboardEvent): void;
464 onKeyPress(event: KeyboardEvent): void;
465
465
466 /**
466 /**
467 * Connect to this function to receive notifications of keys being released.
467 * Connect to this function to receive notifications of keys being released.
468 */
468 */
469 onKeyUp(event: KeyboardEvent): void;
469 onKeyUp(event: KeyboardEvent): void;
470
470
471 /**
471 /**
472 * Connect to this function to receive notifications of when the mouse button is pressed down.
472 * Connect to this function to receive notifications of when the mouse button is pressed down.
473 */
473 */
474 onMouseDown(event: MouseEvent): void;
474 onMouseDown(event: MouseEvent): void;
475
475
476 /**
476 /**
477 * Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
477 * Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
478 */
478 */
479 onMouseMove(event: MouseEvent): void;
479 onMouseMove(event: MouseEvent): void;
480
480
481 /**
481 /**
482 * Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
482 * Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
483 */
483 */
484 onMouseOut(event: MouseEvent): void;
484 onMouseOut(event: MouseEvent): void;
485
485
486 /**
486 /**
487 * Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
487 * Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
488 */
488 */
489 onMouseOver(event: MouseEvent): void;
489 onMouseOver(event: MouseEvent): void;
490
490
491 /**
491 /**
492 * Connect to this function to receive notifications of when the mouse moves off of this widget.
492 * Connect to this function to receive notifications of when the mouse moves off of this widget.
493 */
493 */
494 onMouseLeave(event: MouseEvent): void;
494 onMouseLeave(event: MouseEvent): void;
495
495
496 /**
496 /**
497 * Connect to this function to receive notifications of when the mouse moves onto this widget.
497 * Connect to this function to receive notifications of when the mouse moves onto this widget.
498 */
498 */
499 onMouseEnter(event: MouseEvent): void;
499 onMouseEnter(event: MouseEvent): void;
500
500
501 /**
501 /**
502 * Connect to this function to receive notifications of when the mouse button is released.
502 * Connect to this function to receive notifications of when the mouse button is released.
503 */
503 */
504 onMouseUp(event: MouseEvent): void;
504 onMouseUp(event: MouseEvent): void;
505
505
506 postCreate(): void;
506 postCreate(): void;
507
507
508 /**
508 /**
509 * Deprecated. Use set() instead.
509 * Deprecated. Use set() instead.
510 */
510 */
511 setAttribute(attr: string, value: any): void;
511 setAttribute(attr: string, value: any): void;
512
512
513 /**
513 /**
514 * This method is deprecated, use get() or set() directly.
514 * This method is deprecated, use get() or set() directly.
515 */
515 */
516 attr(name: string | { [attr: string]: any }, value?: any): any;
516 attr(name: string | { [attr: string]: any }, value?: any): any;
517
517
518 /**
518 /**
519 * Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
519 * Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
520 */
520 */
521 getDescendants(): _Widget[];
521 getDescendants(): _Widget[];
522
522
523 /**
523 /**
524 * Called when this widget becomes the selected pane in a
524 * Called when this widget becomes the selected pane in a
525 * `dijit/layout/TabContainer`, `dijit/layout/StackContainer`,
525 * `dijit/layout/TabContainer`, `dijit/layout/StackContainer`,
526 * `dijit/layout/AccordionContainer`, etc.
526 * `dijit/layout/AccordionContainer`, etc.
527 *
527 *
528 * Also called to indicate display of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
528 * Also called to indicate display of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
529 */
529 */
530 onShow(): void;
530 onShow(): void;
531
531
532 /**
532 /**
533 * Called when another widget becomes the selected pane in a
533 * Called when another widget becomes the selected pane in a
534 * `dijit/layout/TabContainer`, `dijit/layout/StackContainer`,
534 * `dijit/layout/TabContainer`, `dijit/layout/StackContainer`,
535 * `dijit/layout/AccordionContainer`, etc.
535 * `dijit/layout/AccordionContainer`, etc.
536 *
536 *
537 * Also called to indicate hide of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
537 * Also called to indicate hide of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
538 */
538 */
539 onHide(): void;
539 onHide(): void;
540
540
541 /**
541 /**
542 * Called when this widget is being displayed as a popup (ex: a Calendar popped
542 * Called when this widget is being displayed as a popup (ex: a Calendar popped
543 * up from a DateTextBox), and it is hidden.
543 * up from a DateTextBox), and it is hidden.
544 * This is called from the dijit.popup code, and should not be called directly.
544 * This is called from the dijit.popup code, and should not be called directly.
545 *
545 *
546 * Also used as a parameter for children of `dijit/layout/StackContainer` or subclasses.
546 * Also used as a parameter for children of `dijit/layout/StackContainer` or subclasses.
547 * Callback if a user tries to close the child. Child will be closed if this function returns true.
547 * Callback if a user tries to close the child. Child will be closed if this function returns true.
548 */
548 */
549 onClose(): boolean;
549 onClose(): boolean;
550 }
550 }
551
551
552 type Props<T> = {
553 [k in Exclude<keyof T, keyof object>] : T[k] extends (...args: any) => any ? never: k;
554 }[ keyof T];
555
556 interface _WidgetBase {
552 interface _WidgetBase {
557 /**
553 /**
558 * Used across all instances a hash to cache attribute names and their getter
554 * Used across all instances a hash to cache attribute names and their getter
559 * and setter names.
555 * and setter names.
560 */
556 */
561 _attrPairNames: { [attr: string]: string };
557 _attrPairNames: { [attr: string]: string };
562
558
563 /**
559 /**
564 * Helper function for get() and set().
560 * Helper function for get() and set().
565 * Caches attribute name values so we don't do the string ops every time.
561 * Caches attribute name values so we don't do the string ops every time.
566 */
562 */
567 _getAttrNames(name: string): string;
563 _getAttrNames(name: string): string;
568
564
569 /**
565 /**
570 * Internal helper for directly changing an attribute value.
566 * Internal helper for directly changing an attribute value.
571 * This method id derived from Stateful and must not be used!
567 * This method id derived from Stateful and must not be used!
572 * @deprecated use `_set(name, value)` instead.
568 * @deprecated use `_set(name, value)` instead.
573 */
569 */
574 _changeAttrValue(name: string, value: any): this;
570 _changeAttrValue(name: string, value: any): this;
575
571
576 get<K extends keyof this>(name: K): this[K];
572 get<K extends keyof this>(name: K): this[K];
577
573
578 /**
574 /**
579 * Helper function to set new value for specified property, and call handlers
575 * Helper function to set new value for specified property, and call handlers
580 * registered with watch() if the value has changed.
576 * registered with watch() if the value has changed.
581 * @param name
577 * @param name
582 * @param value
578 * @param value
583 */
579 */
584 _set<K extends keyof this>(name: K, value: this[K]): void;
580 _set<K extends keyof this>(name: K, value: this[K]): void;
585
581
586 /**
582 /**
587 * Helper function to get value for specified property stored by this._set(),
583 * Helper function to get value for specified property stored by this._set(),
588 * i.e. for properties with custom setters. Used mainly by custom getters.
584 * i.e. for properties with custom setters. Used mainly by custom getters.
589 *
585 *
590 * For example, CheckBox._getValueAttr() calls this._get("value").
586 * For example, CheckBox._getValueAttr() calls this._get("value").
591 * @param name
587 * @param name
592 */
588 */
593 _get<K extends keyof this>(name: K): this[K];
589 _get<K extends keyof this>(name: K): this[K];
594
590
595 /**
591 /**
596 * Set a property on a Stateful instance
592 * Set a property on a Stateful instance
597 */
593 */
598 set<K extends keyof this>(name: K, value: this[K]): this;
594 set<K extends keyof this>(name: K, value: this[K]): this;
599 set<K extends keyof this, V extends this[K] & any[]>(name: K, ...values: V): this;
595 set<K extends keyof this, V extends this[K] & any[]>(name: K, ...values: V): this;
600 set<K extends keyof this>(values: {[p in K]: this[p]}): this;
596 set<K extends keyof this>(values: {[p in K]: this[p]}): this;
601
597
602 /**
598 /**
603 * Watches a property for changes
599 * Watches a property for changes
604 */
600 */
605 watch(callback: <K extends keyof any>(prop: K, oldValue: any, newValue: any) => void): dojo.WatchHandle;
601 watch(callback: <K extends keyof any>(prop: K, oldValue: any, newValue: any) => void): dojo.WatchHandle;
606 watch<K extends Props<this>>(name: K, callback: (prop: K, oldValue: this[K], newValue: this[K]) => void): dojo.WatchHandle;
602 watch<K extends keyof this>(name: K, callback: (prop: K, oldValue: this[K], newValue: this[K]) => void): dojo.WatchHandle;
607 }
603 }
608
604
609 type EventInitArgs<T extends Event> = {
605 type EventInitArgs<T extends Event> = {
610 [p in keyof T]?: T[p] extends (...args: any) => any ? never : T[p];
606 [p in keyof T]?: T[p] extends (...args: any) => any ? never : T[p];
611 };
607 };
612
608
613 /* dijit/_WidgetBase */
609 /* dijit/_WidgetBase */
614 interface _WidgetBase<Events extends { [name in keyof Events]: Event } = GlobalEventHandlersEventMap> extends Destroyable {
610 interface _WidgetBase<Events extends { [name in keyof Events]: Event } = GlobalEventHandlersEventMap> extends Destroyable {
615
611
616 /**
612 /**
617 * A unique, opaque ID string that can be assigned by users or by the
613 * A unique, opaque ID string that can be assigned by users or by the
618 * system. If the developer passes an ID which is known not to be
614 * system. If the developer passes an ID which is known not to be
619 * unique, the specified ID is ignored and the system-generated ID is
615 * unique, the specified ID is ignored and the system-generated ID is
620 * used instead.
616 * used instead.
621 */
617 */
622 id: string;
618 id: string;
623
619
624 /**
620 /**
625 * Rarely used. Overrides the default Dojo locale used to render this widget,
621 * Rarely used. Overrides the default Dojo locale used to render this widget,
626 * as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute.
622 * as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute.
627 * Value must be among the list of locales specified during by the Dojo bootstrap,
623 * Value must be among the list of locales specified during by the Dojo bootstrap,
628 * formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
624 * formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
629 */
625 */
630 lang: string;
626 lang: string;
631
627
632 /**
628 /**
633 * Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir)
629 * Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir)
634 * attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's
630 * attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's
635 * default direction.
631 * default direction.
636 */
632 */
637 dir: string;
633 dir: string;
638
634
639 /**
635 /**
640 * HTML class attribute
636 * HTML class attribute
641 */
637 */
642 class: string;
638 class: string;
643
639
644 /**
640 /**
645 * HTML style attributes as cssText string or name/value hash
641 * HTML style attributes as cssText string or name/value hash
646 */
642 */
647 style: string;
643 style: string;
648
644
649 /**
645 /**
650 * HTML title attribute.
646 * HTML title attribute.
651 *
647 *
652 * For form widgets this specifies a tooltip to display when hovering over
648 * For form widgets this specifies a tooltip to display when hovering over
653 * the widget (just like the native HTML title attribute).
649 * the widget (just like the native HTML title attribute).
654 *
650 *
655 * For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer,
651 * For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer,
656 * etc., it's used to specify the tab label, accordion pane title, etc. In this case it's
652 * etc., it's used to specify the tab label, accordion pane title, etc. In this case it's
657 * interpreted as HTML.
653 * interpreted as HTML.
658 */
654 */
659 title: string;
655 title: string;
660
656
661 /**
657 /**
662 * When this widget's title attribute is used to for a tab label, accordion pane title, etc.,
658 * When this widget's title attribute is used to for a tab label, accordion pane title, etc.,
663 * this specifies the tooltip to appear when the mouse is hovered over that text.
659 * this specifies the tooltip to appear when the mouse is hovered over that text.
664 */
660 */
665 tooltip: string;
661 tooltip: string;
666
662
667 /**
663 /**
668 * Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate
664 * Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate
669 * widget state.
665 * widget state.
670 */
666 */
671 baseClass: string;
667 baseClass: string;
672
668
673 /**
669 /**
674 * pointer to original DOM node
670 * pointer to original DOM node
675 */
671 */
676 srcNodeRef: HTMLElement;
672 srcNodeRef: HTMLElement;
677
673
678 /**
674 /**
679 * This is our visible representation of the widget! Other DOM
675 * This is our visible representation of the widget! Other DOM
680 * Nodes may by assigned to other properties, usually through the
676 * Nodes may by assigned to other properties, usually through the
681 * template system's data-dojo-attach-point syntax, but the domNode
677 * template system's data-dojo-attach-point syntax, but the domNode
682 * property is the canonical "top level" node in widget UI.
678 * property is the canonical "top level" node in widget UI.
683 */
679 */
684 domNode: HTMLElement;
680 domNode: HTMLElement;
685
681
686 /**
682 /**
687 * Designates where children of the source DOM node will be placed.
683 * Designates where children of the source DOM node will be placed.
688 * "Children" in this case refers to both DOM nodes and widgets.
684 * "Children" in this case refers to both DOM nodes and widgets.
689 */
685 */
690 containerNode: HTMLElement;
686 containerNode: HTMLElement;
691
687
692 /**
688 /**
693 * The document this widget belongs to. If not specified to constructor, will default to
689 * The document this widget belongs to. If not specified to constructor, will default to
694 * srcNodeRef.ownerDocument, or if no sourceRef specified, then to the document global
690 * srcNodeRef.ownerDocument, or if no sourceRef specified, then to the document global
695 */
691 */
696 ownerDocument: HTMLElement;
692 ownerDocument: HTMLElement;
697
693
698 /**
694 /**
699 * Deprecated. Instead of attributeMap, widget should have a _setXXXAttr attribute
695 * Deprecated. Instead of attributeMap, widget should have a _setXXXAttr attribute
700 * for each XXX attribute to be mapped to the DOM.
696 * for each XXX attribute to be mapped to the DOM.
701 */
697 */
702 attributeMap: { [attribute: string]: any };
698 attributeMap: { [attribute: string]: any };
703
699
704 /**
700 /**
705 * Bi-directional support, the main variable which is responsible for the direction of the text.
701 * Bi-directional support, the main variable which is responsible for the direction of the text.
706 * The text direction can be different than the GUI direction by using this parameter in creation
702 * The text direction can be different than the GUI direction by using this parameter in creation
707 * of a widget.
703 * of a widget.
708 */
704 */
709 textDir: string;
705 textDir: string;
710
706
711 _started?: boolean;
707 _started?: boolean;
712
708
713 /**
709 /**
714 * Kicks off widget instantiation. See create() for details.
710 * Kicks off widget instantiation. See create() for details.
715 */
711 */
716 postscript(params?: any, srcNodeRef?: HTMLElement): void;
712 postscript(params?: any, srcNodeRef?: HTMLElement): void;
717
713
718 /**
714 /**
719 * Kick off the life-cycle of a widget
715 * Kick off the life-cycle of a widget
720 */
716 */
721 create(params?: any, srcNodeRef?: HTMLElement): void;
717 create(params?: any, srcNodeRef?: HTMLElement): void;
722
718
723 /**
719 /**
724 * Called after the parameters to the widget have been read-in,
720 * Called after the parameters to the widget have been read-in,
725 * but before the widget template is instantiated. Especially
721 * but before the widget template is instantiated. Especially
726 * useful to set properties that are referenced in the widget
722 * useful to set properties that are referenced in the widget
727 * template.
723 * template.
728 */
724 */
729 postMixInProperties(): void;
725 postMixInProperties(): void;
730
726
731 /**
727 /**
732 * Construct the UI for this widget, setting this.domNode.
728 * Construct the UI for this widget, setting this.domNode.
733 * Most widgets will mixin `dijit._TemplatedMixin`, which implements this method.
729 * Most widgets will mixin `dijit._TemplatedMixin`, which implements this method.
734 */
730 */
735 buildRendering(): void;
731 buildRendering(): void;
736
732
737 /**
733 /**
738 * Processing after the DOM fragment is created
734 * Processing after the DOM fragment is created
739 */
735 */
740 postCreate(): void;
736 postCreate(): void;
741
737
742 /**
738 /**
743 * Processing after the DOM fragment is added to the document
739 * Processing after the DOM fragment is added to the document
744 */
740 */
745 startup(): void;
741 startup(): void;
746
742
747 /**
743 /**
748 * Destroy this widget and its descendants
744 * Destroy this widget and its descendants
749 */
745 */
750 destroyRecursive(preserveDom?: boolean): void;
746 destroyRecursive(preserveDom?: boolean): void;
751
747
752 /**
748 /**
753 * Destroys the DOM nodes associated with this widget.
749 * Destroys the DOM nodes associated with this widget.
754 */
750 */
755 destroyRendering(preserveDom?: boolean): void;
751 destroyRendering(preserveDom?: boolean): void;
756
752
757 /**
753 /**
758 * Recursively destroy the children of this widget and their
754 * Recursively destroy the children of this widget and their
759 * descendants.
755 * descendants.
760 */
756 */
761 destroyDescendants(preserveDom?: boolean): void;
757 destroyDescendants(preserveDom?: boolean): void;
762
758
763 /**
759 /**
764 * Deprecated. Override destroy() instead to implement custom widget tear-down
760 * Deprecated. Override destroy() instead to implement custom widget tear-down
765 * behavior.
761 * behavior.
766 * @deprecated
762 * @deprecated
767 */
763 */
768 uninitialize(): boolean;
764 uninitialize(): boolean;
769
765
770 /**
766 /**
771 * Used by widgets to signal that a synthetic event occurred, ex:
767 * Used by widgets to signal that a synthetic event occurred, ex:
772 * | myWidget.emit("attrmodified-selectedChildWidget", {}).
768 * | myWidget.emit("attrmodified-selectedChildWidget", {}).
773 */
769 */
774 emit<K extends keyof Events>(eventName: K, evt: EventInitArgs<Events[K]>): void;
770 emit<K extends keyof Events>(eventName: K, evt: EventInitArgs<Events[K]>, callbackArgs?: any[]): any;
775
776 /**
777 * @param type
778 * @param eventObj
779 * @param callbackArgs
780 */
781 emit<K extends string>(
782 type: K,
783 eventObj?: K extends keyof Events ? EventInitArgs<Events[K]> : any,
784 callbackArgs?: any[]
785 ): any;
786
771
787 /**
772 /**
788 * Call specified function when event occurs, ex: myWidget.on("click", function(){ ... }).
773 * Call specified function when event occurs, ex: myWidget.on("click", function(){ ... }).
789 */
774 */
790 on<K extends keyof Events>(eventName: K, cb: (evt: Events[K]) => void): dojo.WatchHandle;
775 on<K extends keyof Events>(eventName: K, cb: (evt: Events[K]) => void): dojo.WatchHandle;
791
776
792 on(type: string | dojo.ExtensionEvent, func: dojo.EventListener | Function): dojo.WatchHandle;
777 on(type: dojo.ExtensionEvent, func: dojo.EventListener): dojo.WatchHandle;
793
778
794 /**
779 /**
795 * Returns a string that represents the widget.
780 * Returns a string that represents the widget.
796 */
781 */
797 toString(): string;
782 toString(): string;
798
783
799 /**
784 /**
800 * Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent
785 * Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent
801 * is this widget. Note that it does not return all descendants, but rather just direct children.
786 * is this widget. Note that it does not return all descendants, but rather just direct children.
802 */
787 */
803 getChildren<T extends _WidgetBase>(): T[];
788 getChildren<T extends _WidgetBase>(): T[];
804
789
805 /**
790 /**
806 * Returns the parent widget of this widget.
791 * Returns the parent widget of this widget.
807 */
792 */
808 getParent<T extends _WidgetBase>(): T;
793 getParent<T extends _WidgetBase>(): T;
809
794
810 /**
795 /**
811 * Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.
796 * Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.
812 * @deprecated
797 * @deprecated
813 */
798 */
814 connect(obj: any, event: string | dojo.ExtensionEvent, method: string | dojo.EventListener): dojo.WatchHandle;
799 connect(obj: any, event: string | dojo.ExtensionEvent, method: string | dojo.EventListener): dojo.WatchHandle;
815
800
816 /**
801 /**
817 * Deprecated, will be removed in 2.0, use handle.remove() instead.
802 * Deprecated, will be removed in 2.0, use handle.remove() instead.
818 * @deprecated
803 * @deprecated
819 */
804 */
820 disconnect(handle: dojo.WatchHandle): void;
805 disconnect(handle: dojo.WatchHandle): void;
821
806
822 /**
807 /**
823 * Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.
808 * Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.
824 * @deprecated
809 * @deprecated
825 */
810 */
826 subscribe(t: string, method: dojo.EventListener): dojo.WatchHandle;
811 subscribe(t: string, method: dojo.EventListener): dojo.WatchHandle;
827
812
828 /**
813 /**
829 * Deprecated, will be removed in 2.0, use handle.remove() instead.
814 * Deprecated, will be removed in 2.0, use handle.remove() instead.
830 * @deprecated
815 * @deprecated
831 */
816 */
832 unsubscribe(handle: dojo.WatchHandle): void;
817 unsubscribe(handle: dojo.WatchHandle): void;
833
818
834 /**
819 /**
835 * Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
820 * Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
836 */
821 */
837 isLeftToRight(): boolean;
822 isLeftToRight(): boolean;
838
823
839 /**
824 /**
840 * Return true if this widget can currently be focused
825 * Return true if this widget can currently be focused
841 * and false if not
826 * and false if not
842 */
827 */
843 isFocusable(): boolean;
828 isFocusable(): boolean;
844
829
845 /**
830 /**
846 * Place this widget somewhere in the DOM based
831 * Place this widget somewhere in the DOM based
847 * on standard domConstruct.place() conventions.
832 * on standard domConstruct.place() conventions.
848 */
833 */
849 placeAt<T extends _WidgetBase>(reference: dojo.NodeFragmentOrString | T, position?: string | number): this;
834 placeAt<T extends _WidgetBase>(reference: dojo.NodeFragmentOrString | T, position?: string | number): this;
850
835
851 /**
836 /**
852 * Wrapper to setTimeout to avoid deferred functions executing
837 * Wrapper to setTimeout to avoid deferred functions executing
853 * after the originating widget has been destroyed.
838 * after the originating widget has been destroyed.
854 * Returns an object handle with a remove method (that returns null) (replaces clearTimeout).
839 * Returns an object handle with a remove method (that returns null) (replaces clearTimeout).
855 */
840 */
856 defer(fcn: Function, delay?: number): dojo.Handle;
841 defer(fcn: Function, delay?: number): dojo.Handle;
857 }
842 }
858
843
859 interface _WidgetBaseConstructor<W> extends Pick<dojo._base.DeclareConstructor<W>, Exclude<keyof dojo._base.DeclareConstructor<W>, 'new'>> {
844 interface _WidgetBaseConstructor<W> extends Pick<dojo._base.DeclareConstructor<W>, Exclude<keyof dojo._base.DeclareConstructor<W>, 'new'>> {
860 new(params?: Partial<W> & ThisType<W>, srcNodeRef?: dojo.NodeOrString): W & dojo._base.DeclareCreatedObject;
845 new(params?: Partial<W> & ThisType<W>, srcNodeRef?: dojo.NodeOrString): W & dojo._base.DeclareCreatedObject;
861 }
846 }
862
847
863 /* dijit/_WidgetsInTemplateMixin */
848 /* dijit/_WidgetsInTemplateMixin */
864
849
865 interface _WidgetsInTemplateMixin {
850 interface _WidgetsInTemplateMixin {
866 /**
851 /**
867 * Used to provide a context require to dojo/parser in order to be
852 * Used to provide a context require to dojo/parser in order to be
868 * able to use relative MIDs (e.g. `./Widget`) in the widget's template.
853 * able to use relative MIDs (e.g. `./Widget`) in the widget's template.
869 */
854 */
870 contextRequire: Function;
855 contextRequire: Function;
871
856
872 startup(): void;
857 startup(): void;
873 }
858 }
874
859
875 interface _WidgetsInTemplateMixinConstructor extends dojo._base.DeclareConstructor<_WidgetsInTemplateMixin> {
860 interface _WidgetsInTemplateMixinConstructor extends dojo._base.DeclareConstructor<_WidgetsInTemplateMixin> {
876 new(params: Object, srcNodeRef: dojo.NodeOrString): _WidgetsInTemplateMixin;
861 new(params: Object, srcNodeRef: dojo.NodeOrString): _WidgetsInTemplateMixin;
877 }
862 }
878
863
879 /* dijit/a11yclick */
864 /* dijit/a11yclick */
880
865
881 interface A11yClick {
866 interface A11yClick {
882
867
883 /**
868 /**
884 * Custom press, release, and click synthetic events
869 * Custom press, release, and click synthetic events
885 * which trigger on a left mouse click, touch, or space/enter keyup.
870 * which trigger on a left mouse click, touch, or space/enter keyup.
886 */
871 */
887 (node: HTMLElement, listener: Function): dojo.Handle;
872 (node: HTMLElement, listener: Function): dojo.Handle;
888
873
889 /**
874 /**
890 * Mousedown (left button), touchstart, or keydown (space or enter) corresponding to logical click operation.
875 * Mousedown (left button), touchstart, or keydown (space or enter) corresponding to logical click operation.
891 */
876 */
892 press: dojo.ExtensionEvent;
877 press: dojo.ExtensionEvent;
893
878
894 /**
879 /**
895 * Mouseup (left button), touchend, or keyup (space or enter) corresponding to logical click operation.
880 * Mouseup (left button), touchend, or keyup (space or enter) corresponding to logical click operation.
896 */
881 */
897 release: dojo.ExtensionEvent;
882 release: dojo.ExtensionEvent;
898
883
899 /**
884 /**
900 * Mouse cursor or a finger is dragged over the given node.
885 * Mouse cursor or a finger is dragged over the given node.
901 */
886 */
902 move: dojo.ExtensionEvent;
887 move: dojo.ExtensionEvent;
903 }
888 }
904
889
905 /* dijit/Calendar */
890 /* dijit/Calendar */
906
891
907 interface _MonthDropDownButton extends form.DropDownButton<_MonthDropDown> {
892 interface _MonthDropDownButton extends form.DropDownButton<_MonthDropDown> {
908 onMonthSelect(): void;
893 onMonthSelect(): void;
909 postCreate(): void;
894 postCreate(): void;
910
895
911 //set(name: 'month', value: number): this;
896 //set(name: 'month', value: number): this;
912 //set(name: string, value: any): this;
897 //set(name: string, value: any): this;
913 //set(values: Object): this;
898 //set(values: Object): this;
914 }
899 }
915
900
916 interface _MonthDropDownButtonConstructor extends _WidgetBaseConstructor<_MonthDropDownButton> { }
901 interface _MonthDropDownButtonConstructor extends _WidgetBaseConstructor<_MonthDropDownButton> { }
917
902
918 interface _MonthDropDown extends _Widget, _TemplatedMixin, _CssStateMixin {
903 interface _MonthDropDown extends _Widget, _TemplatedMixin, _CssStateMixin {
919 months: string[];
904 months: string[];
920 baseClass: string;
905 baseClass: string;
921 templateString: string;
906 templateString: string;
922
907
923 /**
908 /**
924 * Callback when month is selected from drop down
909 * Callback when month is selected from drop down
925 */
910 */
926 onChange(month: number): void;
911 onChange(month: number): void;
927
912
928 //set(name: 'months', value: string[]): this;
913 //set(name: 'months', value: string[]): this;
929 //set(name: string, value: any): this;
914 //set(name: string, value: any): this;
930 //set(values: Object): this;
915 //set(values: Object): this;
931 }
916 }
932
917
933 interface _MonthDropDownConstructor extends _WidgetBaseConstructor<_MonthDropDown> { }
918 interface _MonthDropDownConstructor extends _WidgetBaseConstructor<_MonthDropDown> { }
934
919
935 interface Calendar extends CalendarLite, _Widget, _CssStateMixin {
920 interface Calendar extends CalendarLite, _Widget, _CssStateMixin {
936
921
937 baseClass: string;
922 baseClass: string;
938
923
939 /**
924 /**
940 * Set node classes for various mouse events, see dijit._CssStateMixin for more details
925 * Set node classes for various mouse events, see dijit._CssStateMixin for more details
941 */
926 */
942 cssStateNodes: CSSStateNodes;
927 cssStateNodes: CSSStateNodes;
943
928
944 /**
929 /**
945 * Creates the drop down button that displays the current month and lets user pick a new one
930 * Creates the drop down button that displays the current month and lets user pick a new one
946 */
931 */
947 _createMonthWidget(): _MonthDropDownButton;
932 _createMonthWidget(): _MonthDropDownButton;
948
933
949 postCreate(): void;
934 postCreate(): void;
950
935
951 /**
936 /**
952 * Handler for when user selects a month from the drop down list
937 * Handler for when user selects a month from the drop down list
953 */
938 */
954 _onMonthSelect(newMonth: number): void;
939 _onMonthSelect(newMonth: number): void;
955
940
956 /**
941 /**
957 * Handler for mouse over events on days, sets hovered style
942 * Handler for mouse over events on days, sets hovered style
958 */
943 */
959 _onDayMouseOver(evt: MouseEvent): void;
944 _onDayMouseOver(evt: MouseEvent): void;
960
945
961 /**
946 /**
962 * Handler for mouse out events on days, clears hovered style
947 * Handler for mouse out events on days, clears hovered style
963 */
948 */
964 _onDayMouseOut(evt: MouseEvent): void;
949 _onDayMouseOut(evt: MouseEvent): void;
965 _onDayMouseDown(evt: MouseEvent): void;
950 _onDayMouseDown(evt: MouseEvent): void;
966 _onDayMouseUp(evt: MouseEvent): void;
951 _onDayMouseUp(evt: MouseEvent): void;
967
952
968 /**
953 /**
969 * Provides keyboard navigation of calendar.
954 * Provides keyboard navigation of calendar.
970 */
955 */
971 handleKey(evt: KeyboardEvent): void;
956 handleKey(evt: KeyboardEvent): void;
972
957
973 /**
958 /**
974 * For handling keydown events on a stand alone calendar
959 * For handling keydown events on a stand alone calendar
975 */
960 */
976 _onKeyDown(evt: KeyboardEvent): void;
961 _onKeyDown(evt: KeyboardEvent): void;
977
962
978 /**
963 /**
979 * Deprecated. Notification that a date cell was selected. It may be the same as the previous value.
964 * Deprecated. Notification that a date cell was selected. It may be the same as the previous value.
980 */
965 */
981 onValueSelected(date: Date): void;
966 onValueSelected(date: Date): void;
982
967
983 onChange(date: Date): void;
968 onChange(date: Date): void;
984
969
985 /**
970 /**
986 * May be overridden to return CSS classes to associate with the date entry for the given dateObject
971 * May be overridden to return CSS classes to associate with the date entry for the given dateObject
987 * for example to indicate a holiday in specified locale.
972 * for example to indicate a holiday in specified locale.
988 */
973 */
989 getClassForDate(dateObject: Date, locale?: string): string;
974 getClassForDate(dateObject: Date, locale?: string): string;
990
975
991 // get(name: 'value'): Date;
976 // get(name: 'value'): Date;
992 // get(name: string): any;
977 // get(name: string): any;
993
978
994 // set(name: 'value', value: number | Date): this;
979 // set(name: 'value', value: number | Date): this;
995 // set(name: string, value: any): this;
980 // set(name: string, value: any): this;
996 // set(values: Object): this;
981 // set(values: Object): this;
997 }
982 }
998
983
999 interface CalendarConstructor extends _WidgetBaseConstructor<Calendar> {
984 interface CalendarConstructor extends _WidgetBaseConstructor<Calendar> {
1000 _MonthWidget: _MonthWidgetConstructor;
985 _MonthWidget: _MonthWidgetConstructor;
1001 _MonthDropDown: _MonthDropDownButtonConstructor;
986 _MonthDropDown: _MonthDropDownButtonConstructor;
1002 _MonthDropDownButton: _MonthDropDownButtonConstructor;
987 _MonthDropDownButton: _MonthDropDownButtonConstructor;
1003 }
988 }
1004
989
1005 /* dijit/CalendarLite */
990 /* dijit/CalendarLite */
1006
991
1007 interface _MonthWidget extends _WidgetBase {
992 interface _MonthWidget extends _WidgetBase {
1008 // set(name: 'month', value: Date): this;
993 // set(name: 'month', value: Date): this;
1009 // set(name: string, value: any): this;
994 // set(name: string, value: any): this;
1010 // set(values: Object): this;
995 // set(values: Object): this;
1011 }
996 }
1012
997
1013 interface _MonthWidgetConstructor extends _WidgetBaseConstructor<_MonthWidget> { }
998 interface _MonthWidgetConstructor extends _WidgetBaseConstructor<_MonthWidget> { }
1014
999
1015 interface CalendarLite extends _WidgetBase, _TemplatedMixin {
1000 interface CalendarLite extends _WidgetBase, _TemplatedMixin {
1016 /**
1001 /**
1017 * Template for main calendar
1002 * Template for main calendar
1018 */
1003 */
1019 templateString: string;
1004 templateString: string;
1020
1005
1021 /**
1006 /**
1022 * Template for cell for a day of the week (ex: M)
1007 * Template for cell for a day of the week (ex: M)
1023 */
1008 */
1024 dowTemplateString: string;
1009 dowTemplateString: string;
1025
1010
1026 dateTemplateString: string;
1011 dateTemplateString: string;
1027 weekTemplateString: string;
1012 weekTemplateString: string;
1028
1013
1029 /**
1014 /**
1030 * The currently selected Date, initially set to invalid date to indicate no selection.
1015 * The currently selected Date, initially set to invalid date to indicate no selection.
1031 */
1016 */
1032 value: Date;
1017 value: Date;
1033
1018
1034 /**
1019 /**
1035 * JavaScript namespace to find calendar routines. If unspecified, uses Gregorian calendar routines
1020 * JavaScript namespace to find calendar routines. If unspecified, uses Gregorian calendar routines
1036 * at dojo/date and dojo/date/locale.
1021 * at dojo/date and dojo/date/locale.
1037 */
1022 */
1038 datePackage: string;
1023 datePackage: string;
1039
1024
1040 /**
1025 /**
1041 * How to represent the days of the week in the calendar header. See locale
1026 * How to represent the days of the week in the calendar header. See locale
1042 */
1027 */
1043 dayWidth: string;
1028 dayWidth: string;
1044
1029
1045 /**
1030 /**
1046 * Order fields are traversed when user hits the tab key
1031 * Order fields are traversed when user hits the tab key
1047 */
1032 */
1048 tabIndex: string;
1033 tabIndex: string;
1049
1034
1050 /**
1035 /**
1051 * (Optional) The first day of week override. By default the first day of week is determined
1036 * (Optional) The first day of week override. By default the first day of week is determined
1052 * for the current locale (extracted from the CLDR).
1037 * for the current locale (extracted from the CLDR).
1053 * Special value -1 (default value), means use locale dependent value.
1038 * Special value -1 (default value), means use locale dependent value.
1054 */
1039 */
1055 dayOffset: number;
1040 dayOffset: number;
1056
1041
1057 /**
1042 /**
1058 * Date object containing the currently focused date, or the date which would be focused
1043 * Date object containing the currently focused date, or the date which would be focused
1059 * if the calendar itself was focused. Also indicates which year and month to display,
1044 * if the calendar itself was focused. Also indicates which year and month to display,
1060 * i.e. the current "page" the calendar is on.
1045 * i.e. the current "page" the calendar is on.
1061 */
1046 */
1062 currentFocus: Date;
1047 currentFocus: Date;
1063
1048
1064 /**
1049 /**
1065 * Put the summary to the node with role=grid
1050 * Put the summary to the node with role=grid
1066 */
1051 */
1067 _setSummaryAttr: string;
1052 _setSummaryAttr: string;
1068
1053
1069 baseClass: string;
1054 baseClass: string;
1070
1055
1071 /**
1056 /**
1072 * Runs various tests on the value, checking that it's a valid date, rather
1057 * Runs various tests on the value, checking that it's a valid date, rather
1073 * than blank or NaN.
1058 * than blank or NaN.
1074 */
1059 */
1075 _isValidDate(value: Date): boolean;
1060 _isValidDate(value: Date): boolean;
1076
1061
1077 /**
1062 /**
1078 * Convert Number into Date, or copy Date object. Then, round to nearest day,
1063 * Convert Number into Date, or copy Date object. Then, round to nearest day,
1079 * setting to 1am to avoid issues when DST shift occurs at midnight, see #8521, #9366)
1064 * setting to 1am to avoid issues when DST shift occurs at midnight, see #8521, #9366)
1080 */
1065 */
1081 _patchDate(value: number | Date): Date;
1066 _patchDate(value: number | Date): Date;
1082
1067
1083 /**
1068 /**
1084 * This just sets the content of node to the specified text.
1069 * This just sets the content of node to the specified text.
1085 * Can't do "node.innerHTML=text" because of an IE bug w/tables, see #3434.
1070 * Can't do "node.innerHTML=text" because of an IE bug w/tables, see #3434.
1086 */
1071 */
1087 _setText(node: HTMLElement, text?: string): void;
1072 _setText(node: HTMLElement, text?: string): void;
1088
1073
1089 /**
1074 /**
1090 * Fills in the calendar grid with each day (1-31).
1075 * Fills in the calendar grid with each day (1-31).
1091 * Call this on creation, when moving to a new month.
1076 * Call this on creation, when moving to a new month.
1092 */
1077 */
1093 _populateGrid(): void;
1078 _populateGrid(): void;
1094
1079
1095 /**
1080 /**
1096 * Fill in localized month, and prev/current/next years
1081 * Fill in localized month, and prev/current/next years
1097 */
1082 */
1098 _populateControls(): void;
1083 _populateControls(): void;
1099
1084
1100 /**
1085 /**
1101 * Sets calendar's value to today's date
1086 * Sets calendar's value to today's date
1102 */
1087 */
1103 goToToday(): void;
1088 goToToday(): void;
1104
1089
1105 /**
1090 /**
1106 * Creates the drop down button that displays the current month and lets user pick a new one
1091 * Creates the drop down button that displays the current month and lets user pick a new one
1107 */
1092 */
1108 _createMonthWidget(): void;
1093 _createMonthWidget(): void;
1109
1094
1110 buildRendering(): void;
1095 buildRendering(): void;
1111 postCreate(): void;
1096 postCreate(): void;
1112
1097
1113 /**
1098 /**
1114 * Set up connects for increment/decrement of months/years
1099 * Set up connects for increment/decrement of months/years
1115 */
1100 */
1116 _connectControls(): void;
1101 _connectControls(): void;
1117
1102
1118 /**
1103 /**
1119 * If the calendar currently has focus, then focuses specified date,
1104 * If the calendar currently has focus, then focuses specified date,
1120 * changing the currently displayed month/year if necessary.
1105 * changing the currently displayed month/year if necessary.
1121 * If the calendar doesn't have focus, updates currently
1106 * If the calendar doesn't have focus, updates currently
1122 * displayed month/year, and sets the cell that will get focus
1107 * displayed month/year, and sets the cell that will get focus
1123 * when Calendar is focused.
1108 * when Calendar is focused.
1124 */
1109 */
1125 _setCurrentFocusAttr(date: Date, forceFocus?: boolean): void;
1110 _setCurrentFocusAttr(date: Date, forceFocus?: boolean): void;
1126
1111
1127 /**
1112 /**
1128 * Focus the calendar by focusing one of the calendar cells
1113 * Focus the calendar by focusing one of the calendar cells
1129 */
1114 */
1130 focus(): void;
1115 focus(): void;
1131
1116
1132 /**
1117 /**
1133 * Handler for day clicks, selects the date if appropriate
1118 * Handler for day clicks, selects the date if appropriate
1134 */
1119 */
1135 _onDayClick(evt: MouseEvent): void;
1120 _onDayClick(evt: MouseEvent): void;
1136
1121
1137 /**
1122 /**
1138 * Returns the cell corresponding to the date, or null if the date is not within the currently
1123 * Returns the cell corresponding to the date, or null if the date is not within the currently
1139 * displayed month.
1124 * displayed month.
1140 */
1125 */
1141 _getNodeByDate(value: Date): HTMLElement;
1126 _getNodeByDate(value: Date): HTMLElement;
1142
1127
1143 /**
1128 /**
1144 * Marks the specified cells as selected, and clears cells previously marked as selected.
1129 * Marks the specified cells as selected, and clears cells previously marked as selected.
1145 * For CalendarLite at most one cell is selected at any point, but this allows an array
1130 * For CalendarLite at most one cell is selected at any point, but this allows an array
1146 * for easy subclassing.
1131 * for easy subclassing.
1147 */
1132 */
1148 _markSelectedDates(dates: Date[]): void;
1133 _markSelectedDates(dates: Date[]): void;
1149
1134
1150 /**
1135 /**
1151 * Called only when the selected date has changed
1136 * Called only when the selected date has changed
1152 */
1137 */
1153 onChange(date: Date): void;
1138 onChange(date: Date): void;
1154
1139
1155 /**
1140 /**
1156 * May be overridden to disable certain dates in the calendar e.g. `isDisabledDate=dojo.date.locale.isWeekend`
1141 * May be overridden to disable certain dates in the calendar e.g. `isDisabledDate=dojo.date.locale.isWeekend`
1157 */
1142 */
1158 isDisabledDate(dateObject: Date, locale?: string): boolean;
1143 isDisabledDate(dateObject: Date, locale?: string): boolean;
1159
1144
1160 /**
1145 /**
1161 * May be overridden to return CSS classes to associate with the date entry for the given dateObject,
1146 * May be overridden to return CSS classes to associate with the date entry for the given dateObject,
1162 * for example to indicate a holiday in specified locale.
1147 * for example to indicate a holiday in specified locale.
1163 */
1148 */
1164 getClassForDate(dateObject: Date, locale?: string): string;
1149 getClassForDate(dateObject: Date, locale?: string): string;
1165
1150
1166 // get(name: 'value'): Date;
1151 // get(name: 'value'): Date;
1167 // get(name: string): any;
1152 // get(name: string): any;
1168
1153
1169 // set(name: 'value', value: number | Date): this;
1154 // set(name: 'value', value: number | Date): this;
1170 // set(name: string, value: any): this;
1155 // set(name: string, value: any): this;
1171 // set(values: Object): this;
1156 // set(values: Object): this;
1172 }
1157 }
1173
1158
1174 interface CalendarLiteConstructor extends _WidgetBaseConstructor<CalendarLite> {
1159 interface CalendarLiteConstructor extends _WidgetBaseConstructor<CalendarLite> {
1175 _MonthWidget: _MonthWidgetConstructor;
1160 _MonthWidget: _MonthWidgetConstructor;
1176 }
1161 }
1177
1162
1178 /* dijit/Destroyable */
1163 /* dijit/Destroyable */
1179
1164
1180 interface Destroyable {
1165 interface Destroyable {
1181 _destroyed?: true;
1166 _destroyed?: true;
1182
1167
1183 /**
1168 /**
1184 * Destroy this class, releasing any resources registered via own().
1169 * Destroy this class, releasing any resources registered via own().
1185 */
1170 */
1186 destroy(preserveDom?: boolean): void;
1171 destroy(preserveDom?: boolean): void;
1187
1172
1188 /**
1173 /**
1189 * Track specified handles and remove/destroy them when this instance is destroyed, unless they were
1174 * Track specified handles and remove/destroy them when this instance is destroyed, unless they were
1190 * already removed/destroyed manually.
1175 * already removed/destroyed manually.
1191 */
1176 */
1192 own(...args: any[]): any[];
1177 own(...args: any[]): any[];
1193 }
1178 }
1194
1179
1195 /**
1180 /**
1196 * Mixin to track handles and release them when instance is destroyed.
1181 * Mixin to track handles and release them when instance is destroyed.
1197 */
1182 */
1198 interface DestroyableConstructor extends dojo._base.DeclareConstructor<Destroyable> { }
1183 interface DestroyableConstructor extends dojo._base.DeclareConstructor<Destroyable> { }
1199
1184
1200 /** dijit/_KeyNavMixin */
1185 /** dijit/_KeyNavMixin */
1201
1186
1202 /**
1187 /**
1203 * A mixin to allow arrow key and letter key navigation of child or descendant widgets.
1188 * A mixin to allow arrow key and letter key navigation of child or descendant widgets.
1204 * It can be used by dijit/_Container based widgets with a flat list of children, or more complex widgets like dijit/Tree.
1189 * It can be used by dijit/_Container based widgets with a flat list of children, or more complex widgets like dijit/Tree.
1205 *
1190 *
1206 * To use this mixin, the subclass must:
1191 * To use this mixin, the subclass must:
1207 *
1192 *
1208 * - Implement _getNext(), _getFirst(), _getLast(), _onLeftArrow(), _onRightArrow() _onDownArrow(), _onUpArrow() methods to handle home/end/left/right/up/down keystrokes. Next and previous in this context refer to a linear ordering of the descendants used by letter key search.
1193 * - Implement _getNext(), _getFirst(), _getLast(), _onLeftArrow(), _onRightArrow() _onDownArrow(), _onUpArrow() methods to handle home/end/left/right/up/down keystrokes. Next and previous in this context refer to a linear ordering of the descendants used by letter key search.
1209 * - Set all descendants' initial tabIndex to "-1"; both initial descendants and any descendants added later, by for example addChild()
1194 * - Set all descendants' initial tabIndex to "-1"; both initial descendants and any descendants added later, by for example addChild()
1210 * - Define childSelector to a function or string that identifies focusable descendant widgets
1195 * - Define childSelector to a function or string that identifies focusable descendant widgets
1211 *
1196 *
1212 * Also, child widgets must implement a focus() method.
1197 * Also, child widgets must implement a focus() method.
1213 */
1198 */
1214 interface _KeyNavMixin extends _FocusMixin {
1199 interface _KeyNavMixin extends _FocusMixin {
1215 /**
1200 /**
1216 * Tab index of the container; same as HTML tabIndex attribute.
1201 * Tab index of the container; same as HTML tabIndex attribute.
1217 * Note then when user tabs into the container, focus is immediately moved to the first item in the container.
1202 * Note then when user tabs into the container, focus is immediately moved to the first item in the container.
1218 */
1203 */
1219 tabIndex: string;
1204 tabIndex: string;
1220
1205
1221 /**
1206 /**
1222 * Selector (passed to on.selector()) used to identify what to treat as a child widget. Used to monitor focus events and set this.focusedChild. Must be set by implementing class. If this is a string (ex: "> *") then the implementing class must require dojo/query.
1207 * Selector (passed to on.selector()) used to identify what to treat as a child widget. Used to monitor focus events and set this.focusedChild. Must be set by implementing class. If this is a string (ex: "> *") then the implementing class must require dojo/query.
1223 */
1208 */
1224 childSelector: string | Function | null;
1209 childSelector: string | Function | null;
1225
1210
1226 /**
1211 /**
1227 * Called on left arrow key, or right arrow key if widget is in RTL mode.
1212 * Called on left arrow key, or right arrow key if widget is in RTL mode.
1228 * Should go back to the previous child in horizontal container widgets like Toolbar.
1213 * Should go back to the previous child in horizontal container widgets like Toolbar.
1229 */
1214 */
1230 _onLeftArrow(evt?: KeyboardEvent): void;
1215 _onLeftArrow(evt?: KeyboardEvent): void;
1231
1216
1232 /**
1217 /**
1233 * Called on right arrow key, or left arrow key if widget is in RTL mode.
1218 * Called on right arrow key, or left arrow key if widget is in RTL mode.
1234 * Should go to the next child in horizontal container widgets like Toolbar.
1219 * Should go to the next child in horizontal container widgets like Toolbar.
1235 */
1220 */
1236 _onRightArrow(evt?: KeyboardEvent): void;
1221 _onRightArrow(evt?: KeyboardEvent): void;
1237
1222
1238 /**
1223 /**
1239 * Called on up arrow key. Should go to the previous child in vertical container widgets like Menu.
1224 * Called on up arrow key. Should go to the previous child in vertical container widgets like Menu.
1240 */
1225 */
1241 _onUpArrow(evt?: KeyboardEvent): void;
1226 _onUpArrow(evt?: KeyboardEvent): void;
1242
1227
1243 /**
1228 /**
1244 * Called on down arrow key. Should go to the next child in vertical container widgets like Menu.
1229 * Called on down arrow key. Should go to the next child in vertical container widgets like Menu.
1245 */
1230 */
1246 _onDownArrow(evt?: KeyboardEvent): void;
1231 _onDownArrow(evt?: KeyboardEvent): void;
1247
1232
1248 /**
1233 /**
1249 * Default focus() implementation: focus the first child.
1234 * Default focus() implementation: focus the first child.
1250 */
1235 */
1251 focus(): void;
1236 focus(): void;
1252
1237
1253 /**
1238 /**
1254 * Returns first child that can be focused.
1239 * Returns first child that can be focused.
1255 */
1240 */
1256 _getFirstFocusableChild(): _WidgetBase;
1241 _getFirstFocusableChild(): _WidgetBase;
1257
1242
1258 /**
1243 /**
1259 * Returns last child that can be focused.
1244 * Returns last child that can be focused.
1260 */
1245 */
1261 _getLastFocusableChild(): _WidgetBase;
1246 _getLastFocusableChild(): _WidgetBase;
1262
1247
1263 /**
1248 /**
1264 * Focus the first focusable child in the container.
1249 * Focus the first focusable child in the container.
1265 */
1250 */
1266 focusFirstChild(): void;
1251 focusFirstChild(): void;
1267
1252
1268 /**
1253 /**
1269 * Focus the last focusable child in the container.
1254 * Focus the last focusable child in the container.
1270 */
1255 */
1271 focusLastChild(): void;
1256 focusLastChild(): void;
1272
1257
1273 /**
1258 /**
1274 * Focus specified child widget.
1259 * Focus specified child widget.
1275 *
1260 *
1276 * @param widget Reference to container's child widget
1261 * @param widget Reference to container's child widget
1277 * @param last If true and if widget has multiple focusable nodes, focus the last one instead of the first one
1262 * @param last If true and if widget has multiple focusable nodes, focus the last one instead of the first one
1278 */
1263 */
1279 focusChild(widget: _WidgetBase, last?: boolean): void;
1264 focusChild(widget: _WidgetBase, last?: boolean): void;
1280
1265
1281 /**
1266 /**
1282 * Handler for when the container itself gets focus.
1267 * Handler for when the container itself gets focus.
1283 *
1268 *
1284 * Initially the container itself has a tabIndex, but when it gets focus, switch focus to first child.
1269 * Initially the container itself has a tabIndex, but when it gets focus, switch focus to first child.
1285 */
1270 */
1286 _onContainerFocus(evt: Event): void;
1271 _onContainerFocus(evt: Event): void;
1287
1272
1288 /**
1273 /**
1289 * Called when a child widget gets focus, either by user clicking it, or programatically by arrow key handling code.
1274 * Called when a child widget gets focus, either by user clicking it, or programatically by arrow key handling code.
1290 *
1275 *
1291 * It marks that the current node is the selected one, and the previously selected node no longer is.
1276 * It marks that the current node is the selected one, and the previously selected node no longer is.
1292 */
1277 */
1293 _onChildFocus(child?: _WidgetBase): void;
1278 _onChildFocus(child?: _WidgetBase): void;
1294
1279
1295 _searchString: string;
1280 _searchString: string;
1296
1281
1297 multiCharSearchDuration: number;
1282 multiCharSearchDuration: number;
1298
1283
1299 /**
1284 /**
1300 * When a key is pressed that matches a child item, this method is called so that a widget can take appropriate action is necessary.
1285 * When a key is pressed that matches a child item, this method is called so that a widget can take appropriate action is necessary.
1301 */
1286 */
1302 onKeyboardSearch(tem: _WidgetBase, evt: Event, searchString: string, numMatches: number): void;
1287 onKeyboardSearch(tem: _WidgetBase, evt: Event, searchString: string, numMatches: number): void;
1303
1288
1304 /**
1289 /**
1305 * Compares the searchString to the widget's text label, returning:
1290 * Compares the searchString to the widget's text label, returning:
1306 *
1291 *
1307 * * -1: a high priority match and stop searching
1292 * * -1: a high priority match and stop searching
1308 * * 0: not a match
1293 * * 0: not a match
1309 * * 1: a match but keep looking for a higher priority match
1294 * * 1: a match but keep looking for a higher priority match
1310 */
1295 */
1311 _keyboardSearchCompare(item: _WidgetBase, searchString: string): -1 | 0 | 1;
1296 _keyboardSearchCompare(item: _WidgetBase, searchString: string): -1 | 0 | 1;
1312
1297
1313 /**
1298 /**
1314 * When a key is pressed, if it's an arrow key etc. then it's handled here.
1299 * When a key is pressed, if it's an arrow key etc. then it's handled here.
1315 */
1300 */
1316 _onContainerKeydown(evt: Event): void;
1301 _onContainerKeydown(evt: Event): void;
1317
1302
1318 /**
1303 /**
1319 * When a printable key is pressed, it's handled here, searching by letter.
1304 * When a printable key is pressed, it's handled here, searching by letter.
1320 */
1305 */
1321 _onContainerKeypress(evt: Event): void;
1306 _onContainerKeypress(evt: Event): void;
1322
1307
1323 /**
1308 /**
1324 * Perform a search of the widget's options based on the user's keyboard activity
1309 * Perform a search of the widget's options based on the user's keyboard activity
1325 *
1310 *
1326 * Called on keypress (and sometimes keydown), searches through this widget's children looking for items that match the user's typed search string. Multiple characters typed within 1 sec of each other are combined for multicharacter searching.
1311 * Called on keypress (and sometimes keydown), searches through this widget's children looking for items that match the user's typed search string. Multiple characters typed within 1 sec of each other are combined for multicharacter searching.
1327 */
1312 */
1328 _keyboardSearch(evt: Event, keyChar: string): void;
1313 _keyboardSearch(evt: Event, keyChar: string): void;
1329
1314
1330 /**
1315 /**
1331 * Called when focus leaves a child widget to go to a sibling widget.
1316 * Called when focus leaves a child widget to go to a sibling widget.
1332 */
1317 */
1333 _onChildBlur(widget: _WidgetBase): void;
1318 _onChildBlur(widget: _WidgetBase): void;
1334
1319
1335 /**
1320 /**
1336 * Returns the next or previous focusable descendant, compared to "child".
1321 * Returns the next or previous focusable descendant, compared to "child".
1337 * Implements and extends _KeyNavMixin._getNextFocusableChild() for a _Container.
1322 * Implements and extends _KeyNavMixin._getNextFocusableChild() for a _Container.
1338 */
1323 */
1339 _getNextFocusableChild(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
1324 _getNextFocusableChild(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
1340
1325
1341 /**
1326 /**
1342 * Returns the first child.
1327 * Returns the first child.
1343 */
1328 */
1344 _getFirst(): _WidgetBase | null;
1329 _getFirst(): _WidgetBase | null;
1345
1330
1346 /**
1331 /**
1347 * Returns the last descendant.
1332 * Returns the last descendant.
1348 */
1333 */
1349 _getLast(): _WidgetBase | null;
1334 _getLast(): _WidgetBase | null;
1350
1335
1351 /**
1336 /**
1352 * Returns the next descendant, compared to "child".
1337 * Returns the next descendant, compared to "child".
1353 */
1338 */
1354 _getNext(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
1339 _getNext(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
1355 }
1340 }
1356
1341
1357 interface _KeyNavMixinConstructor extends dojo._base.DeclareConstructor<_KeyNavMixin> { }
1342 interface _KeyNavMixinConstructor extends dojo._base.DeclareConstructor<_KeyNavMixin> { }
1358
1343
1359 /* dijit/_KeyNavContainer */
1344 /* dijit/_KeyNavContainer */
1360
1345
1361 /**
1346 /**
1362 * A _Container with keyboard navigation of its children.
1347 * A _Container with keyboard navigation of its children.
1363 *
1348 *
1364 * Provides normalized keyboard and focusing code for Container widgets.
1349 * Provides normalized keyboard and focusing code for Container widgets.
1365 * To use this mixin, call connectKeyNavHandlers() in postCreate().
1350 * To use this mixin, call connectKeyNavHandlers() in postCreate().
1366 * Also, child widgets must implement a focus() method.
1351 * Also, child widgets must implement a focus() method.
1367 */
1352 */
1368 interface _KeyNavContainer extends _FocusMixin, _KeyNavMixin, _Container {
1353 interface _KeyNavContainer extends _FocusMixin, _KeyNavMixin, _Container {
1369 /**
1354 /**
1370 * Deprecated. You can call this in postCreate() to attach the keyboard handlers to the container, but the preferred method is to override _onLeftArrow() and _onRightArrow(), or _onUpArrow() and _onDownArrow(), to call focusPrev() and focusNext().
1355 * Deprecated. You can call this in postCreate() to attach the keyboard handlers to the container, but the preferred method is to override _onLeftArrow() and _onRightArrow(), or _onUpArrow() and _onDownArrow(), to call focusPrev() and focusNext().
1371 *
1356 *
1372 * @param prevKeyCodes Key codes for navigating to the previous child.
1357 * @param prevKeyCodes Key codes for navigating to the previous child.
1373 * @param nextKeyCodes Key codes for navigating to the next child.
1358 * @param nextKeyCodes Key codes for navigating to the next child.
1374 */
1359 */
1375 connectKeyNavHandlers(prevKeyCodes: number[], nextKeyCodes: number[]): void;
1360 connectKeyNavHandlers(prevKeyCodes: number[], nextKeyCodes: number[]): void;
1376
1361
1377 /**
1362 /**
1378 * @deprecated
1363 * @deprecated
1379 */
1364 */
1380 startupKeyNavChildren(): void;
1365 startupKeyNavChildren(): void;
1381
1366
1382 /**
1367 /**
1383 * Setup for each child widget.
1368 * Setup for each child widget.
1384 *
1369 *
1385 * Sets tabIndex=-1 on each child, so that the tab key will leave the container rather than visiting each child.
1370 * Sets tabIndex=-1 on each child, so that the tab key will leave the container rather than visiting each child.
1386 *
1371 *
1387 * Note: if you add children by a different method than addChild(), then need to call this manually or at least make sure the child's tabIndex is -1.
1372 * Note: if you add children by a different method than addChild(), then need to call this manually or at least make sure the child's tabIndex is -1.
1388 *
1373 *
1389 * Note: see also _LayoutWidget.setupChild(), which is also called for each child widget.
1374 * Note: see also _LayoutWidget.setupChild(), which is also called for each child widget.
1390 */
1375 */
1391 _startupChild(widget: _WidgetBase): void;
1376 _startupChild(widget: _WidgetBase): void;
1392
1377
1393 /**
1378 /**
1394 * Returns the first child.
1379 * Returns the first child.
1395 */
1380 */
1396 _getFirst(): _Widget | null;
1381 _getFirst(): _Widget | null;
1397
1382
1398 /**
1383 /**
1399 * Returns the last descendant.
1384 * Returns the last descendant.
1400 */
1385 */
1401 _getLast(): _Widget | null;
1386 _getLast(): _Widget | null;
1402
1387
1403 /**
1388 /**
1404 * Focus the next widget
1389 * Focus the next widget
1405 */
1390 */
1406 focusNext(): void;
1391 focusNext(): void;
1407
1392
1408 /**
1393 /**
1409 * Focus the last focusable node in the previous widget
1394 * Focus the last focusable node in the previous widget
1410 *
1395 *
1411 * (ex: go to the ComboButton icon section rather than button section)
1396 * (ex: go to the ComboButton icon section rather than button section)
1412 */
1397 */
1413 focusPrev(): void;
1398 focusPrev(): void;
1414
1399
1415 /**
1400 /**
1416 * Implement _KeyNavMixin.childSelector, to identify focusable child nodes.
1401 * Implement _KeyNavMixin.childSelector, to identify focusable child nodes.
1417 *
1402 *
1418 * If we allowed a dojo/query dependency from this module this could more simply be a string "> *" instead of this function.
1403 * If we allowed a dojo/query dependency from this module this could more simply be a string "> *" instead of this function.
1419 */
1404 */
1420 childSelector(node: Element | Node): boolean | void | any;
1405 childSelector(node: Element | Node): boolean | void | any;
1421 }
1406 }
1422
1407
1423 interface _KeyNavContainerConstructor extends dojo._base.DeclareConstructor<_KeyNavContainer> { }
1408 interface _KeyNavContainerConstructor extends dojo._base.DeclareConstructor<_KeyNavContainer> { }
1424
1409
1425 /* dijit/_MenuBase */
1410 /* dijit/_MenuBase */
1426
1411
1427 /**
1412 /**
1428 * Abstract base class for Menu and MenuBar.
1413 * Abstract base class for Menu and MenuBar.
1429 * Subclass should implement _onUpArrow(), _onDownArrow(), _onLeftArrow(), and _onRightArrow().
1414 * Subclass should implement _onUpArrow(), _onDownArrow(), _onLeftArrow(), and _onRightArrow().
1430 */
1415 */
1431 interface _MenuBase extends _Widget, _TemplatedMixin, _KeyNavContainer, _CssStateMixin {
1416 interface _MenuBase extends _Widget, _TemplatedMixin, _KeyNavContainer, _CssStateMixin {
1432 selected: MenuItem | null;
1417 selected: MenuItem | null;
1433
1418
1434 _setSelectedAttr(item?: MenuItem | null): void;
1419 _setSelectedAttr(item?: MenuItem | null): void;
1435
1420
1436 /**
1421 /**
1437 * This Menu has been clicked (mouse or via space/arrow key) or opened as a submenu, so mere mouseover will open submenus. Focusing a menu via TAB does NOT automatically make it active since TAB is a navigation operation and not a selection one.
1422 * This Menu has been clicked (mouse or via space/arrow key) or opened as a submenu, so mere mouseover will open submenus. Focusing a menu via TAB does NOT automatically make it active since TAB is a navigation operation and not a selection one.
1438 *
1423 *
1439 * For Windows apps, pressing the ALT key focuses the menubar menus (similar to TAB navigation) but the menu is not active (ie no dropdown) until an item is clicked.
1424 * For Windows apps, pressing the ALT key focuses the menubar menus (similar to TAB navigation) but the menu is not active (ie no dropdown) until an item is clicked.
1440 */
1425 */
1441 activated: boolean;
1426 activated: boolean;
1442
1427
1443 _setActivatedAttr(val: boolean): void;
1428 _setActivatedAttr(val: boolean): void;
1444
1429
1445 /**
1430 /**
1446 * pointer to menu that displayed me
1431 * pointer to menu that displayed me
1447 */
1432 */
1448 parentMenu: _Widget | null;
1433 parentMenu: _Widget | null;
1449
1434
1450 /**
1435 /**
1451 * After a menu has been activated (by clicking on it etc.), number of milliseconds before hovering (without clicking) another MenuItem causes that MenuItem's popup to automatically open.
1436 * After a menu has been activated (by clicking on it etc.), number of milliseconds before hovering (without clicking) another MenuItem causes that MenuItem's popup to automatically open.
1452 */
1437 */
1453 popupDelay: number;
1438 popupDelay: number;
1454
1439
1455 /**
1440 /**
1456 * For a passive (unclicked) Menu, number of milliseconds before hovering (without clicking) will cause the popup to open. Default is Infinity, meaning you need to click the menu to open it.
1441 * For a passive (unclicked) Menu, number of milliseconds before hovering (without clicking) will cause the popup to open. Default is Infinity, meaning you need to click the menu to open it.
1457 */
1442 */
1458 passivePopupDelay: number;
1443 passivePopupDelay: number;
1459
1444
1460 /**
1445 /**
1461 * A toggle to control whether or not a Menu gets focused when opened as a drop down from a MenuBar or DropDownButton/ComboButton. Note though that it always get focused when opened via the keyboard.
1446 * A toggle to control whether or not a Menu gets focused when opened as a drop down from a MenuBar or DropDownButton/ComboButton. Note though that it always get focused when opened via the keyboard.
1462 */
1447 */
1463 autoFocus: boolean;
1448 autoFocus: boolean;
1464
1449
1465 /**
1450 /**
1466 * Selector (passed to on.selector()) used to identify MenuItem child widgets, but exclude inert children like MenuSeparator. If subclass overrides to a string (ex: "> *"), the subclass must require dojo/query.
1451 * Selector (passed to on.selector()) used to identify MenuItem child widgets, but exclude inert children like MenuSeparator. If subclass overrides to a string (ex: "> *"), the subclass must require dojo/query.
1467 */
1452 */
1468 childSelector(node: Element | Node): boolean | void | Function;
1453 childSelector(node: Element | Node): boolean | void | Function;
1469
1454
1470 /**
1455 /**
1471 * Attach point for notification about when a menu item has been executed. This is an internal mechanism used for Menus to signal to their parent to close them, because they are about to execute the onClick handler. In general developers should not attach to or override this method.
1456 * Attach point for notification about when a menu item has been executed. This is an internal mechanism used for Menus to signal to their parent to close them, because they are about to execute the onClick handler. In general developers should not attach to or override this method.
1472 */
1457 */
1473 onExecute(): void;
1458 onExecute(): void;
1474
1459
1475 /**
1460 /**
1476 * Attach point for notification about when the user cancels the current menu
1461 * Attach point for notification about when the user cancels the current menu
1477 * This is an internal mechanism used for Menus to signal to their parent to close them. In general developers should not attach to or override this method.
1462 * This is an internal mechanism used for Menus to signal to their parent to close them. In general developers should not attach to or override this method.
1478 */
1463 */
1479 onCancel(): void;
1464 onCancel(): void;
1480
1465
1481 /**
1466 /**
1482 * This handles the right arrow key (left arrow key on RTL systems), which will either open a submenu, or move to the next item in the ancestor MenuBar
1467 * This handles the right arrow key (left arrow key on RTL systems), which will either open a submenu, or move to the next item in the ancestor MenuBar
1483 */
1468 */
1484 _moveToPopup(evt: Event): void;
1469 _moveToPopup(evt: Event): void;
1485
1470
1486 /**
1471 /**
1487 * This handler is called when the mouse moves over the popup.
1472 * This handler is called when the mouse moves over the popup.
1488 */
1473 */
1489 _onPopupHover(evt?: MouseEvent): void;
1474 _onPopupHover(evt?: MouseEvent): void;
1490
1475
1491 /**
1476 /**
1492 * Called when cursor is over a MenuItem.
1477 * Called when cursor is over a MenuItem.
1493 */
1478 */
1494 onItemHover(item: MenuItem): void;
1479 onItemHover(item: MenuItem): void;
1495
1480
1496 /**
1481 /**
1497 * Called when a child MenuItem becomes deselected. Setup timer to close its popup.
1482 * Called when a child MenuItem becomes deselected. Setup timer to close its popup.
1498 */
1483 */
1499 _onChildDeselect(item: MenuItem): void;
1484 _onChildDeselect(item: MenuItem): void;
1500
1485
1501 /**
1486 /**
1502 * Callback fires when mouse exits a MenuItem
1487 * Callback fires when mouse exits a MenuItem
1503 */
1488 */
1504 onItemUnhover(item: MenuItem): void;
1489 onItemUnhover(item: MenuItem): void;
1505
1490
1506 /**
1491 /**
1507 * Cancels the popup timer because the user has stop hovering on the MenuItem, etc.
1492 * Cancels the popup timer because the user has stop hovering on the MenuItem, etc.
1508 */
1493 */
1509 _stopPopupTimer(): void;
1494 _stopPopupTimer(): void;
1510
1495
1511 /**
1496 /**
1512 * Cancels the pending-close timer because the close has been preempted
1497 * Cancels the pending-close timer because the close has been preempted
1513 */
1498 */
1514 _stopPendingCloseTimer(): void;
1499 _stopPendingCloseTimer(): void;
1515
1500
1516 /**
1501 /**
1517 * Returns the top menu in this chain of Menus
1502 * Returns the top menu in this chain of Menus
1518 */
1503 */
1519 _getTopMenu(): void;
1504 _getTopMenu(): void;
1520
1505
1521 /**
1506 /**
1522 * Handle clicks on an item.
1507 * Handle clicks on an item.
1523 */
1508 */
1524 onItemClick(item: _WidgetBase, evt: Event): void;
1509 onItemClick(item: _WidgetBase, evt: Event): void;
1525
1510
1526 /**
1511 /**
1527 * Open the popup to the side of/underneath the current menu item, and optionally focus first item
1512 * Open the popup to the side of/underneath the current menu item, and optionally focus first item
1528 */
1513 */
1529 _openItemPopup(fromItem: MenuItem, focus: boolean): void;
1514 _openItemPopup(fromItem: MenuItem, focus: boolean): void;
1530
1515
1531 /**
1516 /**
1532 * Callback when this menu is opened.
1517 * Callback when this menu is opened.
1533 * This is called by the popup manager as notification that the menu was opened.
1518 * This is called by the popup manager as notification that the menu was opened.
1534 */
1519 */
1535 onOpen(evt?: Event): void;
1520 onOpen(evt?: Event): void;
1536
1521
1537 /**
1522 /**
1538 * Callback when this menu is closed.
1523 * Callback when this menu is closed.
1539 * This is called by the popup manager as notification that the menu was closed.
1524 * This is called by the popup manager as notification that the menu was closed.
1540 */
1525 */
1541 onClose(): boolean;
1526 onClose(): boolean;
1542
1527
1543 /**
1528 /**
1544 * Called when submenu is clicked or focus is lost. Close hierarchy of menus.
1529 * Called when submenu is clicked or focus is lost. Close hierarchy of menus.
1545 */
1530 */
1546 _closeChild(): void;
1531 _closeChild(): void;
1547 /**
1532 /**
1548 * Called when child of this Menu gets focus from:
1533 * Called when child of this Menu gets focus from:
1549 *
1534 *
1550 * 1. clicking it
1535 * 1. clicking it
1551 * 2. tabbing into it
1536 * 2. tabbing into it
1552 * 3. being opened by a parent menu.
1537 * 3. being opened by a parent menu.
1553 *
1538 *
1554 * This is not called just from mouse hover.
1539 * This is not called just from mouse hover.
1555 */
1540 */
1556 _onItemFocus(item: MenuItem): void;
1541 _onItemFocus(item: MenuItem): void;
1557
1542
1558 /**
1543 /**
1559 * Called when focus is moved away from this Menu and it's submenus.
1544 * Called when focus is moved away from this Menu and it's submenus.
1560 */
1545 */
1561 _onBlur(): void;
1546 _onBlur(): void;
1562
1547
1563 /**
1548 /**
1564 * Called when the user is done with this menu. Closes hierarchy of menus.
1549 * Called when the user is done with this menu. Closes hierarchy of menus.
1565 */
1550 */
1566 _cleanUp(clearSelectedItem?: boolean): void;
1551 _cleanUp(clearSelectedItem?: boolean): void;
1567 }
1552 }
1568
1553
1569 interface _MenuBaseConstructor extends _WidgetBaseConstructor<_MenuBase> { }
1554 interface _MenuBaseConstructor extends _WidgetBaseConstructor<_MenuBase> { }
1570
1555
1571 /* dijit/Dialog */
1556 /* dijit/Dialog */
1572
1557
1573 interface _DialogBase extends _TemplatedMixin, form._FormMixin, _DialogMixin, _CssStateMixin {
1558 interface _DialogBase extends _TemplatedMixin, form._FormMixin, _DialogMixin, _CssStateMixin {
1574 templateString: string;
1559 templateString: string;
1575 baseClass: string;
1560 baseClass: string;
1576 cssStateNodes: CSSStateNodes;
1561 cssStateNodes: CSSStateNodes;
1577
1562
1578 /**
1563 /**
1579 * True if Dialog is currently displayed on screen.
1564 * True if Dialog is currently displayed on screen.
1580 */
1565 */
1581 open: boolean;
1566 open: boolean;
1582
1567
1583 /**
1568 /**
1584 * The time in milliseconds it takes the dialog to fade in and out
1569 * The time in milliseconds it takes the dialog to fade in and out
1585 */
1570 */
1586 duration: number;
1571 duration: number;
1587
1572
1588 /**
1573 /**
1589 * A Toggle to modify the default focus behavior of a Dialog, which
1574 * A Toggle to modify the default focus behavior of a Dialog, which
1590 * is to re-focus the element which had focus before being opened.
1575 * is to re-focus the element which had focus before being opened.
1591 * False will disable refocusing. Default: true
1576 * False will disable refocusing. Default: true
1592 */
1577 */
1593 refocus: boolean;
1578 refocus: boolean;
1594
1579
1595 /**
1580 /**
1596 * A Toggle to modify the default focus behavior of a Dialog, which
1581 * A Toggle to modify the default focus behavior of a Dialog, which
1597 * is to focus on the first dialog element after opening the dialog.
1582 * is to focus on the first dialog element after opening the dialog.
1598 * False will disable autofocusing. Default: true
1583 * False will disable autofocusing. Default: true
1599 */
1584 */
1600 autofocus: boolean;
1585 autofocus: boolean;
1601
1586
1602 /**
1587 /**
1603 * Toggles the movable aspect of the Dialog. If true, Dialog
1588 * Toggles the movable aspect of the Dialog. If true, Dialog
1604 * can be dragged by it's title. If false it will remain centered
1589 * can be dragged by it's title. If false it will remain centered
1605 * in the viewport.
1590 * in the viewport.
1606 */
1591 */
1607 draggable: boolean;
1592 draggable: boolean;
1608
1593
1609 /**
1594 /**
1610 * Maximum size to allow the dialog to expand to, relative to viewport size
1595 * Maximum size to allow the dialog to expand to, relative to viewport size
1611 */
1596 */
1612 maxRatio: number;
1597 maxRatio: number;
1613
1598
1614 /**
1599 /**
1615 * Dialog show [x] icon to close itself, and ESC key will close the dialog.
1600 * Dialog show [x] icon to close itself, and ESC key will close the dialog.
1616 */
1601 */
1617 closable: boolean;
1602 closable: boolean;
1618 postMixInProperties(): void;
1603 postMixInProperties(): void;
1619 postCreate(): void;
1604 postCreate(): void;
1620
1605
1621 /**
1606 /**
1622 * Called when data has been loaded from an href.
1607 * Called when data has been loaded from an href.
1623 * Unlike most other callbacks, this function can be connected to (via `dojo.connect`)
1608 * Unlike most other callbacks, this function can be connected to (via `dojo.connect`)
1624 * but should *not* be overridden.
1609 * but should *not* be overridden.
1625 */
1610 */
1626 onLoad(data?: any): void;
1611 onLoad(data?: any): void;
1627
1612
1628 focus(): void;
1613 focus(): void;
1629
1614
1630 /* Not entirely sure of the resolution type of these promises */
1615 /* Not entirely sure of the resolution type of these promises */
1631
1616
1632 /**
1617 /**
1633 * Display the dialog
1618 * Display the dialog
1634 */
1619 */
1635 show(): dojo.promise.Promise<any>;
1620 show(): dojo.promise.Promise<any>;
1636
1621
1637 /**
1622 /**
1638 * Hide the dialog
1623 * Hide the dialog
1639 */
1624 */
1640 hide(): dojo.promise.Promise<any>;
1625 hide(): dojo.promise.Promise<any>;
1641
1626
1642 /**
1627 /**
1643 * Called with no argument when viewport scrolled or viewport size changed. Adjusts Dialog as
1628 * Called with no argument when viewport scrolled or viewport size changed. Adjusts Dialog as
1644 * necessary to keep it visible.
1629 * necessary to keep it visible.
1645 *
1630 *
1646 * Can also be called with an argument (by dojox/layout/ResizeHandle etc.) to explicitly set the
1631 * Can also be called with an argument (by dojox/layout/ResizeHandle etc.) to explicitly set the
1647 * size of the dialog.
1632 * size of the dialog.
1648 */
1633 */
1649 resize(dim?: dojo.DomGeometryWidthHeight): void;
1634 resize(dim?: dojo.DomGeometryWidthHeight): void;
1650
1635
1651 destroy(preserveDom?: boolean): void;
1636 destroy(preserveDom?: boolean): void;
1652 }
1637 }
1653
1638
1654 interface _DialogBaseConstructor extends _WidgetBaseConstructor<_DialogBase> { }
1639 interface _DialogBaseConstructor extends _WidgetBaseConstructor<_DialogBase> { }
1655
1640
1656 interface Dialog extends layout.ContentPane, _DialogBase {
1641 interface Dialog extends layout.ContentPane, _DialogBase {
1657 /* overrides conflicting methods */
1642 /* overrides conflicting methods */
1658 resize(dim?: dojo.DomGeometryWidthHeight): void;
1643 resize(dim?: dojo.DomGeometryWidthHeight): void;
1659 }
1644 }
1660
1645
1661 interface DialogLevelManager {
1646 interface DialogLevelManager {
1662 _beginZIndex: number;
1647 _beginZIndex: number;
1663
1648
1664 /**
1649 /**
1665 * Call right before fade-in animation for new dialog.
1650 * Call right before fade-in animation for new dialog.
1666 *
1651 *
1667 * Saves current focus, displays/adjusts underlay for new dialog,
1652 * Saves current focus, displays/adjusts underlay for new dialog,
1668 * and sets the z-index of the dialog itself.
1653 * and sets the z-index of the dialog itself.
1669 *
1654 *
1670 * New dialog will be displayed on top of all currently displayed dialogs.
1655 * New dialog will be displayed on top of all currently displayed dialogs.
1671 * Caller is responsible for setting focus in new dialog after the fade-in
1656 * Caller is responsible for setting focus in new dialog after the fade-in
1672 * animation completes.
1657 * animation completes.
1673 */
1658 */
1674 show(dialog: _WidgetBase, underlayAttrs: Object): void;
1659 show(dialog: _WidgetBase, underlayAttrs: Object): void;
1675
1660
1676 /**
1661 /**
1677 * Called when the specified dialog is hidden/destroyed, after the fade-out
1662 * Called when the specified dialog is hidden/destroyed, after the fade-out
1678 * animation ends, in order to reset page focus, fix the underlay, etc.
1663 * animation ends, in order to reset page focus, fix the underlay, etc.
1679 * If the specified dialog isn't open then does nothing.
1664 * If the specified dialog isn't open then does nothing.
1680 *
1665 *
1681 * Caller is responsible for either setting display:none on the dialog domNode,
1666 * Caller is responsible for either setting display:none on the dialog domNode,
1682 * or calling dijit/popup.hide(), or removing it from the page DOM.
1667 * or calling dijit/popup.hide(), or removing it from the page DOM.
1683 */
1668 */
1684 hide(dialog: _WidgetBase): void;
1669 hide(dialog: _WidgetBase): void;
1685
1670
1686 /**
1671 /**
1687 * Returns true if specified Dialog is the top in the task
1672 * Returns true if specified Dialog is the top in the task
1688 */
1673 */
1689 isTop(dialog: _WidgetBase): boolean;
1674 isTop(dialog: _WidgetBase): boolean;
1690 }
1675 }
1691
1676
1692 interface DialogConstructor extends _WidgetBaseConstructor<Dialog> {
1677 interface DialogConstructor extends _WidgetBaseConstructor<Dialog> {
1693 /**
1678 /**
1694 * for monkey patching and dojox/widget/DialogSimple
1679 * for monkey patching and dojox/widget/DialogSimple
1695 */
1680 */
1696 _DialogBase: _DialogBaseConstructor;
1681 _DialogBase: _DialogBaseConstructor;
1697 _DialogLevelManager: DialogLevelManager;
1682 _DialogLevelManager: DialogLevelManager;
1698 _dialogStack: {
1683 _dialogStack: {
1699 dialog: _WidgetBase,
1684 dialog: _WidgetBase,
1700 focus: any,
1685 focus: any,
1701 underlayAttrs: any
1686 underlayAttrs: any
1702 }[];
1687 }[];
1703 }
1688 }
1704
1689
1705 /* dijit/ConfirmDialog */
1690 /* dijit/ConfirmDialog */
1706
1691
1707 interface ConfirmDialog extends _ConfirmDialogMixin { }
1692 interface ConfirmDialog extends _ConfirmDialogMixin { }
1708
1693
1709 interface ConfirmDialogConstructor extends DialogConstructor { }
1694 interface ConfirmDialogConstructor extends DialogConstructor { }
1710
1695
1711 /* dijit/DropDownMenu */
1696 /* dijit/DropDownMenu */
1712
1697
1713 /**
1698 /**
1714 * A menu, without features for context menu (Meaning, drop down menu)
1699 * A menu, without features for context menu (Meaning, drop down menu)
1715 */
1700 */
1716 interface DropDownMenu extends _MenuBase { }
1701 interface DropDownMenu extends _MenuBase { }
1717
1702
1718 interface DropDownMenuConstructor extends _WidgetBaseConstructor<DropDownMenu> { }
1703 interface DropDownMenuConstructor extends _WidgetBaseConstructor<DropDownMenu> { }
1719
1704
1720 /* dijit/Fieldset */
1705 /* dijit/Fieldset */
1721
1706
1722 /**
1707 /**
1723 * An accessible fieldset that can be expanded or collapsed via
1708 * An accessible fieldset that can be expanded or collapsed via
1724 * its legend. Fieldset extends `dijit.TitlePane`.
1709 * its legend. Fieldset extends `dijit.TitlePane`.
1725 */
1710 */
1726 interface Fieldset extends TitlePane {
1711 interface Fieldset extends TitlePane {
1727 open: boolean;
1712 open: boolean;
1728 }
1713 }
1729
1714
1730 interface FieldsetConstructor extends _WidgetBaseConstructor<Fieldset> { }
1715 interface FieldsetConstructor extends _WidgetBaseConstructor<Fieldset> { }
1731
1716
1732 /* dijit/Menu */
1717 /* dijit/Menu */
1733
1718
1734 /**
1719 /**
1735 * A context menu you can assign to multiple elements
1720 * A context menu you can assign to multiple elements
1736 */
1721 */
1737 interface Menu extends dijit.DropDownMenu {
1722 interface Menu extends dijit.DropDownMenu {
1738 /**
1723 /**
1739 * Array of dom node ids of nodes to attach to.
1724 * Array of dom node ids of nodes to attach to.
1740 * Fill this with nodeIds upon widget creation and it becomes context menu for those nodes.
1725 * Fill this with nodeIds upon widget creation and it becomes context menu for those nodes.
1741 */
1726 */
1742 targetNodeIds: string[];
1727 targetNodeIds: string[];
1743
1728
1744 /**
1729 /**
1745 * CSS expression to apply this Menu to descendants of targetNodeIds, rather than to
1730 * CSS expression to apply this Menu to descendants of targetNodeIds, rather than to
1746 * the nodes specified by targetNodeIds themselves. Useful for applying a Menu to
1731 * the nodes specified by targetNodeIds themselves. Useful for applying a Menu to
1747 * a range of rows in a table, tree, etc.
1732 * a range of rows in a table, tree, etc.
1748 *
1733 *
1749 * The application must require() an appropriate level of dojo/query to handle the selector.
1734 * The application must require() an appropriate level of dojo/query to handle the selector.
1750 */
1735 */
1751 selector: string;
1736 selector: string;
1752
1737
1753 /**
1738 /**
1754 * If true, right clicking anywhere on the window will cause this context menu to open.
1739 * If true, right clicking anywhere on the window will cause this context menu to open.
1755 * If false, must specify targetNodeIds.
1740 * If false, must specify targetNodeIds.
1756 */
1741 */
1757 contextMenuForWindow: boolean;
1742 contextMenuForWindow: boolean;
1758
1743
1759 /**
1744 /**
1760 * If true, menu will open on left click instead of right click, similar to a file menu.
1745 * If true, menu will open on left click instead of right click, similar to a file menu.
1761 */
1746 */
1762 leftClickToOpen: boolean;
1747 leftClickToOpen: boolean;
1763
1748
1764 /**
1749 /**
1765 * When this menu closes, re-focus the element which had focus before it was opened.
1750 * When this menu closes, re-focus the element which had focus before it was opened.
1766 */
1751 */
1767 refocus: boolean;
1752 refocus: boolean;
1768
1753
1769 /**
1754 /**
1770 * Attach menu to given node
1755 * Attach menu to given node
1771 */
1756 */
1772 bindDomNode(node: string | Node): void;
1757 bindDomNode(node: string | Node): void;
1773
1758
1774 /**
1759 /**
1775 * Detach menu from given node
1760 * Detach menu from given node
1776 */
1761 */
1777 unBindDomNode(nodeName: string | Node): void;
1762 unBindDomNode(nodeName: string | Node): void;
1778 }
1763 }
1779
1764
1780 interface MenuConstructor extends _WidgetBaseConstructor<Menu> { }
1765 interface MenuConstructor extends _WidgetBaseConstructor<Menu> { }
1781
1766
1782 /* dijit/MenuBar */
1767 /* dijit/MenuBar */
1783 interface MenuBar extends _MenuBase {
1768 interface MenuBar extends _MenuBase {
1784 baseClass: 'dijitMenuBar';
1769 baseClass: 'dijitMenuBar';
1785 popupDelay: number;
1770 popupDelay: number;
1786 _isMenuBar: true;
1771 _isMenuBar: true;
1787 _orient: string[];
1772 _orient: string[];
1788 _moveToPopup(evt: Event): void;
1773 _moveToPopup(evt: Event): void;
1789 focusChild(item: _WidgetBase): void;
1774 focusChild(item: _WidgetBase): void;
1790 _onChildDeselect(item: _WidgetBase): void;
1775 _onChildDeselect(item: _WidgetBase): void;
1791 _onLeftArrow(): void;
1776 _onLeftArrow(): void;
1792 _onRightArrow(): void;
1777 _onRightArrow(): void;
1793 _onDownArrow(): void;
1778 _onDownArrow(): void;
1794 _onUpArrow(): void;
1779 _onUpArrow(): void;
1795 onItemClick(item: _WidgetBase, evt: Event): void;
1780 onItemClick(item: _WidgetBase, evt: Event): void;
1796 }
1781 }
1797
1782
1798 interface MenuBarConstructor extends _WidgetBaseConstructor<MenuBar> { }
1783 interface MenuBarConstructor extends _WidgetBaseConstructor<MenuBar> { }
1799
1784
1800 /* dijit/MenuBarItem */
1785 /* dijit/MenuBarItem */
1801 interface MenuBarItem extends MenuItem { }
1786 interface MenuBarItem extends MenuItem { }
1802
1787
1803 interface MenuBarItemConstructor extends _WidgetBaseConstructor<MenuBarItem> { }
1788 interface MenuBarItemConstructor extends _WidgetBaseConstructor<MenuBarItem> { }
1804
1789
1805 /* dijit/MenuItem */
1790 /* dijit/MenuItem */
1806 interface MenuItem extends _Widget, _TemplatedMixin, _Contained, _CssStateMixin {
1791 interface MenuItem extends _Widget, _TemplatedMixin, _Contained, _CssStateMixin {
1807 /**
1792 /**
1808 * Text for the accelerator (shortcut) key combination, a control, alt, etc. modified keystroke meant to execute the menu item regardless of where the focus is on the page.
1793 * Text for the accelerator (shortcut) key combination, a control, alt, etc. modified keystroke meant to execute the menu item regardless of where the focus is on the page.
1809 *
1794 *
1810 * Note that although Menu can display accelerator keys, there is no infrastructure to actually catch and execute those accelerators.
1795 * Note that although Menu can display accelerator keys, there is no infrastructure to actually catch and execute those accelerators.
1811 */
1796 */
1812 accelKey: string;
1797 accelKey: string;
1813
1798
1814 /**
1799 /**
1815 * If true, the menu item is disabled.
1800 * If true, the menu item is disabled.
1816 * If false, the menu item is enabled.
1801 * If false, the menu item is enabled.
1817 */
1802 */
1818 disabled: boolean;
1803 disabled: boolean;
1819
1804
1820 /** Menu text as HTML */
1805 /** Menu text as HTML */
1821 label: string;
1806 label: string;
1822
1807
1823 /**
1808 /**
1824 * Class to apply to DOMNode to make it display an icon.
1809 * Class to apply to DOMNode to make it display an icon.
1825 */
1810 */
1826 iconClass: string;
1811 iconClass: string;
1827
1812
1828 /**
1813 /**
1829 * Hook for attr('accelKey', ...) to work.
1814 * Hook for attr('accelKey', ...) to work.
1830 * Set accelKey on this menu item.
1815 * Set accelKey on this menu item.
1831 */
1816 */
1832 _setAccelKeyAttr(value: string): void;
1817 _setAccelKeyAttr(value: string): void;
1833
1818
1834 /**
1819 /**
1835 * Hook for attr('disabled', ...) to work.
1820 * Hook for attr('disabled', ...) to work.
1836 * Enable or disable this menu item.
1821 * Enable or disable this menu item.
1837 */
1822 */
1838 _setDisabledAttr(value: boolean): void;
1823 _setDisabledAttr(value: boolean): void;
1839
1824
1840 _setLabelAttr(val: string): void;
1825 _setLabelAttr(val: string): void;
1841 _setIconClassAttr(val: string): void;
1826 _setIconClassAttr(val: string): void;
1842
1827
1843 _fillContent(source: Element): void;
1828 _fillContent(source: Element): void;
1844
1829
1845 /**
1830 /**
1846 * Indicate that this node is the currently selected one
1831 * Indicate that this node is the currently selected one
1847 */
1832 */
1848 _setSelected(selected: boolean): void;
1833 _setSelected(selected: boolean): void;
1849
1834
1850 focus(): void;
1835 focus(): void;
1851
1836
1852 /**
1837 /**
1853 * Deprecated.
1838 * Deprecated.
1854 * Use set('disabled', bool) instead.
1839 * Use set('disabled', bool) instead.
1855 */
1840 */
1856 setDisabled(disabled: boolean): void;
1841 setDisabled(disabled: boolean): void;
1857
1842
1858 /**
1843 /**
1859 * Deprecated.
1844 * Deprecated.
1860 * Use set('label', ...) instead.
1845 * Use set('label', ...) instead.
1861 */
1846 */
1862 setLabel(content: string): void;
1847 setLabel(content: string): void;
1863 }
1848 }
1864
1849
1865 interface MenuItemConstructor extends _WidgetBaseConstructor<MenuItem> { }
1850 interface MenuItemConstructor extends _WidgetBaseConstructor<MenuItem> { }
1866
1851
1867 /* dijit/MenuSeparator */
1852 /* dijit/MenuSeparator */
1868 interface MenuSeparator extends _WidgetBase, _TemplatedMixin, _Contained { }
1853 interface MenuSeparator extends _WidgetBase, _TemplatedMixin, _Contained { }
1869
1854
1870 interface MenuSeparatorConstructor extends _WidgetBaseConstructor<MenuSeparator> { }
1855 interface MenuSeparatorConstructor extends _WidgetBaseConstructor<MenuSeparator> { }
1871
1856
1872 /* dijit/place */
1857 /* dijit/place */
1873
1858
1874 interface PlacePosition {
1859 interface PlacePosition {
1875 x: number;
1860 x: number;
1876 y: number;
1861 y: number;
1877 }
1862 }
1878
1863
1879 interface PlaceWidthHeight {
1864 interface PlaceWidthHeight {
1880 w: number;
1865 w: number;
1881 h: number;
1866 h: number;
1882 }
1867 }
1883
1868
1884 interface PlaceRectangle extends PlacePosition, PlaceWidthHeight { }
1869 interface PlaceRectangle extends PlacePosition, PlaceWidthHeight { }
1885
1870
1886 type PlaceCorner = 'BL' | 'TR' | 'BR' | 'TL';
1871 type PlaceCorner = 'BL' | 'TR' | 'BR' | 'TL';
1887
1872
1888 type PlacePositions = 'before' | 'after' | 'before-centered' | 'after-centered' | 'above-centered' | 'above' | 'above-alt' | 'below-centered' | 'below' | 'below-alt';
1873 type PlacePositions = 'before' | 'after' | 'before-centered' | 'after-centered' | 'above-centered' | 'above' | 'above-alt' | 'below-centered' | 'below' | 'below-alt';
1889
1874
1890 interface PlaceChoice {
1875 interface PlaceChoice {
1891 corner: PlaceCorner;
1876 corner: PlaceCorner;
1892 pos: PlacePosition;
1877 pos: PlacePosition;
1893 aroundCorner?: PlaceCorner;
1878 aroundCorner?: PlaceCorner;
1894 }
1879 }
1895
1880
1896 interface PlaceLocation extends PlaceRectangle {
1881 interface PlaceLocation extends PlaceRectangle {
1897 corner: PlaceCorner;
1882 corner: PlaceCorner;
1898 aroundCorner: PlaceCorner;
1883 aroundCorner: PlaceCorner;
1899 overflow: number;
1884 overflow: number;
1900 spaceAvailable: PlaceWidthHeight;
1885 spaceAvailable: PlaceWidthHeight;
1901 }
1886 }
1902
1887
1903 interface LayoutNodeFunction {
1888 interface LayoutNodeFunction {
1904 (node: HTMLElement, aroundCorner: string, corner: string, spaceAvailable: PlaceWidthHeight, aroundNodeCoords: PlaceWidthHeight): number;
1889 (node: HTMLElement, aroundCorner: string, corner: string, spaceAvailable: PlaceWidthHeight, aroundNodeCoords: PlaceWidthHeight): number;
1905 }
1890 }
1906
1891
1907 interface Place {
1892 interface Place {
1908 /**
1893 /**
1909 * Positions node kitty-corner to the rectangle centered at (pos.x, pos.y) with width and height of
1894 * Positions node kitty-corner to the rectangle centered at (pos.x, pos.y) with width and height of
1910 * padding.x * 2 and padding.y * 2, or zero if padding not specified. Picks first corner in corners[]
1895 * padding.x * 2 and padding.y * 2, or zero if padding not specified. Picks first corner in corners[]
1911 * where node is fully visible, or the corner where it's most visible.
1896 * where node is fully visible, or the corner where it's most visible.
1912 *
1897 *
1913 * Node is assumed to be absolutely or relatively positioned.
1898 * Node is assumed to be absolutely or relatively positioned.
1914 */
1899 */
1915 at(node: Element, pos?: PlacePosition, corners?: PlaceCorner[], padding?: PlacePosition, layoutNode?: LayoutNodeFunction): PlaceLocation;
1900 at(node: Element, pos?: PlacePosition, corners?: PlaceCorner[], padding?: PlacePosition, layoutNode?: LayoutNodeFunction): PlaceLocation;
1916
1901
1917 /**
1902 /**
1918 * Position node adjacent or kitty-corner to anchor
1903 * Position node adjacent or kitty-corner to anchor
1919 * such that it's fully visible in viewport.
1904 * such that it's fully visible in viewport.
1920 */
1905 */
1921 around(node: Element, anchor: Element | PlaceRectangle, positions: PlacePositions[], leftToRight?: boolean, layoutNode?: LayoutNodeFunction): PlaceLocation;
1906 around(node: Element, anchor: Element | PlaceRectangle, positions: PlacePositions[], leftToRight?: boolean, layoutNode?: LayoutNodeFunction): PlaceLocation;
1922 }
1907 }
1923
1908
1924 /* dijit/popup */
1909 /* dijit/popup */
1925
1910
1926 interface PopupOpenArgs {
1911 interface PopupOpenArgs {
1927 /**
1912 /**
1928 * widget to display
1913 * widget to display
1929 */
1914 */
1930 popup?: _WidgetBase;
1915 popup?: _WidgetBase;
1931
1916
1932 /**
1917 /**
1933 * the button etc. that is displaying this popup
1918 * the button etc. that is displaying this popup
1934 */
1919 */
1935 parent?: _WidgetBase;
1920 parent?: _WidgetBase;
1936
1921
1937 /**
1922 /**
1938 * DOM node (typically a button); place popup relative to this node. (Specify this *or* "x" and "y" parameters.)
1923 * DOM node (typically a button); place popup relative to this node. (Specify this *or* "x" and "y" parameters.)
1939 */
1924 */
1940 around?: HTMLElement;
1925 around?: HTMLElement;
1941
1926
1942 /**
1927 /**
1943 * Absolute horizontal position (in pixels) to place node at. (Specify this *or* "around" parameter.)
1928 * Absolute horizontal position (in pixels) to place node at. (Specify this *or* "around" parameter.)
1944 */
1929 */
1945 x?: number;
1930 x?: number;
1946
1931
1947 /**
1932 /**
1948 * Absolute vertical position (in pixels) to place node at. (Specify this *or* "around" parameter.)
1933 * Absolute vertical position (in pixels) to place node at. (Specify this *or* "around" parameter.)
1949 */
1934 */
1950 y?: number;
1935 y?: number;
1951
1936
1952 /**
1937 /**
1953 * When the around parameter is specified, orient should be a list of positions to try
1938 * When the around parameter is specified, orient should be a list of positions to try
1954 */
1939 */
1955 orient?: string | string[] | { BL?: string; TR?: string; TL?: string; BR?: string; };
1940 orient?: string | string[] | { BL?: string; TR?: string; TL?: string; BR?: string; };
1956
1941
1957 /**
1942 /**
1958 * callback when user has canceled the popup by:
1943 * callback when user has canceled the popup by:
1959 *
1944 *
1960 * 1. hitting ESC or
1945 * 1. hitting ESC or
1961 * 2. by using the popup widget's proprietary cancel mechanism (like a cancel button in a dialog);
1946 * 2. by using the popup widget's proprietary cancel mechanism (like a cancel button in a dialog);
1962 * i.e. whenever popupWidget.onCancel() is called, args.onCancel is called
1947 * i.e. whenever popupWidget.onCancel() is called, args.onCancel is called
1963 */
1948 */
1964 onCancel?: () => void;
1949 onCancel?: () => void;
1965
1950
1966 /**
1951 /**
1967 * callback whenever this popup is closed
1952 * callback whenever this popup is closed
1968 */
1953 */
1969 onClose?: () => void;
1954 onClose?: () => void;
1970
1955
1971 /**
1956 /**
1972 * callback when user "executed" on the popup/sub-popup by selecting a menu choice, etc. (top menu only)
1957 * callback when user "executed" on the popup/sub-popup by selecting a menu choice, etc. (top menu only)
1973 */
1958 */
1974 onExecute?: () => void;
1959 onExecute?: () => void;
1975
1960
1976 /**
1961 /**
1977 * adding a buffer around the opening position. This is only useful when around is not set.
1962 * adding a buffer around the opening position. This is only useful when around is not set.
1978 */
1963 */
1979 padding?: PlacePosition;
1964 padding?: PlacePosition;
1980
1965
1981 /**
1966 /**
1982 * The max height for the popup. Any popup taller than this will have scrollbars.
1967 * The max height for the popup. Any popup taller than this will have scrollbars.
1983 * Set to Infinity for no max height. Default is to limit height to available space in viewport,
1968 * Set to Infinity for no max height. Default is to limit height to available space in viewport,
1984 * above or below the aroundNode or specified x/y position.
1969 * above or below the aroundNode or specified x/y position.
1985 */
1970 */
1986 maxHeight?: number;
1971 maxHeight?: number;
1987 }
1972 }
1988
1973
1989 interface PopupManager {
1974 interface PopupManager {
1990 /**
1975 /**
1991 * Stack of currently popped up widgets.
1976 * Stack of currently popped up widgets.
1992 * (someone opened _stack[0], and then it opened _stack[1], etc.)
1977 * (someone opened _stack[0], and then it opened _stack[1], etc.)
1993 */
1978 */
1994 _stack: _WidgetBase[];
1979 _stack: _WidgetBase[];
1995
1980
1996 /**
1981 /**
1997 * Z-index of the first popup. (If first popup opens other
1982 * Z-index of the first popup. (If first popup opens other
1998 * popups they get a higher z-index.)
1983 * popups they get a higher z-index.)
1999 */
1984 */
2000 _beginZIndex: number;
1985 _beginZIndex: number;
2001
1986
2002 _idGen: number;
1987 _idGen: number;
2003
1988
2004 /**
1989 /**
2005 * If screen has been scrolled, reposition all the popups in the stack.
1990 * If screen has been scrolled, reposition all the popups in the stack.
2006 * Then set timer to check again later.
1991 * Then set timer to check again later.
2007 */
1992 */
2008 _repositionAll(): void;
1993 _repositionAll(): void;
2009
1994
2010 /**
1995 /**
2011 * Initialization for widgets that will be used as popups.
1996 * Initialization for widgets that will be used as popups.
2012 * Puts widget inside a wrapper DIV (if not already in one),
1997 * Puts widget inside a wrapper DIV (if not already in one),
2013 * and returns pointer to that wrapper DIV.
1998 * and returns pointer to that wrapper DIV.
2014 */
1999 */
2015 _createWrapper(widget: _WidgetBase): HTMLDivElement;
2000 _createWrapper(widget: _WidgetBase): HTMLDivElement;
2016
2001
2017 /**
2002 /**
2018 * Moves the popup widget off-screen.
2003 * Moves the popup widget off-screen.
2019 * Do not use this method to hide popups when not in use, because
2004 * Do not use this method to hide popups when not in use, because
2020 * that will create an accessibility issue: the offscreen popup is
2005 * that will create an accessibility issue: the offscreen popup is
2021 * still in the tabbing order.
2006 * still in the tabbing order.
2022 */
2007 */
2023 moveOffScreen(widget: _WidgetBase): HTMLDivElement;
2008 moveOffScreen(widget: _WidgetBase): HTMLDivElement;
2024
2009
2025 /**
2010 /**
2026 * Hide this popup widget (until it is ready to be shown).
2011 * Hide this popup widget (until it is ready to be shown).
2027 * Initialization for widgets that will be used as popups
2012 * Initialization for widgets that will be used as popups
2028 *
2013 *
2029 * Also puts widget inside a wrapper DIV (if not already in one)
2014 * Also puts widget inside a wrapper DIV (if not already in one)
2030 *
2015 *
2031 * If popup widget needs to layout it should
2016 * If popup widget needs to layout it should
2032 * do so when it is made visible, and popup._onShow() is called.
2017 * do so when it is made visible, and popup._onShow() is called.
2033 */
2018 */
2034 hide(widget: _WidgetBase): void;
2019 hide(widget: _WidgetBase): void;
2035
2020
2036 /**
2021 /**
2037 * Compute the closest ancestor popup that's *not* a child of another popup.
2022 * Compute the closest ancestor popup that's *not* a child of another popup.
2038 * Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button.
2023 * Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button.
2039 */
2024 */
2040 getTopPopup(): _WidgetBase;
2025 getTopPopup(): _WidgetBase;
2041
2026
2042 /**
2027 /**
2043 * Popup the widget at the specified position
2028 * Popup the widget at the specified position
2044 */
2029 */
2045 open(args: PopupOpenArgs): PlaceLocation;
2030 open(args: PopupOpenArgs): PlaceLocation;
2046
2031
2047 /**
2032 /**
2048 * Close specified popup and any popups that it parented.
2033 * Close specified popup and any popups that it parented.
2049 * If no popup is specified, closes all popups.
2034 * If no popup is specified, closes all popups.
2050 */
2035 */
2051 close(popup?: _WidgetBase): void;
2036 close(popup?: _WidgetBase): void;
2052 }
2037 }
2053
2038
2054 /* dijit/PopupMenuBarItem */
2039 /* dijit/PopupMenuBarItem */
2055
2040
2056 interface PopupMenuBarItem extends PopupMenuItem { }
2041 interface PopupMenuBarItem extends PopupMenuItem { }
2057
2042
2058 interface PopupMenuBarItemConstructor extends _WidgetBaseConstructor<PopupMenuBarItem> { }
2043 interface PopupMenuBarItemConstructor extends _WidgetBaseConstructor<PopupMenuBarItem> { }
2059
2044
2060 /** dijit/PopupMenuItem */
2045 /** dijit/PopupMenuItem */
2061
2046
2062 /**
2047 /**
2063 * An item in a Menu that spawn a drop down (usually a drop down menu)
2048 * An item in a Menu that spawn a drop down (usually a drop down menu)
2064 */
2049 */
2065 interface PopupMenuItem extends MenuItem {
2050 interface PopupMenuItem extends MenuItem {
2066 /**
2051 /**
2067 * When Menu is declared in markup, this code gets the menu label and the popup widget from the srcNodeRef.
2052 * When Menu is declared in markup, this code gets the menu label and the popup widget from the srcNodeRef.
2068 *
2053 *
2069 * srcNodeRef.innerHTML contains both the menu item text and a popup widget
2054 * srcNodeRef.innerHTML contains both the menu item text and a popup widget
2070 * The first part holds the menu item text and the second part is the popup
2055 * The first part holds the menu item text and the second part is the popup
2071 */
2056 */
2072 _fillContent(source: Element): void;
2057 _fillContent(source: Element): void;
2073
2058
2074 /**
2059 /**
2075 * Open the popup to the side of/underneath this MenuItem, and optionally focus first item
2060 * Open the popup to the side of/underneath this MenuItem, and optionally focus first item
2076 */
2061 */
2077 _openPopup(params: { around?: Element; popup?: Function }, focus?: boolean): void;
2062 _openPopup(params: { around?: Element; popup?: Function }, focus?: boolean): void;
2078
2063
2079 _closePopup(): void;
2064 _closePopup(): void;
2080 }
2065 }
2081
2066
2082 interface PopupMenuItemConstructor extends _WidgetBaseConstructor<PopupMenuItem> { }
2067 interface PopupMenuItemConstructor extends _WidgetBaseConstructor<PopupMenuItem> { }
2083
2068
2084 /* dijit/registry */
2069 /* dijit/registry */
2085
2070
2086 interface Registry {
2071 interface Registry {
2087 /**
2072 /**
2088 * Number of registered widgets
2073 * Number of registered widgets
2089 */
2074 */
2090 length: number;
2075 length: number;
2091
2076
2092 /**
2077 /**
2093 * Add a widget to the registry. If a duplicate ID is detected, a error is thrown.
2078 * Add a widget to the registry. If a duplicate ID is detected, a error is thrown.
2094 */
2079 */
2095 add(widget: _WidgetBase): void;
2080 add(widget: _WidgetBase): void;
2096
2081
2097 /**
2082 /**
2098 * Remove a widget from the registry. Does not destroy the widget; simply
2083 * Remove a widget from the registry. Does not destroy the widget; simply
2099 * removes the reference.
2084 * removes the reference.
2100 */
2085 */
2101 remove(id: string): void;
2086 remove(id: string): void;
2102
2087
2103 /**
2088 /**
2104 * Find a widget by it's id.
2089 * Find a widget by it's id.
2105 * If passed a widget then just returns the widget.
2090 * If passed a widget then just returns the widget.
2106 */
2091 */
2107 byId(id: string | _WidgetBase): _WidgetBase;
2092 byId(id: string | _WidgetBase): _WidgetBase;
2108
2093
2109 /**
2094 /**
2110 * Returns the widget corresponding to the given DOMNode
2095 * Returns the widget corresponding to the given DOMNode
2111 */
2096 */
2112 byNode(node: Element | Node): _WidgetBase;
2097 byNode(node: Element | Node): _WidgetBase;
2113
2098
2114 /**
2099 /**
2115 * Convert registry into a true Array
2100 * Convert registry into a true Array
2116 */
2101 */
2117 toArray(): _WidgetBase[];
2102 toArray(): _WidgetBase[];
2118
2103
2119 /**
2104 /**
2120 * Generates a unique id for a given widgetType
2105 * Generates a unique id for a given widgetType
2121 */
2106 */
2122 getUniqueId(widgetType: string): string;
2107 getUniqueId(widgetType: string): string;
2123
2108
2124 /**
2109 /**
2125 * Search subtree under root returning widgets found.
2110 * Search subtree under root returning widgets found.
2126 * Doesn't search for nested widgets (ie, widgets inside other widgets).
2111 * Doesn't search for nested widgets (ie, widgets inside other widgets).
2127 */
2112 */
2128 findWidgets(root: Node, skipNode?: Node): _WidgetBase[];
2113 findWidgets(root: Node, skipNode?: Node): _WidgetBase[];
2129
2114
2130 /**
2115 /**
2131 * Returns the widget whose DOM tree contains the specified DOMNode, or null if
2116 * Returns the widget whose DOM tree contains the specified DOMNode, or null if
2132 * the node is not contained within the DOM tree of any widget
2117 * the node is not contained within the DOM tree of any widget
2133 */
2118 */
2134 getEnclosingWidget(node: Element | Node): _WidgetBase;
2119 getEnclosingWidget(node: Element | Node): _WidgetBase;
2135 }
2120 }
2136
2121
2137 /* dijit/TitlePane */
2122 /* dijit/TitlePane */
2138
2123
2139 interface TitlePane extends dijit.layout.ContentPane, _TemplatedMixin, _CssStateMixin {
2124 interface TitlePane extends dijit.layout.ContentPane, _TemplatedMixin, _CssStateMixin {
2140 /**
2125 /**
2141 * Whether pane can be opened or closed by clicking the title bar.
2126 * Whether pane can be opened or closed by clicking the title bar.
2142 */
2127 */
2143 toggleable: boolean;
2128 toggleable: boolean;
2144
2129
2145 /**
2130 /**
2146 * Tabindex setting for the title (so users can tab to the title then use space/enter to open/close the title pane)
2131 * Tabindex setting for the title (so users can tab to the title then use space/enter to open/close the title pane)
2147 */
2132 */
2148 tabIndex: string;
2133 tabIndex: string;
2149
2134
2150 /**
2135 /**
2151 * Time in milliseconds to fade in/fade out
2136 * Time in milliseconds to fade in/fade out
2152 */
2137 */
2153 duration: number;
2138 duration: number;
2154
2139
2155 /**
2140 /**
2156 * Don't change this parameter from the default value.
2141 * Don't change this parameter from the default value.
2157 *
2142 *
2158 * This ContentPane parameter doesn't make sense for TitlePane, since TitlePane is never a child of a layout container, nor should TitlePane try to control the size of an inner widget.
2143 * This ContentPane parameter doesn't make sense for TitlePane, since TitlePane is never a child of a layout container, nor should TitlePane try to control the size of an inner widget.
2159 */
2144 */
2160 doLayout: boolean;
2145 doLayout: boolean;
2161
2146
2162 /**
2147 /**
2163 * Switches between opened and closed state
2148 * Switches between opened and closed state
2164 */
2149 */
2165 toggle(): void;
2150 toggle(): void;
2166
2151
2167 /**
2152 /**
2168 * Set the open/close css state for the TitlePane
2153 * Set the open/close css state for the TitlePane
2169 */
2154 */
2170 _setCss(): void;
2155 _setCss(): void;
2171
2156
2172 /**
2157 /**
2173 * Handler for when user hits a key
2158 * Handler for when user hits a key
2174 */
2159 */
2175 _onTitleKey(e: Event): void;
2160 _onTitleKey(e: Event): void;
2176
2161
2177 /**
2162 /**
2178 * Handler when user clicks the title bar
2163 * Handler when user clicks the title bar
2179 */
2164 */
2180 _onTitleClick(): void;
2165 _onTitleClick(): void;
2181
2166
2182 /**
2167 /**
2183 * Deprecated. Use set('title', ...) instead.
2168 * Deprecated. Use set('title', ...) instead.
2184 */
2169 */
2185 setTitle(): void;
2170 setTitle(): void;
2186 }
2171 }
2187
2172
2188 interface TitlePaneConstructor extends _WidgetBaseConstructor<TitlePane> { }
2173 interface TitlePaneConstructor extends _WidgetBaseConstructor<TitlePane> { }
2189
2174
2190 /* dijit/Toolbar */
2175 /* dijit/Toolbar */
2191
2176
2192 interface Toolbar extends dijit._Widget, dijit._TemplatedMixin, dijit._KeyNavContainer { }
2177 interface Toolbar extends dijit._Widget, dijit._TemplatedMixin, dijit._KeyNavContainer { }
2193
2178
2194 interface ToolbarConstructor extends _WidgetBaseConstructor<Toolbar> { }
2179 interface ToolbarConstructor extends _WidgetBaseConstructor<Toolbar> { }
2195
2180
2196 /* dijit/ToolbarSeparator */
2181 /* dijit/ToolbarSeparator */
2197
2182
2198 interface ToolbarSeparator extends dijit._Widget, dijit._TemplatedMixin { }
2183 interface ToolbarSeparator extends dijit._Widget, dijit._TemplatedMixin { }
2199
2184
2200 interface ToolbarSeparatorConstructor extends _WidgetBaseConstructor<ToolbarSeparator> { }
2185 interface ToolbarSeparatorConstructor extends _WidgetBaseConstructor<ToolbarSeparator> { }
2201
2186
2202 /* dijit/Tooltip */
2187 /* dijit/Tooltip */
2203
2188
2204 interface Tooltip extends _Widget {
2189 interface Tooltip extends _Widget {
2205 /**
2190 /**
2206 * HTML to display in the tooltip.
2191 * HTML to display in the tooltip.
2207 * Specified as innerHTML when creating the widget from markup.
2192 * Specified as innerHTML when creating the widget from markup.
2208 */
2193 */
2209 label: string;
2194 label: string;
2210
2195
2211 /**
2196 /**
2212 * Number of milliseconds to wait after hovering over/focusing on the object, before
2197 * Number of milliseconds to wait after hovering over/focusing on the object, before
2213 * the tooltip is displayed.
2198 * the tooltip is displayed.
2214 */
2199 */
2215 showDelay: number;
2200 showDelay: number;
2216
2201
2217 /**
2202 /**
2218 * Number of milliseconds to wait after unhovering the object, before
2203 * Number of milliseconds to wait after unhovering the object, before
2219 * the tooltip is hidden. Note that blurring an object hides the tooltip immediately.
2204 * the tooltip is hidden. Note that blurring an object hides the tooltip immediately.
2220 */
2205 */
2221 hideDelay: number;
2206 hideDelay: number;
2222
2207
2223 /**
2208 /**
2224 * Id of domNode(s) to attach the tooltip to.
2209 * Id of domNode(s) to attach the tooltip to.
2225 * When user hovers over specified dom node(s), the tooltip will appear.
2210 * When user hovers over specified dom node(s), the tooltip will appear.
2226 */
2211 */
2227 connectId: dojo.NodeOrString | dojo.NodeOrString[];
2212 connectId: dojo.NodeOrString | dojo.NodeOrString[];
2228
2213
2229 /**
2214 /**
2230 * See description of `dijit/Tooltip.defaultPosition` for details on position parameter.
2215 * See description of `dijit/Tooltip.defaultPosition` for details on position parameter.
2231 */
2216 */
2232 position: string;
2217 position: string;
2233
2218
2234 /**
2219 /**
2235 * CSS expression to apply this Tooltip to descendants of connectIds, rather than to
2220 * CSS expression to apply this Tooltip to descendants of connectIds, rather than to
2236 * the nodes specified by connectIds themselves. Useful for applying a Tooltip to
2221 * the nodes specified by connectIds themselves. Useful for applying a Tooltip to
2237 * a range of rows in a table, tree, etc. Use in conjunction with getContent() parameter.
2222 * a range of rows in a table, tree, etc. Use in conjunction with getContent() parameter.
2238 * Ex: connectId: myTable, selector: "tr", getContent: function(node){ return ...; }
2223 * Ex: connectId: myTable, selector: "tr", getContent: function(node){ return ...; }
2239 *
2224 *
2240 * The application must require() an appropriate level of dojo/query to handle the selector.
2225 * The application must require() an appropriate level of dojo/query to handle the selector.
2241 */
2226 */
2242 selector: string;
2227 selector: string;
2243
2228
2244 /**
2229 /**
2245 * Attach tooltip to specified node if it's not already connected
2230 * Attach tooltip to specified node if it's not already connected
2246 */
2231 */
2247 addTarget(node: dojo.NodeOrString): void;
2232 addTarget(node: dojo.NodeOrString): void;
2248
2233
2249 /**
2234 /**
2250 * Detach tooltip from specified node
2235 * Detach tooltip from specified node
2251 */
2236 */
2252 removeTarget(node: dojo.NodeOrString): void;
2237 removeTarget(node: dojo.NodeOrString): void;
2253
2238
2254 /**
2239 /**
2255 * User overridable function that return the text to display in the tooltip.
2240 * User overridable function that return the text to display in the tooltip.
2256 */
2241 */
2257 getContent(node: Node): Node;
2242 getContent(node: Node): Node;
2258
2243
2259 /**
2244 /**
2260 * Display the tooltip; usually not called directly.
2245 * Display the tooltip; usually not called directly.
2261 */
2246 */
2262 open(target: Node): void;
2247 open(target: Node): void;
2263
2248
2264 /**
2249 /**
2265 * Hide the tooltip or cancel timer for show of tooltip
2250 * Hide the tooltip or cancel timer for show of tooltip
2266 */
2251 */
2267 close(): void;
2252 close(): void;
2268
2253
2269 /**
2254 /**
2270 * Called when the tooltip is shown
2255 * Called when the tooltip is shown
2271 */
2256 */
2272 onShow(): void;
2257 onShow(): void;
2273
2258
2274 /**
2259 /**
2275 * Called when the tooltip is hidden
2260 * Called when the tooltip is hidden
2276 */
2261 */
2277 onHide(): void;
2262 onHide(): void;
2278 }
2263 }
2279
2264
2280 interface TooltipConstructor extends _WidgetBaseConstructor<Tooltip> {
2265 interface TooltipConstructor extends _WidgetBaseConstructor<Tooltip> {
2281 /**
2266 /**
2282 * This variable controls the position of tooltips, if the position is not specified to
2267 * This variable controls the position of tooltips, if the position is not specified to
2283 * the Tooltip widget or *TextBox widget itself. It's an array of strings with the values
2268 * the Tooltip widget or *TextBox widget itself. It's an array of strings with the values
2284 * possible for `dijit/place.around()`. The recommended values are:
2269 * possible for `dijit/place.around()`. The recommended values are:
2285 *
2270 *
2286 * - before-centered: centers tooltip to the left of the anchor node/widget, or to the right
2271 * - before-centered: centers tooltip to the left of the anchor node/widget, or to the right
2287 * in the case of RTL scripts like Hebrew and Arabic
2272 * in the case of RTL scripts like Hebrew and Arabic
2288 * - after-centered: centers tooltip to the right of the anchor node/widget, or to the left
2273 * - after-centered: centers tooltip to the right of the anchor node/widget, or to the left
2289 * in the case of RTL scripts like Hebrew and Arabic
2274 * in the case of RTL scripts like Hebrew and Arabic
2290 * - above-centered: tooltip is centered above anchor node
2275 * - above-centered: tooltip is centered above anchor node
2291 * - below-centered: tooltip is centered above anchor node
2276 * - below-centered: tooltip is centered above anchor node
2292 *
2277 *
2293 * The list is positions is tried, in order, until a position is found where the tooltip fits
2278 * The list is positions is tried, in order, until a position is found where the tooltip fits
2294 * within the viewport.
2279 * within the viewport.
2295 *
2280 *
2296 * Be careful setting this parameter. A value of "above-centered" may work fine until the user scrolls
2281 * Be careful setting this parameter. A value of "above-centered" may work fine until the user scrolls
2297 * the screen so that there's no room above the target node. Nodes with drop downs, like
2282 * the screen so that there's no room above the target node. Nodes with drop downs, like
2298 * DropDownButton or FilteringSelect, are especially problematic, in that you need to be sure
2283 * DropDownButton or FilteringSelect, are especially problematic, in that you need to be sure
2299 * that the drop down and tooltip don't overlap, even when the viewport is scrolled so that there
2284 * that the drop down and tooltip don't overlap, even when the viewport is scrolled so that there
2300 * is only room below (or above) the target node, but not both.
2285 * is only room below (or above) the target node, but not both.
2301 */
2286 */
2302 defaultPosition: [string];
2287 defaultPosition: [string];
2303
2288
2304 /**
2289 /**
2305 * Static method to display tooltip w/specified contents in specified position.
2290 * Static method to display tooltip w/specified contents in specified position.
2306 * See description of dijit/Tooltip.defaultPosition for details on position parameter.
2291 * See description of dijit/Tooltip.defaultPosition for details on position parameter.
2307 * If position is not specified then dijit/Tooltip.defaultPosition is used.
2292 * If position is not specified then dijit/Tooltip.defaultPosition is used.
2308 */
2293 */
2309 show(innerHTML: string, aroundNode: PlaceRectangle, position?: [string], rtl?: boolean, textDir?: string, onMouseEnter?: Function, onMouseLeave?: Function): void;
2294 show(innerHTML: string, aroundNode: PlaceRectangle, position?: [string], rtl?: boolean, textDir?: string, onMouseEnter?: Function, onMouseLeave?: Function): void;
2310
2295
2311 /**
2296 /**
2312 * Hide the tooltip
2297 * Hide the tooltip
2313 */
2298 */
2314 hide(aroundNode: PlaceRectangle): void;
2299 hide(aroundNode: PlaceRectangle): void;
2315 }
2300 }
2316
2301
2317 /* dijit/TooltipDialog */
2302 /* dijit/TooltipDialog */
2318
2303
2319 interface TooltipDialog extends layout.ContentPane, _TemplatedMixin, form._FormMixin, _DialogMixin {
2304 interface TooltipDialog extends layout.ContentPane, _TemplatedMixin, form._FormMixin, _DialogMixin {
2320 /**
2305 /**
2321 * Description of tooltip dialog (required for a11y)
2306 * Description of tooltip dialog (required for a11y)
2322 */
2307 */
2323 title: string;
2308 title: string;
2324
2309
2325 /**
2310 /**
2326 * Don't change this parameter from the default value.
2311 * Don't change this parameter from the default value.
2327 * This ContentPane parameter doesn't make sense for TooltipDialog, since TooltipDialog
2312 * This ContentPane parameter doesn't make sense for TooltipDialog, since TooltipDialog
2328 * is never a child of a layout container, nor can you specify the size of
2313 * is never a child of a layout container, nor can you specify the size of
2329 * TooltipDialog in order to control the size of an inner widget.
2314 * TooltipDialog in order to control the size of an inner widget.
2330 */
2315 */
2331 doLayout: boolean;
2316 doLayout: boolean;
2332
2317
2333 /**
2318 /**
2334 * A Toggle to modify the default focus behavior of a Dialog, which
2319 * A Toggle to modify the default focus behavior of a Dialog, which
2335 * is to focus on the first dialog element after opening the dialog.
2320 * is to focus on the first dialog element after opening the dialog.
2336 * False will disable autofocusing. Default: true.
2321 * False will disable autofocusing. Default: true.
2337 */
2322 */
2338 autofocus: boolean;
2323 autofocus: boolean;
2339
2324
2340 /**
2325 /**
2341 * The pointer to the first focusable node in the dialog.
2326 * The pointer to the first focusable node in the dialog.
2342 */
2327 */
2343 _firstFocusItem: any;
2328 _firstFocusItem: any;
2344
2329
2345 /**
2330 /**
2346 * The pointer to which node has focus prior to our dialog.
2331 * The pointer to which node has focus prior to our dialog.
2347 */
2332 */
2348 _lastFocusItem: any;
2333 _lastFocusItem: any;
2349
2334
2350 /**
2335 /**
2351 * Configure widget to be displayed in given position relative to the button.
2336 * Configure widget to be displayed in given position relative to the button.
2352 *
2337 *
2353 * This is called from the dijit.popup code, and should not be called directly.
2338 * This is called from the dijit.popup code, and should not be called directly.
2354 */
2339 */
2355 orient(node: Node | HTMLElement, aroundCorner: PlaceCorner, tooltipCorner: PlaceCorner): void;
2340 orient(node: Node | HTMLElement, aroundCorner: PlaceCorner, tooltipCorner: PlaceCorner): void;
2356
2341
2357 /**
2342 /**
2358 * Focus on first field
2343 * Focus on first field
2359 */
2344 */
2360 focus(): void;
2345 focus(): void;
2361
2346
2362 /**
2347 /**
2363 * Called when dialog is displayed.
2348 * Called when dialog is displayed.
2364 *
2349 *
2365 * This is called from the dijit.popup code, and should not be called directly.
2350 * This is called from the dijit.popup code, and should not be called directly.
2366 */
2351 */
2367 onOpen(pos: {
2352 onOpen(pos: {
2368 aroundCorner: PlaceCorner
2353 aroundCorner: PlaceCorner
2369 aroundNodePos: PlacePosition
2354 aroundNodePos: PlacePosition
2370 corner: PlaceCorner
2355 corner: PlaceCorner
2371 x: number
2356 x: number
2372 y: number
2357 y: number
2373 }): void;
2358 }): void;
2374
2359
2375 /**
2360 /**
2376 * Handler for keydown events
2361 * Handler for keydown events
2377 *
2362 *
2378 * Keep keyboard focus in dialog; close dialog on escape key
2363 * Keep keyboard focus in dialog; close dialog on escape key
2379 */
2364 */
2380 _onKey(evt: KeyboardEvent): void;
2365 _onKey(evt: KeyboardEvent): void;
2381 }
2366 }
2382
2367
2383 interface TooltipDialogConstructor extends _WidgetBaseConstructor<TooltipDialog> { }
2368 interface TooltipDialogConstructor extends _WidgetBaseConstructor<TooltipDialog> { }
2384 }
2369 }
@@ -1,1868 +1,1870
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
232
233 onClick(node: HTMLElement): void;
233 onClick(node: HTMLElement): void;
234
234
235 /**
235 /**
236 * Notifies ComboBox/FilteringSelect that user selected an option.
236 * Notifies ComboBox/FilteringSelect that user selected an option.
237 */
237 */
238 onChange(direction: number): void;
238 onChange(direction: number): void;
239
239
240 /**
240 /**
241 * Notifies ComboBox/FilteringSelect that user clicked to advance to next/previous page.
241 * Notifies ComboBox/FilteringSelect that user clicked to advance to next/previous page.
242 */
242 */
243 onPage(direction: number): void;
243 onPage(direction: number): void;
244
244
245 /**
245 /**
246 * Callback from dijit.popup code to this widget, notifying it that it closed
246 * Callback from dijit.popup code to this widget, notifying it that it closed
247 */
247 */
248 onClose(): void;
248 onClose(): void;
249
249
250 /**
250 /**
251 * Fills in the items in the drop down list
251 * Fills in the items in the drop down list
252 */
252 */
253 createOptions(results: T[], options: dojo.store.api.QueryOptions, labelFunc: (item: T) => { html: boolean; label: string; }): void;
253 createOptions(results: T[], options: dojo.store.api.QueryOptions, labelFunc: (item: T) => { html: boolean; label: string; }): void;
254
254
255 /**
255 /**
256 * Clears the entries in the drop down list, but of course keeps the previous and next buttons.
256 * Clears the entries in the drop down list, but of course keeps the previous and next buttons.
257 */
257 */
258 clearResultList(): void;
258 clearResultList(): void;
259
259
260 /**
260 /**
261 * Highlight the first real item in the list (not Previous Choices).
261 * Highlight the first real item in the list (not Previous Choices).
262 */
262 */
263 highlightFirstOption(): void;
263 highlightFirstOption(): void;
264
264
265 /**
265 /**
266 * Highlight the last real item in the list (not More Choices).
266 * Highlight the last real item in the list (not More Choices).
267 */
267 */
268 highlightLastOption(): void;
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
374
375 interface _DateTimeTextBoxConstructor<T extends _WidgetBase> extends _WidgetBaseConstructor<_DateTimeTextBox<T>> { }
375 interface _DateTimeTextBoxConstructor<T extends _WidgetBase> extends _WidgetBaseConstructor<_DateTimeTextBox<T>> { }
376
376
377 /* dijit/form/_ExpandingTextAreaMixin */
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
386
387 interface OnValidStateChange {
387 interface OnValidStateChange {
388 (isValid?: boolean): void;
388 (isValid?: boolean): void;
389 }
389 }
390
390
391 interface _FormMixin {
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
404
405 reset(): void;
405 reset(): void;
406
406
407 /**
407 /**
408 * returns if the form is valid - same as isValid - but
408 * returns if the form is valid - same as isValid - but
409 * provides a few additional (ui-specific) features:
409 * provides a few additional (ui-specific) features:
410 *
410 *
411 * 1. it will highlight any sub-widgets that are not valid
411 * 1. it will highlight any sub-widgets that are not valid
412 * 2. it will call focus() on the first invalid sub-widget
412 * 2. it will call focus() on the first invalid sub-widget
413 */
413 */
414 validate(): boolean;
414 validate(): boolean;
415
415
416 setValues(val: any): _FormMixin;
416 setValues(val: any): _FormMixin;
417 getValues(): any;
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
433
434 /**
434 /**
435 * Compute what this.state should be based on state of children
435 * Compute what this.state should be based on state of children
436 */
436 */
437 _getState(): '' | 'Error' | 'Incomplete';
437 _getState(): '' | 'Error' | 'Incomplete';
438
438
439 /**
439 /**
440 * Deprecated method. Applications no longer need to call this. Remove for 2.0.
440 * Deprecated method. Applications no longer need to call this. Remove for 2.0.
441 */
441 */
442 disconnectChildren(): void;
442 disconnectChildren(): void;
443
443
444 /**
444 /**
445 * You can call this function directly, ex. in the event that you
445 * You can call this function directly, ex. in the event that you
446 * programmatically add a widget to the form *after* the form has been
446 * programmatically add a widget to the form *after* the form has been
447 * initialized.
447 * initialized.
448 */
448 */
449 connectChildren(inStartup?: boolean): void;
449 connectChildren(inStartup?: boolean): void;
450
450
451 /**
451 /**
452 * Called when child's value or disabled state changes
452 * Called when child's value or disabled state changes
453 */
453 */
454 _onChildChange(attr?: string): void;
454 _onChildChange(attr?: string): void;
455
455
456 startup(): void;
456 startup(): void;
457 destroy(preserveDom?: boolean): void;
457 destroy(preserveDom?: boolean): void;
458
459 _setValueAttr(value: any): void;
458 }
460 }
459
461
460 interface _FormMixinConstructor extends dojo._base.DeclareConstructor<_FormMixin> { }
462 interface _FormMixinConstructor extends dojo._base.DeclareConstructor<_FormMixin> { }
461
463
462 /* dijit/form/_FormSelectWidget */
464 /* dijit/form/_FormSelectWidget */
463
465
464 interface SelectOption {
466 interface SelectOption {
465 value?: string;
467 value?: string;
466 label: string;
468 label: string;
467 selected?: boolean;
469 selected?: boolean;
468 disabled?: boolean;
470 disabled?: boolean;
469 }
471 }
470
472
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 {
473 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 {
472 /**
474 /**
473 * Whether or not we are multi-valued
475 * Whether or not we are multi-valued
474 */
476 */
475 multiple: boolean;
477 multiple: boolean;
476
478
477 /**
479 /**
478 * The set of options for our select item. Roughly corresponds to
480 * The set of options for our select item. Roughly corresponds to
479 * the html `<option>` tag.
481 * the html `<option>` tag.
480 */
482 */
481 options: SelectOption[];
483 options: SelectOption[];
482
484
483 /**
485 /**
484 * A store to use for getting our list of options - rather than reading them
486 * A store to use for getting our list of options - rather than reading them
485 * from the `<option>` html tags. Should support getIdentity().
487 * from the `<option>` html tags. Should support getIdentity().
486 * For back-compat store can also be a dojo/data/api/Identity.
488 * For back-compat store can also be a dojo/data/api/Identity.
487 */
489 */
488 store: dojo.store.api.Store<T, Q, O>;
490 store: dojo.store.api.Store<T, Q, O>;
489
491
490 /**
492 /**
491 * A query to use when fetching items from our store
493 * A query to use when fetching items from our store
492 */
494 */
493 query: Q;
495 query: Q;
494
496
495 /**
497 /**
496 * Query options to use when fetching from the store
498 * Query options to use when fetching from the store
497 */
499 */
498 queryOptions: O;
500 queryOptions: O;
499
501
500 /**
502 /**
501 * The entries in the drop down list come from this attribute in the dojo.store items.
503 * The entries in the drop down list come from this attribute in the dojo.store items.
502 * If ``store`` is set, labelAttr must be set too, unless store is an old-style
504 * If ``store`` is set, labelAttr must be set too, unless store is an old-style
503 * dojo.data store rather than a new dojo/store.
505 * dojo.data store rather than a new dojo/store.
504 */
506 */
505 labelAttr: string;
507 labelAttr: string;
506
508
507 /**
509 /**
508 * A callback to do with an onFetch - but before any items are actually
510 * A callback to do with an onFetch - but before any items are actually
509 * iterated over (i.e. to filter even further what you want to add)
511 * iterated over (i.e. to filter even further what you want to add)
510 */
512 */
511 onFetch: (items: T[]) => void;
513 onFetch: (items: T[]) => void;
512
514
513 /**
515 /**
514 * Flag to sort the options returned from a store by the label of
516 * Flag to sort the options returned from a store by the label of
515 * the store.
517 * the store.
516 */
518 */
517 sortByLabel: boolean;
519 sortByLabel: boolean;
518
520
519 /**
521 /**
520 * By default loadChildren is called when the items are fetched from the
522 * By default loadChildren is called when the items are fetched from the
521 * store. This property allows delaying loadChildren (and the creation
523 * store. This property allows delaying loadChildren (and the creation
522 * of the options/menuitems) until the user clicks the button to open the
524 * of the options/menuitems) until the user clicks the button to open the
523 * dropdown.
525 * dropdown.
524 */
526 */
525 loadChildrenOnOpen: boolean;
527 loadChildrenOnOpen: boolean;
526
528
527 /**
529 /**
528 * This is the `dojo.Deferred` returned by setStore().
530 * This is the `dojo.Deferred` returned by setStore().
529 * Calling onLoadDeferred.then() registers your
531 * Calling onLoadDeferred.then() registers your
530 * callback to be called only once, when the prior setStore completes.
532 * callback to be called only once, when the prior setStore completes.
531 */
533 */
532 onLoadDeferred: dojo.Deferred<void>;
534 onLoadDeferred: dojo.Deferred<void>;
533
535
534 /**
536 /**
535 * Returns a given option (or options).
537 * Returns a given option (or options).
536 */
538 */
537 getOptions(valueOrIdx: string): SelectOption;
539 getOptions(valueOrIdx: string): SelectOption;
538 getOptions(valueOrIdx: number): SelectOption;
540 getOptions(valueOrIdx: number): SelectOption;
539 getOptions(valueOrIdx: SelectOption): SelectOption;
541 getOptions(valueOrIdx: SelectOption): SelectOption;
540 getOptions(valueOrIdx: (string | number | SelectOption)[]): SelectOption[];
542 getOptions(valueOrIdx: (string | number | SelectOption)[]): SelectOption[];
541 getOptions(): SelectOption[];
543 getOptions(): SelectOption[];
542
544
543 /**
545 /**
544 * Adds an option or options to the end of the select. If value
546 * 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.
547 * of the option is empty or missing, a separator is created instead.
546 * Passing in an array of options will yield slightly better performance
548 * Passing in an array of options will yield slightly better performance
547 * since the children are only loaded once.
549 * since the children are only loaded once.
548 */
550 */
549 addOption(option: SelectOption | SelectOption[]): void;
551 addOption(option: SelectOption | SelectOption[]): void;
550
552
551 /**
553 /**
552 * Removes the given option or options. You can remove by string
554 * Removes the given option or options. You can remove by string
553 * (in which case the value is removed), number (in which case the
555 * (in which case the value is removed), number (in which case the
554 * index in the options array is removed), or select option (in
556 * index in the options array is removed), or select option (in
555 * which case, the select option with a matching value is removed).
557 * 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
558 * You can also pass in an array of those values for a slightly
557 * better performance since the children are only loaded once.
559 * better performance since the children are only loaded once.
558 * For numeric option values, specify {value: number} as the argument.
560 * For numeric option values, specify {value: number} as the argument.
559 */
561 */
560 removeOption(option: string | number | SelectOption | (string | number | SelectOption)[]): void;
562 removeOption(option: string | number | SelectOption | (string | number | SelectOption)[]): void;
561
563
562 /**
564 /**
563 * Updates the values of the given option. The option to update
565 * Updates the values of the given option. The option to update
564 * is matched based on the value of the entered option. Passing
566 * is matched based on the value of the entered option. Passing
565 * in an array of new options will yield better performance since
567 * in an array of new options will yield better performance since
566 * the children will only be loaded once.
568 * the children will only be loaded once.
567 */
569 */
568 updateOption(newOption: SelectOption | SelectOption[]): void;
570 updateOption(newOption: SelectOption | SelectOption[]): void;
569
571
570 /**
572 /**
571 * Deprecated!
573 * Deprecated!
572 */
574 */
573 setStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
575 setStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
574 query: Q;
576 query: Q;
575 queryOptions: O;
577 queryOptions: O;
576 onFetch: (items: T[], fetchArgs?: any) => void;
578 onFetch: (items: T[], fetchArgs?: any) => void;
577 }): dojo.store.api.Store<T, Q, O>;
579 }): dojo.store.api.Store<T, Q, O>;
578
580
579 /**
581 /**
580 * Sets the store you would like to use with this select widget.
582 * 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
583 * 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
584 * function returns the original store, in case you want to reuse
583 * it or something.
585 * it or something.
584 */
586 */
585 _deprecatedSetStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
587 _deprecatedSetStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
586 query: Q;
588 query: Q;
587 queryOptions: O;
589 queryOptions: O;
588 onFetch: (items: T[], fetchArgs?: any) => void;
590 onFetch: (items: T[], fetchArgs?: any) => void;
589 }): dojo.store.api.Store<T, Q, O>;
591 }): dojo.store.api.Store<T, Q, O>;
590
592
591 /**
593 /**
592 * Loads the children represented by this widget's options.
594 * Loads the children represented by this widget's options.
593 * reset the menu to make it populatable on the next click
595 * reset the menu to make it populatable on the next click
594 */
596 */
595 _loadChildren(): void;
597 _loadChildren(): void;
596
598
597 /**
599 /**
598 * Sets the "selected" class on the item for styling purposes
600 * Sets the "selected" class on the item for styling purposes
599 */
601 */
600 _updateSelection(): void;
602 _updateSelection(): void;
601
603
602 /**
604 /**
603 * Returns the value of the widget by reading the options for
605 * Returns the value of the widget by reading the options for
604 * the selected flag
606 * the selected flag
605 */
607 */
606 _getValueFromOpts(): string;
608 _getValueFromOpts(): string;
607
609
608 buildRendering(): void;
610 buildRendering(): void;
609
611
610 /**
612 /**
611 * Loads our options and sets up our dropdown correctly. We
613 * Loads our options and sets up our dropdown correctly. We
612 * don't want any content, so we don't call any inherit chain
614 * don't want any content, so we don't call any inherit chain
613 * function.
615 * function.
614 */
616 */
615 _fillContent(): void;
617 _fillContent(): void;
616
618
617 /**
619 /**
618 * sets up our event handling that we need for functioning
620 * sets up our event handling that we need for functioning
619 * as a select
621 * as a select
620 */
622 */
621 postCreate(): void;
623 postCreate(): void;
622
624
623 startup(): void;
625 startup(): void;
624
626
625 /**
627 /**
626 * Clean up our connections
628 * Clean up our connections
627 */
629 */
628 destroy(preserveDom?: boolean): void;
630 destroy(preserveDom?: boolean): void;
629
631
630 /**
632 /**
631 * User-overridable function which, for the given option, adds an
633 * 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
634 * 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
635 * separator is added in that place. Make sure to store the option
634 * in the created option widget.
636 * in the created option widget.
635 */
637 */
636 _addOptionItem(option: SelectOption): void;
638 _addOptionItem(option: SelectOption): void;
637
639
638 /**
640 /**
639 * User-overridable function which, for the given option, removes
641 * User-overridable function which, for the given option, removes
640 * its item from the select.
642 * its item from the select.
641 */
643 */
642 _removeOptionItem(option: SelectOption): void;
644 _removeOptionItem(option: SelectOption): void;
643
645
644 /**
646 /**
645 * Overridable function which will set the display for the
647 * Overridable function which will set the display for the
646 * widget. newDisplay is either a string (in the case of
648 * widget. newDisplay is either a string (in the case of
647 * single selects) or array of strings (in the case of multi-selects)
649 * single selects) or array of strings (in the case of multi-selects)
648 */
650 */
649 _setDisplay(newDisplay: string | string[]): void;
651 _setDisplay(newDisplay: string | string[]): void;
650
652
651 /**
653 /**
652 * Overridable function to return the children that this widget contains.
654 * Overridable function to return the children that this widget contains.
653 */
655 */
654 _getChildren(): any[];
656 _getChildren(): any[];
655
657
656 /**
658 /**
657 * hooks into this.attr to provide a mechanism for getting the
659 * hooks into this.attr to provide a mechanism for getting the
658 * option items for the current value of the widget.
660 * option items for the current value of the widget.
659 */
661 */
660 _getSelectedOptionsAttr(): SelectOption[];
662 _getSelectedOptionsAttr(): SelectOption[];
661
663
662 /**
664 /**
663 * a function that will "fake" loading children, if needed, and
665 * a function that will "fake" loading children, if needed, and
664 * if we have set to not load children until the widget opens.
666 * if we have set to not load children until the widget opens.
665 */
667 */
666 _pseudoLoadChildren(items: T[]): void;
668 _pseudoLoadChildren(items: T[]): void;
667
669
668 /**
670 /**
669 * a function that can be connected to in order to receive a
671 * a function that can be connected to in order to receive a
670 * notification that the store has finished loading and all options
672 * notification that the store has finished loading and all options
671 * from that store are available
673 * from that store are available
672 */
674 */
673 onSetStore(): void;
675 onSetStore(): void;
674 }
676 }
675
677
676 /* dijit/form/_FormValueMixin */
678 /* dijit/form/_FormValueMixin */
677
679
678 interface _FormValueMixin extends _FormWidgetMixin {
680 interface _FormValueMixin extends _FormWidgetMixin {
679
681
680 /**
682 /**
681 * Should this widget respond to user input?
683 * Should this widget respond to user input?
682 * In markup, this is specified as "readOnly".
684 * In markup, this is specified as "readOnly".
683 * Similar to disabled except readOnly form values are submitted.
685 * Similar to disabled except readOnly form values are submitted.
684 */
686 */
685 readOnly: boolean;
687 readOnly: boolean;
686
688
687 postCreate(): void;
689 postCreate(): void;
688
690
689 /**
691 /**
690 * Restore the value to the last value passed to onChange
692 * Restore the value to the last value passed to onChange
691 */
693 */
692 undo(): void;
694 undo(): void;
693
695
694 /**
696 /**
695 * Reset the widget's value to what it was at initialization time
697 * Reset the widget's value to what it was at initialization time
696 */
698 */
697 reset(): void;
699 reset(): void;
698
700
699 _hasBeenBlurred?: boolean;
701 _hasBeenBlurred?: boolean;
700 }
702 }
701
703
702 /* dijit/form/_FormValueWidget */
704 /* dijit/form/_FormValueWidget */
703
705
704 interface _FormValueWidget extends _FormWidget, _FormValueMixin {
706 interface _FormValueWidget extends _FormWidget, _FormValueMixin {
705 /**
707 /**
706 * Work around table sizing bugs on IE7 by forcing redraw
708 * Work around table sizing bugs on IE7 by forcing redraw
707 */
709 */
708 _layoutHackIE7(): void;
710 _layoutHackIE7(): void;
709
711
710 // set(name: string, value: any): this;
712 // set(name: string, value: any): this;
711 // set(values: Object): this;
713 // set(values: Object): this;
712 }
714 }
713
715
714 interface _FormValueWidgetConstructor extends _WidgetBaseConstructor<_FormValueWidget> { }
716 interface _FormValueWidgetConstructor extends _WidgetBaseConstructor<_FormValueWidget> { }
715
717
716 /* dijit/form/_FormWidget */
718 /* dijit/form/_FormWidget */
717
719
718 interface _FormWidget extends _Widget, _TemplatedMixin, _CssStateMixin, _FormWidgetMixin {
720 interface _FormWidget extends _Widget, _TemplatedMixin, _CssStateMixin, _FormWidgetMixin {
719 setDisabled(disabled: boolean): void;
721 setDisabled(disabled: boolean): void;
720 setValue(value: string): void;
722 setValue(value: string): void;
721 postMixInProperties(): void;
723 postMixInProperties(): void;
722
724
723 // set(name: 'value', value: string): this;
725 // set(name: 'value', value: string): this;
724 // set(name: string, value: any): this;
726 // set(name: string, value: any): this;
725 // set(values: Object): this;
727 // set(values: Object): this;
726 }
728 }
727
729
728 interface _FormWidgetConstructor extends _WidgetBaseConstructor<_FormWidget> { }
730 interface _FormWidgetConstructor extends _WidgetBaseConstructor<_FormWidget> { }
729
731
730 /* dijit/form/_FormWidgetMixin */
732 /* dijit/form/_FormWidgetMixin */
731
733
732 /**
734 /**
733 * Mixin for widgets corresponding to native HTML elements such as `<checkbox>` or `<button>`,
735 * Mixin for widgets corresponding to native HTML elements such as `<checkbox>` or `<button>`,
734 * which can be children of a `<form>` node or a `dijit/form/Form` widget.
736 * which can be children of a `<form>` node or a `dijit/form/Form` widget.
735 *
737 *
736 * Represents a single HTML element.
738 * Represents a single HTML element.
737 * All these widgets should have these attributes just like native HTML input elements.
739 * All these widgets should have these attributes just like native HTML input elements.
738 * You can set them during widget construction or afterwards, via `dijit/_WidgetBase.set()`.
740 * You can set them during widget construction or afterwards, via `dijit/_WidgetBase.set()`.
739 *
741 *
740 * They also share some common methods.
742 * They also share some common methods.
741 */
743 */
742 interface _FormWidgetMixin {
744 interface _FormWidgetMixin {
743 /**
745 /**
744 * Name used when submitting form; same as "name" attribute or plain HTML elements
746 * Name used when submitting form; same as "name" attribute or plain HTML elements
745 */
747 */
746 name: string;
748 name: string;
747
749
748
750
749 /** Corresponds to the native HTML `<input>` element's attribute. */
751 /** Corresponds to the native HTML `<input>` element's attribute. */
750 alt: string;
752 alt: string;
751
753
752 /** Corresponds to the native HTML `<input>` element's attribute. */
754 /** Corresponds to the native HTML `<input>` element's attribute. */
753 value: any;
755 value: any;
754
756
755 /** Corresponds to the native HTML `<input>` element's attribute. */
757 /** Corresponds to the native HTML `<input>` element's attribute. */
756 type: string;
758 type: string;
757
759
758 /** Apply aria-label in markup to the widget's focusNode */
760 /** Apply aria-label in markup to the widget's focusNode */
759 "aria-label": "focusNode";
761 "aria-label": "focusNode";
760
762
761 /** Order fields are traversed when user hits the tab key */
763 /** Order fields are traversed when user hits the tab key */
762 tabIndex: number;
764 tabIndex: number;
763
765
764 /** Should this widget respond to user input?
766 /** Should this widget respond to user input?
765 * In markup, this is specified as "disabled='disabled'", or just "disabled".
767 * In markup, this is specified as "disabled='disabled'", or just "disabled".
766 */
768 */
767 disabled: boolean;
769 disabled: boolean;
768
770
769 /** Fires onChange for each value change or only on demand */
771 /** Fires onChange for each value change or only on demand */
770 intermediateChanges: boolean;
772 intermediateChanges: boolean;
771
773
772 /** On focus, should this widget scroll into view? */
774 /** On focus, should this widget scroll into view? */
773 scrollOnFocus: boolean;
775 scrollOnFocus: boolean;
774
776
775 _setDisabledAttr(value: boolean): void;
777 _setDisabledAttr(value: boolean): void;
776
778
777 _onFocus(by: string): void;
779 _onFocus(by: string): void;
778
780
779 /** Tells if this widget is focusable or not. Used internally by dijit.
781 /** Tells if this widget is focusable or not. Used internally by dijit.
780 * @protected
782 * @protected
781 */
783 */
782 isFocusable(): boolean;
784 isFocusable(): boolean;
783
785
784 /** Put focus on this widget */
786 /** Put focus on this widget */
785 focus(): void;
787 focus(): void;
786
788
787 /** Compare 2 values (as returned by get('value') for this widget).
789 /** Compare 2 values (as returned by get('value') for this widget).
788 * @protected
790 * @protected
789 */
791 */
790 compare(val1: any, val2: any): number;
792 compare(val1: any, val2: any): number;
791
793
792 onChange(newValue: any): void;
794 onChange(newValue: any): void;
793
795
794 /**
796 /**
795 * Hook so set('value', value) works.
797 * Hook so set('value', value) works.
796 *
798 *
797 * Sets the value of the widget.
799 * Sets the value of the widget.
798 * If the value has changed, then fire onChange event, unless priorityChange
800 * If the value has changed, then fire onChange event, unless priorityChange
799 * is specified as null (or false?)
801 * is specified as null (or false?)
800 *
802 *
801 * @param value
803 * @param value
802 * @param priorityChange
804 * @param priorityChange
803 */
805 */
804 _setValueAttr(value: any, priorityChange?: boolean);
806 _setValueAttr(value: any, priorityChange?: boolean);
805
807
806 /**
808 /**
807 * Called when the value of the widget has changed. Saves the new value in this.value,
809 * Called when the value of the widget has changed. Saves the new value in this.value,
808 * and calls onChange() if appropriate. See _FormWidget._handleOnChange() for details.
810 * and calls onChange() if appropriate. See _FormWidget._handleOnChange() for details.
809 *
811 *
810 * @param newValue
812 * @param newValue
811 * @param priorityChange
813 * @param priorityChange
812 */
814 */
813 _handleOnChange(newValue: any, priorityChange?: boolean);
815 _handleOnChange(newValue: any, priorityChange?: boolean);
814 }
816 }
815
817
816 /* dijit/form/_ListBase */
818 /* dijit/form/_ListBase */
817
819
818 interface _ListBase {
820 interface _ListBase {
819 /**
821 /**
820 * currently selected node
822 * currently selected node
821 */
823 */
822 selected: HTMLElement;
824 selected: HTMLElement;
823
825
824 /**
826 /**
825 * Select the first displayed item in the list.
827 * Select the first displayed item in the list.
826 */
828 */
827 selectFirstNode(): void;
829 selectFirstNode(): void;
828
830
829 /**
831 /**
830 * Select the last displayed item in the list
832 * Select the last displayed item in the list
831 */
833 */
832 selectLastNode(): void;
834 selectLastNode(): void;
833
835
834 /**
836 /**
835 * Select the item just below the current selection.
837 * Select the item just below the current selection.
836 * If nothing selected, select first node.
838 * If nothing selected, select first node.
837 */
839 */
838 selectNextNode(): void;
840 selectNextNode(): void;
839
841
840 /**
842 /**
841 * Select the item just above the current selection.
843 * Select the item just above the current selection.
842 * If nothing selected, select last node (if
844 * If nothing selected, select last node (if
843 * you select Previous and try to keep scrolling up the list).
845 * you select Previous and try to keep scrolling up the list).
844 */
846 */
845 selectPreviousNode(): void;
847 selectPreviousNode(): void;
846
848
847 // set(name: 'selected', value: HTMLElement): this;
849 // set(name: 'selected', value: HTMLElement): this;
848 // set(name: string, value: any): this;
850 // set(name: string, value: any): this;
849 // set(values: Object): this;
851 // set(values: Object): this;
850 }
852 }
851
853
852 /* dijit/form/_ListMouseMixin */
854 /* dijit/form/_ListMouseMixin */
853
855
854 interface _ListMouseMixin extends _ListBase {
856 interface _ListMouseMixin extends _ListBase {
855 postCreate(): void;
857 postCreate(): void;
856 }
858 }
857
859
858 /* dijit/form/_RadioButtonMixin */
860 /* dijit/form/_RadioButtonMixin */
859
861
860 interface _RadioButtonMixin {
862 interface _RadioButtonMixin {
861 /**
863 /**
862 * type attribute on `<input>` node.
864 * type attribute on `<input>` node.
863 * Users should not change this value.
865 * Users should not change this value.
864 */
866 */
865 type: string;
867 type: string;
866 }
868 }
867
869
868 /* dijit/form/_SearchMixin */
870 /* dijit/form/_SearchMixin */
869
871
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> {
872 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> {
871 /**
873 /**
872 * Argument to data provider.
874 * Argument to data provider.
873 * Specifies maximum number of search results to return per query
875 * Specifies maximum number of search results to return per query
874 */
876 */
875 pageSize: number;
877 pageSize: number;
876
878
877 /**
879 /**
878 * Reference to data provider object used by this ComboBox.
880 * Reference to data provider object used by this ComboBox.
879 * The store must accept an object hash of properties for its query. See `query` and `queryExpr` for details.
881 * The store must accept an object hash of properties for its query. See `query` and `queryExpr` for details.
880 */
882 */
881 store: dojo.store.api.Store<T, Q, O>;
883 store: dojo.store.api.Store<T, Q, O>;
882
884
883 /**
885 /**
884 * Mixin to the store's fetch.
886 * Mixin to the store's fetch.
885 * For example, to set the sort order of the ComboBox menu, pass:
887 * For example, to set the sort order of the ComboBox menu, pass:
886 * { sort: [{attribute:"name",descending: true}] }
888 * { sort: [{attribute:"name",descending: true}] }
887 * To override the default queryOptions so that deep=false, do:
889 * To override the default queryOptions so that deep=false, do:
888 * { queryOptions: {ignoreCase: true, deep: false} }
890 * { queryOptions: {ignoreCase: true, deep: false} }
889 */
891 */
890 fetchProperties: { [property: string]: any };
892 fetchProperties: { [property: string]: any };
891
893
892 /**
894 /**
893 * A query that can be passed to `store` to initially filter the items.
895 * A query that can be passed to `store` to initially filter the items.
894 * ComboBox overwrites any reference to the `searchAttr` and sets it to the `queryExpr` with the user's input substituted.
896 * ComboBox overwrites any reference to the `searchAttr` and sets it to the `queryExpr` with the user's input substituted.
895 */
897 */
896 query: Q;
898 query: Q;
897
899
898 /**
900 /**
899 * Alternate to specifying a store. Id of a dijit/form/DataList widget.
901 * Alternate to specifying a store. Id of a dijit/form/DataList widget.
900 */
902 */
901 list: string;
903 list: string;
902
904
903 /**
905 /**
904 * Delay in milliseconds between when user types something and we start
906 * Delay in milliseconds between when user types something and we start
905 * searching based on that value
907 * searching based on that value
906 */
908 */
907 searchDelay: number;
909 searchDelay: number;
908
910
909 /**
911 /**
910 * Search for items in the data store where this attribute (in the item)
912 * Search for items in the data store where this attribute (in the item)
911 * matches what the user typed
913 * matches what the user typed
912 */
914 */
913 searchAttr: string;
915 searchAttr: string;
914
916
915 /**
917 /**
916 * This specifies what query is sent to the data store,
918 * This specifies what query is sent to the data store,
917 * based on what the user has typed. Changing this expression will modify
919 * based on what the user has typed. Changing this expression will modify
918 * whether the results are only exact matches, a "starting with" match,
920 * whether the results are only exact matches, a "starting with" match,
919 * etc.
921 * etc.
920 * `${0}` will be substituted for the user text.
922 * `${0}` will be substituted for the user text.
921 * `*` is used for wildcards.
923 * `*` is used for wildcards.
922 * `${0}*` means "starts with", `*${0}*` means "contains", `${0}` means "is"
924 * `${0}*` means "starts with", `*${0}*` means "contains", `${0}` means "is"
923 */
925 */
924 queryExpr: string;
926 queryExpr: string;
925
927
926 /**
928 /**
927 * Set true if the query should ignore case when matching possible items
929 * Set true if the query should ignore case when matching possible items
928 */
930 */
929 ignoreCase: boolean;
931 ignoreCase: boolean;
930
932
931 /**
933 /**
932 * Helper function to convert a simple pattern to a regular expression for matching.
934 * Helper function to convert a simple pattern to a regular expression for matching.
933 */
935 */
934 _patternToRegExp(pattern: string): RegExp;
936 _patternToRegExp(pattern: string): RegExp;
935
937
936 _abortQuery(): void;
938 _abortQuery(): void;
937
939
938 /**
940 /**
939 * Handles input (keyboard/paste) events
941 * Handles input (keyboard/paste) events
940 */
942 */
941 _processInput(e: KeyboardEvent): void;
943 _processInput(e: KeyboardEvent): void;
942
944
943 /**
945 /**
944 * Callback when a search completes.
946 * Callback when a search completes.
945 */
947 */
946 onSearch(results: T[], query: Q, options: O): void;
948 onSearch(results: T[], query: Q, options: O): void;
947
949
948 _startSearchFromInput(): void;
950 _startSearchFromInput(): void;
949
951
950 /**
952 /**
951 * Starts a search for elements matching text (text=="" means to return all items
953 * Starts a search for elements matching text (text=="" means to return all items
952 * and calls onSearch(...) when the search completes, to display the results.
954 * and calls onSearch(...) when the search completes, to display the results.
953 */
955 */
954 _startSearch(text: string): void;
956 _startSearch(text: string): void;
955
957
956 postMixInProperties(): void;
958 postMixInProperties(): void;
957
959
958 // set(name: 'list', value: string): this;
960 // set(name: 'list', value: string): this;
959 // set(name: string, value: any): this;
961 // set(name: string, value: any): this;
960 // set(values: Object): this;
962 // set(values: Object): this;
961 }
963 }
962
964
963 /* dijit/form/_Spinner */
965 /* dijit/form/_Spinner */
964
966
965 interface AdjustFunction {
967 interface AdjustFunction {
966 (val: any, delta: number): any;
968 (val: any, delta: number): any;
967 }
969 }
968
970
969 interface _Spinner extends RangeBoundTextBox {
971 interface _Spinner extends RangeBoundTextBox {
970 /**
972 /**
971 * Number of milliseconds before a held arrow key or up/down button becomes typematic
973 * Number of milliseconds before a held arrow key or up/down button becomes typematic
972 */
974 */
973 defaultTimeout: number;
975 defaultTimeout: number;
974
976
975 /**
977 /**
976 * minimum number of milliseconds that typematic event fires when held key or button is held
978 * minimum number of milliseconds that typematic event fires when held key or button is held
977 */
979 */
978 minimumTimeout: number;
980 minimumTimeout: number;
979
981
980 /**
982 /**
981 * Fraction of time used to change the typematic timer between events.
983 * Fraction of time used to change the typematic timer between events.
982 * 1.0 means that each typematic event fires at defaultTimeout intervals.
984 * 1.0 means that each typematic event fires at defaultTimeout intervals.
983 * Less than 1.0 means that each typematic event fires at an increasing faster rate.
985 * Less than 1.0 means that each typematic event fires at an increasing faster rate.
984 */
986 */
985 timeoutChangeRate: number;
987 timeoutChangeRate: number;
986
988
987 /**
989 /**
988 * Adjust the value by this much when spinning using the arrow keys/buttons
990 * Adjust the value by this much when spinning using the arrow keys/buttons
989 */
991 */
990 smallDelta: number;
992 smallDelta: number;
991
993
992 /**
994 /**
993 * Adjust the value by this much when spinning using the PgUp/Dn keys
995 * Adjust the value by this much when spinning using the PgUp/Dn keys
994 */
996 */
995 largeDelta: number;
997 largeDelta: number;
996
998
997 templateString: string;
999 templateString: string;
998 baseClass: string;
1000 baseClass: string;
999 cssStateNodes: CSSStateNodes;
1001 cssStateNodes: CSSStateNodes;
1000
1002
1001 /**
1003 /**
1002 * Overridable function used to adjust a primitive value(Number/Date/...) by the delta amount specified.
1004 * Overridable function used to adjust a primitive value(Number/Date/...) by the delta amount specified.
1003 * The val is adjusted in a way that makes sense to the object type.
1005 * The val is adjusted in a way that makes sense to the object type.
1004 */
1006 */
1005 adjust: AdjustFunction;
1007 adjust: AdjustFunction;
1006
1008
1007 postCreate(): void;
1009 postCreate(): void;
1008 }
1010 }
1009
1011
1010 interface _SpinnerConstrctor extends _WidgetBaseConstructor<_Spinner> { }
1012 interface _SpinnerConstrctor extends _WidgetBaseConstructor<_Spinner> { }
1011
1013
1012 /* dijit/form/_TextBoxMixin */
1014 /* dijit/form/_TextBoxMixin */
1013
1015
1014 interface _TextBoxMixin<C extends Constraints = Constraints> {
1016 interface _TextBoxMixin<C extends Constraints = Constraints> {
1015 /**
1017 /**
1016 * Removes leading and trailing whitespace if true. Default is false.
1018 * Removes leading and trailing whitespace if true. Default is false.
1017 */
1019 */
1018 trim: boolean;
1020 trim: boolean;
1019
1021
1020 /**
1022 /**
1021 * Converts all characters to uppercase if true. Default is false.
1023 * Converts all characters to uppercase if true. Default is false.
1022 */
1024 */
1023 uppercase: boolean;
1025 uppercase: boolean;
1024
1026
1025 /**
1027 /**
1026 * Converts all characters to lowercase if true. Default is false.
1028 * Converts all characters to lowercase if true. Default is false.
1027 */
1029 */
1028 lowercase: boolean;
1030 lowercase: boolean;
1029
1031
1030 /**
1032 /**
1031 * Converts the first character of each word to uppercase if true.
1033 * Converts the first character of each word to uppercase if true.
1032 */
1034 */
1033 propercase: boolean;
1035 propercase: boolean;
1034
1036
1035 /**
1037 /**
1036 * HTML INPUT tag maxLength declaration.
1038 * HTML INPUT tag maxLength declaration.
1037 */
1039 */
1038 maxLength: string;
1040 maxLength: string;
1039
1041
1040 /**
1042 /**
1041 * If true, all text will be selected when focused with mouse
1043 * If true, all text will be selected when focused with mouse
1042 */
1044 */
1043 selectOnClick: boolean;
1045 selectOnClick: boolean;
1044
1046
1045 /**
1047 /**
1046 * Defines a hint to help users fill out the input field (as defined in HTML 5).
1048 * Defines a hint to help users fill out the input field (as defined in HTML 5).
1047 * This should only contain plain text (no html markup).
1049 * This should only contain plain text (no html markup).
1048 */
1050 */
1049 placeHolder: string;
1051 placeHolder: string;
1050
1052
1051 /**
1053 /**
1052 * For subclasses like ComboBox where the displayed value
1054 * For subclasses like ComboBox where the displayed value
1053 * (ex: Kentucky) and the serialized value (ex: KY) are different,
1055 * (ex: Kentucky) and the serialized value (ex: KY) are different,
1054 * this represents the displayed value.
1056 * this represents the displayed value.
1055 *
1057 *
1056 * Setting 'displayedValue' through set('displayedValue', ...)
1058 * Setting 'displayedValue' through set('displayedValue', ...)
1057 * updates 'value', and vice-versa. Otherwise 'value' is updated
1059 * updates 'value', and vice-versa. Otherwise 'value' is updated
1058 * from 'displayedValue' periodically, like onBlur etc.
1060 * from 'displayedValue' periodically, like onBlur etc.
1059 */
1061 */
1060 displayedValue: string;
1062 displayedValue: string;
1061
1063
1062 /**
1064 /**
1063 * Replaceable function to convert a value to a properly formatted string.
1065 * Replaceable function to convert a value to a properly formatted string.
1064 */
1066 */
1065 format: ConstrainedValueFunction<any, C, any>;
1067 format: ConstrainedValueFunction<any, C, any>;
1066
1068
1067 /**
1069 /**
1068 * Replaceable function to convert a formatted string to a value
1070 * Replaceable function to convert a formatted string to a value
1069 */
1071 */
1070 parse: ConstrainedValueFunction<any, C, any>;
1072 parse: ConstrainedValueFunction<any, C, any>;
1071
1073
1072 /**
1074 /**
1073 * Connect to this function to receive notifications of various user data-input events.
1075 * 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.
1076 * 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
1077 * 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.
1078 * correspond to the standard DOM "input" event, because it occurs before the input has been processed.
1077 */
1079 */
1078 onInput(e: InputEvent): void;
1080 onInput(e: InputEvent): void;
1079
1081
1080 postCreate(): void;
1082 postCreate(): void;
1081
1083
1082 /**
1084 /**
1083 * if the textbox is blank, what value should be reported
1085 * if the textbox is blank, what value should be reported
1084 */
1086 */
1085 _blankValue: string;
1087 _blankValue: string;
1086
1088
1087 /**
1089 /**
1088 * Auto-corrections (such as trimming) that are applied to textbox
1090 * Auto-corrections (such as trimming) that are applied to textbox
1089 * value on blur or form submit.
1091 * value on blur or form submit.
1090 */
1092 */
1091 filter<T>(val: T): T;
1093 filter<T>(val: T): T;
1092 filter<T extends number>(value: T): T;
1094 filter<T extends number>(value: T): T;
1093
1095
1094 _setBlurValue(): void;
1096 _setBlurValue(): void;
1095
1097
1096 reset(): void;
1098 reset(): void;
1097 }
1099 }
1098
1100
1099 /* dijit/form/_ToggleButtonMixin */
1101 /* dijit/form/_ToggleButtonMixin */
1100
1102
1101 interface _ToggleButtonMixin {
1103 interface _ToggleButtonMixin {
1102 /**
1104 /**
1103 * Corresponds to the native HTML `<input>` element's attribute.
1105 * Corresponds to the native HTML `<input>` element's attribute.
1104 * In markup, specified as "checked='checked'" or just "checked".
1106 * In markup, specified as "checked='checked'" or just "checked".
1105 * True if the button is depressed, or the checkbox is checked,
1107 * True if the button is depressed, or the checkbox is checked,
1106 * or the radio button is selected, etc.
1108 * or the radio button is selected, etc.
1107 */
1109 */
1108 checked: boolean;
1110 checked: boolean;
1109
1111
1110 postCreate(): void;
1112 postCreate(): void;
1111
1113
1112 /**
1114 /**
1113 * Reset the widget's value to what it was at initialization time
1115 * Reset the widget's value to what it was at initialization time
1114 */
1116 */
1115 reset(): void;
1117 reset(): void;
1116
1118
1117 _hasBeenBlurred?: boolean;
1119 _hasBeenBlurred?: boolean;
1118 }
1120 }
1119
1121
1120 /* dijit/form/Button */
1122 /* dijit/form/Button */
1121
1123
1122 interface Button extends _FormWidget, _ButtonMixin {
1124 interface Button extends _FormWidget, _ButtonMixin {
1123 /**
1125 /**
1124 * Set this to true to hide the label text and display only the icon.
1126 * Set this to true to hide the label text and display only the icon.
1125 * (If showLabel=false then iconClass must be specified.)
1127 * (If showLabel=false then iconClass must be specified.)
1126 * Especially useful for toolbars.
1128 * Especially useful for toolbars.
1127 * If showLabel=true, the label will become the title (a.k.a. tooltip/hint)
1129 * If showLabel=true, the label will become the title (a.k.a. tooltip/hint)
1128 */
1130 */
1129 showLabel: boolean;
1131 showLabel: boolean;
1130
1132
1131 /**
1133 /**
1132 * Class to apply to DOMNode in button to make it display an icon
1134 * Class to apply to DOMNode in button to make it display an icon
1133 */
1135 */
1134 iconClass: string;
1136 iconClass: string;
1135
1137
1136 baseClass: string;
1138 baseClass: string;
1137 templateString: string;
1139 templateString: string;
1138 postCreate(): void;
1140 postCreate(): void;
1139 setLabel(content: string): void;
1141 setLabel(content: string): void;
1140 onLabelSet(e: Event): void;
1142 onLabelSet(e: Event): void;
1141
1143
1142 onClick(e: MouseEvent): boolean | void;
1144 onClick(e: MouseEvent): boolean | void;
1143
1145
1144 // set(name: 'showLabel', value: boolean): this;
1146 // set(name: 'showLabel', value: boolean): this;
1145 // set(name: 'value', value: string): this;
1147 // set(name: 'value', value: string): this;
1146 // set(name: 'name', value: string): this;
1148 // set(name: 'name', value: string): this;
1147 // set(name: 'label', value: string): this;
1149 // set(name: 'label', value: string): this;
1148 // set(name: string, value: any): this;
1150 // set(name: string, value: any): this;
1149 // set(values: Object): this;
1151 // set(values: Object): this;
1150 }
1152 }
1151
1153
1152 interface ButtonConstructor extends _WidgetBaseConstructor<Button> { }
1154 interface ButtonConstructor extends _WidgetBaseConstructor<Button> { }
1153
1155
1154 /* dijit/form/CheckBox */
1156 /* dijit/form/CheckBox */
1155
1157
1156 interface CheckBox extends ToggleButton, _CheckBoxMixin {
1158 interface CheckBox extends ToggleButton, _CheckBoxMixin {
1157 templateString: string;
1159 templateString: string;
1158 baseClass: string;
1160 baseClass: string;
1159 postMixInProperties(): void;
1161 postMixInProperties(): void;
1160 value: string;
1162 value: string;
1161
1163
1162 // set(name: 'value', value: string | boolean): this;
1164 // set(name: 'value', value: string | boolean): this;
1163 // set(name: string, value: any): this;
1165 // set(name: string, value: any): this;
1164 // set(values: Object): this;
1166 // set(values: Object): this;
1165 }
1167 }
1166
1168
1167 interface CheckBoxConstructor extends _WidgetBaseConstructor<CheckBox> { }
1169 interface CheckBoxConstructor extends _WidgetBaseConstructor<CheckBox> { }
1168
1170
1169 /* dijit/form/ComboBox */
1171 /* dijit/form/ComboBox */
1170
1172
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> {
1173 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;
1174 // set(name: string, value: any): this;
1173 // set(values: Object): this;
1175 // set(values: Object): this;
1174 }
1176 }
1175
1177
1176 interface ComboBoxConstructor extends _WidgetBaseConstructor<ComboBox<any>> {
1178 interface ComboBoxConstructor extends _WidgetBaseConstructor<ComboBox<any>> {
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>;
1179 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>;
1178 }
1180 }
1179
1181
1180 /* dijit/form/ComboBoxMixin */
1182 /* dijit/form/ComboBoxMixin */
1181
1183
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> {
1184 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> {
1183
1185
1184 /**
1186 /**
1185 * Dropdown widget class used to select a date/time.
1187 * Dropdown widget class used to select a date/time.
1186 * Subclasses should specify this.
1188 * Subclasses should specify this.
1187 */
1189 */
1188 dropDownClass: _ComboBoxMenu<T>;
1190 dropDownClass: _ComboBoxMenu<T>;
1189
1191
1190 /**
1192 /**
1191 * Set this textbox to have a down arrow button, to display the drop down list.
1193 * Set this textbox to have a down arrow button, to display the drop down list.
1192 * Defaults to true.
1194 * Defaults to true.
1193 */
1195 */
1194 hasDownArrow: boolean;
1196 hasDownArrow: boolean;
1195
1197
1196 templateString: string;
1198 templateString: string;
1197 baseClass: string;
1199 baseClass: string;
1198
1200
1199 /**
1201 /**
1200 * Reference to data provider object used by this ComboBox.
1202 * Reference to data provider object used by this ComboBox.
1201 *
1203 *
1202 * Should be dojo/store/api/Store, but dojo/data/api/Read supported
1204 * Should be dojo/store/api/Store, but dojo/data/api/Read supported
1203 * for backwards compatibility.
1205 * for backwards compatibility.
1204 */
1206 */
1205 store: dojo.store.api.Store<T, Q, O>;
1207 store: dojo.store.api.Store<T, Q, O>;
1206
1208
1207 cssStateNodes: CSSStateNodes;
1209 cssStateNodes: CSSStateNodes;
1208 postMixInProperties(): void;
1210 postMixInProperties(): void;
1209 buildRendering(): void;
1211 buildRendering(): void;
1210 }
1212 }
1211
1213
1212 interface ComboBoxMixinConstructor<T = any, U extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, V = any> extends _WidgetBaseConstructor<ComboBoxMixin<T, U, V>> { }
1214 interface ComboBoxMixinConstructor<T = any, U extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, V = any> extends _WidgetBaseConstructor<ComboBoxMixin<T, U, V>> { }
1213
1215
1214 /* dijit/form/CurrencyTextBox */
1216 /* dijit/form/CurrencyTextBox */
1215
1217
1216 interface CurrencyTextBoxConstraints extends NumberTextBoxConstraints, dojo.CurrencyFormatOptions, dojo.CurrencyParseOptions {
1218 interface CurrencyTextBoxConstraints extends NumberTextBoxConstraints, dojo.CurrencyFormatOptions, dojo.CurrencyParseOptions {
1217 }
1219 }
1218
1220
1219 interface CurrencyTextBox extends NumberTextBox {
1221 interface CurrencyTextBox extends NumberTextBox {
1220 /**
1222 /**
1221 * the [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD"
1223 * the [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD"
1222 */
1224 */
1223 currency: string;
1225 currency: string;
1224
1226
1225 /**
1227 /**
1226 * Despite the name, this parameter specifies both constraints on the input
1228 * Despite the name, this parameter specifies both constraints on the input
1227 * (including minimum/maximum allowed values) as well as
1229 * (including minimum/maximum allowed values) as well as
1228 * formatting options. See `dijit/form/CurrencyTextBox.__Constraints` for details.
1230 * formatting options. See `dijit/form/CurrencyTextBox.__Constraints` for details.
1229 */
1231 */
1230 constraints: CurrencyTextBoxConstraints;
1232 constraints: CurrencyTextBoxConstraints;
1231
1233
1232 baseClass: string;
1234 baseClass: string;
1233
1235
1234 _formatter: (value: number, options?: dojo.CurrencyFormatOptions) => string;
1236 _formatter: (value: number, options?: dojo.CurrencyFormatOptions) => string;
1235 _parser: (expression: string, options?: dojo.CurrencyParseOptions) => number;
1237 _parser: (expression: string, options?: dojo.CurrencyParseOptions) => number;
1236 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1238 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1237
1239
1238 /**
1240 /**
1239 * Parses string value as a Currency, according to the constraints object
1241 * Parses string value as a Currency, according to the constraints object
1240 */
1242 */
1241 parse(value: string, constraints: CurrencyTextBoxConstraints): string;
1243 parse(value: string, constraints: CurrencyTextBoxConstraints): string;
1242 }
1244 }
1243
1245
1244 interface CurrencyTextBoxConstructor extends _WidgetBaseConstructor<CurrencyTextBox> { }
1246 interface CurrencyTextBoxConstructor extends _WidgetBaseConstructor<CurrencyTextBox> { }
1245
1247
1246 /* dijit/form/DataList */
1248 /* dijit/form/DataList */
1247
1249
1248 interface DataList<T extends Object> extends dojo.store.Memory<T> {
1250 interface DataList<T extends Object> extends dojo.store.Memory<T> {
1249 /**
1251 /**
1250 * Get the option marked as selected, like `<option selected>`.
1252 * Get the option marked as selected, like `<option selected>`.
1251 * Not part of dojo.data API.
1253 * Not part of dojo.data API.
1252 */
1254 */
1253 fetchSelectedItem(): T;
1255 fetchSelectedItem(): T;
1254 }
1256 }
1255
1257
1256 interface DataListConstructor {
1258 interface DataListConstructor {
1257 new <T extends Object>(params: Object, srcNodeRef: dojo.NodeOrString): DataList<T>;
1259 new <T extends Object>(params: Object, srcNodeRef: dojo.NodeOrString): DataList<T>;
1258 }
1260 }
1259
1261
1260 /* dijit/form/DateTextBox */
1262 /* dijit/form/DateTextBox */
1261
1263
1262 interface DateTextBox extends _DateTimeTextBox<Calendar> {
1264 interface DateTextBox extends _DateTimeTextBox<Calendar> {
1263 baseClass: string;
1265 baseClass: string;
1264 popupClass: CalendarConstructor;
1266 popupClass: CalendarConstructor;
1265 _selector: string;
1267 _selector: string;
1266 maxHeight: number;
1268 maxHeight: number;
1267
1269
1268 /**
1270 /**
1269 * The value of this widget as a JavaScript Date object, with only year/month/day specified.`
1271 * The value of this widget as a JavaScript Date object, with only year/month/day specified.`
1270 */
1272 */
1271 value: Date;
1273 value: Date;
1272 }
1274 }
1273
1275
1274 interface DateTextBoxConstructor extends _WidgetBaseConstructor<DateTextBox> { }
1276 interface DateTextBoxConstructor extends _WidgetBaseConstructor<DateTextBox> { }
1275
1277
1276 /* dijit/form/DropDownButton */
1278 /* dijit/form/DropDownButton */
1277
1279
1278 interface DropDownButton<T extends _WidgetBase> extends Button, _Container, _HasDropDown<T> {
1280 interface DropDownButton<T extends _WidgetBase> extends Button, _Container, _HasDropDown<T> {
1279 baseClass: string;
1281 baseClass: string;
1280 templateString: string;
1282 templateString: string;
1281
1283
1282 /**
1284 /**
1283 * Overrides _TemplatedMixin#_fillContent().
1285 * Overrides _TemplatedMixin#_fillContent().
1284 * My inner HTML possibly contains both the button label and/or a drop down widget, like
1286 * 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>
1287 * <DropDownButton> <span>push me</span> <Menu> ... </Menu> </DropDownButton>
1286 */
1288 */
1287 _fillContent(): void;
1289 _fillContent(): void;
1288 startup(): void;
1290 startup(): void;
1289
1291
1290 /**
1292 /**
1291 * Returns whether or not we are loaded - if our dropdown has an href,
1293 * Returns whether or not we are loaded - if our dropdown has an href,
1292 * then we want to check that.
1294 * then we want to check that.
1293 */
1295 */
1294 isLoaded(): boolean;
1296 isLoaded(): boolean;
1295
1297
1296 /**
1298 /**
1297 * Default implementation assumes that drop down already exists,
1299 * Default implementation assumes that drop down already exists,
1298 * but hasn't loaded it's data (ex: ContentPane w/href).
1300 * but hasn't loaded it's data (ex: ContentPane w/href).
1299 * App must override if the drop down is lazy-created.
1301 * App must override if the drop down is lazy-created.
1300 */
1302 */
1301 loadDropDown(callback: () => void): void;
1303 loadDropDown(callback: () => void): void;
1302
1304
1303 /**
1305 /**
1304 * Overridden so that focus is handled by the _HasDropDown mixin, not by
1306 * Overridden so that focus is handled by the _HasDropDown mixin, not by
1305 * the _FormWidget mixin.
1307 * the _FormWidget mixin.
1306 */
1308 */
1307 isFocusable(): boolean;
1309 isFocusable(): boolean;
1308 }
1310 }
1309
1311
1310 interface DropDownButtonConstructor extends _WidgetBaseConstructor<DropDownButton<any>> {
1312 interface DropDownButtonConstructor extends _WidgetBaseConstructor<DropDownButton<any>> {
1311 new <T extends _WidgetBase>(params: Object, srcNodeRef: dojo.NodeOrString): DropDownButton<T>;
1313 new <T extends _WidgetBase>(params: Object, srcNodeRef: dojo.NodeOrString): DropDownButton<T>;
1312 }
1314 }
1313
1315
1314 /* dijit/form/FilteringSelect */
1316 /* dijit/form/FilteringSelect */
1315
1317
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> {
1318 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> {
1317 /**
1319 /**
1318 * True (default) if user is required to enter a value into this field.
1320 * True (default) if user is required to enter a value into this field.
1319 */
1321 */
1320 required: boolean;
1322 required: boolean;
1321
1323
1322 _lastDisplayedValue: string;
1324 _lastDisplayedValue: string;
1323 _isValidSubset(): boolean;
1325 _isValidSubset(): boolean;
1324 isValid(): boolean;
1326 isValid(): boolean;
1325 _refreshState(): void;
1327 _refreshState(): void;
1326
1328
1327 /**
1329 /**
1328 * Callback from dojo.store after lookup of user entered value finishes
1330 * Callback from dojo.store after lookup of user entered value finishes
1329 */
1331 */
1330 _callbackSetLabel(result: T[], query: Q, options: O, priorityChange?: boolean): void;
1332 _callbackSetLabel(result: T[], query: Q, options: O, priorityChange?: boolean): void;
1331
1333
1332 _openResultList(results: T[], query: Q, options: O): void;
1334 _openResultList(results: T[], query: Q, options: O): void;
1333 undo(): void;
1335 undo(): void;
1334
1336
1335 // set(name: 'displayedValue', value: string): this;
1337 // set(name: 'displayedValue', value: string): this;
1336 // set(name: 'item', value: T): this;
1338 // set(name: 'item', value: T): this;
1337 // set(name: string, value: any): this;
1339 // set(name: string, value: any): this;
1338 // set(values: Object): this;
1340 // set(values: Object): this;
1339 }
1341 }
1340
1342
1341 interface FilteringSelectConstructor extends _WidgetBaseConstructor<FilteringSelect<any, any, any, any>> {
1343 interface FilteringSelectConstructor extends _WidgetBaseConstructor<FilteringSelect<any, any, any, any>> {
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>;
1344 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>;
1343 }
1345 }
1344
1346
1345 /* dijit/form/Form */
1347 /* dijit/form/Form */
1346
1348
1347 interface Form extends _Widget, _TemplatedMixin, _FormMixin, layout._ContentPaneResizeMixin {
1349 interface Form extends _Widget, _TemplatedMixin, _FormMixin, layout._ContentPaneResizeMixin {
1348 name?: string;
1350 name?: string;
1349 action?: string;
1351 action?: string;
1350 method?: string;
1352 method?: string;
1351 encType?: string;
1353 encType?: string;
1352 'accept-charset'?: string;
1354 'accept-charset'?: string;
1353 accept?: string;
1355 accept?: string;
1354 target?: string;
1356 target?: string;
1355 templateString: string;
1357 templateString: string;
1356
1358
1357 /**
1359 /**
1358 * Deprecated: use submit()
1360 * Deprecated: use submit()
1359 */
1361 */
1360 execute(formContents: Object): void;
1362 execute(formContents: Object): void;
1361
1363
1362 /**
1364 /**
1363 * Deprecated: use onSubmit()
1365 * Deprecated: use onSubmit()
1364 */
1366 */
1365 onExecute(): void;
1367 onExecute(): void;
1366
1368
1367 /**
1369 /**
1368 * restores all widget values back to their init values,
1370 * restores all widget values back to their init values,
1369 * calls onReset() which can cancel the reset by returning false
1371 * calls onReset() which can cancel the reset by returning false
1370 */
1372 */
1371 reset(e?: Event): void;
1373 reset(e?: Event): void;
1372
1374
1373 /**
1375 /**
1374 * Callback when user resets the form. This method is intended
1376 * Callback when user resets the form. This method is intended
1375 * to be over-ridden. When the `reset` method is called
1377 * to be over-ridden. When the `reset` method is called
1376 * programmatically, the return value from `onReset` is used
1378 * programmatically, the return value from `onReset` is used
1377 * to compute whether or not resetting should proceed
1379 * to compute whether or not resetting should proceed
1378 */
1380 */
1379 onReset(e?: Event): boolean;
1381 onReset(e?: Event): boolean;
1380
1382
1381 /**
1383 /**
1382 * Callback when user submits the form.
1384 * Callback when user submits the form.
1383 */
1385 */
1384 onSubmit(e?: Event): boolean;
1386 onSubmit(e?: Event): boolean;
1385
1387
1386 /**
1388 /**
1387 * programmatically submit form if and only if the `onSubmit` returns true
1389 * programmatically submit form if and only if the `onSubmit` returns true
1388 */
1390 */
1389 submit(): void;
1391 submit(): void;
1390 }
1392 }
1391
1393
1392 interface FormConstructor extends _WidgetBaseConstructor<Form> { }
1394 interface FormConstructor extends _WidgetBaseConstructor<Form> { }
1393
1395
1394 /* dijit/form/HorizontalRule */
1396 /* dijit/form/HorizontalRule */
1395
1397
1396 /**
1398 /**
1397 * Hash marks for `dijit/form/HorizontalSlider`
1399 * Hash marks for `dijit/form/HorizontalSlider`
1398 */
1400 */
1399 interface HorizontalRule extends _Widget, _TemplatedMixin {
1401 interface HorizontalRule extends _Widget, _TemplatedMixin {
1400 /**
1402 /**
1401 * Number of hash marks to generate
1403 * Number of hash marks to generate
1402 */
1404 */
1403 count: number;
1405 count: number;
1404
1406
1405 /**
1407 /**
1406 * For HorizontalSlider, this is either "topDecoration" or "bottomDecoration", and indicates whether this rule goes above or below the slider.
1408 * For HorizontalSlider, this is either "topDecoration" or "bottomDecoration", and indicates whether this rule goes above or below the slider.
1407 */
1409 */
1408 container: string;
1410 container: string;
1409
1411
1410 /**
1412 /**
1411 * CSS style to apply to individual hash marks
1413 * CSS style to apply to individual hash marks
1412 */
1414 */
1413 ruleStyle: string;
1415 ruleStyle: string;
1414
1416
1415 _positionPrefix: string;
1417 _positionPrefix: string;
1416 _positionSuffix: string;
1418 _positionSuffix: string;
1417 _suffix: string;
1419 _suffix: string;
1418
1420
1419 _genHTML(pos: number): string;
1421 _genHTML(pos: number): string;
1420
1422
1421 /**
1423 /**
1422 * VerticalRule will override this...
1424 * VerticalRule will override this...
1423 */
1425 */
1424 _isHorizontal: boolean;
1426 _isHorizontal: boolean;
1425 }
1427 }
1426
1428
1427 interface HorizontalRuleConstructor extends _WidgetBaseConstructor<HorizontalRule> { }
1429 interface HorizontalRuleConstructor extends _WidgetBaseConstructor<HorizontalRule> { }
1428
1430
1429 /* dijit/form/HorizontalRuleLabels */
1431 /* dijit/form/HorizontalRuleLabels */
1430
1432
1431 /**
1433 /**
1432 * Labels for `dijit/form/HorizontalSlider`
1434 * Labels for `dijit/form/HorizontalSlider`
1433 */
1435 */
1434 interface HorizontalRuleLabels extends HorizontalRule {
1436 interface HorizontalRuleLabels extends HorizontalRule {
1435 /**
1437 /**
1436 * CSS style to apply to individual text labels
1438 * CSS style to apply to individual text labels
1437 */
1439 */
1438 labelStyle: string;
1440 labelStyle: string;
1439
1441
1440 /**
1442 /**
1441 * Array of text labels to render - evenly spaced from left-to-right or bottom-to-top.
1443 * Array of text labels to render - evenly spaced from left-to-right or bottom-to-top.
1442 * Alternately, minimum and maximum can be specified, to get numeric labels.
1444 * Alternately, minimum and maximum can be specified, to get numeric labels.
1443 */
1445 */
1444 labels: string[];
1446 labels: string[];
1445
1447
1446 /**
1448 /**
1447 * Number of generated numeric labels that should be rendered as '' on the ends when labels[] are not specified
1449 * Number of generated numeric labels that should be rendered as '' on the ends when labels[] are not specified
1448 */
1450 */
1449 numericMargin: number;
1451 numericMargin: number;
1450
1452
1451 /**
1453 /**
1452 * Leftmost label value for generated numeric labels when labels[] are not specified
1454 * Leftmost label value for generated numeric labels when labels[] are not specified
1453 */
1455 */
1454 minimum: number;
1456 minimum: number;
1455
1457
1456 /**
1458 /**
1457 * Rightmost label value for generated numeric labels when labels[] are not specified
1459 * Rightmost label value for generated numeric labels when labels[] are not specified
1458 */
1460 */
1459 maximum: number;
1461 maximum: number;
1460
1462
1461 /**
1463 /**
1462 * pattern, places, lang, et al (see dojo.number) for generated numeric labels when labels[] are not specified
1464 * pattern, places, lang, et al (see dojo.number) for generated numeric labels when labels[] are not specified
1463 */
1465 */
1464 constraints: { pattern: string };
1466 constraints: { pattern: string };
1465
1467
1466 /**
1468 /**
1467 * Returns the value to be used in HTML for the label as part of the left: attribute
1469 * Returns the value to be used in HTML for the label as part of the left: attribute
1468 */
1470 */
1469 _calcPosition(pos: number): number;
1471 _calcPosition(pos: number): number;
1470
1472
1471 _genHTML(pos: number, ndx?: number): string;
1473 _genHTML(pos: number, ndx?: number): string;
1472
1474
1473 /**
1475 /**
1474 * extension point for bidi code
1476 * extension point for bidi code
1475 */
1477 */
1476 _genDirectionHTML(label: string): string;
1478 _genDirectionHTML(label: string): string;
1477
1479
1478 /**
1480 /**
1479 * Overridable function to return array of labels to use for this slider.
1481 * Overridable function to return array of labels to use for this slider.
1480 * Can specify a getLabels() method instead of a labels[] array, or min/max attributes.
1482 * Can specify a getLabels() method instead of a labels[] array, or min/max attributes.
1481 */
1483 */
1482 getLabels(): string[];
1484 getLabels(): string[];
1483 }
1485 }
1484
1486
1485 interface HorizontalRuleLabelsConstructor extends _WidgetBaseConstructor<HorizontalRuleLabels> { }
1487 interface HorizontalRuleLabelsConstructor extends _WidgetBaseConstructor<HorizontalRuleLabels> { }
1486
1488
1487 /* dijit/form/HorizontalSlider */
1489 /* dijit/form/HorizontalSlider */
1488
1490
1489 interface _SliderMover extends dojo.dnd.Mover { }
1491 interface _SliderMover extends dojo.dnd.Mover { }
1490
1492
1491 /**
1493 /**
1492 * A form widget that allows one to select a value with a horizontally draggable handle
1494 * A form widget that allows one to select a value with a horizontally draggable handle
1493 */
1495 */
1494 interface HorizontalSlider extends _FormValueWidget, _Container {
1496 interface HorizontalSlider extends _FormValueWidget, _Container {
1495 /**
1497 /**
1496 * Show increment/decrement buttons at the ends of the slider?
1498 * Show increment/decrement buttons at the ends of the slider?
1497 */
1499 */
1498 showButtons: boolean;
1500 showButtons: boolean;
1499
1501
1500 /**
1502 /**
1501 * The minimum value the slider can be set to.
1503 * The minimum value the slider can be set to.
1502 */
1504 */
1503 minimum: number;
1505 minimum: number;
1504
1506
1505 /**
1507 /**
1506 * The maximum value the slider can be set to.
1508 * The maximum value the slider can be set to.
1507 */
1509 */
1508 maximum: number;
1510 maximum: number;
1509
1511
1510 /**
1512 /**
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.
1513 * 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.
1512 * Thus, the slider has only 'discreteValues' possible values.
1514 * Thus, the slider has only 'discreteValues' possible values.
1513 *
1515 *
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.
1516 * For example, if minimum=10, maxiumum=30, and discreteValues=3, then the slider handle has three possible positions, representing values 10, 20, or 30.
1515 *
1517 *
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).
1518 * 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).
1517 */
1519 */
1518 discreteValues: number;
1520 discreteValues: number;
1519
1521
1520 /**
1522 /**
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.
1523 * If discreteValues is also specified, this indicates the amount of clicks (ie, snap positions) that the slider handle is moved via pageup/pagedown keys.
1522 * If discreteValues is not specified, it indicates the number of pixels.
1524 * If discreteValues is not specified, it indicates the number of pixels.
1523 */
1525 */
1524 pageIncrement: number;
1526 pageIncrement: number;
1525
1527
1526 /**
1528 /**
1527 * If clicking the slider bar changes the value or not
1529 * If clicking the slider bar changes the value or not
1528 */
1530 */
1529 clickSelect: boolean;
1531 clickSelect: boolean;
1530
1532
1531 /**
1533 /**
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.
1534 * 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.
1533 */
1535 */
1534 slideDuration: number;
1536 slideDuration: number;
1535
1537
1536 _mousePixelCoord: string;
1538 _mousePixelCoord: string;
1537 _pixelCount: string;
1539 _pixelCount: string;
1538 _startingPixelCoord: string;
1540 _startingPixelCoord: string;
1539 _handleOffsetCoord: string;
1541 _handleOffsetCoord: string;
1540 _progressPixelSize: string;
1542 _progressPixelSize: string;
1541
1543
1542 _onKeyUp(e: Event): void;
1544 _onKeyUp(e: Event): void;
1543 _onKeyDown(e: Event): void;
1545 _onKeyDown(e: Event): void;
1544 _onHandleClick(e: Event): void;
1546 _onHandleClick(e: Event): void;
1545
1547
1546 /**
1548 /**
1547 * Returns true if direction is from right to left
1549 * Returns true if direction is from right to left
1548 */
1550 */
1549 _isReversed(): boolean;
1551 _isReversed(): boolean;
1550
1552
1551 _onBarClick(e: Event): void;
1553 _onBarClick(e: Event): void;
1552
1554
1553 _setPixelValue(pixelValue: number, maxPixels: number, priorityChange?: boolean): void;
1555 _setPixelValue(pixelValue: number, maxPixels: number, priorityChange?: boolean): void;
1554
1556
1555 _setValueAttr(value: number, priorityChange?: boolean): void;
1557 _setValueAttr(value: number, priorityChange?: boolean): void;
1556
1558
1557 _bumpValue(signedChange: number, priorityChange: boolean): void;
1559 _bumpValue(signedChange: number, priorityChange: boolean): void;
1558
1560
1559 _onClkBumper(val: any): void;
1561 _onClkBumper(val: any): void;
1560 _onClkIncBumper(): void;
1562 _onClkIncBumper(): void;
1561 _onClkDecBumper(): void;
1563 _onClkDecBumper(): void;
1562
1564
1563 decrement(e: Event): void;
1565 decrement(e: Event): void;
1564 increment(e: Event): void;
1566 increment(e: Event): void;
1565
1567
1566 _mouseWheeled(evt: Event): void;
1568 _mouseWheeled(evt: Event): void;
1567
1569
1568 _typematicCallback(count: number, button: Element, e: Event): void;
1570 _typematicCallback(count: number, button: Element, e: Event): void;
1569 }
1571 }
1570
1572
1571 interface HorizontalSliderConstructor extends _WidgetBaseConstructor<HorizontalSlider> {
1573 interface HorizontalSliderConstructor extends _WidgetBaseConstructor<HorizontalSlider> {
1572 /**
1574 /**
1573 * for monkey patching
1575 * for monkey patching
1574 */
1576 */
1575 _Mover: _SliderMover;
1577 _Mover: _SliderMover;
1576 }
1578 }
1577
1579
1578 /* dijit/form/MappedTextBox */
1580 /* dijit/form/MappedTextBox */
1579
1581
1580 interface MappedTextBox<C extends Constraints> extends ValidationTextBox<C> {
1582 interface MappedTextBox<C extends Constraints> extends ValidationTextBox<C> {
1581 postMixInProperties(): void;
1583 postMixInProperties(): void;
1582 serialize: SerializationFunction;
1584 serialize: SerializationFunction;
1583 toString(): string;
1585 toString(): string;
1584 validate(isFocused?: boolean): boolean;
1586 validate(isFocused?: boolean): boolean;
1585 buildRendering(): void;
1587 buildRendering(): void;
1586 reset(): void;
1588 reset(): void;
1587 }
1589 }
1588
1590
1589 interface MappedTextBoxConstructor extends _WidgetBaseConstructor<MappedTextBox<Constraints>> {
1591 interface MappedTextBoxConstructor extends _WidgetBaseConstructor<MappedTextBox<Constraints>> {
1590 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): MappedTextBox<C>;
1592 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): MappedTextBox<C>;
1591 }
1593 }
1592
1594
1593 /* dijit/form/NumberSpinner */
1595 /* dijit/form/NumberSpinner */
1594
1596
1595 interface NumberSpinner extends _Spinner, NumberTextBoxMixin {
1597 interface NumberSpinner extends _Spinner, NumberTextBoxMixin {
1596 constraints: NumberTextBoxConstraints;
1598 constraints: NumberTextBoxConstraints;
1597 baseClass: string;
1599 baseClass: string;
1598 adjust(val: any, delta: number): any;
1600 adjust(val: any, delta: number): any;
1599
1601
1600 /* overrides */
1602 /* overrides */
1601 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1603 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1602 parse(value: string, constraints: NumberTextBoxConstraints): string;
1604 parse(value: string, constraints: NumberTextBoxConstraints): string;
1603 format(value: number, constraints: NumberTextBoxConstraints): string;
1605 format(value: number, constraints: NumberTextBoxConstraints): string;
1604 filter(value: number): number;
1606 filter(value: number): number;
1605 value: number;
1607 value: number;
1606 }
1608 }
1607
1609
1608 interface NumberSpinnerConstructor extends _WidgetBaseConstructor<NumberSpinner> { }
1610 interface NumberSpinnerConstructor extends _WidgetBaseConstructor<NumberSpinner> { }
1609
1611
1610 /* dijit/form/NumberTextBox */
1612 /* dijit/form/NumberTextBox */
1611
1613
1612 interface NumberTextBoxConstraints extends RangeBoundTextBoxConstraints, dojo.NumberFormatOptions, dojo.NumberParseOptions { }
1614 interface NumberTextBoxConstraints extends RangeBoundTextBoxConstraints, dojo.NumberFormatOptions, dojo.NumberParseOptions { }
1613
1615
1614 interface NumberTextBoxMixin {
1616 interface NumberTextBoxMixin {
1615 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1617 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1616 constraints: NumberTextBoxConstraints;
1618 constraints: NumberTextBoxConstraints;
1617 value: number;
1619 value: number;
1618 editOptions: { pattern: string };
1620 editOptions: { pattern: string };
1619 _formatter: (value: number, options?: dojo.NumberFormatOptions) => string;
1621 _formatter: (value: number, options?: dojo.NumberFormatOptions) => string;
1620 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1622 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1621 _decimalInfo: (constraints: Constraints) => { sep: string; places: number; };
1623 _decimalInfo: (constraints: Constraints) => { sep: string; places: number; };
1622 postMixInProperties(): void;
1624 postMixInProperties(): void;
1623 format(value: number, constraints: NumberTextBoxConstraints): string;
1625 format(value: number, constraints: NumberTextBoxConstraints): string;
1624 _parser: (expression: string, options?: dojo.NumberParseOptions) => number;
1626 _parser: (expression: string, options?: dojo.NumberParseOptions) => number;
1625 parse(value: string, constraints: dojo.NumberParseOptions): string;
1627 parse(value: string, constraints: dojo.NumberParseOptions): string;
1626 filter(value: number): number;
1628 filter(value: number): number;
1627 serialize: SerializationFunction;
1629 serialize: SerializationFunction;
1628 isValid(isFocused: boolean): boolean;
1630 isValid(isFocused: boolean): boolean;
1629 }
1631 }
1630
1632
1631 interface NumberTextBoxMixinConstructor extends _WidgetBaseConstructor<NumberTextBoxMixin> { }
1633 interface NumberTextBoxMixinConstructor extends _WidgetBaseConstructor<NumberTextBoxMixin> { }
1632
1634
1633 interface NumberTextBox extends RangeBoundTextBox, NumberTextBoxMixin {
1635 interface NumberTextBox extends RangeBoundTextBox, NumberTextBoxMixin {
1634 constraints: NumberTextBoxConstraints;
1636 constraints: NumberTextBoxConstraints;
1635 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1637 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1636 parse(value: string, constraints: dojo.NumberParseOptions): string;
1638 parse(value: string, constraints: dojo.NumberParseOptions): string;
1637 format(value: number, constraints: dojo.NumberFormatOptions): string;
1639 format(value: number, constraints: dojo.NumberFormatOptions): string;
1638 value: number;
1640 value: number;
1639 filter(value: number): number;
1641 filter(value: number): number;
1640 }
1642 }
1641
1643
1642 interface NumberTextBoxConstructor extends _WidgetBaseConstructor<NumberTextBox> {
1644 interface NumberTextBoxConstructor extends _WidgetBaseConstructor<NumberTextBox> {
1643 Mixin: NumberTextBoxMixinConstructor;
1645 Mixin: NumberTextBoxMixinConstructor;
1644 }
1646 }
1645
1647
1646 /* dijit/form/RadioButton */
1648 /* dijit/form/RadioButton */
1647
1649
1648 interface RadioButton extends CheckBox, _RadioButtonMixin {
1650 interface RadioButton extends CheckBox, _RadioButtonMixin {
1649 baseClass: string;
1651 baseClass: string;
1650 }
1652 }
1651
1653
1652 interface RadioButtonConstructor extends _WidgetBaseConstructor<RadioButton> { }
1654 interface RadioButtonConstructor extends _WidgetBaseConstructor<RadioButton> { }
1653
1655
1654 /* dijit/form/RangeBoundTextBox */
1656 /* dijit/form/RangeBoundTextBox */
1655
1657
1656 interface RangeBoundTextBoxConstraints extends Constraints {
1658 interface RangeBoundTextBoxConstraints extends Constraints {
1657 min?: number;
1659 min?: number;
1658 max?: number;
1660 max?: number;
1659 }
1661 }
1660
1662
1661 interface RangeBoundTextBox extends MappedTextBox<RangeBoundTextBoxConstraints> {
1663 interface RangeBoundTextBox extends MappedTextBox<RangeBoundTextBoxConstraints> {
1662 /**
1664 /**
1663 * The message to display if value is out-of-range
1665 * The message to display if value is out-of-range
1664 */
1666 */
1665 rangeMessage: string;
1667 rangeMessage: string;
1666
1668
1667 /**
1669 /**
1668 * Overridable function used to validate the range of the numeric input value.
1670 * Overridable function used to validate the range of the numeric input value.
1669 */
1671 */
1670 rangeCheck(primative: number, constraints: RangeBoundTextBoxConstraints): boolean;
1672 rangeCheck(primative: number, constraints: RangeBoundTextBoxConstraints): boolean;
1671
1673
1672 /**
1674 /**
1673 * Tests if the value is in the min/max range specified in constraints
1675 * Tests if the value is in the min/max range specified in constraints
1674 */
1676 */
1675 isInRange(isFocused: boolean): boolean;
1677 isInRange(isFocused: boolean): boolean;
1676
1678
1677 /**
1679 /**
1678 * Returns true if the value is out of range and will remain
1680 * Returns true if the value is out of range and will remain
1679 * out of range even if the user types more characters
1681 * out of range even if the user types more characters
1680 */
1682 */
1681 _isDefinitelyOutOfRange(): boolean;
1683 _isDefinitelyOutOfRange(): boolean;
1682
1684
1683 isValid(isFocused: boolean): boolean;
1685 isValid(isFocused: boolean): boolean;
1684 getErrorMessage(isFocused: boolean): string;
1686 getErrorMessage(isFocused: boolean): string;
1685 postMixInProperties(): void;
1687 postMixInProperties(): void;
1686 }
1688 }
1687
1689
1688 interface RangeBoundTextBoxConstructor extends _WidgetBaseConstructor<RangeBoundTextBox> { }
1690 interface RangeBoundTextBoxConstructor extends _WidgetBaseConstructor<RangeBoundTextBox> { }
1689
1691
1690 /* dijit/form/Select */
1692 /* dijit/form/Select */
1691
1693
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 {
1694 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 {
1693 baseClass: string;
1695 baseClass: string;
1694
1696
1695 /**
1697 /**
1696 * What to display in an "empty" drop down.
1698 * What to display in an "empty" drop down.
1697 */
1699 */
1698 emptyLabel: string;
1700 emptyLabel: string;
1699
1701
1700 /**
1702 /**
1701 * Specifies how to interpret the labelAttr in the data store items.
1703 * Specifies how to interpret the labelAttr in the data store items.
1702 */
1704 */
1703 labelType: string;
1705 labelType: string;
1704
1706
1705 /**
1707 /**
1706 * Currently displayed error/prompt message
1708 * Currently displayed error/prompt message
1707 */
1709 */
1708 message: string;
1710 message: string;
1709
1711
1710 /**
1712 /**
1711 * Can be true or false, default is false.
1713 * Can be true or false, default is false.
1712 */
1714 */
1713 required: boolean;
1715 required: boolean;
1714
1716
1715 /**
1717 /**
1716 * "Incomplete" if this select is required but unset (i.e. blank value), "" otherwise
1718 * "Incomplete" if this select is required but unset (i.e. blank value), "" otherwise
1717 */
1719 */
1718 state: string;
1720 state: string;
1719
1721
1720 /**
1722 /**
1721 * Order fields are traversed when user hits the tab key
1723 * Order fields are traversed when user hits the tab key
1722 */
1724 */
1723 tabIndex: any;
1725 tabIndex: any;
1724 templateString: any;
1726 templateString: any;
1725
1727
1726 /**
1728 /**
1727 * See the description of dijit/Tooltip.defaultPosition for details on this parameter.
1729 * See the description of dijit/Tooltip.defaultPosition for details on this parameter.
1728 */
1730 */
1729 tooltipPosition: any;
1731 tooltipPosition: any;
1730
1732
1731 childSelector(node: Element | Node): boolean;
1733 childSelector(node: Element | Node): boolean;
1732 destroy(preserveDom: boolean): void;
1734 destroy(preserveDom: boolean): void;
1733 focus(): void;
1735 focus(): void;
1734
1736
1735 /**
1737 /**
1736 * Sets the value to the given option, used during search by letter.
1738 * Sets the value to the given option, used during search by letter.
1737 * @param widget Reference to option's widget
1739 * @param widget Reference to option's widget
1738 */
1740 */
1739 focusChild(widget: dijit._WidgetBase): void;
1741 focusChild(widget: dijit._WidgetBase): void;
1740 isLoaded(): boolean;
1742 isLoaded(): boolean;
1741
1743
1742 /**
1744 /**
1743 * Whether or not this is a valid value.
1745 * Whether or not this is a valid value.
1744 * @param isFocused
1746 * @param isFocused
1745 */
1747 */
1746 isValid(isFocused: boolean): boolean;
1748 isValid(isFocused: boolean): boolean;
1747
1749
1748 /**
1750 /**
1749 * populates the menu
1751 * populates the menu
1750 * @param loadCallback
1752 * @param loadCallback
1751 */
1753 */
1752 loadDropDown(loadCallback: () => any): void;
1754 loadDropDown(loadCallback: () => any): void;
1753 postCreate(): void;
1755 postCreate(): void;
1754
1756
1755 /**
1757 /**
1756 * set the missing message
1758 * set the missing message
1757 */
1759 */
1758 postMixInProperties(): void;
1760 postMixInProperties(): void;
1759
1761
1760 /**
1762 /**
1761 * Overridden so that the state will be cleared.
1763 * Overridden so that the state will be cleared.
1762 */
1764 */
1763 reset(): void;
1765 reset(): void;
1764 startup(): void;
1766 startup(): void;
1765
1767
1766 /**
1768 /**
1767 * Called by oninit, onblur, and onkeypress, and whenever required/disabled state changes
1769 * Called by oninit, onblur, and onkeypress, and whenever required/disabled state changes
1768 * @param isFocused
1770 * @param isFocused
1769 */
1771 */
1770 validate(isFocused: boolean): boolean;
1772 validate(isFocused: boolean): boolean;
1771
1773
1772 /**
1774 /**
1773 * When a key is pressed that matches a child item,
1775 * When a key is pressed that matches a child item,
1774 * this method is called so that a widget can take
1776 * this method is called so that a widget can take
1775 * appropriate action is necessary.
1777 * appropriate action is necessary.
1776 * @param item
1778 * @param item
1777 * @param evt
1779 * @param evt
1778 * @param searchString
1780 * @param searchString
1779 * @param numMatches
1781 * @param numMatches
1780 */
1782 */
1781 onKeyboardSearch(item: dijit._WidgetBase, evt: Event, searchString: string, numMatches: number): void;
1783 onKeyboardSearch(item: dijit._WidgetBase, evt: Event, searchString: string, numMatches: number): void;
1782 }
1784 }
1783
1785
1784 interface SelectConstructor extends _WidgetBaseConstructor<Select<any, any, any, any>> { }
1786 interface SelectConstructor extends _WidgetBaseConstructor<Select<any, any, any, any>> { }
1785
1787
1786 /* dijit/form/SimpleTextarea */
1788 /* dijit/form/SimpleTextarea */
1787
1789
1788 interface SimpleTextarea extends TextBox {
1790 interface SimpleTextarea extends TextBox {
1789 baseClass: string;
1791 baseClass: string;
1790 rows: string;
1792 rows: string;
1791 cols: string;
1793 cols: string;
1792 templateString: string;
1794 templateString: string;
1793 postMixInProperties(): void;
1795 postMixInProperties(): void;
1794 buildRendering(): void;
1796 buildRendering(): void;
1795 filter(value: string): string;
1797 filter(value: string): string;
1796 }
1798 }
1797
1799
1798 interface SimpleTextareaConstructor extends _WidgetBaseConstructor<SimpleTextarea> {
1800 interface SimpleTextareaConstructor extends _WidgetBaseConstructor<SimpleTextarea> {
1799 new(params: Object, srcNodeRef: dojo.NodeOrString): SimpleTextarea;
1801 new(params: Object, srcNodeRef: dojo.NodeOrString): SimpleTextarea;
1800 }
1802 }
1801
1803
1802 /* dijit/form/Textarea */
1804 /* dijit/form/Textarea */
1803
1805
1804 interface Textarea extends SimpleTextarea, _ExpandingTextAreaMixin {
1806 interface Textarea extends SimpleTextarea, _ExpandingTextAreaMixin {
1805 baseClass: string;
1807 baseClass: string;
1806 cols: string;
1808 cols: string;
1807 buildRendering(): void;
1809 buildRendering(): void;
1808 }
1810 }
1809
1811
1810 interface TextareaConstructor extends _WidgetBaseConstructor<Textarea> { }
1812 interface TextareaConstructor extends _WidgetBaseConstructor<Textarea> { }
1811
1813
1812 /* dijit/form/TextBox */
1814 /* dijit/form/TextBox */
1813
1815
1814 interface TextBox extends _FormValueWidget, _TextBoxMixin<Constraints> {
1816 interface TextBox extends _FormValueWidget, _TextBoxMixin<Constraints> {
1815
1817
1816 }
1818 }
1817
1819
1818 interface TextBoxConstructor extends _WidgetBaseConstructor<TextBox> { }
1820 interface TextBoxConstructor extends _WidgetBaseConstructor<TextBox> { }
1819
1821
1820 /* dijit/form/ToggleButton */
1822 /* dijit/form/ToggleButton */
1821
1823
1822 interface ToggleButton extends Button, _ToggleButtonMixin {
1824 interface ToggleButton extends Button, _ToggleButtonMixin {
1823 baseClass: string;
1825 baseClass: string;
1824
1826
1825 setChecked(checked: boolean): void;
1827 setChecked(checked: boolean): void;
1826 }
1828 }
1827
1829
1828 interface ToggleButtonConstructor extends _WidgetBaseConstructor<ToggleButton> { }
1830 interface ToggleButtonConstructor extends _WidgetBaseConstructor<ToggleButton> { }
1829
1831
1830 /* dijit/form/ValidationTextBox */
1832 /* dijit/form/ValidationTextBox */
1831
1833
1832 interface IsValidFunction {
1834 interface IsValidFunction {
1833 (isFocused?: boolean): boolean;
1835 (isFocused?: boolean): boolean;
1834 }
1836 }
1835
1837
1836 interface ValidationTextBox<C extends Constraints = Constraints> extends TextBox {
1838 interface ValidationTextBox<C extends Constraints = Constraints> extends TextBox {
1837 templateString: string;
1839 templateString: string;
1838 required: boolean;
1840 required: boolean;
1839 promptMessage: string;
1841 promptMessage: string;
1840 invalidMessage: string;
1842 invalidMessage: string;
1841 missingMessage: string;
1843 missingMessage: string;
1842 message: string;
1844 message: string;
1843 constraints: C;
1845 constraints: C;
1844 pattern: string | ConstraintsToRegExpString<C>;
1846 pattern: string | ConstraintsToRegExpString<C>;
1845 regExp: string;
1847 regExp: string;
1846 regExpGen(constraints: C): void;
1848 regExpGen(constraints: C): void;
1847 state: string;
1849 state: string;
1848 tooltipPosition: string[];
1850 tooltipPosition: string[];
1849 validator: ConstrainedValidFunction<C>;
1851 validator: ConstrainedValidFunction<C>;
1850 isValid: IsValidFunction;
1852 isValid: IsValidFunction;
1851 getErrorMessage(isFocused: boolean): string;
1853 getErrorMessage(isFocused: boolean): string;
1852 getPromptMessage(isFocused: boolean): string;
1854 getPromptMessage(isFocused: boolean): string;
1853 validate(isFocused: boolean): boolean;
1855 validate(isFocused: boolean): boolean;
1854 displayMessage(message: string): void;
1856 displayMessage(message: string): void;
1855
1857
1856 startup(): void;
1858 startup(): void;
1857 postMixInProperties(): void;
1859 postMixInProperties(): void;
1858
1860
1859 reset(): void;
1861 reset(): void;
1860
1862
1861 destroy(preserveDom?: boolean): void;
1863 destroy(preserveDom?: boolean): void;
1862 }
1864 }
1863
1865
1864 interface ValidationTextBoxConstructor extends _WidgetBaseConstructor<ValidationTextBox<Constraints>> {
1866 interface ValidationTextBoxConstructor extends _WidgetBaseConstructor<ValidationTextBox<Constraints>> {
1865 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): ValidationTextBox<C>;
1867 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): ValidationTextBox<C>;
1866 }
1868 }
1867 }
1869 }
1868 }
1870 }
@@ -1,2104 +1,2108
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?: string | 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 | string;
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<EM extends { [e in string]: any; } = any> {
787 on(type: string | ExtensionEvent, listener: EventListener | Function): Handle;
787 on<E extends keyof EM>(type: E, listener: (this: this, ...args: EM[E] extends any[] ? EM[E]: [EM[E]]) => void ): Handle;
788 emit(type: string | ExtensionEvent, ...events: any[]): boolean;
788
789 on(type: ExtensionEvent, listener: (...args: any[]) => void): Handle;
790
791 emit<E extends keyof EM>(type: E, ...args: EM[E] extends any[] ? EM[E] : [EM[E]] );
792 emit(type: ExtensionEvent, ...events: any[]): boolean;
789 }
793 }
790
794
791 interface EventedConstructor extends _base.DeclareConstructor<Evented> {
795 interface EventedConstructor extends _base.DeclareConstructor<Evented> {
792 new (params?: Object): Evented;
796 new <T>(params?: Object): Evented<T>;
793 }
797 }
794
798
795 /* dojo/fx */
799 /* dojo/fx */
796
800
797 /* dojo/fx augments the dojo/_base/fx, therefore it is typed in fx.d.ts and not referenced from
801 /* 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/* */
802 index.d.ts or module.d.ts and is self contained typings for dojo/fx and dojo/fx/* */
799
803
800 /* dojo/gears */
804 /* dojo/gears */
801
805
802 /* This is long-ago deprecated by Google, so just doing a minimal typing */
806 /* This is long-ago deprecated by Google, so just doing a minimal typing */
803
807
804 interface Gears {
808 interface Gears {
805 _gearsObject(): any;
809 _gearsObject(): any;
806 available: boolean;
810 available: boolean;
807 }
811 }
808
812
809 /* dojo/has */
813 /* dojo/has */
810
814
811 interface HasCache {
815 interface HasCache {
812 [feature: string]: any;
816 [feature: string]: any;
813 }
817 }
814
818
815 interface HasTestFunction {
819 interface HasTestFunction {
816 /* TypeScript has no way of referring to the global scope see Microsoft/TypeScript#983 */
820 /* TypeScript has no way of referring to the global scope see Microsoft/TypeScript#983 */
817 (global?: any, doc?: Document, element?: Element): any;
821 (global?: any, doc?: Document, element?: Element): any;
818 }
822 }
819
823
820 interface Has {
824 interface Has {
821 /**
825 /**
822 * Return the current value of the named feature.
826 * 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.
827 * @param {string | number} name The name (if a string) or identifier (if an integer) of the feature to test.
824 */
828 */
825 (name: string | number): any;
829 (name: string | number): any;
826 (name: 'host-browser'): boolean;
830 (name: 'host-browser'): boolean;
827 (name: 'host-node'): any;
831 (name: 'host-node'): any;
828 (name: 'host-rhino'): boolean;
832 (name: 'host-rhino'): boolean;
829 (name: 'dom'): boolean;
833 (name: 'dom'): boolean;
830 (name: 'dojo-dom-ready-api'): 1;
834 (name: 'dojo-dom-ready-api'): 1;
831 (name: 'dojo-sniff'): 1;
835 (name: 'dojo-sniff'): 1;
832 // if host-browser is true
836 // if host-browser is true
833 (name: 'dom-addeventlistener'): void | boolean;
837 (name: 'dom-addeventlistener'): void | boolean;
834 (name: 'touch'): void | boolean;
838 (name: 'touch'): void | boolean;
835 (name: 'touch-events'): void | boolean;
839 (name: 'touch-events'): void | boolean;
836 (name: 'pointer-events'): void | boolean;
840 (name: 'pointer-events'): void | boolean;
837 (name: 'MSPointer'): void | boolean;
841 (name: 'MSPointer'): void | boolean;
838 (name: 'device-width'): void | number;
842 (name: 'device-width'): void | number;
839 (name: 'dom-attributes-explicit'): void | boolean;
843 (name: 'dom-attributes-explicit'): void | boolean;
840 (name: 'dom-attributes-specified-flag'): void | boolean;
844 (name: 'dom-attributes-specified-flag'): void | boolean;
841 // dojo/_base/browser
845 // dojo/_base/browser
842 (name: 'config-selectorEngine'): string;
846 (name: 'config-selectorEngine'): string;
843
847
844 cache: HasCache;
848 cache: HasCache;
845
849
846 /**
850 /**
847 * Register a new feature test for some named feature.
851 * Register a new feature test for some named feature.
848 */
852 */
849 add(name: string | number, test: HasTestFunction, now?: boolean, force?: boolean): any;
853 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;
854 add<T extends (Object | string | number | boolean | null | void)>(name: string | number, test: T, now?: boolean, force?: boolean): any;
851
855
852 /**
856 /**
853 * Deletes the contents of the element passed to test functions.
857 * Deletes the contents of the element passed to test functions.
854 */
858 */
855 clearElement(element: HTMLElement): HTMLElement;
859 clearElement(element: HTMLElement): HTMLElement;
856
860
857 /**
861 /**
858 * Resolves id into a module id based on possibly-nested tenary expression that branches on has feature test value(s).
862 * Resolves id into a module id based on possibly-nested tenary expression that branches on has feature test value(s).
859 */
863 */
860 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
864 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
861
865
862 /**
866 /**
863 * Conditional loading of AMD modules based on a has feature test value.
867 * Conditional loading of AMD modules based on a has feature test value.
864 */
868 */
865 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
869 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
866 }
870 }
867
871
868 /* dojo/hash */
872 /* dojo/hash */
869
873
870 interface Hash {
874 interface Hash {
871 (hash?: string, replace?: boolean): string;
875 (hash?: string, replace?: boolean): string;
872 }
876 }
873
877
874 /* dojo/hccss */
878 /* dojo/hccss */
875
879
876 /* this only does has.add and re-exports the has interface */
880 /* this only does has.add and re-exports the has interface */
877 interface Has {
881 interface Has {
878 (name: 'highcontrast'): void | boolean;
882 (name: 'highcontrast'): void | boolean;
879 }
883 }
880
884
881 /* dojo/html */
885 /* dojo/html */
882
886
883 type ContentSetterContent = string | Node | ArrayLike<Node>;
887 type ContentSetterContent = string | Node | ArrayLike<Node>;
884
888
885 interface ContentSetterParams {
889 interface ContentSetterParams {
886 node?: NodeOrString;
890 node?: NodeOrString;
887 content?: ContentSetterContent;
891 content?: ContentSetterContent;
888 id?: string;
892 id?: string;
889 cleanContent?: boolean;
893 cleanContent?: boolean;
890 extractContent?: boolean;
894 extractContent?: boolean;
891 parseContent?: boolean;
895 parseContent?: boolean;
892 parserScope?: boolean;
896 parserScope?: boolean;
893 startup?: boolean;
897 startup?: boolean;
894 onBegin?: Function;
898 onBegin?: Function;
895 onEnd?: Function;
899 onEnd?: Function;
896 tearDown?: Function;
900 tearDown?: Function;
897 onContentError?: Function;
901 onContentError?: Function;
898 onExecError?: Function;
902 onExecError?: Function;
899 }
903 }
900
904
901 interface ContentSetter {
905 interface ContentSetter {
902
906
903 /**
907 /**
904 * An node which will be the parent element that we set content into
908 * An node which will be the parent element that we set content into
905 */
909 */
906 node: NodeOrString;
910 node: NodeOrString;
907
911
908 /**
912 /**
909 * The content to be placed in the node. Can be an HTML string, a node reference, or a enumerable list of nodes
913 * The content to be placed in the node. Can be an HTML string, a node reference, or a enumerable list of nodes
910 */
914 */
911 content: ContentSetterContent;
915 content: ContentSetterContent;
912
916
913 /**
917 /**
914 * Usually only used internally, and auto-generated with each instance
918 * Usually only used internally, and auto-generated with each instance
915 */
919 */
916 id: string;
920 id: string;
917
921
918 /**
922 /**
919 * Should the content be treated as a full html document,
923 * Should the content be treated as a full html document,
920 * and the real content stripped of <html>, <body> wrapper before injection
924 * and the real content stripped of <html>, <body> wrapper before injection
921 */
925 */
922 cleanContent: boolean;
926 cleanContent: boolean;
923
927
924 /**
928 /**
925 * Should the content be treated as a full html document,
929 * Should the content be treated as a full html document,
926 * and the real content stripped of `<html> <body>` wrapper before injection
930 * and the real content stripped of `<html> <body>` wrapper before injection
927 */
931 */
928 extractContent: boolean;
932 extractContent: boolean;
929
933
930 /**
934 /**
931 * Should the node by passed to the parser after the new content is set
935 * Should the node by passed to the parser after the new content is set
932 */
936 */
933 parseContent: boolean;
937 parseContent: boolean;
934
938
935 /**
939 /**
936 * Flag passed to parser. Root for attribute names to search for. If scopeName is dojo,
940 * 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
941 * will search for data-dojo-type (or dojoType). For backwards compatibility
938 * reasons defaults to dojo._scopeName (which is "dojo" except when
942 * 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.)
943 * multi-version support is used, when it will be something like dojo16, dojo20, etc.)
940 */
944 */
941 parserScope: string;
945 parserScope: string;
942
946
943 /**
947 /**
944 * Start the child widgets after parsing them. Only obeyed if parseContent is true.
948 * Start the child widgets after parsing them. Only obeyed if parseContent is true.
945 */
949 */
946 startup: boolean;
950 startup: boolean;
947
951
948 /**
952 /**
949 * front-end to the set-content sequence
953 * front-end to the set-content sequence
950 */
954 */
951 set(cont?: ContentSetterContent, params?: ContentSetterParams): promise.Promise<Node> | Node;
955 set(cont?: ContentSetterContent, params?: ContentSetterParams): promise.Promise<Node> | Node;
952
956
953 /**
957 /**
954 * sets the content on the node
958 * sets the content on the node
955 */
959 */
956 setContent(): void;
960 setContent(): void;
957
961
958 /**
962 /**
959 * cleanly empty out existing content
963 * cleanly empty out existing content
960 */
964 */
961 empty(): void;
965 empty(): void;
962
966
963 /**
967 /**
964 * Called after instantiation, but before set();
968 * Called after instantiation, but before set();
965 * It allows modification of any of the object properties -
969 * It allows modification of any of the object properties -
966 * including the node and content provided - before the set operation actually takes place
970 * including the node and content provided - before the set operation actually takes place
967 */
971 */
968 onBegin(): Node;
972 onBegin(): Node;
969
973
970 /**
974 /**
971 * Called after set(), when the new content has been pushed into the node
975 * 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
976 * 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
977 * This default implementation checks a parseContent flag to optionally run the dojo parser over the new content
974 */
978 */
975 onEnd(): Node;
979 onEnd(): Node;
976
980
977 /**
981 /**
978 * manually reset the Setter instance if its being re-used for example for another set()
982 * manually reset the Setter instance if its being re-used for example for another set()
979 */
983 */
980 tearDown(): void;
984 tearDown(): void;
981
985
982 onContentError(): string;
986 onContentError(): string;
983 onExecError(): string;
987 onExecError(): string;
984 _mixin(params: ContentSetterParams): void;
988 _mixin(params: ContentSetterParams): void;
985 parseDeferred: Deferred<any[]>;
989 parseDeferred: Deferred<any[]>;
986
990
987 /**
991 /**
988 * runs the dojo parser over the node contents, storing any results in this.parseResults
992 * runs the dojo parser over the node contents, storing any results in this.parseResults
989 */
993 */
990 _parse(): void;
994 _parse(): void;
991
995
992 /**
996 /**
993 * shows user the string that is returned by on[type]Error
997 * shows user the string that is returned by on[type]Error
994 * override/implement on[type]Error and return your own string to customize
998 * override/implement on[type]Error and return your own string to customize
995 */
999 */
996 _onError(type: string, err: Error, consoleText?: string): void;
1000 _onError(type: string, err: Error, consoleText?: string): void;
997 }
1001 }
998
1002
999 interface ContentSetterConstructor extends _base.DeclareConstructor<ContentSetter> {
1003 interface ContentSetterConstructor extends _base.DeclareConstructor<ContentSetter> {
1000 new (params?: ContentSetterParams, node?: NodeOrString): ContentSetter;
1004 new (params?: ContentSetterParams, node?: NodeOrString): ContentSetter;
1001 }
1005 }
1002
1006
1003 interface Html {
1007 interface Html {
1004 /**
1008 /**
1005 * removes !DOCTYPE and title elements from the html string.
1009 * removes !DOCTYPE and title elements from the html string.
1006 *
1010 *
1007 * khtml is picky about dom faults, you can't attach a style or `<title>` node as child of body
1011 * 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
1012 * must go into head, so we need to cut out those tags
1009 */
1013 */
1010 _secureForInnerHtml(cont: string): string;
1014 _secureForInnerHtml(cont: string): string;
1011
1015
1012 /**
1016 /**
1013 * Deprecated, should use dojo/dom-constuct.empty() directly, remove in 2.0.
1017 * Deprecated, should use dojo/dom-constuct.empty() directly, remove in 2.0.
1014 */
1018 */
1015 _emptyNode(node: NodeOrString): void;
1019 _emptyNode(node: NodeOrString): void;
1016
1020
1017 /**
1021 /**
1018 * inserts the given content into the given node
1022 * inserts the given content into the given node
1019 */
1023 */
1020 _setNodeContent<T extends Node>(node: Node, cont: string | Node | ArrayLike<T>): Node;
1024 _setNodeContent<T extends Node>(node: Node, cont: string | Node | ArrayLike<T>): Node;
1021
1025
1022 _ContentSetter: ContentSetterConstructor;
1026 _ContentSetter: ContentSetterConstructor;
1023
1027
1024 /**
1028 /**
1025 * inserts (replaces) the given content into the given node. dojo/dom-construct.place(cont, node, "only")
1029 * 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.
1030 * may be a better choice for simple HTML insertion.
1027 */
1031 */
1028 set(node: Node, cont?: ContentSetterContent, params?: ContentSetterParams): promise.Promise<Node> | Node;
1032 set(node: Node, cont?: ContentSetterContent, params?: ContentSetterParams): promise.Promise<Node> | Node;
1029 }
1033 }
1030
1034
1031 /* dojo/i18n */
1035 /* dojo/i18n */
1032
1036
1033 interface I18n {
1037 interface I18n {
1034 getLocalization(moduleName: string, bundleName: string, locale?: string): any;
1038 getLocalization(moduleName: string, bundleName: string, locale?: string): any;
1035
1039
1036 dynamic: boolean;
1040 dynamic: boolean;
1037
1041
1038 /**
1042 /**
1039 * Resolves id into a module id based on possibly-nested tenary expression that branches on has feature test value(s).
1043 * Resolves id into a module id based on possibly-nested tenary expression that branches on has feature test value(s).
1040 */
1044 */
1041 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
1045 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
1042
1046
1043 normalizeLocale(locale?: string): string;
1047 normalizeLocale(locale?: string): string;
1044
1048
1045 /**
1049 /**
1046 * Conditional loading of AMD modules based on a has feature test value.
1050 * Conditional loading of AMD modules based on a has feature test value.
1047 */
1051 */
1048 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
1052 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
1049
1053
1050 cache: { [bundle: string]: any };
1054 cache: { [bundle: string]: any };
1051
1055
1052 getL10nName(moduleName: string, bundleName: string, locale?: string): string;
1056 getL10nName(moduleName: string, bundleName: string, locale?: string): string;
1053 }
1057 }
1054
1058
1055 /* dojo/io-query */
1059 /* dojo/io-query */
1056
1060
1057 interface IoQuery {
1061 interface IoQuery {
1058 /**
1062 /**
1059 * takes a name/value mapping object and returns a string representing
1063 * takes a name/value mapping object and returns a string representing
1060 * a URL-encoded version of that object.
1064 * a URL-encoded version of that object.
1061 */
1065 */
1062 objectToQuery(map: GenericObject): string;
1066 objectToQuery(map: GenericObject): string;
1063
1067
1064 /**
1068 /**
1065 * Create an object representing a de-serialized query section of a
1069 * Create an object representing a de-serialized query section of a
1066 * URL. Query keys with multiple values are returned in an array.
1070 * URL. Query keys with multiple values are returned in an array.
1067 */
1071 */
1068 queryToObject(str: string): GenericObject;
1072 queryToObject(str: string): GenericObject;
1069 }
1073 }
1070
1074
1071 /* dojo/json */
1075 /* dojo/json */
1072
1076
1073 interface Json {
1077 interface Json {
1074
1078
1075 /**
1079 /**
1076 * Parses a [JSON](http://json.org) string to return a JavaScript object.
1080 * Parses a [JSON](http://json.org) string to return a JavaScript object.
1077 */
1081 */
1078 parse(str: string, strict?: boolean): any;
1082 parse(str: string, strict?: boolean): any;
1079
1083
1080 /**
1084 /**
1081 * Returns a [JSON](http://json.org) serialization of an object.
1085 * Returns a [JSON](http://json.org) serialization of an object.
1082 */
1086 */
1083 stringify(value: any, replacer?: (key: string, value: any) => any| any[], space?: string | number): string;
1087 stringify(value: any, replacer?: (key: string, value: any) => any| any[], space?: string | number): string;
1084 }
1088 }
1085
1089
1086 /* dojo/keys */
1090 /* dojo/keys */
1087
1091
1088 interface Keys {
1092 interface Keys {
1089 BACKSPACE: number;
1093 BACKSPACE: number;
1090 TAB: number;
1094 TAB: number;
1091 CLEAR: number;
1095 CLEAR: number;
1092 ENTER: number;
1096 ENTER: number;
1093 SHIFT: number;
1097 SHIFT: number;
1094 CTRL: number;
1098 CTRL: number;
1095 ALT: number;
1099 ALT: number;
1096 META: number;
1100 META: number;
1097 PAUSE: number;
1101 PAUSE: number;
1098 CAPS_LOCK: number;
1102 CAPS_LOCK: number;
1099 ESCAPE: number;
1103 ESCAPE: number;
1100 SPACE: number;
1104 SPACE: number;
1101 PAGE_UP: number;
1105 PAGE_UP: number;
1102 PAGE_DOWN: number;
1106 PAGE_DOWN: number;
1103 END: number;
1107 END: number;
1104 HOME: number;
1108 HOME: number;
1105 LEFT_ARROW: number;
1109 LEFT_ARROW: number;
1106 UP_ARROW: number;
1110 UP_ARROW: number;
1107 RIGHT_ARROW: number;
1111 RIGHT_ARROW: number;
1108 DOWN_ARROW: number;
1112 DOWN_ARROW: number;
1109 INSERT: number;
1113 INSERT: number;
1110 DELETE: number;
1114 DELETE: number;
1111 HELP: number;
1115 HELP: number;
1112 LEFT_WINDOW: number;
1116 LEFT_WINDOW: number;
1113 RIGHT_WINDOW: number;
1117 RIGHT_WINDOW: number;
1114 SELECT: number;
1118 SELECT: number;
1115 NUMPAD_0: number;
1119 NUMPAD_0: number;
1116 NUMPAD_1: number;
1120 NUMPAD_1: number;
1117 NUMPAD_2: number;
1121 NUMPAD_2: number;
1118 NUMPAD_3: number;
1122 NUMPAD_3: number;
1119 NUMPAD_4: number;
1123 NUMPAD_4: number;
1120 NUMPAD_5: number;
1124 NUMPAD_5: number;
1121 NUMPAD_6: number;
1125 NUMPAD_6: number;
1122 NUMPAD_7: number;
1126 NUMPAD_7: number;
1123 NUMPAD_8: number;
1127 NUMPAD_8: number;
1124 NUMPAD_9: number;
1128 NUMPAD_9: number;
1125 NUMPAD_MULTIPLY: number;
1129 NUMPAD_MULTIPLY: number;
1126 NUMPAD_PLUS: number;
1130 NUMPAD_PLUS: number;
1127 NUMPAD_ENTER: number;
1131 NUMPAD_ENTER: number;
1128 NUMPAD_MINUS: number;
1132 NUMPAD_MINUS: number;
1129 NUMPAD_PERIOD: number;
1133 NUMPAD_PERIOD: number;
1130 NUMPAD_DIVIDE: number;
1134 NUMPAD_DIVIDE: number;
1131 F1: number;
1135 F1: number;
1132 F2: number;
1136 F2: number;
1133 F3: number;
1137 F3: number;
1134 F4: number;
1138 F4: number;
1135 F5: number;
1139 F5: number;
1136 F6: number;
1140 F6: number;
1137 F7: number;
1141 F7: number;
1138 F8: number;
1142 F8: number;
1139 F9: number;
1143 F9: number;
1140 F10: number;
1144 F10: number;
1141 F11: number;
1145 F11: number;
1142 F12: number;
1146 F12: number;
1143 F13: number;
1147 F13: number;
1144 F14: number;
1148 F14: number;
1145 F15: number;
1149 F15: number;
1146 NUM_LOCK: number;
1150 NUM_LOCK: number;
1147 SCROLL_LOCK: number;
1151 SCROLL_LOCK: number;
1148 UP_DPAD: number;
1152 UP_DPAD: number;
1149 DOWN_DPAD: number;
1153 DOWN_DPAD: number;
1150 LEFT_DPAD: number;
1154 LEFT_DPAD: number;
1151 RIGHT_DPAD: number;
1155 RIGHT_DPAD: number;
1152 copyKey: number;
1156 copyKey: number;
1153 }
1157 }
1154
1158
1155 /* dojo/loadInit */
1159 /* dojo/loadInit */
1156
1160
1157 interface LoadInit {
1161 interface LoadInit {
1158 dynamic: number;
1162 dynamic: number;
1159
1163
1160 /**
1164 /**
1161 * Resolves id into a module id based on possibly-nested tenary expression that branches on has feature test value(s).
1165 * Resolves id into a module id based on possibly-nested tenary expression that branches on has feature test value(s).
1162 */
1166 */
1163 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
1167 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
1164
1168
1165 /**
1169 /**
1166 * Conditional loading of AMD modules based on a has feature test value.
1170 * Conditional loading of AMD modules based on a has feature test value.
1167 */
1171 */
1168 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
1172 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
1169 }
1173 }
1170
1174
1171 /* dojo/mouse */
1175 /* dojo/mouse */
1172
1176
1173 interface Mouse {
1177 interface Mouse {
1174 _eventHandler(type: string, selectHandler?: (evt: MouseEvent, listener: EventListener) => void): MouseEvent;
1178 _eventHandler(type: string, selectHandler?: (evt: MouseEvent, listener: EventListener) => void): MouseEvent;
1175
1179
1176 /**
1180 /**
1177 * This is an extension event for the mouseenter that IE provides, emulating the
1181 * This is an extension event for the mouseenter that IE provides, emulating the
1178 * behavior on other browsers.
1182 * behavior on other browsers.
1179 */
1183 */
1180 enter: MouseEvent;
1184 enter: MouseEvent;
1181
1185
1182 /**
1186 /**
1183 * This is an extension event for the mouseleave that IE provides, emulating the
1187 * This is an extension event for the mouseleave that IE provides, emulating the
1184 * behavior on other browsers.
1188 * behavior on other browsers.
1185 */
1189 */
1186 leave: MouseEvent;
1190 leave: MouseEvent;
1187
1191
1188 /**
1192 /**
1189 * This is an extension event for the mousewheel that non-Mozilla browsers provide,
1193 * This is an extension event for the mousewheel that non-Mozilla browsers provide,
1190 * emulating the behavior on Mozilla based browsers.
1194 * emulating the behavior on Mozilla based browsers.
1191 */
1195 */
1192 wheel: string | ExtensionEvent;
1196 wheel: string | ExtensionEvent;
1193
1197
1194 /**
1198 /**
1195 * Test an event object (from a mousedown event) to see if the left button was pressed.
1199 * Test an event object (from a mousedown event) to see if the left button was pressed.
1196 */
1200 */
1197 isLeft(e: MouseEvent): boolean;
1201 isLeft(e: MouseEvent): boolean;
1198
1202
1199 /**
1203 /**
1200 * Test an event object (from a mousedown event) to see if the middle button was pressed.
1204 * Test an event object (from a mousedown event) to see if the middle button was pressed.
1201 */
1205 */
1202 isMiddle(e: MouseEvent): boolean;
1206 isMiddle(e: MouseEvent): boolean;
1203
1207
1204 /**
1208 /**
1205 * Test an event object (from a mousedown event) to see if the right button was pressed.
1209 * Test an event object (from a mousedown event) to see if the right button was pressed.
1206 */
1210 */
1207 isRight(e: MouseEvent): boolean;
1211 isRight(e: MouseEvent): boolean;
1208 }
1212 }
1209
1213
1210 /* dojo/node */
1214 /* dojo/node */
1211
1215
1212 /* should only be used for re-exporting CommonJS modules */
1216 /* should only be used for re-exporting CommonJS modules */
1213
1217
1214 /* dojo/NodeList */
1218 /* dojo/NodeList */
1215
1219
1216 /* Just proxies dojo/query::NodeList */
1220 /* Just proxies dojo/query::NodeList */
1217
1221
1218 /* dojo/NodeList-* are included as seperate .d.ts files */
1222 /* dojo/NodeList-* are included as seperate .d.ts files */
1219
1223
1220 /* dojo/number */
1224 /* dojo/number */
1221
1225
1222 interface NumberFormatOptions {
1226 interface NumberFormatOptions {
1223
1227
1224 /**
1228 /**
1225 * override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
1229 * 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
1230 * with this string. Default value is based on locale. Overriding this property will defeat
1227 * localization. Literal characters in patterns are not supported.
1231 * localization. Literal characters in patterns are not supported.
1228 */
1232 */
1229 pattern?: string;
1233 pattern?: string;
1230
1234
1231 /**
1235 /**
1232 * choose a format type based on the locale from the following:
1236 * choose a format type based on the locale from the following:
1233 * decimal, scientific (not yet supported), percent, currency. decimal by default.
1237 * decimal, scientific (not yet supported), percent, currency. decimal by default.
1234 */
1238 */
1235 type?: string;
1239 type?: string;
1236
1240
1237 /**
1241 /**
1238 * fixed number of decimal places to show. This overrides any
1242 * fixed number of decimal places to show. This overrides any
1239 * information in the provided pattern.
1243 * information in the provided pattern.
1240 */
1244 */
1241 places?: number;
1245 places?: number | string;
1242
1246
1243 /**
1247 /**
1244 * 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1
1248 * 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1
1245 * means do not round.
1249 * means do not round.
1246 */
1250 */
1247 round?: number;
1251 round?: number;
1248
1252
1249 /**
1253 /**
1250 * override the locale used to determine formatting rules
1254 * override the locale used to determine formatting rules
1251 */
1255 */
1252 locale?: string;
1256 locale?: string;
1253
1257
1254 /**
1258 /**
1255 * If false, show no decimal places, overriding places and pattern settings.
1259 * If false, show no decimal places, overriding places and pattern settings.
1256 */
1260 */
1257 fractional?: boolean | [ boolean, boolean ];
1261 fractional?: boolean | [ boolean, boolean ];
1258 }
1262 }
1259
1263
1260 interface NumberFormatAbsoluteOptions {
1264 interface NumberFormatAbsoluteOptions {
1261 /**
1265 /**
1262 * the decimal separator
1266 * the decimal separator
1263 */
1267 */
1264 decimal?: string;
1268 decimal?: string;
1265
1269
1266 /**
1270 /**
1267 * the group separator
1271 * the group separator
1268 */
1272 */
1269 group?: string;
1273 group?: string;
1270
1274
1271 /**
1275 /**
1272 * number of decimal places. the range "n,m" will format to m places.
1276 * number of decimal places. the range "n,m" will format to m places.
1273 */
1277 */
1274 places?: number | string;
1278 places?: number | string;
1275
1279
1276 /**
1280 /**
1277 * 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1
1281 * 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1
1278 * means don't round.
1282 * means don't round.
1279 */
1283 */
1280 round?: number;
1284 round?: number;
1281 }
1285 }
1282
1286
1283 interface NumberRegexpOptions {
1287 interface NumberRegexpOptions {
1284
1288
1285 /**
1289 /**
1286 * override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
1290 * 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
1291 * with this string. Default value is based on locale. Overriding this property will defeat
1288 * localization.
1292 * localization.
1289 */
1293 */
1290 pattern?: string;
1294 pattern?: string;
1291
1295
1292 /**
1296 /**
1293 * choose a format type based on the locale from the following:
1297 * choose a format type based on the locale from the following:
1294 * decimal, scientific (not yet supported), percent, currency. decimal by default.
1298 * decimal, scientific (not yet supported), percent, currency. decimal by default.
1295 */
1299 */
1296 type?: string;
1300 type?: string;
1297
1301
1298 /**
1302 /**
1299 * override the locale used to determine formatting rules
1303 * override the locale used to determine formatting rules
1300 */
1304 */
1301 locacle?: string;
1305 locacle?: string;
1302
1306
1303 /**
1307 /**
1304 * strict parsing, false by default. Strict parsing requires input as produced by the format() method.
1308 * 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
1309 * Non-strict is more permissive, e.g. flexible on white space, omitting thousands separators
1306 */
1310 */
1307 strict?: boolean;
1311 strict?: boolean;
1308
1312
1309 /**
1313 /**
1310 * number of decimal places to accept: Infinity, a positive number, or
1314 * 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.
1315 * a range "n,m". Defined by pattern or Infinity if pattern not provided.
1312 */
1316 */
1313 places?: number | string;
1317 places?: number | string;
1314 }
1318 }
1315
1319
1316 interface NumberParseOptions {
1320 interface NumberParseOptions {
1317
1321
1318 /**
1322 /**
1319 * override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
1323 * 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
1324 * with this string. Default value is based on locale. Overriding this property will defeat
1321 * localization. Literal characters in patterns are not supported.
1325 * localization. Literal characters in patterns are not supported.
1322 */
1326 */
1323 pattern?: string;
1327 pattern?: string;
1324
1328
1325 /**
1329 /**
1326 * choose a format type based on the locale from the following:
1330 * choose a format type based on the locale from the following:
1327 * decimal, scientific (not yet supported), percent, currency. decimal by default.
1331 * decimal, scientific (not yet supported), percent, currency. decimal by default.
1328 */
1332 */
1329 type?: string;
1333 type?: string;
1330
1334
1331 /**
1335 /**
1332 * override the locale used to determine formatting rules
1336 * override the locale used to determine formatting rules
1333 */
1337 */
1334 locale?: string;
1338 locale?: string;
1335
1339
1336 /**
1340 /**
1337 * strict parsing, false by default. Strict parsing requires input as produced by the format() method.
1341 * 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
1342 * Non-strict is more permissive, e.g. flexible on white space, omitting thousands separators
1339 */
1343 */
1340 strict?: boolean;
1344 strict?: boolean;
1341
1345
1342 /**
1346 /**
1343 * Whether to include the fractional portion, where the number of decimal places are implied by pattern
1347 * 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.
1348 * or explicit 'places' parameter. The value [true,false] makes the fractional portion optional.
1345 */
1349 */
1346 fractional?: boolean | [boolean, boolean];
1350 fractional?: boolean | [boolean, boolean];
1347 }
1351 }
1348
1352
1349 interface RealNumberRegexpFlags {
1353 interface RealNumberRegexpFlags {
1350
1354
1351 /**
1355 /**
1352 * The integer number of decimal places or a range given as "n,m". If
1356 * 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
1357 * not given, the decimal part is optional and the number of places is
1354 * unlimited.
1358 * unlimited.
1355 */
1359 */
1356 places?: number;
1360 places?: number | string;
1357
1361
1358 /**
1362 /**
1359 * A string for the character used as the decimal point. Default
1363 * A string for the character used as the decimal point. Default
1360 * is ".".
1364 * is ".".
1361 */
1365 */
1362 decimal?: string;
1366 decimal?: string;
1363
1367
1364 /**
1368 /**
1365 * Whether decimal places are used. Can be true, false, or [true,
1369 * Whether decimal places are used. Can be true, false, or [true,
1366 * false]. Default is [true, false] which means optional.
1370 * false]. Default is [true, false] which means optional.
1367 */
1371 */
1368 fractional?: boolean | [boolean, boolean];
1372 fractional?: boolean | [boolean, boolean];
1369
1373
1370 /**
1374 /**
1371 * Express in exponential notation. Can be true, false, or [true,
1375 * Express in exponential notation. Can be true, false, or [true,
1372 * false]. Default is [true, false], (i.e. will match if the
1376 * false]. Default is [true, false], (i.e. will match if the
1373 * exponential part is present are not).
1377 * exponential part is present are not).
1374 */
1378 */
1375 exponent?: boolean | [boolean, boolean];
1379 exponent?: boolean | [boolean, boolean];
1376
1380
1377 /**
1381 /**
1378 * The leading plus-or-minus sign on the exponent. Can be true,
1382 * The leading plus-or-minus sign on the exponent. Can be true,
1379 * false, or [true, false]. Default is [true, false], (i.e. will
1383 * 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
1384 * match if it is signed or unsigned). flags in regexp.integer can be
1381 * applied.
1385 * applied.
1382 */
1386 */
1383 eSigned?: boolean | [boolean, boolean];
1387 eSigned?: boolean | [boolean, boolean];
1384 }
1388 }
1385
1389
1386 interface IntegerRegexpFlags {
1390 interface IntegerRegexpFlags {
1387
1391
1388 /**
1392 /**
1389 * The leading plus-or-minus sign. Can be true, false, or `[true,false]`.
1393 * 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
1394 * Default is `[true, false]`, (i.e. will match if it is signed
1391 * or unsigned).
1395 * or unsigned).
1392 */
1396 */
1393 signed?: boolean;
1397 signed?: boolean;
1394
1398
1395 /**
1399 /**
1396 * The character used as the thousands separator. Default is no
1400 * The character used as the thousands separator. Default is no
1397 * separator. For more than one symbol use an array, e.g. `[",", ""]`,
1401 * separator. For more than one symbol use an array, e.g. `[",", ""]`,
1398 * makes ',' optional.
1402 * makes ',' optional.
1399 */
1403 */
1400 separator?: string;
1404 separator?: string;
1401
1405
1402 /**
1406 /**
1403 * group size between separators
1407 * group size between separators
1404 */
1408 */
1405 groupSize?: number;
1409 groupSize?: number;
1406
1410
1407 /**
1411 /**
1408 * second grouping, where separators 2..n have a different interval than the first separator (for India)
1412 * second grouping, where separators 2..n have a different interval than the first separator (for India)
1409 */
1413 */
1410 groupSize2?: number;
1414 groupSize2?: number;
1411 }
1415 }
1412
1416
1413 interface Number {
1417 interface Number {
1414 /**
1418 /**
1415 * Format a Number as a String, using locale-specific settings
1419 * Format a Number as a String, using locale-specific settings
1416 */
1420 */
1417 format(value: number, options?: NumberFormatOptions): string;
1421 format(value: number, options?: NumberFormatOptions): string;
1418
1422
1419 /**
1423 /**
1420 * not precise, but good enough
1424 * not precise, but good enough
1421 */
1425 */
1422 _numberPatternRE: RegExp;
1426 _numberPatternRE: RegExp;
1423
1427
1424 /**
1428 /**
1425 * Apply pattern to format value as a string using options. Gives no
1429 * Apply pattern to format value as a string using options. Gives no
1426 * consideration to local customs.
1430 * consideration to local customs.
1427 */
1431 */
1428 _applyPattern(value: number, pattern: string, options?: NumberFormatOptions): string;
1432 _applyPattern(value: number, pattern: string, options?: NumberFormatOptions): string;
1429
1433
1430 /**
1434 /**
1431 * Rounds to the nearest value with the given number of decimal places, away from zero
1435 * Rounds to the nearest value with the given number of decimal places, away from zero
1432 */
1436 */
1433 round(value: number, places?: number, increment?: number): number;
1437 round(value: number, places?: number, increment?: number): number;
1434
1438
1435 /**
1439 /**
1436 * Apply numeric pattern to absolute value using options. Gives no
1440 * Apply numeric pattern to absolute value using options. Gives no
1437 * consideration to local customs.
1441 * consideration to local customs.
1438 */
1442 */
1439 _formatAbsolute(value: number, pattern: string, options?: NumberFormatAbsoluteOptions): string;
1443 _formatAbsolute(value: number, pattern: string, options?: NumberFormatAbsoluteOptions): string;
1440
1444
1441 /**
1445 /**
1442 * Builds the regular needed to parse a number
1446 * Builds the regular needed to parse a number
1443 */
1447 */
1444 regexp(options?: NumberRegexpOptions): string;
1448 regexp(options?: NumberRegexpOptions): string;
1445
1449
1446 _parseInfo(options?: any): { regexp: string, group: string, decimal: string, factor: number };
1450 _parseInfo(options?: any): { regexp: string, group: string, decimal: string, factor: number };
1447
1451
1448 /**
1452 /**
1449 * Convert a properly formatted string to a primitive Number, using
1453 * Convert a properly formatted string to a primitive Number, using
1450 * locale-specific settings.
1454 * locale-specific settings.
1451 */
1455 */
1452 parse(expression: string, options?: NumberParseOptions): number;
1456 parse(expression: string, options?: NumberParseOptions): number;
1453
1457
1454 /**
1458 /**
1455 * Builds a regular expression to match a real number in exponential
1459 * Builds a regular expression to match a real number in exponential
1456 * notation
1460 * notation
1457 */
1461 */
1458 _realNumberRegexp(flags: RealNumberRegexpFlags): string;
1462 _realNumberRegexp(flags: RealNumberRegexpFlags): string;
1459
1463
1460 /**
1464 /**
1461 * Builds a regular expression that matches an integer
1465 * Builds a regular expression that matches an integer
1462 */
1466 */
1463 _integerRegexp(flags: IntegerRegexpFlags): string;
1467 _integerRegexp(flags: IntegerRegexpFlags): string;
1464 }
1468 }
1465
1469
1466 /* dojo/on */
1470 /* dojo/on */
1467
1471
1468 interface ExtensionEvent {
1472 interface ExtensionEvent {
1469 (target: Element | GenericObject, listener: EventListener): Handle;
1473 (target: Element | GenericObject, listener: EventListener): Handle;
1470 }
1474 }
1471
1475
1472 interface PauseHandle extends Handle {
1476 interface PauseHandle extends Handle {
1473 pause(): void;
1477 pause(): void;
1474 resume(): void;
1478 resume(): void;
1475 }
1479 }
1476
1480
1477 interface MatchesTarget {
1481 interface MatchesTarget {
1478 matches(node: Element, selector: string, context?: any): any[];
1482 matches(node: Element, selector: string, context?: any): any[];
1479 [id: string]: any;
1483 [id: string]: any;
1480 }
1484 }
1481
1485
1482 interface On {
1486 interface On {
1483 /**
1487 /**
1484 * A function that provides core event listening functionality. With this function
1488 * 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
1489 * you can provide a target, event type, and listener to be notified of
1486 * future matching events that are fired.
1490 * future matching events that are fired.
1487 */
1491 */
1488 (target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): Handle;
1492 (target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): Handle;
1489
1493
1490 /**
1494 /**
1491 * This function acts the same as on(), but with pausable functionality. The
1495 * This function acts the same as on(), but with pausable functionality. The
1492 * returned signal object has pause() and resume() functions. Calling the
1496 * returned signal object has pause() and resume() functions. Calling the
1493 * pause() method will cause the listener to not be called for future events.
1497 * pause() method will cause the listener to not be called for future events.
1494 */
1498 */
1495 pausable(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): PauseHandle;
1499 pausable(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): PauseHandle;
1496
1500
1497 /**
1501 /**
1498 * This function acts the same as on(), but will only call the listener once. The
1502 * This function acts the same as on(), but will only call the listener once. The
1499 * listener will be called for the first
1503 * listener will be called for the first
1500 * event that takes place and then listener will automatically be removed.
1504 * event that takes place and then listener will automatically be removed.
1501 */
1505 */
1502 once(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): Handle;
1506 once(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): Handle;
1503
1507
1504 parse(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix: boolean, matchesTarget: Element | GenericObject): Handle;
1508 parse(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix: boolean, matchesTarget: Element | GenericObject): Handle;
1505
1509
1506 /**
1510 /**
1507 * Check if a node match the current selector within the constraint of a context
1511 * Check if a node match the current selector within the constraint of a context
1508 */
1512 */
1509 matches(node: Element, selector: string, context: Element, children: boolean, matchesTarget?: MatchesTarget): Element | boolean;
1513 matches(node: Element, selector: string, context: Element, children: boolean, matchesTarget?: MatchesTarget): Element | boolean;
1510
1514
1511 /**
1515 /**
1512 * Creates a new extension event with event delegation. This is based on
1516 * Creates a new extension event with event delegation. This is based on
1513 * the provided event type (can be extension event) that
1517 * the provided event type (can be extension event) that
1514 * only calls the listener when the CSS selector matches the target of the event.
1518 * only calls the listener when the CSS selector matches the target of the event.
1515 *
1519 *
1516 * The application must require() an appropriate level of dojo/query to handle the selector.
1520 * The application must require() an appropriate level of dojo/query to handle the selector.
1517 */
1521 */
1518 selector(selector: string, type: string | ExtensionEvent, children?: boolean): ExtensionEvent;
1522 selector(selector: string, type: string | ExtensionEvent, children?: boolean): ExtensionEvent;
1519
1523
1520 /**
1524 /**
1521 * Fires an event on the target object.
1525 * Fires an event on the target object.
1522 */
1526 */
1523 emit(target: Element | GenericObject, type: string | ExtensionEvent, event?: any): boolean;
1527 emit(target: Element | GenericObject, type: string | ExtensionEvent, event?: any): boolean;
1524
1528
1525 /**
1529 /**
1526 * normalizes properties on the event object including event
1530 * normalizes properties on the event object including event
1527 * bubbling methods, keystroke normalization, and x/y positions
1531 * bubbling methods, keystroke normalization, and x/y positions
1528 */
1532 */
1529 _fixEvent(evt: any, sender: any): any;
1533 _fixEvent(evt: any, sender: any): any;
1530 }
1534 }
1531
1535
1532 /* dojo/parser */
1536 /* dojo/parser */
1533
1537
1534 interface ParserOptions { }
1538 interface ParserOptions { }
1535
1539
1536 interface ParserObjects {
1540 interface ParserObjects {
1537 ctor?: GenericConstructor<any>;
1541 ctor?: GenericConstructor<any>;
1538 types?: string[];
1542 types?: string[];
1539 node: Node;
1543 node: Node;
1540 scripts?: HTMLScriptElement[];
1544 scripts?: HTMLScriptElement[];
1541 inherited?: { [prop: string]: any; };
1545 inherited?: { [prop: string]: any; };
1542 }
1546 }
1543
1547
1544 interface InstancesArray extends Array<any>, promise.Promise<any> {}
1548 interface InstancesArray extends Array<any>, promise.Promise<any> {}
1545
1549
1546 interface Parser {
1550 interface Parser {
1547 /**
1551 /**
1548 * Clear cached data. Used mainly for benchmarking.
1552 * Clear cached data. Used mainly for benchmarking.
1549 */
1553 */
1550 _clearCache(): void;
1554 _clearCache(): void;
1551
1555
1552 /**
1556 /**
1553 * Convert a `<script type="dojo/method" args="a, b, c"> ... </script>`
1557 * Convert a `<script type="dojo/method" args="a, b, c"> ... </script>`
1554 * into a function
1558 * into a function
1555 */
1559 */
1556 _functionFromScript(node: HTMLScriptElement, attrData: string): Function;
1560 _functionFromScript(node: HTMLScriptElement, attrData: string): Function;
1557
1561
1558 /**
1562 /**
1559 * Takes array of nodes, and turns them into class instances and
1563 * Takes array of nodes, and turns them into class instances and
1560 * potentially calls a startup method to allow them to connect with
1564 * potentially calls a startup method to allow them to connect with
1561 * any children.
1565 * any children.
1562 */
1566 */
1563 instantiate(nodes: Node[], mixin?: Object, options?: ParserOptions): any[];
1567 instantiate(nodes: Node[], mixin?: Object, options?: ParserOptions): any[];
1564
1568
1565 /**
1569 /**
1566 * Takes array of objects representing nodes, and turns them into class instances and
1570 * 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
1571 * potentially calls a startup method to allow them to connect with
1568 * any children.
1572 * any children.
1569 */
1573 */
1570 _instantiate(nodes: ParserObjects[], mixin?: Object, options?: ParserOptions, returnPromise?: boolean): any[] | promise.Promise<any[]>;
1574 _instantiate(nodes: ParserObjects[], mixin?: Object, options?: ParserOptions, returnPromise?: boolean): any[] | promise.Promise<any[]>;
1571
1575
1572 /**
1576 /**
1573 * Calls new ctor(params, node), where params is the hash of parameters specified on the node,
1577 * 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().
1578 * excluding data-dojo-type and data-dojo-mixins. Does not call startup().
1575 */
1579 */
1576 construct<T>(
1580 construct<T>(
1577 ctor: GenericConstructor<T>,
1581 ctor: GenericConstructor<T>,
1578 node: Node, mixin?: Object,
1582 node: Node, mixin?: Object,
1579 options?: ParserOptions,
1583 options?: ParserOptions,
1580 scripts?: HTMLScriptElement[],
1584 scripts?: HTMLScriptElement[],
1581 inherited?: { [prop: string]: any; }
1585 inherited?: { [prop: string]: any; }
1582 ): promise.Promise<T> | T;
1586 ): promise.Promise<T> | T;
1583
1587
1584 /**
1588 /**
1585 * Scan a DOM tree and return an array of objects representing the DOMNodes
1589 * Scan a DOM tree and return an array of objects representing the DOMNodes
1586 * that need to be turned into widgets.
1590 * that need to be turned into widgets.
1587 */
1591 */
1588 scan(root?: Node, options?: ParserOptions): promise.Promise<ParserObjects[]>;
1592 scan(root?: Node, options?: ParserOptions): promise.Promise<ParserObjects[]>;
1589
1593
1590 /**
1594 /**
1591 * Helper for _scanAMD(). Takes a `<script type=dojo/require>bar: "acme/bar", ...</script>` node,
1595 * 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
1596 * 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.
1597 * variables, and returns a Promise for when that operation completes.
1594 *
1598 *
1595 * In the example above, it is effectively doing a require(["acme/bar", ...], function(a){ bar = a; }).
1599 * In the example above, it is effectively doing a require(["acme/bar", ...], function(a){ bar = a; }).
1596 */
1600 */
1597 _require(script: HTMLScriptElement, options: ParserOptions): promise.Promise<any>;
1601 _require(script: HTMLScriptElement, options: ParserOptions): promise.Promise<any>;
1598
1602
1599 /**
1603 /**
1600 * Scans the DOM for any declarative requires and returns their values.
1604 * Scans the DOM for any declarative requires and returns their values.
1601 */
1605 */
1602 _scanAmd(root?: Node, options?: ParserOptions): promise.Promise<boolean>;
1606 _scanAmd(root?: Node, options?: ParserOptions): promise.Promise<boolean>;
1603
1607
1604 /**
1608 /**
1605 * Scan the DOM for class instances, and instantiate them.
1609 * Scan the DOM for class instances, and instantiate them.
1606 */
1610 */
1607 parse(rootNode?: Node, options?: ParserOptions): InstancesArray;
1611 parse(rootNode?: Node, options?: ParserOptions): InstancesArray;
1608 }
1612 }
1609
1613
1610 /* dojo/query */
1614 /* dojo/query */
1611
1615
1612 interface NodeListFilterCallback<T extends Node> {
1616 interface NodeListFilterCallback<T extends Node> {
1613 (item: T, idx: number, nodeList: this): boolean;
1617 (item: T, idx: number, nodeList: this): boolean;
1614 }
1618 }
1615
1619
1616 type NodeListFilter<T extends Node> = string | NodeListFilterCallback<T>;
1620 type NodeListFilter<T extends Node> = string | NodeListFilterCallback<T>;
1617
1621
1618 interface NodeList<T extends Node> extends ArrayLike<T> {
1622 interface NodeList<T extends Node> extends ArrayLike<T> {
1619 /**
1623 /**
1620 * decorate an array to make it look like a `dojo/NodeList`.
1624 * decorate an array to make it look like a `dojo/NodeList`.
1621 */
1625 */
1622 _wrap<U extends Node, V extends Node>(a: U[], parent?: NodeList<V>, NodeListCtor?: NodeListConstructor): NodeList<U>;
1626 _wrap<U extends Node, V extends Node>(a: U[], parent?: NodeList<V>, NodeListCtor?: NodeListConstructor): NodeList<U>;
1623
1627
1624 _NodeListCtor: NodeListConstructor;
1628 _NodeListCtor: NodeListConstructor;
1625 toString(): string;
1629 toString(): string;
1626
1630
1627 /**
1631 /**
1628 * private function to hold to a parent NodeList. end() to return the parent NodeList.
1632 * private function to hold to a parent NodeList. end() to return the parent NodeList.
1629 */
1633 */
1630 _stash(parent: Node): this;
1634 _stash(parent: Node): this;
1631
1635
1632 /**
1636 /**
1633 * Listen for events on the nodes in the NodeList.
1637 * Listen for events on the nodes in the NodeList.
1634 */
1638 */
1635 on(eventName: string, listener: EventListener): Handle[];
1639 on(eventName: string, listener: EventListener): Handle[];
1636
1640
1637 /**
1641 /**
1638 * Ends use of the current `NodeList` by returning the previous NodeList
1642 * Ends use of the current `NodeList` by returning the previous NodeList
1639 * that generated the current NodeList.
1643 * that generated the current NodeList.
1640 */
1644 */
1641 end<U extends Node>(): NodeList<U>;
1645 end<U extends Node>(): NodeList<U>;
1642
1646
1643 /**
1647 /**
1644 * Returns a new NodeList, maintaining this one in place
1648 * Returns a new NodeList, maintaining this one in place
1645 */
1649 */
1646 slice(begin: number, end?: number): this;
1650 slice(begin: number, end?: number): this;
1647
1651
1648 /**
1652 /**
1649 * Returns a new NodeList, manipulating this NodeList based on
1653 * Returns a new NodeList, manipulating this NodeList based on
1650 * the arguments passed, potentially splicing in new elements
1654 * the arguments passed, potentially splicing in new elements
1651 * at an offset, optionally deleting elements
1655 * at an offset, optionally deleting elements
1652 */
1656 */
1653 splice(index: number, howmany?: number, ...items: T[]): this;
1657 splice(index: number, howmany?: number, ...items: T[]): this;
1654
1658
1655 /**
1659 /**
1656 * see `dojo/_base/array.indexOf()`. The primary difference is that the acted-on
1660 * see `dojo/_base/array.indexOf()`. The primary difference is that the acted-on
1657 * array is implicitly this NodeList
1661 * array is implicitly this NodeList
1658 */
1662 */
1659 indexOf(value: T, fromIndex?: number, findLast?: boolean): number;
1663 indexOf(value: T, fromIndex?: number, findLast?: boolean): number;
1660
1664
1661 /**
1665 /**
1662 * see `dojo/_base/array.lastIndexOf()`. The primary difference is that the
1666 * see `dojo/_base/array.lastIndexOf()`. The primary difference is that the
1663 * acted-on array is implicitly this NodeList
1667 * acted-on array is implicitly this NodeList
1664 */
1668 */
1665 lastIndexOf(value: T, fromIndex?: number): number;
1669 lastIndexOf(value: T, fromIndex?: number): number;
1666
1670
1667 /**
1671 /**
1668 * see `dojo/_base/array.every()` and the [Array.every
1672 * see `dojo/_base/array.every()` and the [Array.every
1669 * docs](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every).
1673 * docs](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every).
1670 * Takes the same structure of arguments and returns as
1674 * Takes the same structure of arguments and returns as
1671 * dojo/_base/array.every() with the caveat that the passed array is
1675 * dojo/_base/array.every() with the caveat that the passed array is
1672 * implicitly this NodeList
1676 * implicitly this NodeList
1673 */
1677 */
1674 every(callback: (item: T, idx: number, nodeList: this) => boolean | string, thisObj?: Object): boolean;
1678 every(callback: (item: T, idx: number, nodeList: this) => boolean | string, thisObj?: Object): boolean;
1675
1679
1676 /**
1680 /**
1677 * Takes the same structure of arguments and returns as
1681 * Takes the same structure of arguments and returns as
1678 * `dojo/_base/array.some()` with the caveat that the passed array as
1682 * `dojo/_base/array.some()` with the caveat that the passed array as
1679 * implicitly this NodeList. See `dojo/_base/array.some()` and Mozillaas
1683 * implicitly this NodeList. See `dojo/_base/array.some()` and Mozillaas
1680 * [Array.soas
1684 * [Array.soas
1681 * documentation](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some).
1685 * documentation](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some).
1682 */
1686 */
1683 some(callback: (item: T, idx: number, nodeList: this) => boolean | string, thisObj?: Object): boolean;
1687 some(callback: (item: T, idx: number, nodeList: this) => boolean | string, thisObj?: Object): boolean;
1684
1688
1685 /**
1689 /**
1686 * Returns a new NodeList comprised of items in this NodeList
1690 * Returns a new NodeList comprised of items in this NodeList
1687 * as well as items passed in as parameters
1691 * as well as items passed in as parameters
1688 */
1692 */
1689 concat(...items: T[]): this;
1693 concat(...items: T[]): this;
1690
1694
1691 /**
1695 /**
1692 * see `dojo/_base/array.map()`. The primary difference is that the acted-on
1696 * see `dojo/_base/array.map()`. The primary difference is that the acted-on
1693 * array is implicitly this NodeList and the return is a
1697 * array is implicitly this NodeList and the return is a
1694 * NodeList (a subclass of Array)
1698 * NodeList (a subclass of Array)
1695 */
1699 */
1696 map<U extends Node>(func: (item: T, idx: number, nodeList: this) => U, obj?: Object): NodeList<U>;
1700 map<U extends Node>(func: (item: T, idx: number, nodeList: this) => U, obj?: Object): NodeList<U>;
1697
1701
1698 /**
1702 /**
1699 * see `dojo/_base/array.forEach()`. The primary difference is that the acted-on
1703 * 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
1704 * array is implicitly this NodeList. If you want the option to break out
1701 * of the forEach loop, use every() or some() instead.
1705 * of the forEach loop, use every() or some() instead.
1702 */
1706 */
1703 forEach(callback: (item: T, idx: number, nodeList: this) => void, thisObj?: Object): this;
1707 forEach(callback: (item: T, idx: number, nodeList: this) => void, thisObj?: Object): this;
1704
1708
1705 /**
1709 /**
1706 * "masks" the built-in javascript filter() method (supported
1710 * "masks" the built-in javascript filter() method (supported
1707 * in Dojo via `dojo/_base/array.filter`) to support passing a simple
1711 * in Dojo via `dojo/_base/array.filter`) to support passing a simple
1708 * string filter in addition to supporting filtering function
1712 * string filter in addition to supporting filtering function
1709 * objects.
1713 * objects.
1710 */
1714 */
1711 filter<U extends Node>(filter: NodeListFilter<T>, thisObj?: Object): NodeList<U>;
1715 filter<U extends Node>(filter: NodeListFilter<T>, thisObj?: Object): NodeList<U>;
1712
1716
1713 /**
1717 /**
1714 * Create a new instance of a specified class, using the
1718 * Create a new instance of a specified class, using the
1715 * specified properties and each node in the NodeList as a
1719 * specified properties and each node in the NodeList as a
1716 * srcNodeRef.
1720 * srcNodeRef.
1717 */
1721 */
1718 instantiate(declaredClass: string | GenericConstructor<any>, properties?: Object): this;
1722 instantiate(declaredClass: string | GenericConstructor<any>, properties?: Object): this;
1719
1723
1720 /**
1724 /**
1721 * Returns a new NodeList comprised of items in this NodeList
1725 * Returns a new NodeList comprised of items in this NodeList
1722 * at the given index or indices.
1726 * at the given index or indices.
1723 */
1727 */
1724 at(...indices: number[]): this;
1728 at(...indices: number[]): this;
1725
1729
1726 }
1730 }
1727
1731
1728 interface NodeListConstructor {
1732 interface NodeListConstructor {
1729 new <T extends Node>(array: number | Array<T> | NodeListOf<T>): NodeList<T>;
1733 new <T extends Node>(array: number | Array<T> | NodeListOf<T>): NodeList<T>;
1730 new <T extends Node>(...args: T[]): NodeList<T>;
1734 new <T extends Node>(...args: T[]): NodeList<T>;
1731 <T extends Node>(array: number | Array<T> | NodeListOf<T>): NodeList<T>;
1735 <T extends Node>(array: number | Array<T> | NodeListOf<T>): NodeList<T>;
1732 <T extends Node>(...args: T[]): NodeList<T>;
1736 <T extends Node>(...args: T[]): NodeList<T>;
1733
1737
1734 prototype: NodeList<any>;
1738 prototype: NodeList<any>;
1735
1739
1736 /**
1740 /**
1737 * decorate an array to make it look like a `dojo/NodeList`.
1741 * decorate an array to make it look like a `dojo/NodeList`.
1738 */
1742 */
1739 _wrap<U extends Node, V extends Node>(a: U[], parent?: NodeList<V>, NodeListCtor?: NodeListConstructor): NodeList<U>;
1743 _wrap<U extends Node, V extends Node>(a: U[], parent?: NodeList<V>, NodeListCtor?: NodeListConstructor): NodeList<U>;
1740
1744
1741 /**
1745 /**
1742 * adapts a single node function to be used in the map-type
1746 * 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`
1747 * actions. The return is a new array of values, as via `dojo/_base/array.map`
1744 */
1748 */
1745 _adaptAsMap<T extends Node, U extends Node>(f: (node: T) => U, o?: Object): NodeList<U>;
1749 _adaptAsMap<T extends Node, U extends Node>(f: (node: T) => U, o?: Object): NodeList<U>;
1746
1750
1747 /**
1751 /**
1748 * adapts a single node function to be used in the forEach-type
1752 * adapts a single node function to be used in the forEach-type
1749 * actions. The initial object is returned from the specialized
1753 * actions. The initial object is returned from the specialized
1750 * function.
1754 * function.
1751 */
1755 */
1752 _adaptAsForEach<T extends Node>(f: (node: T) => void, o?: Object): this;
1756 _adaptAsForEach<T extends Node>(f: (node: T) => void, o?: Object): this;
1753
1757
1754 /**
1758 /**
1755 * adapts a single node function to be used in the filter-type actions
1759 * adapts a single node function to be used in the filter-type actions
1756 */
1760 */
1757 _adaptAsFilter<T extends Node>(f: (node: T) => boolean, o?: Object): this;
1761 _adaptAsFilter<T extends Node>(f: (node: T) => boolean, o?: Object): this;
1758
1762
1759 /**
1763 /**
1760 * adapts a single node function to be used in the map-type
1764 * adapts a single node function to be used in the map-type
1761 * actions, behaves like forEach() or map() depending on arguments
1765 * actions, behaves like forEach() or map() depending on arguments
1762 */
1766 */
1763 _adaptWithCondition<T extends Node, U extends Node>(f: (node: T) => U | void, g: (...args: any[]) => boolean, o?: Object): NodeList<U> | this;
1767 _adaptWithCondition<T extends Node, U extends Node>(f: (node: T) => U | void, g: (...args: any[]) => boolean, o?: Object): NodeList<U> | this;
1764 }
1768 }
1765
1769
1766 interface Query {
1770 interface Query {
1767 /**
1771 /**
1768 * Returns nodes which match the given CSS selector, searching the
1772 * Returns nodes which match the given CSS selector, searching the
1769 * entire document by default but optionally taking a node to scope
1773 * entire document by default but optionally taking a node to scope
1770 * the search by. Returns an instance of NodeList.
1774 * the search by. Returns an instance of NodeList.
1771 */
1775 */
1772 <T extends Node>(query: string, root?: NodeOrString): NodeList<T>;
1776 <T extends Node>(query: string, root?: NodeOrString): NodeList<T>;
1773 <T extends Node>(root: Node): NodeList<T>;
1777 <T extends Node>(root: Node): NodeList<T>;
1774
1778
1775 NodeList: NodeListConstructor;
1779 NodeList: NodeListConstructor;
1776
1780
1777 /**
1781 /**
1778 * Test to see if a node matches a selector
1782 * Test to see if a node matches a selector
1779 */
1783 */
1780 matches(node: Node, selector: string, root?: NodeOrString): boolean;
1784 matches(node: Node, selector: string, root?: NodeOrString): boolean;
1781
1785
1782 /**
1786 /**
1783 * Filters an array of nodes. Note that this does not guarantee to return a NodeList, just an array.
1787 * Filters an array of nodes. Note that this does not guarantee to return a NodeList, just an array.
1784 */
1788 */
1785 filter<T extends Node>(nodes: NodeList<T> | T[], select: string, root?: NodeOrString): T[] | NodeList<T>;
1789 filter<T extends Node>(nodes: NodeList<T> | T[], select: string, root?: NodeOrString): T[] | NodeList<T>;
1786
1790
1787 /**
1791 /**
1788 * can be used as AMD plugin to conditionally load new query engine
1792 * can be used as AMD plugin to conditionally load new query engine
1789 */
1793 */
1790 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
1794 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
1791 }
1795 }
1792
1796
1793 /* dojo/ready */
1797 /* dojo/ready */
1794
1798
1795 interface Ready {
1799 interface Ready {
1796 /**
1800 /**
1797 * Add a function to execute on DOM content loaded and all requested modules have arrived and been evaluated.
1801 * Add a function to execute on DOM content loaded and all requested modules have arrived and been evaluated.
1798 * In most cases, the `domReady` plug-in should suffice and this method should not be needed.
1802 * In most cases, the `domReady` plug-in should suffice and this method should not be needed.
1799 *
1803 *
1800 * When called in a non-browser environment, just checks that all requested modules have arrived and been
1804 * When called in a non-browser environment, just checks that all requested modules have arrived and been
1801 * evaluated.
1805 * evaluated.
1802 */
1806 */
1803 (callback: Function): void;
1807 (callback: Function): void;
1804 (context: Object, callback: Function | string): void;
1808 (context: Object, callback: Function | string): void;
1805 (priority: number, callback: Function): void;
1809 (priority: number, callback: Function): void;
1806 (priority: number, context: Object, callback: Function | string): void;
1810 (priority: number, context: Object, callback: Function | string): void;
1807 }
1811 }
1808
1812
1809 /* dojo/regexp */
1813 /* dojo/regexp */
1810
1814
1811 interface RegExpModule {
1815 interface RegExpModule {
1812 /**
1816 /**
1813 * Adds escape sequences for special characters in regular expressions
1817 * Adds escape sequences for special characters in regular expressions
1814 */
1818 */
1815 escapeString(str: string, except?: string): string;
1819 escapeString(str: string, except?: string): string;
1816
1820
1817 /**
1821 /**
1818 * Builds a regular expression that groups subexpressions
1822 * Builds a regular expression that groups subexpressions
1819 */
1823 */
1820 buildGroupRE(arr: any[] | Object, re: (item: any) => string, nonCapture?: boolean): string;
1824 buildGroupRE(arr: any[] | Object, re: (item: any) => string, nonCapture?: boolean): string;
1821
1825
1822 /**
1826 /**
1823 * adds group match to expression
1827 * adds group match to expression
1824 */
1828 */
1825 group(expression: string, nonCapture?: boolean): string;
1829 group(expression: string, nonCapture?: boolean): string;
1826 }
1830 }
1827
1831
1828 /* dojo/request */
1832 /* dojo/request */
1829
1833
1830 /* This is contained in request.d.ts */
1834 /* This is contained in request.d.ts */
1831
1835
1832 /* dojo/require */
1836 /* dojo/require */
1833
1837
1834 interface RequirePlugin {
1838 interface RequirePlugin {
1835 dynamic: number;
1839 dynamic: number;
1836 normalize(id: string): string;
1840 normalize(id: string): string;
1837 load(mid: string, require: any, loaded: (...modules: any[]) => void): void;
1841 load(mid: string, require: any, loaded: (...modules: any[]) => void): void;
1838 }
1842 }
1839
1843
1840 /* dojo/robot */
1844 /* dojo/robot */
1841
1845
1842 interface Robot extends doh.Robot {
1846 interface Robot extends doh.Robot {
1843 _resolveNode(n: NodeOrString | (() => Node)): Node;
1847 _resolveNode(n: NodeOrString | (() => Node)): Node;
1844 _scrollIntoView(n: Node): void;
1848 _scrollIntoView(n: Node): void;
1845 _position(n: Node): DomGeometryBoxExtents;
1849 _position(n: Node): DomGeometryBoxExtents;
1846 _getWindowChain(n: Node): Window[];
1850 _getWindowChain(n: Node): Window[];
1847
1851
1848 /**
1852 /**
1849 * Scroll the passed node into view, if it is not.
1853 * Scroll the passed node into view, if it is not.
1850 */
1854 */
1851 scrollIntoView(node: NodeOrString | (() => Node), delay?: number): void;
1855 scrollIntoView(node: NodeOrString | (() => Node), delay?: number): void;
1852
1856
1853 /**
1857 /**
1854 * Moves the mouse over the specified node at the specified relative x,y offset.
1858 * Moves the mouse over the specified node at the specified relative x,y offset.
1855 */
1859 */
1856 mouseMoveAt(
1860 mouseMoveAt(
1857 node: NodeOrString | (() => Node),
1861 node: NodeOrString | (() => Node),
1858 delay?: number,
1862 delay?: number,
1859 duration?: number,
1863 duration?: number,
1860 offsetX?: number,
1864 offsetX?: number,
1861 offsetY?: number
1865 offsetY?: number
1862 ): void;
1866 ): void;
1863 }
1867 }
1864
1868
1865 /* dojo/robotx */
1869 /* dojo/robotx */
1866
1870
1867 interface RobotX extends Robot {
1871 interface RobotX extends Robot {
1868 /**
1872 /**
1869 * Called every time a new page is loaded into the iframe, to setup variables
1873 * Called every time a new page is loaded into the iframe, to setup variables
1870 * Point dojo.global, dojo.publish, etc. to refer to iframe.
1874 * Point dojo.global, dojo.publish, etc. to refer to iframe.
1871 * Remove for 2.0?
1875 * Remove for 2.0?
1872 */
1876 */
1873 _updateDocument(): void;
1877 _updateDocument(): void;
1874
1878
1875 /**
1879 /**
1876 * Opens the application at the specified URL for testing, redirecting dojo to point to the application
1880 * Opens the application at the specified URL for testing, redirecting dojo to point to the application
1877 * environment instead of the test environment.
1881 * environment instead of the test environment.
1878 */
1882 */
1879 initRobot(url: string): void;
1883 initRobot(url: string): void;
1880
1884
1881 /**
1885 /**
1882 * Notifies DOH that the doh.robot is about to make a page change in the application it is driving,
1886 * Notifies DOH that the doh.robot is about to make a page change in the application it is driving,
1883 * returning a doh.Deferred object the user should return in their runTest function as part of a DOH test.
1887 * returning a doh.Deferred object the user should return in their runTest function as part of a DOH test.
1884 */
1888 */
1885 waitForPageToLoad(submitActions: () => void): any;
1889 waitForPageToLoad(submitActions: () => void): any;
1886 }
1890 }
1887
1891
1888 /* dojo/router */
1892 /* dojo/router */
1889
1893
1890 /* Module just exports instance of dojo.router.BaseRouter */
1894 /* Module just exports instance of dojo.router.BaseRouter */
1891
1895
1892 /* dojo/sniff */
1896 /* dojo/sniff */
1893
1897
1894 interface Has {
1898 interface Has {
1895 (name: 'air'): boolean;
1899 (name: 'air'): boolean;
1896 (name: 'wp'): void | number;
1900 (name: 'wp'): void | number;
1897 (name: 'msapp'): void | number;
1901 (name: 'msapp'): void | number;
1898 (name: 'khtml'): void | number;
1902 (name: 'khtml'): void | number;
1899 (name: 'edge'): void | number;
1903 (name: 'edge'): void | number;
1900 (name: 'opr'): void | number;
1904 (name: 'opr'): void | number;
1901 (name: 'webkit'): void | number;
1905 (name: 'webkit'): void | number;
1902 (name: 'chrome'): void | number;
1906 (name: 'chrome'): void | number;
1903 (name: 'android'): void | number;
1907 (name: 'android'): void | number;
1904 (name: 'safari'): void | number;
1908 (name: 'safari'): void | number;
1905 (name: 'mac'): boolean;
1909 (name: 'mac'): boolean;
1906 (name: 'quirks'): boolean;
1910 (name: 'quirks'): boolean;
1907 (name: 'iphone'): void | number;
1911 (name: 'iphone'): void | number;
1908 (name: 'ipod'): void | number;
1912 (name: 'ipod'): void | number;
1909 (name: 'ipad'): void | number;
1913 (name: 'ipad'): void | number;
1910 (name: 'ios'): void | number;
1914 (name: 'ios'): void | number;
1911 (name: 'bb'): void | number | boolean;
1915 (name: 'bb'): void | number | boolean;
1912 (name: 'trident'): void | number;
1916 (name: 'trident'): void | number;
1913 (name: 'svg'): boolean;
1917 (name: 'svg'): boolean;
1914 (name: 'opera'): void | number;
1918 (name: 'opera'): void | number;
1915 (name: 'mozilla'): void | number;
1919 (name: 'mozilla'): void | number;
1916 (name: 'ff'): void | number;
1920 (name: 'ff'): void | number;
1917 (name: 'ie'): void | number;
1921 (name: 'ie'): void | number;
1918 (name: 'wii'): boolean | any;
1922 (name: 'wii'): boolean | any;
1919 }
1923 }
1920
1924
1921 /* Just rexports has after adding features */
1925 /* Just rexports has after adding features */
1922
1926
1923 /* dojo/Stateful */
1927 /* dojo/Stateful */
1924
1928
1925 interface WatchHandle extends Handle {
1929 interface WatchHandle extends Handle {
1926 unwatch(): void;
1930 unwatch(): void;
1927 }
1931 }
1928
1932
1929 interface Stateful<T = any> {
1933 interface Stateful<T = any> {
1930 /**
1934 /**
1931 * Used across all instances a hash to cache attribute names and their getter
1935 * Used across all instances a hash to cache attribute names and their getter
1932 * and setter names.
1936 * and setter names.
1933 */
1937 */
1934 _attrPairNames: { [attr: string]: string };
1938 _attrPairNames: { [attr: string]: string };
1935
1939
1936 /**
1940 /**
1937 * Helper function for get() and set().
1941 * Helper function for get() and set().
1938 * Caches attribute name values so we don't do the string ops every time.
1942 * Caches attribute name values so we don't do the string ops every time.
1939 */
1943 */
1940 _getAttrNames(name: string): string;
1944 _getAttrNames(name: string): string;
1941
1945
1942 /**
1946 /**
1943 * Automatic setting of params during construction
1947 * Automatic setting of params during construction
1944 */
1948 */
1945 postscript(params?: Object): void;
1949 postscript(params?: Object): void;
1946
1950
1947 /**
1951 /**
1948 * Get a property on a Stateful instance.
1952 * Get a property on a Stateful instance.
1949 */
1953 */
1950 get<K extends keyof T & string>(name: K): T[K];
1954 get<K extends keyof T & string>(name: K): T[K];
1951
1955
1952 /**
1956 /**
1953 * Set a property on a Stateful instance
1957 * Set a property on a Stateful instance
1954 */
1958 */
1955 set<K extends keyof T & string>(name: K, value: T[K]): this;
1959 set<K extends keyof T & string>(name: K, value: 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;
1960 set<K extends { [p in keyof T]: T[p] extends any[] ? p : never; }[keyof T & string] >(name: K, ...values: T[K]): this;
1957 set(values: Partial<T>): this;
1961 set(values: Partial<T>): this;
1958
1962
1959 /**
1963 /**
1960 * Internal helper for directly changing an attribute value.
1964 * Internal helper for directly changing an attribute value.
1961 */
1965 */
1962 _changeAttrValue(name: string, value: any): this;
1966 _changeAttrValue(name: string, value: any): this;
1963
1967
1964 /**
1968 /**
1965 * Watches a property for changes
1969 * Watches a property for changes
1966 */
1970 */
1967 watch(callback:(prop: keyof any, oldValue: any, newValue: any) => void): WatchHandle;
1971 watch(callback:(prop: keyof any, oldValue: any, newValue: any) => void): WatchHandle;
1968 watch<K extends keyof T>(name: K, callback: (prop: K, oldValue: T[K], newValue: T[K]) => void): WatchHandle;
1972 watch<K extends keyof T>(name: K, callback: (prop: K, oldValue: T[K], newValue: T[K]) => void): WatchHandle;
1969 }
1973 }
1970
1974
1971 interface StatefulConstructor extends _base.DeclareConstructor<Stateful> {
1975 interface StatefulConstructor extends _base.DeclareConstructor<Stateful> {
1972 new <T>(params?: Partial<T>): Stateful<T>;
1976 new <T>(params?: Partial<T>): Stateful<T>;
1973 }
1977 }
1974
1978
1975 /* dojo/string */
1979 /* dojo/string */
1976
1980
1977 interface String {
1981 interface String {
1978
1982
1979 /**
1983 /**
1980 * Efficiently escape a string for insertion into HTML (innerHTML or attributes), replacing &, <, >, ", ', and / characters.
1984 * Efficiently escape a string for insertion into HTML (innerHTML or attributes), replacing &, <, >, ", ', and / characters.
1981 */
1985 */
1982 escape(str: string): string;
1986 escape(str: string): string;
1983
1987
1984 /**
1988 /**
1985 * Efficiently replicate a string `n` times.
1989 * Efficiently replicate a string `n` times.
1986 */
1990 */
1987 rep(str: string, num: number): string;
1991 rep(str: string, num: number): string;
1988
1992
1989 /**
1993 /**
1990 * Pad a string to guarantee that it is at least `size` length by
1994 * Pad a string to guarantee that it is at least `size` length by
1991 * filling with the character `ch` at either the start or end of the
1995 * filling with the character `ch` at either the start or end of the
1992 * string. Pads at the start, by default.
1996 * string. Pads at the start, by default.
1993 */
1997 */
1994 pad(text: string, size: number, ch?: string, end?: boolean): string;
1998 pad(text: string, size: number, ch?: string, end?: boolean): string;
1995
1999
1996 /**
2000 /**
1997 * Performs parameterized substitutions on a string. Throws an
2001 * Performs parameterized substitutions on a string. Throws an
1998 * exception if any parameter is unmatched.
2002 * exception if any parameter is unmatched.
1999 */
2003 */
2000 substitute(template: string, map: Object | any[], transform?: (value: any, key: string) => any, thisObject?: Object): string;
2004 substitute(template: string, map: Object | any[], transform?: (value: any, key: string) => any, thisObject?: Object): string;
2001
2005
2002 /**
2006 /**
2003 * Trims whitespace from both sides of the string
2007 * Trims whitespace from both sides of the string
2004 */
2008 */
2005 trim(str: string): string;
2009 trim(str: string): string;
2006 }
2010 }
2007
2011
2008 /* dojo/text */
2012 /* dojo/text */
2009
2013
2010 /**
2014 /**
2011 * A getter and setter for storing the string content associated with the
2015 * A getter and setter for storing the string content associated with the
2012 * module and url arguments.
2016 * module and url arguments.
2013 */
2017 */
2014 interface Cache {
2018 interface Cache {
2015 (module: string | GenericObject, url: string, value?: string | { value: string, sanitize?: boolean }): string;
2019 (module: string | GenericObject, url: string, value?: string | { value: string, sanitize?: boolean }): string;
2016 }
2020 }
2017
2021
2018 interface Text {
2022 interface Text {
2019 /**
2023 /**
2020 * the dojo/text caches it's own resources because of dojo.cache
2024 * the dojo/text caches it's own resources because of dojo.cache
2021 */
2025 */
2022 dynamic: boolean;
2026 dynamic: boolean;
2023
2027
2024 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
2028 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
2025
2029
2026 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
2030 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
2027 }
2031 }
2028
2032
2029 /* dojo/throttle */
2033 /* dojo/throttle */
2030
2034
2031 interface Throttle {
2035 interface Throttle {
2032 <T extends Function>(cb: T, wait: number): T;
2036 <T extends Function>(cb: T, wait: number): T;
2033 }
2037 }
2034
2038
2035 /* dojo/topic */
2039 /* dojo/topic */
2036
2040
2037 interface Topic {
2041 interface Topic {
2038 /**
2042 /**
2039 * Publishes a message to a topic on the pub/sub hub. All arguments after
2043 * Publishes a message to a topic on the pub/sub hub. All arguments after
2040 * the first will be passed to the subscribers, so any number of arguments
2044 * the first will be passed to the subscribers, so any number of arguments
2041 * can be provided (not just event).
2045 * can be provided (not just event).
2042 */
2046 */
2043 publish(topic: string | ExtensionEvent, ...event: any[]): boolean;
2047 publish(topic: string | ExtensionEvent, ...event: any[]): boolean;
2044
2048
2045 /**
2049 /**
2046 * Subscribes to a topic on the pub/sub hub
2050 * Subscribes to a topic on the pub/sub hub
2047 */
2051 */
2048 subscribe(topic: string | ExtensionEvent, listener: EventListener | Function): Handle;
2052 subscribe(topic: string | ExtensionEvent, listener: EventListener | Function): Handle;
2049 }
2053 }
2050
2054
2051 /* dojo/touch */
2055 /* dojo/touch */
2052
2056
2053 interface Touch {
2057 interface Touch {
2054 press: ExtensionEvent;
2058 press: ExtensionEvent;
2055 move: ExtensionEvent;
2059 move: ExtensionEvent;
2056 release: ExtensionEvent;
2060 release: ExtensionEvent;
2057 cancel: ExtensionEvent;
2061 cancel: ExtensionEvent;
2058 over: ExtensionEvent;
2062 over: ExtensionEvent;
2059 out: ExtensionEvent;
2063 out: ExtensionEvent;
2060 enter: ExtensionEvent;
2064 enter: ExtensionEvent;
2061 leave: ExtensionEvent;
2065 leave: ExtensionEvent;
2062 }
2066 }
2063
2067
2064 /* dojo/uacss */
2068 /* dojo/uacss */
2065
2069
2066 /* rexports has after adding classes to dom */
2070 /* rexports has after adding classes to dom */
2067
2071
2068 /* dojo/when */
2072 /* dojo/when */
2069
2073
2070 interface When {
2074 interface When {
2071 /**
2075 /**
2072 * Transparently applies callbacks to values and/or promises.
2076 * Transparently applies callbacks to values and/or promises.
2073 */
2077 */
2074 <T>(value: T | dojo.promise.Promise<T>): dojo.promise.Promise<T>;
2078 <T>(value: T | dojo.promise.Promise<T>): dojo.promise.Promise<T>;
2075 <T>(value: T | dojo.promise.Promise<T>,
2079 <T>(value: T | dojo.promise.Promise<T>,
2076 callback?: dojo.promise.PromiseCallback<T, T>,
2080 callback?: dojo.promise.PromiseCallback<T, T>,
2077 errback?: dojo.promise.PromiseErrback<T>,
2081 errback?: dojo.promise.PromiseErrback<T>,
2078 progress?: dojo.promise.PromiseProgback): T | dojo.promise.Promise<T>;
2082 progress?: dojo.promise.PromiseProgback): T | dojo.promise.Promise<T>;
2079 <T, U>(value: T | dojo.promise.Promise<T>,
2083 <T, U>(value: T | dojo.promise.Promise<T>,
2080 callback?: dojo.promise.PromiseCallback<T, U>,
2084 callback?: dojo.promise.PromiseCallback<T, U>,
2081 errback?: dojo.promise.PromiseErrback<U>,
2085 errback?: dojo.promise.PromiseErrback<U>,
2082 progress?: dojo.promise.PromiseProgback): U | dojo.promise.Promise<U>;
2086 progress?: dojo.promise.PromiseProgback): U | dojo.promise.Promise<U>;
2083 }
2087 }
2084
2088
2085 /* dojo/window */
2089 /* dojo/window */
2086
2090
2087 interface WindowModule {
2091 interface WindowModule {
2088
2092
2089 /**
2093 /**
2090 * Returns the dimensions and scroll position of the viewable area of a browser window
2094 * Returns the dimensions and scroll position of the viewable area of a browser window
2091 */
2095 */
2092 getBox(doc?: Document): DomGeometryBox;
2096 getBox(doc?: Document): DomGeometryBox;
2093
2097
2094 /**
2098 /**
2095 * Get window object associated with document doc.
2099 * Get window object associated with document doc.
2096 */
2100 */
2097 get(doc?: Document): Window;
2101 get(doc?: Document): Window;
2098
2102
2099 /**
2103 /**
2100 * Scroll the passed node into view using minimal movement, if it is not already.
2104 * Scroll the passed node into view using minimal movement, if it is not already.
2101 */
2105 */
2102 scrollIntoView(node: Element, pos?: DomGeometryXYBox): void;
2106 scrollIntoView(node: Element, pos?: DomGeometryXYBox): void;
2103 }
2107 }
2104 }
2108 }
@@ -1,824 +1,824
1 /// <reference path="index.d.ts" />
1 /// <reference path="index.d.ts" />
2
2
3 declare module 'dojo/_base/array' {
3 declare module 'dojo/_base/array' {
4 const dojoArray: dojo._base.Array;
4 const dojoArray: dojo._base.Array;
5 export = dojoArray;
5 export = dojoArray;
6 }
6 }
7
7
8 declare module 'dojo/_base/browser' {
8 declare module 'dojo/_base/browser' {
9 const ready: dojo.Ready;
9 const ready: dojo.Ready;
10 export = ready;
10 export = ready;
11 }
11 }
12
12
13 declare module 'dojo/_base/Color' {
13 declare module 'dojo/_base/Color' {
14 type Color = dojo._base.Color;
14 type Color = dojo._base.Color;
15 const Color: dojo._base.ColorConstructor;
15 const Color: dojo._base.ColorConstructor;
16 export = Color;
16 export = Color;
17 }
17 }
18
18
19 declare module 'dojo/_base/config' {
19 declare module 'dojo/_base/config' {
20 const config: dojo._base.Config;
20 const config: dojo._base.Config;
21 export = config;
21 export = config;
22 }
22 }
23
23
24 declare module 'dojo/_base/connect' {
24 declare module 'dojo/_base/connect' {
25 const connect: dojo._base.Connect;
25 const connect: dojo._base.Connect;
26 export = connect;
26 export = connect;
27 }
27 }
28
28
29 declare module 'dojo/_base/declare' {
29 declare module 'dojo/_base/declare' {
30 const dojoDeclare: dojo._base.Declare;
30 const dojoDeclare: dojo._base.Declare;
31 export = dojoDeclare;
31 export = dojoDeclare;
32 }
32 }
33
33
34 declare module 'dojo/_base/Deferred' {
34 declare module 'dojo/_base/Deferred' {
35 type Deferred<T> = dojo._base.Deferred<T>;
35 type Deferred<T> = dojo._base.Deferred<T>;
36 const Deferred: dojo._base.DeferredConstructor;
36 const Deferred: dojo._base.DeferredConstructor;
37 export = Deferred;
37 export = Deferred;
38 }
38 }
39
39
40 declare module 'dojo/_base/event' {
40 declare module 'dojo/_base/event' {
41 const event: dojo._base.EventModule;
41 const event: dojo._base.EventModule;
42 export = event;
42 export = event;
43 }
43 }
44
44
45 declare module 'dojo/_base/fx' {
45 declare module 'dojo/_base/fx' {
46 const fx: dojo._base.Fx;
46 const fx: dojo._base.Fx;
47 export = fx;
47 export = fx;
48 }
48 }
49
49
50 declare module 'dojo/_base/html' {
50 declare module 'dojo/_base/html' {
51 const dojo: dojo._base.Dojo;
51 const dojo: dojo._base.Dojo;
52 export = dojo;
52 export = dojo;
53 }
53 }
54
54
55 declare module 'dojo/_base/json' {
55 declare module 'dojo/_base/json' {
56 const dojo: dojo._base.Dojo;
56 const dojo: dojo._base.Dojo;
57 export = dojo;
57 export = dojo;
58 }
58 }
59
59
60 declare module 'dojo/_base/kernel' {
60 declare module 'dojo/_base/kernel' {
61 const dojo: dojo._base.Dojo;
61 const dojo: dojo._base.Dojo;
62 export = dojo;
62 export = dojo;
63 }
63 }
64
64
65 declare module 'dojo/_base/lang' {
65 declare module 'dojo/_base/lang' {
66 const lang: dojo._base.Lang;
66 const lang: dojo._base.Lang;
67 export = lang;
67 export = lang;
68 }
68 }
69
69
70 declare module 'dojo/_base/loader' {
70 declare module 'dojo/_base/loader' {
71 const loader: dojo._base.Loader;
71 const loader: dojo._base.Loader;
72 export = loader;
72 export = loader;
73 }
73 }
74
74
75 declare module 'dojo/_base/NodeList' {
75 declare module 'dojo/_base/NodeList' {
76 type NodeList<T extends Node> = dojo.NodeList<T>;
76 type NodeList<T extends Node> = dojo.NodeList<T>;
77 const NodeList: dojo.NodeListConstructor;
77 const NodeList: dojo.NodeListConstructor;
78 export = NodeList;
78 export = NodeList;
79 }
79 }
80
80
81 declare module 'dojo/_base/query' {
81 declare module 'dojo/_base/query' {
82 const query: dojo.Query;
82 const query: dojo.Query;
83 export = query;
83 export = query;
84 }
84 }
85
85
86 declare module 'dojo/_base/sniff' {
86 declare module 'dojo/_base/sniff' {
87 const has: dojo.Has;
87 const has: dojo.Has;
88 export = has;
88 export = has;
89 }
89 }
90
90
91 declare module 'dojo/_base/unload' {
91 declare module 'dojo/_base/unload' {
92 const unload: dojo._base.Unload;
92 const unload: dojo._base.Unload;
93 export = unload;
93 export = unload;
94 }
94 }
95
95
96 declare module 'dojo/_base/url' {
96 declare module 'dojo/_base/url' {
97 type Url = dojo._base.Url;
97 type Url = dojo._base.Url;
98 const Url: dojo._base.UrlConstructor;
98 const Url: dojo._base.UrlConstructor;
99 export = Url;
99 export = Url;
100 }
100 }
101
101
102 declare module 'dojo/_base/window' {
102 declare module 'dojo/_base/window' {
103 const window: dojo._base.Window;
103 const window: dojo._base.Window;
104 export = window;
104 export = window;
105 }
105 }
106
106
107 declare module 'dojo/_base/xhr' {
107 declare module 'dojo/_base/xhr' {
108 const xhr: dojo._base.Xhr;
108 const xhr: dojo._base.Xhr;
109 export = xhr;
109 export = xhr;
110 }
110 }
111
111
112 declare module 'dojo/AdapterRegistry' {
112 declare module 'dojo/AdapterRegistry' {
113 type AdapterRegistry = dojo.AdapterRegistry;
113 type AdapterRegistry = dojo.AdapterRegistry;
114 const AdapterRegistry: dojo.AdapterRegistryConstructor;
114 const AdapterRegistry: dojo.AdapterRegistryConstructor;
115 export = AdapterRegistry;
115 export = AdapterRegistry;
116 }
116 }
117
117
118 declare module 'dojo/aspect' {
118 declare module 'dojo/aspect' {
119 const aspect: dojo.Aspect;
119 const aspect: dojo.Aspect;
120 export = aspect;
120 export = aspect;
121 }
121 }
122
122
123 declare module 'dojo/back' {
123 declare module 'dojo/back' {
124 const back: dojo.Back;
124 const back: dojo.Back;
125 export = back;
125 export = back;
126 }
126 }
127
127
128 declare module 'dojo/behavior' {
128 declare module 'dojo/behavior' {
129 const behavior: dojo.Behavior;
129 const behavior: dojo.Behavior;
130 export = behavior;
130 export = behavior;
131 }
131 }
132
132
133 declare module 'dojo/cache' {
133 declare module 'dojo/cache' {
134 const cache: dojo.Cache;
134 const cache: dojo.Cache;
135 export = cache;
135 export = cache;
136 }
136 }
137
137
138 declare module 'dojo/cldr/monetary' {
138 declare module 'dojo/cldr/monetary' {
139 const monetary: dojo.cldr.Monetary;
139 const monetary: dojo.cldr.Monetary;
140 export = monetary;
140 export = monetary;
141 }
141 }
142
142
143 declare module 'dojo/cldr/supplemental' {
143 declare module 'dojo/cldr/supplemental' {
144 const supplemental: dojo.cldr.Supplemental;
144 const supplemental: dojo.cldr.Supplemental;
145 export = supplemental;
145 export = supplemental;
146 }
146 }
147
147
148 declare module 'dojo/colors' {
148 declare module 'dojo/colors' {
149 type Color = dojo._base.Color;
149 type Color = dojo._base.Color;
150 const Color: dojo._base.ColorConstructor;
150 const Color: dojo._base.ColorConstructor;
151 export = Color;
151 export = Color;
152 }
152 }
153
153
154 declare module 'dojo/cookie' {
154 declare module 'dojo/cookie' {
155 const cookie: dojo.Cookie;
155 const cookie: dojo.Cookie;
156 export = cookie;
156 export = cookie;
157 }
157 }
158
158
159 declare module 'dojo/currency' {
159 declare module 'dojo/currency' {
160 const currency: dojo.Currency;
160 const currency: dojo.Currency;
161 export = currency;
161 export = currency;
162 }
162 }
163
163
164 declare module 'dojo/data/api/Identity' {
164 declare module 'dojo/data/api/Identity' {
165 type Identity<T> = dojo.data.api.Identity<T>;
165 type Identity<T> = dojo.data.api.Identity<T>;
166 const Identity: dojo.data.api.IdentityConstructor;
166 const Identity: dojo.data.api.IdentityConstructor;
167 export = Identity;
167 export = Identity;
168 }
168 }
169
169
170 declare module 'dojo/data/api/Item' {
170 declare module 'dojo/data/api/Item' {
171 type Item = dojo.data.api.Item;
171 type Item = dojo.data.api.Item;
172 const Item: dojo.data.api.ItemConstructor;
172 const Item: dojo.data.api.ItemConstructor;
173 export = Item;
173 export = Item;
174 }
174 }
175
175
176 declare module 'dojo/data/api/Notification' {
176 declare module 'dojo/data/api/Notification' {
177 type Notification<T> = dojo.data.api.Notification<T>;
177 type Notification<T> = dojo.data.api.Notification<T>;
178 const Notification: dojo.data.api.NotificationConstructor;
178 const Notification: dojo.data.api.NotificationConstructor;
179 export = Notification;
179 export = Notification;
180 }
180 }
181
181
182 declare module 'dojo/data/api/Read' {
182 declare module 'dojo/data/api/Read' {
183 type Read<T> = dojo.data.api.Read<T>;
183 type Read<T> = dojo.data.api.Read<T>;
184 const Read: dojo.data.api.ReadConstructor;
184 const Read: dojo.data.api.ReadConstructor;
185 export = Read;
185 export = Read;
186 }
186 }
187
187
188 declare module 'dojo/data/api/Request' {
188 declare module 'dojo/data/api/Request' {
189 type Request = dojo.data.api.Request;
189 type Request = dojo.data.api.Request;
190 const Request: dojo.data.api.RequestConstructor;
190 const Request: dojo.data.api.RequestConstructor;
191 export = Request;
191 export = Request;
192 }
192 }
193
193
194 declare module 'dojo/data/api/Write' {
194 declare module 'dojo/data/api/Write' {
195 type Write<T> = dojo.data.api.Write<T>;
195 type Write<T> = dojo.data.api.Write<T>;
196 const Write: dojo.data.api.WriteConstructor;
196 const Write: dojo.data.api.WriteConstructor;
197 export = Write;
197 export = Write;
198 }
198 }
199
199
200 declare module 'dojo/data/util/filter' {
200 declare module 'dojo/data/util/filter' {
201 const filter: dojo.data.util.Filter;
201 const filter: dojo.data.util.Filter;
202 export = filter;
202 export = filter;
203 }
203 }
204
204
205 declare module 'dojo/data/util/simpleFetch' {
205 declare module 'dojo/data/util/simpleFetch' {
206 const simpleFetch: dojo.data.util.SimpleFetch;
206 const simpleFetch: dojo.data.util.SimpleFetch;
207 export = simpleFetch;
207 export = simpleFetch;
208 }
208 }
209
209
210 declare module 'dojo/data/util/sorter' {
210 declare module 'dojo/data/util/sorter' {
211 const sorter: dojo.data.util.Sorter;
211 const sorter: dojo.data.util.Sorter;
212 export = sorter;
212 export = sorter;
213 }
213 }
214
214
215 declare module 'dojo/data/ItemFileReadStore' {
215 declare module 'dojo/data/ItemFileReadStore' {
216 type ItemFileReadStore<T> = dojo.data.ItemFileReadStore<T>;
216 type ItemFileReadStore<T> = dojo.data.ItemFileReadStore<T>;
217 const ItemFileReadStore: dojo.data.ItemFileReadStoreConstructor;
217 const ItemFileReadStore: dojo.data.ItemFileReadStoreConstructor;
218 export = ItemFileReadStore;
218 export = ItemFileReadStore;
219 }
219 }
220
220
221 declare module 'dojo/data/ItemFileWriteStore' {
221 declare module 'dojo/data/ItemFileWriteStore' {
222 type ItemFileWriteStore<T> = dojo.data.ItemFileWriteStore<T>;
222 type ItemFileWriteStore<T> = dojo.data.ItemFileWriteStore<T>;
223 const ItemFileWriteStore: dojo.data.ItemFileWriteStoreConstructor;
223 const ItemFileWriteStore: dojo.data.ItemFileWriteStoreConstructor;
224 export = ItemFileWriteStore;
224 export = ItemFileWriteStore;
225 }
225 }
226
226
227 declare module 'dojo/data/ObjectStore' {
227 declare module 'dojo/data/ObjectStore' {
228 type ObjectStore<T> = dojo.data.ObjectStore<T>;
228 type ObjectStore<T> = dojo.data.ObjectStore<T>;
229 const ObjectStore: dojo.data.ObjectStoreConstructor;
229 const ObjectStore: dojo.data.ObjectStoreConstructor;
230 export = ObjectStore;
230 export = ObjectStore;
231 }
231 }
232
232
233 declare module 'dojo/date' {
233 declare module 'dojo/date' {
234 const date: dojo.date.DateBase;
234 const date: dojo.date.DateBase;
235 export = date;
235 export = date;
236 }
236 }
237
237
238 declare module 'dojo/date/locale' {
238 declare module 'dojo/date/locale' {
239 const dateLocale: dojo.date.DateLocale;
239 const dateLocale: dojo.date.DateLocale;
240 export = dateLocale;
240 export = dateLocale;
241 }
241 }
242
242
243 declare module 'dojo/date/stamp' {
243 declare module 'dojo/date/stamp' {
244 const stamp: dojo.date.Stamp;
244 const stamp: dojo.date.Stamp;
245 export = stamp;
245 export = stamp;
246 }
246 }
247
247
248 declare module 'dojo/debounce' {
248 declare module 'dojo/debounce' {
249 const debounce: dojo.Debounce;
249 const debounce: dojo.Debounce;
250 export = debounce;
250 export = debounce;
251 }
251 }
252
252
253 declare module 'dojo/Deferred' {
253 declare module 'dojo/Deferred' {
254 type Deferred<T> = dojo.Deferred<T>;
254 type Deferred<T> = dojo.Deferred<T>;
255 const Deferred: dojo.DeferredConstructor;
255 const Deferred: dojo.DeferredConstructor;
256 export = Deferred;
256 export = Deferred;
257 }
257 }
258
258
259 declare module 'dojo/DeferredList' {
259 declare module 'dojo/DeferredList' {
260 type DeferredList<T> = dojo.DeferredList<T>;
260 type DeferredList<T> = dojo.DeferredList<T>;
261 const DeferredList: dojo.DeferredListConstructor;
261 const DeferredList: dojo.DeferredListConstructor;
262 export = DeferredList;
262 export = DeferredList;
263 }
263 }
264
264
265 declare module 'dojo/dnd/autoscroll' {
265 declare module 'dojo/dnd/autoscroll' {
266 const autoscroll: dojo.dnd.AutoScroll;
266 const autoscroll: dojo.dnd.AutoScroll;
267 export = autoscroll;
267 export = autoscroll;
268 }
268 }
269
269
270 declare module 'dojo/dnd/AutoSource' {
270 declare module 'dojo/dnd/AutoSource' {
271 const AutoSource: dojo.dnd.AutoSourceConstructor;
271 const AutoSource: dojo.dnd.AutoSourceConstructor;
272 export = AutoSource;
272 export = AutoSource;
273 }
273 }
274
274
275 declare module 'dojo/dnd/Avatar' {
275 declare module 'dojo/dnd/Avatar' {
276 type Avatar = dojo.dnd.Avatar;
276 type Avatar = dojo.dnd.Avatar;
277 const Avatar: dojo.dnd.AvatarConstructor;
277 const Avatar: dojo.dnd.AvatarConstructor;
278 export = Avatar;
278 export = Avatar;
279 }
279 }
280
280
281 declare module 'dojo/dnd/common' {
281 declare module 'dojo/dnd/common' {
282 const common: dojo.dnd.Common;
282 const common: dojo.dnd.Common;
283 export = common;
283 export = common;
284 }
284 }
285
285
286 declare module 'dojo/dnd/Container' {
286 declare module 'dojo/dnd/Container' {
287 type Container = dojo.dnd.Container;
287 type Container = dojo.dnd.Container;
288 const Container: dojo.dnd.ContainerConstructor;
288 const Container: dojo.dnd.ContainerConstructor;
289 export = Container;
289 export = Container;
290 }
290 }
291
291
292 declare module 'dojo/dnd/Manager' {
292 declare module 'dojo/dnd/Manager' {
293 type Manager = dojo.dnd.Manager;
293 type Manager = dojo.dnd.Manager;
294 const Manager: dojo.dnd.ManagerConstructor;
294 const Manager: dojo.dnd.ManagerConstructor;
295 export = Manager;
295 export = Manager;
296 }
296 }
297
297
298 declare module 'dojo/dnd/move' {
298 declare module 'dojo/dnd/move' {
299 const Move: dojo.dnd.Move;
299 const Move: dojo.dnd.Move;
300 export = Move;
300 export = Move;
301 }
301 }
302
302
303 declare module 'dojo/dnd/Moveable' {
303 declare module 'dojo/dnd/Moveable' {
304 type Moveable = dojo.dnd.Moveable;
304 type Moveable = dojo.dnd.Moveable;
305 const Moveable: dojo.dnd.Moveable;
305 const Moveable: dojo.dnd.Moveable;
306 export = Moveable;
306 export = Moveable;
307 }
307 }
308
308
309 declare module 'dojo/dnd/Mover' {
309 declare module 'dojo/dnd/Mover' {
310 type Mover = dojo.dnd.Mover;
310 type Mover = dojo.dnd.Mover;
311 const Mover: dojo.dnd.MoverConstructor;
311 const Mover: dojo.dnd.MoverConstructor;
312 export = Mover;
312 export = Mover;
313 }
313 }
314
314
315 declare module 'dojo/dnd/Selector' {
315 declare module 'dojo/dnd/Selector' {
316 type Selector = dojo.dnd.Selector;
316 type Selector = dojo.dnd.Selector;
317 const Selector: dojo.dnd.SelectorConstructor;
317 const Selector: dojo.dnd.SelectorConstructor;
318 export = Selector;
318 export = Selector;
319 }
319 }
320
320
321 declare module 'dojo/dnd/Source' {
321 declare module 'dojo/dnd/Source' {
322 type Source = dojo.dnd.Source;
322 type Source = dojo.dnd.Source;
323 const Source: dojo.dnd.SourceConstructor;
323 const Source: dojo.dnd.SourceConstructor;
324 export = Source;
324 export = Source;
325 }
325 }
326
326
327 declare module 'dojo/dnd/Target' {
327 declare module 'dojo/dnd/Target' {
328 type Target = dojo.dnd.Target;
328 type Target = dojo.dnd.Target;
329 const Target: dojo.dnd.TargetConstructor;
329 const Target: dojo.dnd.TargetConstructor;
330 export = Target;
330 export = Target;
331 }
331 }
332
332
333 declare module 'dojo/dnd/TimedMoveable' {
333 declare module 'dojo/dnd/TimedMoveable' {
334 type TimedMoveable = dojo.dnd.TimedMoveable;
334 type TimedMoveable = dojo.dnd.TimedMoveable;
335 const TimedMoveable: dojo.dnd.TimedMoveableConstructor;
335 const TimedMoveable: dojo.dnd.TimedMoveableConstructor;
336 export = TimedMoveable;
336 export = TimedMoveable;
337 }
337 }
338
338
339 declare module 'dojo/dojo' {
339 declare module 'dojo/dojo' {
340 const require: dojo.Require;
340 const require: dojo.Require;
341 export = require;
341 export = require;
342 }
342 }
343
343
344 declare module 'require' {
344 declare module 'require' {
345 const require: dojo.Require;
345 const require: dojo.Require;
346 export = require;
346 export = require;
347 }
347 }
348
348
349 declare module 'dojo/dom' {
349 declare module 'dojo/dom' {
350 const dom: dojo.Dom;
350 const dom: dojo.Dom;
351 export = dom;
351 export = dom;
352 }
352 }
353
353
354 declare module 'dojo/dom-attr' {
354 declare module 'dojo/dom-attr' {
355 const domAttr: dojo.DomAttr;
355 const domAttr: dojo.DomAttr;
356 export = domAttr;
356 export = domAttr;
357 }
357 }
358
358
359 declare module 'dojo/dom-class' {
359 declare module 'dojo/dom-class' {
360 const domClass: dojo.DomClass;
360 const domClass: dojo.DomClass;
361 export = domClass;
361 export = domClass;
362 }
362 }
363
363
364 declare module 'dojo/dom-construct' {
364 declare module 'dojo/dom-construct' {
365 const domConstruct: dojo.DomConstruct;
365 const domConstruct: dojo.DomConstruct;
366 export = domConstruct;
366 export = domConstruct;
367 }
367 }
368
368
369 declare module 'dojo/dom-form' {
369 declare module 'dojo/dom-form' {
370 const domForm: dojo.DomForm;
370 const domForm: dojo.DomForm;
371 export = domForm;
371 export = domForm;
372 }
372 }
373
373
374 declare module 'dojo/dom-geometry' {
374 declare module 'dojo/dom-geometry' {
375 const domGeom: dojo.DomGeometry;
375 const domGeom: dojo.DomGeometry;
376 export = domGeom;
376 export = domGeom;
377 }
377 }
378
378
379 declare module 'dojo/dom-prop' {
379 declare module 'dojo/dom-prop' {
380 const domProp: dojo.DomProp;
380 const domProp: dojo.DomProp;
381 export = domProp;
381 export = domProp;
382 }
382 }
383
383
384 declare module 'dojo/dom-style' {
384 declare module 'dojo/dom-style' {
385 const domStyle: dojo.DomStyle;
385 const domStyle: dojo.DomStyle;
386 export = domStyle;
386 export = domStyle;
387 }
387 }
388
388
389 declare module 'dojo/domReady' {
389 declare module 'dojo/domReady' {
390 const domReady: dojo.DomReady;
390 const domReady: dojo.DomReady;
391 export = domReady;
391 export = domReady;
392 }
392 }
393
393
394 declare module 'dojo/domReady!' {
394 declare module 'dojo/domReady!' {
395 const callback: any;
395 const callback: any;
396 export = callback;
396 export = callback;
397 }
397 }
398
398
399 declare module 'dojo/errors/CancelError' {
399 declare module 'dojo/errors/CancelError' {
400 type CancelError = dojo.errors.CancelError;
400 type CancelError = dojo.errors.CancelError;
401 const CancelError: dojo.errors.CancelErrorConstructor;
401 const CancelError: dojo.errors.CancelErrorConstructor;
402 export = CancelError;
402 export = CancelError;
403 }
403 }
404
404
405 declare module 'dojo/errors/create' {
405 declare module 'dojo/errors/create' {
406 const create: dojo.errors.Create;
406 const create: dojo.errors.Create;
407 export = create;
407 export = create;
408 }
408 }
409
409
410 declare module 'dojo/errors/RequestError' {
410 declare module 'dojo/errors/RequestError' {
411 type RequestError = dojo.errors.RequestError;
411 type RequestError = dojo.errors.RequestError;
412 const RequestError: dojo.errors.RequestErrorConstructor;
412 const RequestError: dojo.errors.RequestErrorConstructor;
413 export = RequestError;
413 export = RequestError;
414 }
414 }
415
415
416 declare module 'dojo/errors/RequestTimeoutError' {
416 declare module 'dojo/errors/RequestTimeoutError' {
417 type RequestTimeoutError = dojo.errors.RequestError;
417 type RequestTimeoutError = dojo.errors.RequestError;
418 const RequestTimeoutError: dojo.errors.RequestTimeoutErrorConstructor;
418 const RequestTimeoutError: dojo.errors.RequestTimeoutErrorConstructor;
419 export = RequestTimeoutError;
419 export = RequestTimeoutError;
420 }
420 }
421
421
422 declare module 'dojo/Evented' {
422 declare module 'dojo/Evented' {
423 type Evented = dojo.Evented;
423 type Evented<T> = dojo.Evented<T>;
424 const Evented: dojo.EventedConstructor;
424 const Evented: dojo.EventedConstructor;
425 export = Evented;
425 export = Evented;
426 }
426 }
427
427
428 declare module 'dojo/gears' {
428 declare module 'dojo/gears' {
429 const gears: dojo.Gears;
429 const gears: dojo.Gears;
430 export = gears;
430 export = gears;
431 }
431 }
432
432
433 declare module 'dojo/has' {
433 declare module 'dojo/has' {
434 const has: dojo.Has;
434 const has: dojo.Has;
435 export = has;
435 export = has;
436 }
436 }
437
437
438 declare module 'dojo/hash' {
438 declare module 'dojo/hash' {
439 const hash: dojo.Hash;
439 const hash: dojo.Hash;
440 export = hash;
440 export = hash;
441 }
441 }
442
442
443 declare module 'dojo/hccss' {
443 declare module 'dojo/hccss' {
444 const hccss: dojo.Has;
444 const hccss: dojo.Has;
445 export = hccss;
445 export = hccss;
446 }
446 }
447
447
448 declare module 'dojo/html' {
448 declare module 'dojo/html' {
449 const html: dojo.Html;
449 const html: dojo.Html;
450 export = html;
450 export = html;
451 }
451 }
452
452
453 declare module 'dojo/i18n' {
453 declare module 'dojo/i18n' {
454 const i18n: dojo.I18n;
454 const i18n: dojo.I18n;
455 export = i18n;
455 export = i18n;
456 }
456 }
457
457
458 declare module 'dojo/io/iframe' {
458 declare module 'dojo/io/iframe' {
459 const iframe: dojo.io.IFrame;
459 const iframe: dojo.io.IFrame;
460 export = iframe;
460 export = iframe;
461 }
461 }
462
462
463 declare module 'dojo/io/script' {
463 declare module 'dojo/io/script' {
464 const script: dojo.io.Script;
464 const script: dojo.io.Script;
465 export = script;
465 export = script;
466 }
466 }
467
467
468 declare module 'dojo/io-query' {
468 declare module 'dojo/io-query' {
469 const ioQuery: dojo.IoQuery;
469 const ioQuery: dojo.IoQuery;
470 export = ioQuery;
470 export = ioQuery;
471 }
471 }
472
472
473 declare module 'dojo/json' {
473 declare module 'dojo/json' {
474 const json: dojo.Json;
474 const json: dojo.Json;
475 export = json;
475 export = json;
476 }
476 }
477
477
478 declare module 'dojo/keys' {
478 declare module 'dojo/keys' {
479 const keys: dojo.Keys;
479 const keys: dojo.Keys;
480 export = keys;
480 export = keys;
481 }
481 }
482
482
483 declare module 'dojo/loadInit' {
483 declare module 'dojo/loadInit' {
484 const loadInit: dojo.LoadInit;
484 const loadInit: dojo.LoadInit;
485 export = loadInit;
485 export = loadInit;
486 }
486 }
487
487
488 declare module 'dojo/loadInit!' {
488 declare module 'dojo/loadInit!' {
489 const loadInit: (mid: string, require: any, loaded: (...modules: any[]) => void) => void;
489 const loadInit: (mid: string, require: any, loaded: (...modules: any[]) => void) => void;
490 export = loadInit;
490 export = loadInit;
491 }
491 }
492
492
493 declare module 'dojo/main' {
493 declare module 'dojo/main' {
494 const main: dojo._base.Dojo;
494 const main: dojo._base.Dojo;
495 export = main;
495 export = main;
496 }
496 }
497
497
498 declare module 'dojo/mouse' {
498 declare module 'dojo/mouse' {
499 const mouse: dojo.Mouse;
499 const mouse: dojo.Mouse;
500 export = mouse;
500 export = mouse;
501 }
501 }
502
502
503 declare module 'dojo/NodeList' {
503 declare module 'dojo/NodeList' {
504 type NodeList<T extends Node> = dojo.NodeList<T>;
504 type NodeList<T extends Node> = dojo.NodeList<T>;
505 const NodeList: dojo.NodeListConstructor;
505 const NodeList: dojo.NodeListConstructor;
506 export = NodeList;
506 export = NodeList;
507 }
507 }
508
508
509 declare module 'dojo/number' {
509 declare module 'dojo/number' {
510 const value: dojo.Number;
510 const value: dojo.Number;
511 export = value;
511 export = value;
512 }
512 }
513
513
514 declare module 'dojo/on' {
514 declare module 'dojo/on' {
515 const on: dojo.On;
515 const on: dojo.On;
516 export = on;
516 export = on;
517 }
517 }
518
518
519 declare module 'dojo/on/asyncEventListener' {
519 declare module 'dojo/on/asyncEventListener' {
520 const asyncEventListener: dojo.on.AsyncEventListener;
520 const asyncEventListener: dojo.on.AsyncEventListener;
521 export = asyncEventListener;
521 export = asyncEventListener;
522 }
522 }
523
523
524 declare module 'dojo/on/debounce' {
524 declare module 'dojo/on/debounce' {
525 const debounce: dojo.on.Debounce;
525 const debounce: dojo.on.Debounce;
526 export = debounce;
526 export = debounce;
527 }
527 }
528
528
529 declare module 'dojo/on/throttle' {
529 declare module 'dojo/on/throttle' {
530 const throttle: dojo.on.Throttle;
530 const throttle: dojo.on.Throttle;
531 export = throttle;
531 export = throttle;
532 }
532 }
533
533
534 declare module 'dojo/parser' {
534 declare module 'dojo/parser' {
535 const parser: dojo.Parser;
535 const parser: dojo.Parser;
536 export = parser;
536 export = parser;
537 }
537 }
538
538
539 declare module 'dojo/promise/all' {
539 declare module 'dojo/promise/all' {
540 const all: dojo.promise.All;
540 const all: dojo.promise.All;
541 export = all;
541 export = all;
542 }
542 }
543
543
544 declare module 'dojo/promise/first' {
544 declare module 'dojo/promise/first' {
545 const first: dojo.promise.First;
545 const first: dojo.promise.First;
546 export = first;
546 export = first;
547 }
547 }
548
548
549 declare module 'dojo/promise/instrumentation' {
549 declare module 'dojo/promise/instrumentation' {
550 const instrumentation: dojo.promise.Instrumentation;
550 const instrumentation: dojo.promise.Instrumentation;
551 export = instrumentation;
551 export = instrumentation;
552 }
552 }
553
553
554 declare module 'dojo/promise/Promise' {
554 declare module 'dojo/promise/Promise' {
555 type Promise<T> = dojo.promise.Promise<T>;
555 type Promise<T> = dojo.promise.Promise<T>;
556 const Promise: dojo.promise.PromiseConstructor;
556 const Promise: dojo.promise.PromiseConstructor;
557 export = Promise;
557 export = Promise;
558 }
558 }
559
559
560 declare module 'dojo/promise/tracer' {
560 declare module 'dojo/promise/tracer' {
561 const tracer: dojo.promise.Tracer;
561 const tracer: dojo.promise.Tracer;
562 export = tracer;
562 export = tracer;
563 }
563 }
564
564
565 declare module 'dojo/query' {
565 declare module 'dojo/query' {
566 const query: dojo.Query;
566 const query: dojo.Query;
567 export = query;
567 export = query;
568 }
568 }
569
569
570 /* modules for included selector engines */
570 /* modules for included selector engines */
571
571
572 declare module 'dojo/query!acme' {
572 declare module 'dojo/query!acme' {
573 const query: dojo.Query;
573 const query: dojo.Query;
574 export = query;
574 export = query;
575 }
575 }
576
576
577 declare module 'dojo/query!lite' {
577 declare module 'dojo/query!lite' {
578 const query: dojo.Query;
578 const query: dojo.Query;
579 export = query;
579 export = query;
580 }
580 }
581
581
582 declare module 'dojo/ready' {
582 declare module 'dojo/ready' {
583 const ready: dojo.Ready;
583 const ready: dojo.Ready;
584 export = ready;
584 export = ready;
585 }
585 }
586
586
587 declare module 'dojo/regexp' {
587 declare module 'dojo/regexp' {
588 const regexp: dojo.RegExpModule;
588 const regexp: dojo.RegExpModule;
589 export = regexp;
589 export = regexp;
590 }
590 }
591
591
592 declare module 'dojo/request' {
592 declare module 'dojo/request' {
593 const request: dojo.request.Request;
593 const request: dojo.request.Request;
594 export = request;
594 export = request;
595 }
595 }
596
596
597 declare module 'dojo/request/default' {
597 declare module 'dojo/request/default' {
598 const def: dojo.request.Default;
598 const def: dojo.request.Default;
599 export = def;
599 export = def;
600 }
600 }
601
601
602 declare module 'dojo/request/default!' {
602 declare module 'dojo/request/default!' {
603 const def: dojo.request.Request;
603 const def: dojo.request.Request;
604 export = def;
604 export = def;
605 }
605 }
606
606
607 declare module 'dojo/request/handlers' {
607 declare module 'dojo/request/handlers' {
608 const handlers: dojo.request.Handlers;
608 const handlers: dojo.request.Handlers;
609 export = handlers;
609 export = handlers;
610 }
610 }
611
611
612 declare module 'dojo/request/iframe' {
612 declare module 'dojo/request/iframe' {
613 const iframe: dojo.request.IFrame;
613 const iframe: dojo.request.IFrame;
614 export = iframe;
614 export = iframe;
615 }
615 }
616
616
617 declare module 'dojo/request/node' {
617 declare module 'dojo/request/node' {
618 const node: dojo.request.Node;
618 const node: dojo.request.Node;
619 export = node;
619 export = node;
620 }
620 }
621
621
622 declare module 'dojo/request/registry' {
622 declare module 'dojo/request/registry' {
623 const registry: dojo.request.Registry;
623 const registry: dojo.request.Registry;
624 export = registry;
624 export = registry;
625 }
625 }
626
626
627 declare module 'dojo/request/script' {
627 declare module 'dojo/request/script' {
628 const script: dojo.request.Script;
628 const script: dojo.request.Script;
629 export = script;
629 export = script;
630 }
630 }
631
631
632 declare module 'dojo/request/util' {
632 declare module 'dojo/request/util' {
633 const util: dojo.request.Util;
633 const util: dojo.request.Util;
634 export = util;
634 export = util;
635 }
635 }
636
636
637 declare module 'dojo/request/watch' {
637 declare module 'dojo/request/watch' {
638 const watch: dojo.request.Watch;
638 const watch: dojo.request.Watch;
639 export = watch;
639 export = watch;
640 }
640 }
641
641
642 declare module 'dojo/request/xhr' {
642 declare module 'dojo/request/xhr' {
643 const xhr: dojo.request.Xhr;
643 const xhr: dojo.request.Xhr;
644 export = xhr;
644 export = xhr;
645 }
645 }
646
646
647 declare module 'dojo/require' {
647 declare module 'dojo/require' {
648 const require: dojo.RequirePlugin;
648 const require: dojo.RequirePlugin;
649 export = require;
649 export = require;
650 }
650 }
651
651
652 declare module 'dojo/robot' {
652 declare module 'dojo/robot' {
653 const robot: dojo.Robot;
653 const robot: dojo.Robot;
654 export = robot;
654 export = robot;
655 }
655 }
656
656
657 declare module 'dojo/robotx' {
657 declare module 'dojo/robotx' {
658 const robotx: dojo.RobotX;
658 const robotx: dojo.RobotX;
659 export = robotx;
659 export = robotx;
660 }
660 }
661
661
662 declare module 'dojo/router' {
662 declare module 'dojo/router' {
663 const router: dojo.router.RouterBase;
663 const router: dojo.router.RouterBase;
664 export = router;
664 export = router;
665 }
665 }
666
666
667 declare module 'dojo/router/RouterBase' {
667 declare module 'dojo/router/RouterBase' {
668 type RouterBase = dojo.router.RouterBase;
668 type RouterBase = dojo.router.RouterBase;
669 const RouterBase: dojo.router.RouterBaseConstructor;
669 const RouterBase: dojo.router.RouterBaseConstructor;
670 export = RouterBase;
670 export = RouterBase;
671 }
671 }
672
672
673 declare module 'dojo/rpc/JsonpService' {
673 declare module 'dojo/rpc/JsonpService' {
674 type JsonpService<T> = dojo.rpc.JsonpService<T>;
674 type JsonpService<T> = dojo.rpc.JsonpService<T>;
675 const JsonpService: dojo.rpc.JsonpServiceConstructor;
675 const JsonpService: dojo.rpc.JsonpServiceConstructor;
676 export = JsonpService;
676 export = JsonpService;
677 }
677 }
678
678
679 declare module 'dojo/rpc/JsonService' {
679 declare module 'dojo/rpc/JsonService' {
680 type JsonService<T> = dojo.rpc.JsonService<T>;
680 type JsonService<T> = dojo.rpc.JsonService<T>;
681 const JsonService: dojo.rpc.JsonServiceConstructor;
681 const JsonService: dojo.rpc.JsonServiceConstructor;
682 export = JsonService;
682 export = JsonService;
683 }
683 }
684
684
685 declare module 'dojo/rpc/RpcService' {
685 declare module 'dojo/rpc/RpcService' {
686 type RpcService<T> = dojo.rpc.RpcService<T>;
686 type RpcService<T> = dojo.rpc.RpcService<T>;
687 const RpcService: dojo.rpc.RpcServiceConstructor;
687 const RpcService: dojo.rpc.RpcServiceConstructor;
688 export = RpcService;
688 export = RpcService;
689 }
689 }
690
690
691 declare module 'dojo/selector/_loader' {
691 declare module 'dojo/selector/_loader' {
692 const loader: dojo.selector.Loader;
692 const loader: dojo.selector.Loader;
693 export = loader;
693 export = loader;
694 }
694 }
695
695
696 declare module 'dojo/selector/_loader!' {
696 declare module 'dojo/selector/_loader!' {
697 const lite: dojo.selector.LiteQueryEnegine;
697 const lite: dojo.selector.LiteQueryEnegine;
698 export = lite;
698 export = lite;
699 }
699 }
700
700
701 declare module 'dojo/selector/_loader!acme' {
701 declare module 'dojo/selector/_loader!acme' {
702 const acme: dojo.selector.AcmeQueryEngine;
702 const acme: dojo.selector.AcmeQueryEngine;
703 export = acme;
703 export = acme;
704 }
704 }
705
705
706 declare module 'dojo/selector/_loader!lite' {
706 declare module 'dojo/selector/_loader!lite' {
707 const lite: dojo.selector.LiteQueryEnegine;
707 const lite: dojo.selector.LiteQueryEnegine;
708 export = lite;
708 export = lite;
709 }
709 }
710
710
711 declare module 'dojo/selector/acme' {
711 declare module 'dojo/selector/acme' {
712 const acme: dojo.selector.AcmeQueryEngine;
712 const acme: dojo.selector.AcmeQueryEngine;
713 export = acme;
713 export = acme;
714 }
714 }
715
715
716 declare module 'dojo/selector/lite' {
716 declare module 'dojo/selector/lite' {
717 const lite: dojo.selector.LiteQueryEnegine;
717 const lite: dojo.selector.LiteQueryEnegine;
718 export = lite;
718 export = lite;
719 }
719 }
720
720
721 declare module 'dojo/sniff' {
721 declare module 'dojo/sniff' {
722 const sniff: dojo.Has;
722 const sniff: dojo.Has;
723 export = sniff;
723 export = sniff;
724 }
724 }
725
725
726 declare module 'dojo/Stateful' {
726 declare module 'dojo/Stateful' {
727 type Stateful<T = any> = dojo.Stateful<T>;
727 type Stateful<T = any> = dojo.Stateful<T>;
728 const Stateful: dojo.StatefulConstructor;
728 const Stateful: dojo.StatefulConstructor;
729 export = Stateful;
729 export = Stateful;
730 }
730 }
731
731
732 declare module 'dojo/store/api/Store' {
732 declare module 'dojo/store/api/Store' {
733 type Store<T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions> = dojo.store.api.Store<T, Q, O>;
733 type Store<T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions> = dojo.store.api.Store<T, Q, O>;
734 const Store: dojo.store.api.StoreConstructor;
734 const Store: dojo.store.api.StoreConstructor;
735 export = Store;
735 export = Store;
736 }
736 }
737
737
738 declare module 'dojo/store/util/QueryResults' {
738 declare module 'dojo/store/util/QueryResults' {
739 const QueryResults: dojo.store.util.QueryResultsFunction;
739 const QueryResults: dojo.store.util.QueryResultsFunction;
740 export = QueryResults;
740 export = QueryResults;
741 }
741 }
742
742
743 declare module 'dojo/store/util/SimpleQueryEngine' {
743 declare module 'dojo/store/util/SimpleQueryEngine' {
744 const SimpleQueryEngine: dojo.store.util.SimpleQueryEngine;
744 const SimpleQueryEngine: dojo.store.util.SimpleQueryEngine;
745 export = SimpleQueryEngine;
745 export = SimpleQueryEngine;
746 }
746 }
747
747
748 declare module 'dojo/store/Cache' {
748 declare module 'dojo/store/Cache' {
749 const Cache: dojo.store.Cache;
749 const Cache: dojo.store.Cache;
750 export = Cache;
750 export = Cache;
751 }
751 }
752
752
753 declare module 'dojo/store/DataStore' {
753 declare module 'dojo/store/DataStore' {
754 type DataStore<T extends Object> = dojo.store.DataStore<T>;
754 type DataStore<T extends Object> = dojo.store.DataStore<T>;
755 const DataStore: dojo.store.DataStoreConstructor;
755 const DataStore: dojo.store.DataStoreConstructor;
756 export = DataStore;
756 export = DataStore;
757 }
757 }
758
758
759 declare module 'dojo/store/JsonRest' {
759 declare module 'dojo/store/JsonRest' {
760 type JsonRest<T extends object, Q extends dojo.store.api.BaseQueryType, O extends dojo.store.JsonRestQueryOptions> = dojo.store.JsonRest<T, Q, O>;
760 type JsonRest<T extends object, Q extends dojo.store.api.BaseQueryType, O extends dojo.store.JsonRestQueryOptions> = dojo.store.JsonRest<T, Q, O>;
761 const JsonRest: dojo.store.JsonRestConstructor;
761 const JsonRest: dojo.store.JsonRestConstructor;
762 export = JsonRest;
762 export = JsonRest;
763 }
763 }
764
764
765 declare module 'dojo/store/Memory' {
765 declare module 'dojo/store/Memory' {
766 type Memory<T extends Object> = dojo.store.Memory<T>;
766 type Memory<T extends Object> = dojo.store.Memory<T>;
767 const Memory: dojo.store.MemoryConstructor;
767 const Memory: dojo.store.MemoryConstructor;
768 export = Memory;
768 export = Memory;
769 }
769 }
770
770
771 declare module 'dojo/store/Observable' {
771 declare module 'dojo/store/Observable' {
772 const Observerable: dojo.store.Observable;
772 const Observerable: dojo.store.Observable;
773 export = Observerable;
773 export = Observerable;
774 }
774 }
775
775
776 declare module 'dojo/string' {
776 declare module 'dojo/string' {
777 const value: dojo.String;
777 const value: dojo.String;
778 export = value;
778 export = value;
779 }
779 }
780
780
781 declare module 'dojo/text' {
781 declare module 'dojo/text' {
782 const text: dojo.Text;
782 const text: dojo.Text;
783 export = text;
783 export = text;
784 }
784 }
785
785
786 declare module 'dojo/throttle' {
786 declare module 'dojo/throttle' {
787 const throttle: dojo.Throttle;
787 const throttle: dojo.Throttle;
788 export = throttle;
788 export = throttle;
789 }
789 }
790
790
791 declare module 'dojo/topic' {
791 declare module 'dojo/topic' {
792 const hub: dojo.Topic;
792 const hub: dojo.Topic;
793 export = hub;
793 export = hub;
794 }
794 }
795
795
796 declare module 'dojo/touch' {
796 declare module 'dojo/touch' {
797 const touch: dojo.Touch;
797 const touch: dojo.Touch;
798 export = touch;
798 export = touch;
799 }
799 }
800
800
801 declare module 'dojo/uacss' {
801 declare module 'dojo/uacss' {
802 const uacss: dojo.Has;
802 const uacss: dojo.Has;
803 export = uacss;
803 export = uacss;
804 }
804 }
805
805
806 declare module 'dojo/when' {
806 declare module 'dojo/when' {
807 const when: dojo.When;
807 const when: dojo.When;
808 export = when;
808 export = when;
809 }
809 }
810
810
811 declare module 'dojo/window' {
811 declare module 'dojo/window' {
812 const window: dojo.WindowModule;
812 const window: dojo.WindowModule;
813 export = window;
813 export = window;
814 }
814 }
815
815
816 declare module 'dojo/i18n!*' {
816 declare module 'dojo/i18n!*' {
817 const value: any;
817 const value: any;
818 export = value;
818 export = value;
819 }
819 }
820
820
821 declare module 'dojo/text!*' {
821 declare module 'dojo/text!*' {
822 const content: string;
822 const content: string;
823 export = content;
823 export = content;
824 }
824 }
@@ -1,8 +1,8
1 import "dojo/NodeList-fx";
1 import * as NodeList from "dojo/NodeList-fx";
2
2
3 declare const nl: dojo.NodeList<Node>;
3 const nl: dojo.NodeList<Node> = new NodeList();
4
4
5 const anim: dojo._base.Animation = nl.fadeIn();
5 const anim: dojo._base.Animation = nl.fadeIn();
6 const anim2: dojo._base.Animation = nl.fadeIn({duration: 500});
6 const anim2: dojo._base.Animation = nl.fadeIn({duration: 500});
7 const nl2: typeof nl = nl.fadeOut({auto: true, onEnd: () => {}});
7 const nl2: typeof nl = nl.fadeOut({auto: true, onEnd: () => {}});
8 const other = nl.fadeOut({auto: false}); No newline at end of file
8 const other = nl.fadeOut({auto: false});
@@ -1,59 +1,59
1 import * as _WidgetBase from "dijit/_WidgetBase";
1 import * as _WidgetBase from "dijit/_WidgetBase";
2 import { watch } from "./traits";
2 import { watch } from "./traits";
3
3
4 interface ScheduleWidgetAttrs {
4 interface ScheduleWidgetAttrs {
5 data: string[];
5 data: string[];
6 }
6 }
7
7
8 interface ScheduleWidgetEvents {
8 interface ScheduleWidgetEvents {
9 "scheduled": Event & {
9 "scheduled": Event & {
10 detail: {
10 detail: {
11 startDate: Date,
11 startDate: Date,
12 endDate: Date
12 endDate: Date
13 }
13 }
14 };
14 };
15 }
15 }
16
16
17 class ScheduleWidget extends _WidgetBase<ScheduleWidgetAttrs, ScheduleWidgetEvents> {
17 class ScheduleWidget extends _WidgetBase<ScheduleWidgetAttrs, ScheduleWidgetEvents> {
18 data: string[];
18 data: string[];
19
19
20 _onClick() {
20 _onClick() {
21 this.set("data", "", "");
21 this.set("data", "", "");
22
22
23 const t = this.get("title");
23 const t = this.get("title");
24 this.set({
24 this.set({
25 data: ["",""]
25 data: ["",""]
26 });
26 });
27 }
27 }
28
28
29 render(){
29 render(){
30 watch(this, "title", v => String(v) );
30 watch(this, "title", v => String(v) );
31 }
31 }
32 }
32 }
33
33
34 const w = new ScheduleWidget({title: "Year schedule", data: ["a", "b"] });
34 const w = new ScheduleWidget({title: "Year schedule", data: ["a", "b"] });
35
35
36 w.get("data");
36 w.get("data");
37
37
38 w.set("data", "a","b");
38 w.set("data", "a","b");
39 w.set({
39 w.set({
40 data: ["a", "b"]
40 data: ["a", "b"]
41 });
41 });
42
42
43 w.watch((p, o, n) => [p,o,n]);
43 w.watch((p, o, n) => [p,o,n]);
44
44
45 w.watch("data", (p, o, n) => [p,o,n]);
45 w.watch("data", (p, o, n) => [p,o,n]);
46
46
47 watch(w, "title", v => String(v) );
47 watch(w, "title", v => String(v) );
48 watch(w, "data", v => String(v) );
48 watch(w, "data", v => String(v) );
49
49
50 w.emit("scheduled", { detail: { startDate: new Date(), endDate: new Date()} });
50 w.emit("scheduled", { detail: { startDate: new Date(), endDate: new Date()} });
51
51
52 w.emit("click", {} );
52 w.emit("click", {} );
53
53
54 w.emit("click", {} );
54 w.emit("click", {} );
55
55
56 w.emit("some-extra-event", {});
56 w.emit<any>("some-extra-event", {});
57
57
58 w.on("click", e => e);
58 w.on("click", e => e);
59 w.on("some-extra-event", e => e);
59 w.on<any>("some-extra-event", e => e);
General Comments 0
You need to be logged in to leave comments. Login now