##// END OF EJS Templates
some fixes after testing
cin -
r5:af2703f9110e default
parent child
Show More
@@ -1,68 +1,70
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 = ["../main/typings/dojo/modules","../main/typings/dijit/modules"]
43 module = "ESNext"
44 it.target = "ESNext"
43 }
45 }
44 }
46 }
45
47
46 npmPackMeta {
48 npmPackMeta {
47 meta {
49 meta {
48 name = "@$npmScope/$project.name"
50 name = "@$npmScope/$project.name"
49 }
51 }
50 }
52 }
51
53
52 task npmPackTypings(type: Copy) {
54 task npmPackTypings(type: Copy) {
53 dependsOn typings
55 dependsOn typings
54
56
55 npmPackContents.dependsOn it
57 npmPackContents.dependsOn it
56
58
57 from typescript.typingsDir
59 from typescript.typingsDir
58 into npm.packageDir
60 into npm.packageDir
59 }
61 }
60
62
61 task printVersion {
63 task printVersion {
62 doLast {
64 doLast {
63 println "packageName: ${npmPackMeta.metadata.get().name}";
65 println "packageName: ${npmPackMeta.metadata.get().name}";
64 println "version: $version";
66 println "version: $version";
65 println "target: $typescript.compilerOptions.target";
67 println "target: $typescript.compilerOptions.target";
66 println "module: $typescript.compilerOptions.module";
68 println "module: $typescript.compilerOptions.module";
67 }
69 }
68 } No newline at end of file
70 }
@@ -1,2380 +1,2384
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
552 interface _WidgetBase {
556 interface _WidgetBase {
553 /**
557 /**
554 * Used across all instances a hash to cache attribute names and their getter
558 * Used across all instances a hash to cache attribute names and their getter
555 * and setter names.
559 * and setter names.
556 */
560 */
557 _attrPairNames: { [attr: string]: string };
561 _attrPairNames: { [attr: string]: string };
558
562
559 /**
563 /**
560 * Helper function for get() and set().
564 * Helper function for get() and set().
561 * Caches attribute name values so we don't do the string ops every time.
565 * Caches attribute name values so we don't do the string ops every time.
562 */
566 */
563 _getAttrNames(name: string): string;
567 _getAttrNames(name: string): string;
564
568
565 /**
569 /**
566 * Internal helper for directly changing an attribute value.
570 * Internal helper for directly changing an attribute value.
567 * This method id derived from Stateful and must not be used!
571 * This method id derived from Stateful and must not be used!
568 * @deprecated use `_set(name, value)` instead.
572 * @deprecated use `_set(name, value)` instead.
569 */
573 */
570 _changeAttrValue(name: string, value: any): this;
574 _changeAttrValue(name: string, value: any): this;
571
575
572 get<K extends keyof this & string>(name: K): this[K];
576 get<K extends keyof this>(name: K): this[K];
573
577
574 /**
578 /**
575 * Helper function to set new value for specified property, and call handlers
579 * Helper function to set new value for specified property, and call handlers
576 * registered with watch() if the value has changed.
580 * registered with watch() if the value has changed.
577 * @param name
581 * @param name
578 * @param value
582 * @param value
579 */
583 */
580 _set<K extends keyof this>(name: K, value: this[K]): void;
584 _set<K extends keyof this>(name: K, value: this[K]): void;
581
585
582 /**
586 /**
583 * Helper function to get value for specified property stored by this._set(),
587 * Helper function to get value for specified property stored by this._set(),
584 * i.e. for properties with custom setters. Used mainly by custom getters.
588 * i.e. for properties with custom setters. Used mainly by custom getters.
585 *
589 *
586 * For example, CheckBox._getValueAttr() calls this._get("value").
590 * For example, CheckBox._getValueAttr() calls this._get("value").
587 * @param name
591 * @param name
588 */
592 */
589 _get<K extends keyof this>(name: K): this[K];
593 _get<K extends keyof this>(name: K): this[K];
590
594
591 /**
595 /**
592 * Set a property on a Stateful instance
596 * Set a property on a Stateful instance
593 */
597 */
594 set<K extends keyof this & string>(name: K, value: this[K]): this;
598 set<K extends keyof this>(name: K, value: this[K]): this;
595 set<K extends { [p in keyof this]: this[p] extends any[] ? p : never; }[keyof this & string]>(name: K, ...values: this[K]): this;
599 set<K extends keyof this, V extends this[K] & any[]>(name: K, ...values: V): this;
596 set(values: Partial<this>): this;
600 set<K extends keyof this>(values: {[p in K]: this[p]}): this;
597
601
598 /**
602 /**
599 * Watches a property for changes
603 * Watches a property for changes
600 */
604 */
601 watch(callback: <K extends keyof any>(prop: K, oldValue: any, newValue: any) => void): dojo.WatchHandle;
605 watch(callback: <K extends keyof any>(prop: K, oldValue: any, newValue: any) => void): dojo.WatchHandle;
602 watch<K extends keyof this>(name: K, callback: (prop: K, oldValue: this[K], newValue: this[K]) => void): dojo.WatchHandle;
606 watch<K extends Props<this>>(name: K, callback: (prop: K, oldValue: this[K], newValue: this[K]) => void): dojo.WatchHandle;
603 }
607 }
604
608
605 type EventInitArgs<T extends Event> = {
609 type EventInitArgs<T extends Event> = {
606 [p in keyof T]?: T[p] extends (...args: any) => any ? never : T[p];
610 [p in keyof T]?: T[p] extends (...args: any) => any ? never : T[p];
607 };
611 };
608
612
609 /* dijit/_WidgetBase */
613 /* dijit/_WidgetBase */
610 interface _WidgetBase<Events extends { [name in keyof Events]: Event } = GlobalEventHandlersEventMap> extends Destroyable {
614 interface _WidgetBase<Events extends { [name in keyof Events]: Event } = GlobalEventHandlersEventMap> extends Destroyable {
611
615
612 /**
616 /**
613 * A unique, opaque ID string that can be assigned by users or by the
617 * A unique, opaque ID string that can be assigned by users or by the
614 * system. If the developer passes an ID which is known not to be
618 * system. If the developer passes an ID which is known not to be
615 * unique, the specified ID is ignored and the system-generated ID is
619 * unique, the specified ID is ignored and the system-generated ID is
616 * used instead.
620 * used instead.
617 */
621 */
618 id: string;
622 id: string;
619
623
620 /**
624 /**
621 * Rarely used. Overrides the default Dojo locale used to render this widget,
625 * Rarely used. Overrides the default Dojo locale used to render this widget,
622 * as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute.
626 * as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute.
623 * Value must be among the list of locales specified during by the Dojo bootstrap,
627 * Value must be among the list of locales specified during by the Dojo bootstrap,
624 * formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
628 * formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
625 */
629 */
626 lang: string;
630 lang: string;
627
631
628 /**
632 /**
629 * Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir)
633 * Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir)
630 * attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's
634 * attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's
631 * default direction.
635 * default direction.
632 */
636 */
633 dir: string;
637 dir: string;
634
638
635 /**
639 /**
636 * HTML class attribute
640 * HTML class attribute
637 */
641 */
638 class: string;
642 class: string;
639
643
640 /**
644 /**
641 * HTML style attributes as cssText string or name/value hash
645 * HTML style attributes as cssText string or name/value hash
642 */
646 */
643 style: string;
647 style: string;
644
648
645 /**
649 /**
646 * HTML title attribute.
650 * HTML title attribute.
647 *
651 *
648 * For form widgets this specifies a tooltip to display when hovering over
652 * For form widgets this specifies a tooltip to display when hovering over
649 * the widget (just like the native HTML title attribute).
653 * the widget (just like the native HTML title attribute).
650 *
654 *
651 * For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer,
655 * For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer,
652 * etc., it's used to specify the tab label, accordion pane title, etc. In this case it's
656 * etc., it's used to specify the tab label, accordion pane title, etc. In this case it's
653 * interpreted as HTML.
657 * interpreted as HTML.
654 */
658 */
655 title: string;
659 title: string;
656
660
657 /**
661 /**
658 * When this widget's title attribute is used to for a tab label, accordion pane title, etc.,
662 * When this widget's title attribute is used to for a tab label, accordion pane title, etc.,
659 * this specifies the tooltip to appear when the mouse is hovered over that text.
663 * this specifies the tooltip to appear when the mouse is hovered over that text.
660 */
664 */
661 tooltip: string;
665 tooltip: string;
662
666
663 /**
667 /**
664 * Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate
668 * Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate
665 * widget state.
669 * widget state.
666 */
670 */
667 baseClass: string;
671 baseClass: string;
668
672
669 /**
673 /**
670 * pointer to original DOM node
674 * pointer to original DOM node
671 */
675 */
672 srcNodeRef: HTMLElement;
676 srcNodeRef: HTMLElement;
673
677
674 /**
678 /**
675 * This is our visible representation of the widget! Other DOM
679 * This is our visible representation of the widget! Other DOM
676 * Nodes may by assigned to other properties, usually through the
680 * Nodes may by assigned to other properties, usually through the
677 * template system's data-dojo-attach-point syntax, but the domNode
681 * template system's data-dojo-attach-point syntax, but the domNode
678 * property is the canonical "top level" node in widget UI.
682 * property is the canonical "top level" node in widget UI.
679 */
683 */
680 domNode: HTMLElement;
684 domNode: HTMLElement;
681
685
682 /**
686 /**
683 * Designates where children of the source DOM node will be placed.
687 * Designates where children of the source DOM node will be placed.
684 * "Children" in this case refers to both DOM nodes and widgets.
688 * "Children" in this case refers to both DOM nodes and widgets.
685 */
689 */
686 containerNode: HTMLElement;
690 containerNode: HTMLElement;
687
691
688 /**
692 /**
689 * The document this widget belongs to. If not specified to constructor, will default to
693 * The document this widget belongs to. If not specified to constructor, will default to
690 * srcNodeRef.ownerDocument, or if no sourceRef specified, then to the document global
694 * srcNodeRef.ownerDocument, or if no sourceRef specified, then to the document global
691 */
695 */
692 ownerDocument: HTMLElement;
696 ownerDocument: HTMLElement;
693
697
694 /**
698 /**
695 * Deprecated. Instead of attributeMap, widget should have a _setXXXAttr attribute
699 * Deprecated. Instead of attributeMap, widget should have a _setXXXAttr attribute
696 * for each XXX attribute to be mapped to the DOM.
700 * for each XXX attribute to be mapped to the DOM.
697 */
701 */
698 attributeMap: { [attribute: string]: any };
702 attributeMap: { [attribute: string]: any };
699
703
700 /**
704 /**
701 * Bi-directional support, the main variable which is responsible for the direction of the text.
705 * Bi-directional support, the main variable which is responsible for the direction of the text.
702 * The text direction can be different than the GUI direction by using this parameter in creation
706 * The text direction can be different than the GUI direction by using this parameter in creation
703 * of a widget.
707 * of a widget.
704 */
708 */
705 textDir: string;
709 textDir: string;
706
710
707 _started?: boolean;
711 _started?: boolean;
708
712
709 /**
713 /**
710 * Kicks off widget instantiation. See create() for details.
714 * Kicks off widget instantiation. See create() for details.
711 */
715 */
712 postscript(params?: any, srcNodeRef?: HTMLElement): void;
716 postscript(params?: any, srcNodeRef?: HTMLElement): void;
713
717
714 /**
718 /**
715 * Kick off the life-cycle of a widget
719 * Kick off the life-cycle of a widget
716 */
720 */
717 create(params?: any, srcNodeRef?: HTMLElement): void;
721 create(params?: any, srcNodeRef?: HTMLElement): void;
718
722
719 /**
723 /**
720 * Called after the parameters to the widget have been read-in,
724 * Called after the parameters to the widget have been read-in,
721 * but before the widget template is instantiated. Especially
725 * but before the widget template is instantiated. Especially
722 * useful to set properties that are referenced in the widget
726 * useful to set properties that are referenced in the widget
723 * template.
727 * template.
724 */
728 */
725 postMixInProperties(): void;
729 postMixInProperties(): void;
726
730
727 /**
731 /**
728 * Construct the UI for this widget, setting this.domNode.
732 * Construct the UI for this widget, setting this.domNode.
729 * Most widgets will mixin `dijit._TemplatedMixin`, which implements this method.
733 * Most widgets will mixin `dijit._TemplatedMixin`, which implements this method.
730 */
734 */
731 buildRendering(): void;
735 buildRendering(): void;
732
736
733 /**
737 /**
734 * Processing after the DOM fragment is created
738 * Processing after the DOM fragment is created
735 */
739 */
736 postCreate(): void;
740 postCreate(): void;
737
741
738 /**
742 /**
739 * Processing after the DOM fragment is added to the document
743 * Processing after the DOM fragment is added to the document
740 */
744 */
741 startup(): void;
745 startup(): void;
742
746
743 /**
747 /**
744 * Destroy this widget and its descendants
748 * Destroy this widget and its descendants
745 */
749 */
746 destroyRecursive(preserveDom?: boolean): void;
750 destroyRecursive(preserveDom?: boolean): void;
747
751
748 /**
752 /**
749 * Destroys the DOM nodes associated with this widget.
753 * Destroys the DOM nodes associated with this widget.
750 */
754 */
751 destroyRendering(preserveDom?: boolean): void;
755 destroyRendering(preserveDom?: boolean): void;
752
756
753 /**
757 /**
754 * Recursively destroy the children of this widget and their
758 * Recursively destroy the children of this widget and their
755 * descendants.
759 * descendants.
756 */
760 */
757 destroyDescendants(preserveDom?: boolean): void;
761 destroyDescendants(preserveDom?: boolean): void;
758
762
759 /**
763 /**
760 * Deprecated. Override destroy() instead to implement custom widget tear-down
764 * Deprecated. Override destroy() instead to implement custom widget tear-down
761 * behavior.
765 * behavior.
762 * @deprecated
766 * @deprecated
763 */
767 */
764 uninitialize(): boolean;
768 uninitialize(): boolean;
765
769
766 /**
770 /**
767 * Used by widgets to signal that a synthetic event occurred, ex:
771 * Used by widgets to signal that a synthetic event occurred, ex:
768 * | myWidget.emit("attrmodified-selectedChildWidget", {}).
772 * | myWidget.emit("attrmodified-selectedChildWidget", {}).
769 */
773 */
770 emit<K extends keyof Events>(eventName: K, evt: EventInitArgs<Events[K]>): void;
774 emit<K extends keyof Events>(eventName: K, evt: EventInitArgs<Events[K]>): void;
771
775
772 /**
776 /**
773 * @param type
777 * @param type
774 * @param eventObj
778 * @param eventObj
775 * @param callbackArgs
779 * @param callbackArgs
776 */
780 */
777 emit<K extends string>(
781 emit<K extends string>(
778 type: K,
782 type: K,
779 eventObj?: K extends keyof Events ? EventInitArgs<Events[K]> : any,
783 eventObj?: K extends keyof Events ? EventInitArgs<Events[K]> : any,
780 callbackArgs?: any[]
784 callbackArgs?: any[]
781 ): any;
785 ): any;
782
786
783 /**
787 /**
784 * Call specified function when event occurs, ex: myWidget.on("click", function(){ ... }).
788 * Call specified function when event occurs, ex: myWidget.on("click", function(){ ... }).
785 */
789 */
786 on<K extends keyof Events>(eventName: K, cb: (evt: Events[K]) => void): dojo.WatchHandle;
790 on<K extends keyof Events>(eventName: K, cb: (evt: Events[K]) => void): dojo.WatchHandle;
787
791
788 on(type: string | dojo.ExtensionEvent, func: dojo.EventListener | Function): dojo.WatchHandle;
792 on(type: string | dojo.ExtensionEvent, func: dojo.EventListener | Function): dojo.WatchHandle;
789
793
790 /**
794 /**
791 * Returns a string that represents the widget.
795 * Returns a string that represents the widget.
792 */
796 */
793 toString(): string;
797 toString(): string;
794
798
795 /**
799 /**
796 * Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent
800 * Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent
797 * is this widget. Note that it does not return all descendants, but rather just direct children.
801 * is this widget. Note that it does not return all descendants, but rather just direct children.
798 */
802 */
799 getChildren<T extends _WidgetBase>(): T[];
803 getChildren<T extends _WidgetBase>(): T[];
800
804
801 /**
805 /**
802 * Returns the parent widget of this widget.
806 * Returns the parent widget of this widget.
803 */
807 */
804 getParent<T extends _WidgetBase>(): T;
808 getParent<T extends _WidgetBase>(): T;
805
809
806 /**
810 /**
807 * Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.
811 * Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.
808 * @deprecated
812 * @deprecated
809 */
813 */
810 connect(obj: any, event: string | dojo.ExtensionEvent, method: string | dojo.EventListener): dojo.WatchHandle;
814 connect(obj: any, event: string | dojo.ExtensionEvent, method: string | dojo.EventListener): dojo.WatchHandle;
811
815
812 /**
816 /**
813 * Deprecated, will be removed in 2.0, use handle.remove() instead.
817 * Deprecated, will be removed in 2.0, use handle.remove() instead.
814 * @deprecated
818 * @deprecated
815 */
819 */
816 disconnect(handle: dojo.WatchHandle): void;
820 disconnect(handle: dojo.WatchHandle): void;
817
821
818 /**
822 /**
819 * Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.
823 * Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.
820 * @deprecated
824 * @deprecated
821 */
825 */
822 subscribe(t: string, method: dojo.EventListener): dojo.WatchHandle;
826 subscribe(t: string, method: dojo.EventListener): dojo.WatchHandle;
823
827
824 /**
828 /**
825 * Deprecated, will be removed in 2.0, use handle.remove() instead.
829 * Deprecated, will be removed in 2.0, use handle.remove() instead.
826 * @deprecated
830 * @deprecated
827 */
831 */
828 unsubscribe(handle: dojo.WatchHandle): void;
832 unsubscribe(handle: dojo.WatchHandle): void;
829
833
830 /**
834 /**
831 * Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
835 * Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
832 */
836 */
833 isLeftToRight(): boolean;
837 isLeftToRight(): boolean;
834
838
835 /**
839 /**
836 * Return true if this widget can currently be focused
840 * Return true if this widget can currently be focused
837 * and false if not
841 * and false if not
838 */
842 */
839 isFocusable(): boolean;
843 isFocusable(): boolean;
840
844
841 /**
845 /**
842 * Place this widget somewhere in the DOM based
846 * Place this widget somewhere in the DOM based
843 * on standard domConstruct.place() conventions.
847 * on standard domConstruct.place() conventions.
844 */
848 */
845 placeAt<T extends _WidgetBase>(reference: dojo.NodeFragmentOrString | T, position?: string | number): this;
849 placeAt<T extends _WidgetBase>(reference: dojo.NodeFragmentOrString | T, position?: string | number): this;
846
850
847 /**
851 /**
848 * Wrapper to setTimeout to avoid deferred functions executing
852 * Wrapper to setTimeout to avoid deferred functions executing
849 * after the originating widget has been destroyed.
853 * after the originating widget has been destroyed.
850 * Returns an object handle with a remove method (that returns null) (replaces clearTimeout).
854 * Returns an object handle with a remove method (that returns null) (replaces clearTimeout).
851 */
855 */
852 defer(fcn: Function, delay?: number): dojo.Handle;
856 defer(fcn: Function, delay?: number): dojo.Handle;
853 }
857 }
854
858
855 interface _WidgetBaseConstructor<W> extends Pick<dojo._base.DeclareConstructor<W>, Exclude<keyof dojo._base.DeclareConstructor<W>, 'new'>> {
859 interface _WidgetBaseConstructor<W> extends Pick<dojo._base.DeclareConstructor<W>, Exclude<keyof dojo._base.DeclareConstructor<W>, 'new'>> {
856 new(params?: Partial<W> & ThisType<W>, srcNodeRef?: dojo.NodeOrString): W & dojo._base.DeclareCreatedObject;
860 new(params?: Partial<W> & ThisType<W>, srcNodeRef?: dojo.NodeOrString): W & dojo._base.DeclareCreatedObject;
857 }
861 }
858
862
859 /* dijit/_WidgetsInTemplateMixin */
863 /* dijit/_WidgetsInTemplateMixin */
860
864
861 interface _WidgetsInTemplateMixin {
865 interface _WidgetsInTemplateMixin {
862 /**
866 /**
863 * Used to provide a context require to dojo/parser in order to be
867 * Used to provide a context require to dojo/parser in order to be
864 * able to use relative MIDs (e.g. `./Widget`) in the widget's template.
868 * able to use relative MIDs (e.g. `./Widget`) in the widget's template.
865 */
869 */
866 contextRequire: Function;
870 contextRequire: Function;
867
871
868 startup(): void;
872 startup(): void;
869 }
873 }
870
874
871 interface _WidgetsInTemplateMixinConstructor extends dojo._base.DeclareConstructor<_WidgetsInTemplateMixin> {
875 interface _WidgetsInTemplateMixinConstructor extends dojo._base.DeclareConstructor<_WidgetsInTemplateMixin> {
872 new(params: Object, srcNodeRef: dojo.NodeOrString): _WidgetsInTemplateMixin;
876 new(params: Object, srcNodeRef: dojo.NodeOrString): _WidgetsInTemplateMixin;
873 }
877 }
874
878
875 /* dijit/a11yclick */
879 /* dijit/a11yclick */
876
880
877 interface A11yClick {
881 interface A11yClick {
878
882
879 /**
883 /**
880 * Custom press, release, and click synthetic events
884 * Custom press, release, and click synthetic events
881 * which trigger on a left mouse click, touch, or space/enter keyup.
885 * which trigger on a left mouse click, touch, or space/enter keyup.
882 */
886 */
883 (node: HTMLElement, listener: Function): dojo.Handle;
887 (node: HTMLElement, listener: Function): dojo.Handle;
884
888
885 /**
889 /**
886 * Mousedown (left button), touchstart, or keydown (space or enter) corresponding to logical click operation.
890 * Mousedown (left button), touchstart, or keydown (space or enter) corresponding to logical click operation.
887 */
891 */
888 press: dojo.ExtensionEvent;
892 press: dojo.ExtensionEvent;
889
893
890 /**
894 /**
891 * Mouseup (left button), touchend, or keyup (space or enter) corresponding to logical click operation.
895 * Mouseup (left button), touchend, or keyup (space or enter) corresponding to logical click operation.
892 */
896 */
893 release: dojo.ExtensionEvent;
897 release: dojo.ExtensionEvent;
894
898
895 /**
899 /**
896 * Mouse cursor or a finger is dragged over the given node.
900 * Mouse cursor or a finger is dragged over the given node.
897 */
901 */
898 move: dojo.ExtensionEvent;
902 move: dojo.ExtensionEvent;
899 }
903 }
900
904
901 /* dijit/Calendar */
905 /* dijit/Calendar */
902
906
903 interface _MonthDropDownButton extends form.DropDownButton<_MonthDropDown> {
907 interface _MonthDropDownButton extends form.DropDownButton<_MonthDropDown> {
904 onMonthSelect(): void;
908 onMonthSelect(): void;
905 postCreate(): void;
909 postCreate(): void;
906
910
907 //set(name: 'month', value: number): this;
911 //set(name: 'month', value: number): this;
908 //set(name: string, value: any): this;
912 //set(name: string, value: any): this;
909 //set(values: Object): this;
913 //set(values: Object): this;
910 }
914 }
911
915
912 interface _MonthDropDownButtonConstructor extends _WidgetBaseConstructor<_MonthDropDownButton> { }
916 interface _MonthDropDownButtonConstructor extends _WidgetBaseConstructor<_MonthDropDownButton> { }
913
917
914 interface _MonthDropDown extends _Widget, _TemplatedMixin, _CssStateMixin {
918 interface _MonthDropDown extends _Widget, _TemplatedMixin, _CssStateMixin {
915 months: string[];
919 months: string[];
916 baseClass: string;
920 baseClass: string;
917 templateString: string;
921 templateString: string;
918
922
919 /**
923 /**
920 * Callback when month is selected from drop down
924 * Callback when month is selected from drop down
921 */
925 */
922 onChange(month: number): void;
926 onChange(month: number): void;
923
927
924 //set(name: 'months', value: string[]): this;
928 //set(name: 'months', value: string[]): this;
925 //set(name: string, value: any): this;
929 //set(name: string, value: any): this;
926 //set(values: Object): this;
930 //set(values: Object): this;
927 }
931 }
928
932
929 interface _MonthDropDownConstructor extends _WidgetBaseConstructor<_MonthDropDown> { }
933 interface _MonthDropDownConstructor extends _WidgetBaseConstructor<_MonthDropDown> { }
930
934
931 interface Calendar extends CalendarLite, _Widget, _CssStateMixin {
935 interface Calendar extends CalendarLite, _Widget, _CssStateMixin {
932
936
933 baseClass: string;
937 baseClass: string;
934
938
935 /**
939 /**
936 * Set node classes for various mouse events, see dijit._CssStateMixin for more details
940 * Set node classes for various mouse events, see dijit._CssStateMixin for more details
937 */
941 */
938 cssStateNodes: CSSStateNodes;
942 cssStateNodes: CSSStateNodes;
939
943
940 /**
944 /**
941 * Creates the drop down button that displays the current month and lets user pick a new one
945 * Creates the drop down button that displays the current month and lets user pick a new one
942 */
946 */
943 _createMonthWidget(): _MonthDropDownButton;
947 _createMonthWidget(): _MonthDropDownButton;
944
948
945 postCreate(): void;
949 postCreate(): void;
946
950
947 /**
951 /**
948 * Handler for when user selects a month from the drop down list
952 * Handler for when user selects a month from the drop down list
949 */
953 */
950 _onMonthSelect(newMonth: number): void;
954 _onMonthSelect(newMonth: number): void;
951
955
952 /**
956 /**
953 * Handler for mouse over events on days, sets hovered style
957 * Handler for mouse over events on days, sets hovered style
954 */
958 */
955 _onDayMouseOver(evt: MouseEvent): void;
959 _onDayMouseOver(evt: MouseEvent): void;
956
960
957 /**
961 /**
958 * Handler for mouse out events on days, clears hovered style
962 * Handler for mouse out events on days, clears hovered style
959 */
963 */
960 _onDayMouseOut(evt: MouseEvent): void;
964 _onDayMouseOut(evt: MouseEvent): void;
961 _onDayMouseDown(evt: MouseEvent): void;
965 _onDayMouseDown(evt: MouseEvent): void;
962 _onDayMouseUp(evt: MouseEvent): void;
966 _onDayMouseUp(evt: MouseEvent): void;
963
967
964 /**
968 /**
965 * Provides keyboard navigation of calendar.
969 * Provides keyboard navigation of calendar.
966 */
970 */
967 handleKey(evt: KeyboardEvent): void;
971 handleKey(evt: KeyboardEvent): void;
968
972
969 /**
973 /**
970 * For handling keydown events on a stand alone calendar
974 * For handling keydown events on a stand alone calendar
971 */
975 */
972 _onKeyDown(evt: KeyboardEvent): void;
976 _onKeyDown(evt: KeyboardEvent): void;
973
977
974 /**
978 /**
975 * Deprecated. Notification that a date cell was selected. It may be the same as the previous value.
979 * Deprecated. Notification that a date cell was selected. It may be the same as the previous value.
976 */
980 */
977 onValueSelected(date: Date): void;
981 onValueSelected(date: Date): void;
978
982
979 onChange(date: Date): void;
983 onChange(date: Date): void;
980
984
981 /**
985 /**
982 * May be overridden to return CSS classes to associate with the date entry for the given dateObject
986 * May be overridden to return CSS classes to associate with the date entry for the given dateObject
983 * for example to indicate a holiday in specified locale.
987 * for example to indicate a holiday in specified locale.
984 */
988 */
985 getClassForDate(dateObject: Date, locale?: string): string;
989 getClassForDate(dateObject: Date, locale?: string): string;
986
990
987 // get(name: 'value'): Date;
991 // get(name: 'value'): Date;
988 // get(name: string): any;
992 // get(name: string): any;
989
993
990 // set(name: 'value', value: number | Date): this;
994 // set(name: 'value', value: number | Date): this;
991 // set(name: string, value: any): this;
995 // set(name: string, value: any): this;
992 // set(values: Object): this;
996 // set(values: Object): this;
993 }
997 }
994
998
995 interface CalendarConstructor extends _WidgetBaseConstructor<Calendar> {
999 interface CalendarConstructor extends _WidgetBaseConstructor<Calendar> {
996 _MonthWidget: _MonthWidgetConstructor;
1000 _MonthWidget: _MonthWidgetConstructor;
997 _MonthDropDown: _MonthDropDownButtonConstructor;
1001 _MonthDropDown: _MonthDropDownButtonConstructor;
998 _MonthDropDownButton: _MonthDropDownButtonConstructor;
1002 _MonthDropDownButton: _MonthDropDownButtonConstructor;
999 }
1003 }
1000
1004
1001 /* dijit/CalendarLite */
1005 /* dijit/CalendarLite */
1002
1006
1003 interface _MonthWidget extends _WidgetBase {
1007 interface _MonthWidget extends _WidgetBase {
1004 // set(name: 'month', value: Date): this;
1008 // set(name: 'month', value: Date): this;
1005 // set(name: string, value: any): this;
1009 // set(name: string, value: any): this;
1006 // set(values: Object): this;
1010 // set(values: Object): this;
1007 }
1011 }
1008
1012
1009 interface _MonthWidgetConstructor extends _WidgetBaseConstructor<_MonthWidget> { }
1013 interface _MonthWidgetConstructor extends _WidgetBaseConstructor<_MonthWidget> { }
1010
1014
1011 interface CalendarLite extends _WidgetBase, _TemplatedMixin {
1015 interface CalendarLite extends _WidgetBase, _TemplatedMixin {
1012 /**
1016 /**
1013 * Template for main calendar
1017 * Template for main calendar
1014 */
1018 */
1015 templateString: string;
1019 templateString: string;
1016
1020
1017 /**
1021 /**
1018 * Template for cell for a day of the week (ex: M)
1022 * Template for cell for a day of the week (ex: M)
1019 */
1023 */
1020 dowTemplateString: string;
1024 dowTemplateString: string;
1021
1025
1022 dateTemplateString: string;
1026 dateTemplateString: string;
1023 weekTemplateString: string;
1027 weekTemplateString: string;
1024
1028
1025 /**
1029 /**
1026 * The currently selected Date, initially set to invalid date to indicate no selection.
1030 * The currently selected Date, initially set to invalid date to indicate no selection.
1027 */
1031 */
1028 value: Date;
1032 value: Date;
1029
1033
1030 /**
1034 /**
1031 * JavaScript namespace to find calendar routines. If unspecified, uses Gregorian calendar routines
1035 * JavaScript namespace to find calendar routines. If unspecified, uses Gregorian calendar routines
1032 * at dojo/date and dojo/date/locale.
1036 * at dojo/date and dojo/date/locale.
1033 */
1037 */
1034 datePackage: string;
1038 datePackage: string;
1035
1039
1036 /**
1040 /**
1037 * How to represent the days of the week in the calendar header. See locale
1041 * How to represent the days of the week in the calendar header. See locale
1038 */
1042 */
1039 dayWidth: string;
1043 dayWidth: string;
1040
1044
1041 /**
1045 /**
1042 * Order fields are traversed when user hits the tab key
1046 * Order fields are traversed when user hits the tab key
1043 */
1047 */
1044 tabIndex: string;
1048 tabIndex: string;
1045
1049
1046 /**
1050 /**
1047 * (Optional) The first day of week override. By default the first day of week is determined
1051 * (Optional) The first day of week override. By default the first day of week is determined
1048 * for the current locale (extracted from the CLDR).
1052 * for the current locale (extracted from the CLDR).
1049 * Special value -1 (default value), means use locale dependent value.
1053 * Special value -1 (default value), means use locale dependent value.
1050 */
1054 */
1051 dayOffset: number;
1055 dayOffset: number;
1052
1056
1053 /**
1057 /**
1054 * Date object containing the currently focused date, or the date which would be focused
1058 * Date object containing the currently focused date, or the date which would be focused
1055 * if the calendar itself was focused. Also indicates which year and month to display,
1059 * if the calendar itself was focused. Also indicates which year and month to display,
1056 * i.e. the current "page" the calendar is on.
1060 * i.e. the current "page" the calendar is on.
1057 */
1061 */
1058 currentFocus: Date;
1062 currentFocus: Date;
1059
1063
1060 /**
1064 /**
1061 * Put the summary to the node with role=grid
1065 * Put the summary to the node with role=grid
1062 */
1066 */
1063 _setSummaryAttr: string;
1067 _setSummaryAttr: string;
1064
1068
1065 baseClass: string;
1069 baseClass: string;
1066
1070
1067 /**
1071 /**
1068 * Runs various tests on the value, checking that it's a valid date, rather
1072 * Runs various tests on the value, checking that it's a valid date, rather
1069 * than blank or NaN.
1073 * than blank or NaN.
1070 */
1074 */
1071 _isValidDate(value: Date): boolean;
1075 _isValidDate(value: Date): boolean;
1072
1076
1073 /**
1077 /**
1074 * Convert Number into Date, or copy Date object. Then, round to nearest day,
1078 * Convert Number into Date, or copy Date object. Then, round to nearest day,
1075 * setting to 1am to avoid issues when DST shift occurs at midnight, see #8521, #9366)
1079 * setting to 1am to avoid issues when DST shift occurs at midnight, see #8521, #9366)
1076 */
1080 */
1077 _patchDate(value: number | Date): Date;
1081 _patchDate(value: number | Date): Date;
1078
1082
1079 /**
1083 /**
1080 * This just sets the content of node to the specified text.
1084 * This just sets the content of node to the specified text.
1081 * Can't do "node.innerHTML=text" because of an IE bug w/tables, see #3434.
1085 * Can't do "node.innerHTML=text" because of an IE bug w/tables, see #3434.
1082 */
1086 */
1083 _setText(node: HTMLElement, text?: string): void;
1087 _setText(node: HTMLElement, text?: string): void;
1084
1088
1085 /**
1089 /**
1086 * Fills in the calendar grid with each day (1-31).
1090 * Fills in the calendar grid with each day (1-31).
1087 * Call this on creation, when moving to a new month.
1091 * Call this on creation, when moving to a new month.
1088 */
1092 */
1089 _populateGrid(): void;
1093 _populateGrid(): void;
1090
1094
1091 /**
1095 /**
1092 * Fill in localized month, and prev/current/next years
1096 * Fill in localized month, and prev/current/next years
1093 */
1097 */
1094 _populateControls(): void;
1098 _populateControls(): void;
1095
1099
1096 /**
1100 /**
1097 * Sets calendar's value to today's date
1101 * Sets calendar's value to today's date
1098 */
1102 */
1099 goToToday(): void;
1103 goToToday(): void;
1100
1104
1101 /**
1105 /**
1102 * Creates the drop down button that displays the current month and lets user pick a new one
1106 * Creates the drop down button that displays the current month and lets user pick a new one
1103 */
1107 */
1104 _createMonthWidget(): void;
1108 _createMonthWidget(): void;
1105
1109
1106 buildRendering(): void;
1110 buildRendering(): void;
1107 postCreate(): void;
1111 postCreate(): void;
1108
1112
1109 /**
1113 /**
1110 * Set up connects for increment/decrement of months/years
1114 * Set up connects for increment/decrement of months/years
1111 */
1115 */
1112 _connectControls(): void;
1116 _connectControls(): void;
1113
1117
1114 /**
1118 /**
1115 * If the calendar currently has focus, then focuses specified date,
1119 * If the calendar currently has focus, then focuses specified date,
1116 * changing the currently displayed month/year if necessary.
1120 * changing the currently displayed month/year if necessary.
1117 * If the calendar doesn't have focus, updates currently
1121 * If the calendar doesn't have focus, updates currently
1118 * displayed month/year, and sets the cell that will get focus
1122 * displayed month/year, and sets the cell that will get focus
1119 * when Calendar is focused.
1123 * when Calendar is focused.
1120 */
1124 */
1121 _setCurrentFocusAttr(date: Date, forceFocus?: boolean): void;
1125 _setCurrentFocusAttr(date: Date, forceFocus?: boolean): void;
1122
1126
1123 /**
1127 /**
1124 * Focus the calendar by focusing one of the calendar cells
1128 * Focus the calendar by focusing one of the calendar cells
1125 */
1129 */
1126 focus(): void;
1130 focus(): void;
1127
1131
1128 /**
1132 /**
1129 * Handler for day clicks, selects the date if appropriate
1133 * Handler for day clicks, selects the date if appropriate
1130 */
1134 */
1131 _onDayClick(evt: MouseEvent): void;
1135 _onDayClick(evt: MouseEvent): void;
1132
1136
1133 /**
1137 /**
1134 * Returns the cell corresponding to the date, or null if the date is not within the currently
1138 * Returns the cell corresponding to the date, or null if the date is not within the currently
1135 * displayed month.
1139 * displayed month.
1136 */
1140 */
1137 _getNodeByDate(value: Date): HTMLElement;
1141 _getNodeByDate(value: Date): HTMLElement;
1138
1142
1139 /**
1143 /**
1140 * Marks the specified cells as selected, and clears cells previously marked as selected.
1144 * Marks the specified cells as selected, and clears cells previously marked as selected.
1141 * For CalendarLite at most one cell is selected at any point, but this allows an array
1145 * For CalendarLite at most one cell is selected at any point, but this allows an array
1142 * for easy subclassing.
1146 * for easy subclassing.
1143 */
1147 */
1144 _markSelectedDates(dates: Date[]): void;
1148 _markSelectedDates(dates: Date[]): void;
1145
1149
1146 /**
1150 /**
1147 * Called only when the selected date has changed
1151 * Called only when the selected date has changed
1148 */
1152 */
1149 onChange(date: Date): void;
1153 onChange(date: Date): void;
1150
1154
1151 /**
1155 /**
1152 * May be overridden to disable certain dates in the calendar e.g. `isDisabledDate=dojo.date.locale.isWeekend`
1156 * May be overridden to disable certain dates in the calendar e.g. `isDisabledDate=dojo.date.locale.isWeekend`
1153 */
1157 */
1154 isDisabledDate(dateObject: Date, locale?: string): boolean;
1158 isDisabledDate(dateObject: Date, locale?: string): boolean;
1155
1159
1156 /**
1160 /**
1157 * May be overridden to return CSS classes to associate with the date entry for the given dateObject,
1161 * May be overridden to return CSS classes to associate with the date entry for the given dateObject,
1158 * for example to indicate a holiday in specified locale.
1162 * for example to indicate a holiday in specified locale.
1159 */
1163 */
1160 getClassForDate(dateObject: Date, locale?: string): string;
1164 getClassForDate(dateObject: Date, locale?: string): string;
1161
1165
1162 // get(name: 'value'): Date;
1166 // get(name: 'value'): Date;
1163 // get(name: string): any;
1167 // get(name: string): any;
1164
1168
1165 // set(name: 'value', value: number | Date): this;
1169 // set(name: 'value', value: number | Date): this;
1166 // set(name: string, value: any): this;
1170 // set(name: string, value: any): this;
1167 // set(values: Object): this;
1171 // set(values: Object): this;
1168 }
1172 }
1169
1173
1170 interface CalendarLiteConstructor extends _WidgetBaseConstructor<CalendarLite> {
1174 interface CalendarLiteConstructor extends _WidgetBaseConstructor<CalendarLite> {
1171 _MonthWidget: _MonthWidgetConstructor;
1175 _MonthWidget: _MonthWidgetConstructor;
1172 }
1176 }
1173
1177
1174 /* dijit/Destroyable */
1178 /* dijit/Destroyable */
1175
1179
1176 interface Destroyable {
1180 interface Destroyable {
1177 _destroyed?: true;
1181 _destroyed?: true;
1178
1182
1179 /**
1183 /**
1180 * Destroy this class, releasing any resources registered via own().
1184 * Destroy this class, releasing any resources registered via own().
1181 */
1185 */
1182 destroy(preserveDom?: boolean): void;
1186 destroy(preserveDom?: boolean): void;
1183
1187
1184 /**
1188 /**
1185 * Track specified handles and remove/destroy them when this instance is destroyed, unless they were
1189 * Track specified handles and remove/destroy them when this instance is destroyed, unless they were
1186 * already removed/destroyed manually.
1190 * already removed/destroyed manually.
1187 */
1191 */
1188 own(...args: any[]): any[];
1192 own(...args: any[]): any[];
1189 }
1193 }
1190
1194
1191 /**
1195 /**
1192 * Mixin to track handles and release them when instance is destroyed.
1196 * Mixin to track handles and release them when instance is destroyed.
1193 */
1197 */
1194 interface DestroyableConstructor extends dojo._base.DeclareConstructor<Destroyable> { }
1198 interface DestroyableConstructor extends dojo._base.DeclareConstructor<Destroyable> { }
1195
1199
1196 /** dijit/_KeyNavMixin */
1200 /** dijit/_KeyNavMixin */
1197
1201
1198 /**
1202 /**
1199 * A mixin to allow arrow key and letter key navigation of child or descendant widgets.
1203 * A mixin to allow arrow key and letter key navigation of child or descendant widgets.
1200 * It can be used by dijit/_Container based widgets with a flat list of children, or more complex widgets like dijit/Tree.
1204 * It can be used by dijit/_Container based widgets with a flat list of children, or more complex widgets like dijit/Tree.
1201 *
1205 *
1202 * To use this mixin, the subclass must:
1206 * To use this mixin, the subclass must:
1203 *
1207 *
1204 * - 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.
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.
1205 * - Set all descendants' initial tabIndex to "-1"; both initial descendants and any descendants added later, by for example addChild()
1209 * - Set all descendants' initial tabIndex to "-1"; both initial descendants and any descendants added later, by for example addChild()
1206 * - Define childSelector to a function or string that identifies focusable descendant widgets
1210 * - Define childSelector to a function or string that identifies focusable descendant widgets
1207 *
1211 *
1208 * Also, child widgets must implement a focus() method.
1212 * Also, child widgets must implement a focus() method.
1209 */
1213 */
1210 interface _KeyNavMixin extends _FocusMixin {
1214 interface _KeyNavMixin extends _FocusMixin {
1211 /**
1215 /**
1212 * Tab index of the container; same as HTML tabIndex attribute.
1216 * Tab index of the container; same as HTML tabIndex attribute.
1213 * Note then when user tabs into the container, focus is immediately moved to the first item in the container.
1217 * Note then when user tabs into the container, focus is immediately moved to the first item in the container.
1214 */
1218 */
1215 tabIndex: string;
1219 tabIndex: string;
1216
1220
1217 /**
1221 /**
1218 * 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.
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.
1219 */
1223 */
1220 childSelector: string | Function | null;
1224 childSelector: string | Function | null;
1221
1225
1222 /**
1226 /**
1223 * Called on left arrow key, or right arrow key if widget is in RTL mode.
1227 * Called on left arrow key, or right arrow key if widget is in RTL mode.
1224 * Should go back to the previous child in horizontal container widgets like Toolbar.
1228 * Should go back to the previous child in horizontal container widgets like Toolbar.
1225 */
1229 */
1226 _onLeftArrow(evt?: KeyboardEvent): void;
1230 _onLeftArrow(evt?: KeyboardEvent): void;
1227
1231
1228 /**
1232 /**
1229 * Called on right arrow key, or left arrow key if widget is in RTL mode.
1233 * Called on right arrow key, or left arrow key if widget is in RTL mode.
1230 * Should go to the next child in horizontal container widgets like Toolbar.
1234 * Should go to the next child in horizontal container widgets like Toolbar.
1231 */
1235 */
1232 _onRightArrow(evt?: KeyboardEvent): void;
1236 _onRightArrow(evt?: KeyboardEvent): void;
1233
1237
1234 /**
1238 /**
1235 * Called on up arrow key. Should go to the previous child in vertical container widgets like Menu.
1239 * Called on up arrow key. Should go to the previous child in vertical container widgets like Menu.
1236 */
1240 */
1237 _onUpArrow(evt?: KeyboardEvent): void;
1241 _onUpArrow(evt?: KeyboardEvent): void;
1238
1242
1239 /**
1243 /**
1240 * Called on down arrow key. Should go to the next child in vertical container widgets like Menu.
1244 * Called on down arrow key. Should go to the next child in vertical container widgets like Menu.
1241 */
1245 */
1242 _onDownArrow(evt?: KeyboardEvent): void;
1246 _onDownArrow(evt?: KeyboardEvent): void;
1243
1247
1244 /**
1248 /**
1245 * Default focus() implementation: focus the first child.
1249 * Default focus() implementation: focus the first child.
1246 */
1250 */
1247 focus(): void;
1251 focus(): void;
1248
1252
1249 /**
1253 /**
1250 * Returns first child that can be focused.
1254 * Returns first child that can be focused.
1251 */
1255 */
1252 _getFirstFocusableChild(): _WidgetBase;
1256 _getFirstFocusableChild(): _WidgetBase;
1253
1257
1254 /**
1258 /**
1255 * Returns last child that can be focused.
1259 * Returns last child that can be focused.
1256 */
1260 */
1257 _getLastFocusableChild(): _WidgetBase;
1261 _getLastFocusableChild(): _WidgetBase;
1258
1262
1259 /**
1263 /**
1260 * Focus the first focusable child in the container.
1264 * Focus the first focusable child in the container.
1261 */
1265 */
1262 focusFirstChild(): void;
1266 focusFirstChild(): void;
1263
1267
1264 /**
1268 /**
1265 * Focus the last focusable child in the container.
1269 * Focus the last focusable child in the container.
1266 */
1270 */
1267 focusLastChild(): void;
1271 focusLastChild(): void;
1268
1272
1269 /**
1273 /**
1270 * Focus specified child widget.
1274 * Focus specified child widget.
1271 *
1275 *
1272 * @param widget Reference to container's child widget
1276 * @param widget Reference to container's child widget
1273 * @param last If true and if widget has multiple focusable nodes, focus the last one instead of the first one
1277 * @param last If true and if widget has multiple focusable nodes, focus the last one instead of the first one
1274 */
1278 */
1275 focusChild(widget: _WidgetBase, last?: boolean): void;
1279 focusChild(widget: _WidgetBase, last?: boolean): void;
1276
1280
1277 /**
1281 /**
1278 * Handler for when the container itself gets focus.
1282 * Handler for when the container itself gets focus.
1279 *
1283 *
1280 * Initially the container itself has a tabIndex, but when it gets focus, switch focus to first child.
1284 * Initially the container itself has a tabIndex, but when it gets focus, switch focus to first child.
1281 */
1285 */
1282 _onContainerFocus(evt: Event): void;
1286 _onContainerFocus(evt: Event): void;
1283
1287
1284 /**
1288 /**
1285 * Called when a child widget gets focus, either by user clicking it, or programatically by arrow key handling code.
1289 * Called when a child widget gets focus, either by user clicking it, or programatically by arrow key handling code.
1286 *
1290 *
1287 * It marks that the current node is the selected one, and the previously selected node no longer is.
1291 * It marks that the current node is the selected one, and the previously selected node no longer is.
1288 */
1292 */
1289 _onChildFocus(child?: _WidgetBase): void;
1293 _onChildFocus(child?: _WidgetBase): void;
1290
1294
1291 _searchString: string;
1295 _searchString: string;
1292
1296
1293 multiCharSearchDuration: number;
1297 multiCharSearchDuration: number;
1294
1298
1295 /**
1299 /**
1296 * When a key is pressed that matches a child item, this method is called so that a widget can take appropriate action is necessary.
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.
1297 */
1301 */
1298 onKeyboardSearch(tem: _WidgetBase, evt: Event, searchString: string, numMatches: number): void;
1302 onKeyboardSearch(tem: _WidgetBase, evt: Event, searchString: string, numMatches: number): void;
1299
1303
1300 /**
1304 /**
1301 * Compares the searchString to the widget's text label, returning:
1305 * Compares the searchString to the widget's text label, returning:
1302 *
1306 *
1303 * * -1: a high priority match and stop searching
1307 * * -1: a high priority match and stop searching
1304 * * 0: not a match
1308 * * 0: not a match
1305 * * 1: a match but keep looking for a higher priority match
1309 * * 1: a match but keep looking for a higher priority match
1306 */
1310 */
1307 _keyboardSearchCompare(item: _WidgetBase, searchString: string): -1 | 0 | 1;
1311 _keyboardSearchCompare(item: _WidgetBase, searchString: string): -1 | 0 | 1;
1308
1312
1309 /**
1313 /**
1310 * When a key is pressed, if it's an arrow key etc. then it's handled here.
1314 * When a key is pressed, if it's an arrow key etc. then it's handled here.
1311 */
1315 */
1312 _onContainerKeydown(evt: Event): void;
1316 _onContainerKeydown(evt: Event): void;
1313
1317
1314 /**
1318 /**
1315 * When a printable key is pressed, it's handled here, searching by letter.
1319 * When a printable key is pressed, it's handled here, searching by letter.
1316 */
1320 */
1317 _onContainerKeypress(evt: Event): void;
1321 _onContainerKeypress(evt: Event): void;
1318
1322
1319 /**
1323 /**
1320 * Perform a search of the widget's options based on the user's keyboard activity
1324 * Perform a search of the widget's options based on the user's keyboard activity
1321 *
1325 *
1322 * 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.
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.
1323 */
1327 */
1324 _keyboardSearch(evt: Event, keyChar: string): void;
1328 _keyboardSearch(evt: Event, keyChar: string): void;
1325
1329
1326 /**
1330 /**
1327 * Called when focus leaves a child widget to go to a sibling widget.
1331 * Called when focus leaves a child widget to go to a sibling widget.
1328 */
1332 */
1329 _onChildBlur(widget: _WidgetBase): void;
1333 _onChildBlur(widget: _WidgetBase): void;
1330
1334
1331 /**
1335 /**
1332 * Returns the next or previous focusable descendant, compared to "child".
1336 * Returns the next or previous focusable descendant, compared to "child".
1333 * Implements and extends _KeyNavMixin._getNextFocusableChild() for a _Container.
1337 * Implements and extends _KeyNavMixin._getNextFocusableChild() for a _Container.
1334 */
1338 */
1335 _getNextFocusableChild(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
1339 _getNextFocusableChild(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
1336
1340
1337 /**
1341 /**
1338 * Returns the first child.
1342 * Returns the first child.
1339 */
1343 */
1340 _getFirst(): _WidgetBase | null;
1344 _getFirst(): _WidgetBase | null;
1341
1345
1342 /**
1346 /**
1343 * Returns the last descendant.
1347 * Returns the last descendant.
1344 */
1348 */
1345 _getLast(): _WidgetBase | null;
1349 _getLast(): _WidgetBase | null;
1346
1350
1347 /**
1351 /**
1348 * Returns the next descendant, compared to "child".
1352 * Returns the next descendant, compared to "child".
1349 */
1353 */
1350 _getNext(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
1354 _getNext(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
1351 }
1355 }
1352
1356
1353 interface _KeyNavMixinConstructor extends dojo._base.DeclareConstructor<_KeyNavMixin> { }
1357 interface _KeyNavMixinConstructor extends dojo._base.DeclareConstructor<_KeyNavMixin> { }
1354
1358
1355 /* dijit/_KeyNavContainer */
1359 /* dijit/_KeyNavContainer */
1356
1360
1357 /**
1361 /**
1358 * A _Container with keyboard navigation of its children.
1362 * A _Container with keyboard navigation of its children.
1359 *
1363 *
1360 * Provides normalized keyboard and focusing code for Container widgets.
1364 * Provides normalized keyboard and focusing code for Container widgets.
1361 * To use this mixin, call connectKeyNavHandlers() in postCreate().
1365 * To use this mixin, call connectKeyNavHandlers() in postCreate().
1362 * Also, child widgets must implement a focus() method.
1366 * Also, child widgets must implement a focus() method.
1363 */
1367 */
1364 interface _KeyNavContainer extends _FocusMixin, _KeyNavMixin, _Container {
1368 interface _KeyNavContainer extends _FocusMixin, _KeyNavMixin, _Container {
1365 /**
1369 /**
1366 * 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().
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().
1367 *
1371 *
1368 * @param prevKeyCodes Key codes for navigating to the previous child.
1372 * @param prevKeyCodes Key codes for navigating to the previous child.
1369 * @param nextKeyCodes Key codes for navigating to the next child.
1373 * @param nextKeyCodes Key codes for navigating to the next child.
1370 */
1374 */
1371 connectKeyNavHandlers(prevKeyCodes: number[], nextKeyCodes: number[]): void;
1375 connectKeyNavHandlers(prevKeyCodes: number[], nextKeyCodes: number[]): void;
1372
1376
1373 /**
1377 /**
1374 * @deprecated
1378 * @deprecated
1375 */
1379 */
1376 startupKeyNavChildren(): void;
1380 startupKeyNavChildren(): void;
1377
1381
1378 /**
1382 /**
1379 * Setup for each child widget.
1383 * Setup for each child widget.
1380 *
1384 *
1381 * Sets tabIndex=-1 on each child, so that the tab key will leave the container rather than visiting each child.
1385 * Sets tabIndex=-1 on each child, so that the tab key will leave the container rather than visiting each child.
1382 *
1386 *
1383 * 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.
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.
1384 *
1388 *
1385 * Note: see also _LayoutWidget.setupChild(), which is also called for each child widget.
1389 * Note: see also _LayoutWidget.setupChild(), which is also called for each child widget.
1386 */
1390 */
1387 _startupChild(widget: _WidgetBase): void;
1391 _startupChild(widget: _WidgetBase): void;
1388
1392
1389 /**
1393 /**
1390 * Returns the first child.
1394 * Returns the first child.
1391 */
1395 */
1392 _getFirst(): _Widget | null;
1396 _getFirst(): _Widget | null;
1393
1397
1394 /**
1398 /**
1395 * Returns the last descendant.
1399 * Returns the last descendant.
1396 */
1400 */
1397 _getLast(): _Widget | null;
1401 _getLast(): _Widget | null;
1398
1402
1399 /**
1403 /**
1400 * Focus the next widget
1404 * Focus the next widget
1401 */
1405 */
1402 focusNext(): void;
1406 focusNext(): void;
1403
1407
1404 /**
1408 /**
1405 * Focus the last focusable node in the previous widget
1409 * Focus the last focusable node in the previous widget
1406 *
1410 *
1407 * (ex: go to the ComboButton icon section rather than button section)
1411 * (ex: go to the ComboButton icon section rather than button section)
1408 */
1412 */
1409 focusPrev(): void;
1413 focusPrev(): void;
1410
1414
1411 /**
1415 /**
1412 * Implement _KeyNavMixin.childSelector, to identify focusable child nodes.
1416 * Implement _KeyNavMixin.childSelector, to identify focusable child nodes.
1413 *
1417 *
1414 * If we allowed a dojo/query dependency from this module this could more simply be a string "> *" instead of this function.
1418 * If we allowed a dojo/query dependency from this module this could more simply be a string "> *" instead of this function.
1415 */
1419 */
1416 childSelector(node: Element | Node): boolean | void | any;
1420 childSelector(node: Element | Node): boolean | void | any;
1417 }
1421 }
1418
1422
1419 interface _KeyNavContainerConstructor extends dojo._base.DeclareConstructor<_KeyNavContainer> { }
1423 interface _KeyNavContainerConstructor extends dojo._base.DeclareConstructor<_KeyNavContainer> { }
1420
1424
1421 /* dijit/_MenuBase */
1425 /* dijit/_MenuBase */
1422
1426
1423 /**
1427 /**
1424 * Abstract base class for Menu and MenuBar.
1428 * Abstract base class for Menu and MenuBar.
1425 * Subclass should implement _onUpArrow(), _onDownArrow(), _onLeftArrow(), and _onRightArrow().
1429 * Subclass should implement _onUpArrow(), _onDownArrow(), _onLeftArrow(), and _onRightArrow().
1426 */
1430 */
1427 interface _MenuBase extends _Widget, _TemplatedMixin, _KeyNavContainer, _CssStateMixin {
1431 interface _MenuBase extends _Widget, _TemplatedMixin, _KeyNavContainer, _CssStateMixin {
1428 selected: MenuItem | null;
1432 selected: MenuItem | null;
1429
1433
1430 _setSelectedAttr(item?: MenuItem | null): void;
1434 _setSelectedAttr(item?: MenuItem | null): void;
1431
1435
1432 /**
1436 /**
1433 * 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.
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.
1434 *
1438 *
1435 * 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.
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.
1436 */
1440 */
1437 activated: boolean;
1441 activated: boolean;
1438
1442
1439 _setActivatedAttr(val: boolean): void;
1443 _setActivatedAttr(val: boolean): void;
1440
1444
1441 /**
1445 /**
1442 * pointer to menu that displayed me
1446 * pointer to menu that displayed me
1443 */
1447 */
1444 parentMenu: _Widget | null;
1448 parentMenu: _Widget | null;
1445
1449
1446 /**
1450 /**
1447 * 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.
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.
1448 */
1452 */
1449 popupDelay: number;
1453 popupDelay: number;
1450
1454
1451 /**
1455 /**
1452 * 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.
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.
1453 */
1457 */
1454 passivePopupDelay: number;
1458 passivePopupDelay: number;
1455
1459
1456 /**
1460 /**
1457 * 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.
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.
1458 */
1462 */
1459 autoFocus: boolean;
1463 autoFocus: boolean;
1460
1464
1461 /**
1465 /**
1462 * 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.
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.
1463 */
1467 */
1464 childSelector(node: Element | Node): boolean | void | Function;
1468 childSelector(node: Element | Node): boolean | void | Function;
1465
1469
1466 /**
1470 /**
1467 * 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.
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.
1468 */
1472 */
1469 onExecute(): void;
1473 onExecute(): void;
1470
1474
1471 /**
1475 /**
1472 * Attach point for notification about when the user cancels the current menu
1476 * Attach point for notification about when the user cancels the current menu
1473 * 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.
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.
1474 */
1478 */
1475 onCancel(): void;
1479 onCancel(): void;
1476
1480
1477 /**
1481 /**
1478 * 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
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
1479 */
1483 */
1480 _moveToPopup(evt: Event): void;
1484 _moveToPopup(evt: Event): void;
1481
1485
1482 /**
1486 /**
1483 * This handler is called when the mouse moves over the popup.
1487 * This handler is called when the mouse moves over the popup.
1484 */
1488 */
1485 _onPopupHover(evt?: MouseEvent): void;
1489 _onPopupHover(evt?: MouseEvent): void;
1486
1490
1487 /**
1491 /**
1488 * Called when cursor is over a MenuItem.
1492 * Called when cursor is over a MenuItem.
1489 */
1493 */
1490 onItemHover(item: MenuItem): void;
1494 onItemHover(item: MenuItem): void;
1491
1495
1492 /**
1496 /**
1493 * Called when a child MenuItem becomes deselected. Setup timer to close its popup.
1497 * Called when a child MenuItem becomes deselected. Setup timer to close its popup.
1494 */
1498 */
1495 _onChildDeselect(item: MenuItem): void;
1499 _onChildDeselect(item: MenuItem): void;
1496
1500
1497 /**
1501 /**
1498 * Callback fires when mouse exits a MenuItem
1502 * Callback fires when mouse exits a MenuItem
1499 */
1503 */
1500 onItemUnhover(item: MenuItem): void;
1504 onItemUnhover(item: MenuItem): void;
1501
1505
1502 /**
1506 /**
1503 * Cancels the popup timer because the user has stop hovering on the MenuItem, etc.
1507 * Cancels the popup timer because the user has stop hovering on the MenuItem, etc.
1504 */
1508 */
1505 _stopPopupTimer(): void;
1509 _stopPopupTimer(): void;
1506
1510
1507 /**
1511 /**
1508 * Cancels the pending-close timer because the close has been preempted
1512 * Cancels the pending-close timer because the close has been preempted
1509 */
1513 */
1510 _stopPendingCloseTimer(): void;
1514 _stopPendingCloseTimer(): void;
1511
1515
1512 /**
1516 /**
1513 * Returns the top menu in this chain of Menus
1517 * Returns the top menu in this chain of Menus
1514 */
1518 */
1515 _getTopMenu(): void;
1519 _getTopMenu(): void;
1516
1520
1517 /**
1521 /**
1518 * Handle clicks on an item.
1522 * Handle clicks on an item.
1519 */
1523 */
1520 onItemClick(item: _WidgetBase, evt: Event): void;
1524 onItemClick(item: _WidgetBase, evt: Event): void;
1521
1525
1522 /**
1526 /**
1523 * Open the popup to the side of/underneath the current menu item, and optionally focus first item
1527 * Open the popup to the side of/underneath the current menu item, and optionally focus first item
1524 */
1528 */
1525 _openItemPopup(fromItem: MenuItem, focus: boolean): void;
1529 _openItemPopup(fromItem: MenuItem, focus: boolean): void;
1526
1530
1527 /**
1531 /**
1528 * Callback when this menu is opened.
1532 * Callback when this menu is opened.
1529 * This is called by the popup manager as notification that the menu was opened.
1533 * This is called by the popup manager as notification that the menu was opened.
1530 */
1534 */
1531 onOpen(evt?: Event): void;
1535 onOpen(evt?: Event): void;
1532
1536
1533 /**
1537 /**
1534 * Callback when this menu is closed.
1538 * Callback when this menu is closed.
1535 * This is called by the popup manager as notification that the menu was closed.
1539 * This is called by the popup manager as notification that the menu was closed.
1536 */
1540 */
1537 onClose(): boolean;
1541 onClose(): boolean;
1538
1542
1539 /**
1543 /**
1540 * Called when submenu is clicked or focus is lost. Close hierarchy of menus.
1544 * Called when submenu is clicked or focus is lost. Close hierarchy of menus.
1541 */
1545 */
1542 _closeChild(): void;
1546 _closeChild(): void;
1543 /**
1547 /**
1544 * Called when child of this Menu gets focus from:
1548 * Called when child of this Menu gets focus from:
1545 *
1549 *
1546 * 1. clicking it
1550 * 1. clicking it
1547 * 2. tabbing into it
1551 * 2. tabbing into it
1548 * 3. being opened by a parent menu.
1552 * 3. being opened by a parent menu.
1549 *
1553 *
1550 * This is not called just from mouse hover.
1554 * This is not called just from mouse hover.
1551 */
1555 */
1552 _onItemFocus(item: MenuItem): void;
1556 _onItemFocus(item: MenuItem): void;
1553
1557
1554 /**
1558 /**
1555 * Called when focus is moved away from this Menu and it's submenus.
1559 * Called when focus is moved away from this Menu and it's submenus.
1556 */
1560 */
1557 _onBlur(): void;
1561 _onBlur(): void;
1558
1562
1559 /**
1563 /**
1560 * Called when the user is done with this menu. Closes hierarchy of menus.
1564 * Called when the user is done with this menu. Closes hierarchy of menus.
1561 */
1565 */
1562 _cleanUp(clearSelectedItem?: boolean): void;
1566 _cleanUp(clearSelectedItem?: boolean): void;
1563 }
1567 }
1564
1568
1565 interface _MenuBaseConstructor extends _WidgetBaseConstructor<_MenuBase> { }
1569 interface _MenuBaseConstructor extends _WidgetBaseConstructor<_MenuBase> { }
1566
1570
1567 /* dijit/Dialog */
1571 /* dijit/Dialog */
1568
1572
1569 interface _DialogBase extends _TemplatedMixin, form._FormMixin, _DialogMixin, _CssStateMixin {
1573 interface _DialogBase extends _TemplatedMixin, form._FormMixin, _DialogMixin, _CssStateMixin {
1570 templateString: string;
1574 templateString: string;
1571 baseClass: string;
1575 baseClass: string;
1572 cssStateNodes: CSSStateNodes;
1576 cssStateNodes: CSSStateNodes;
1573
1577
1574 /**
1578 /**
1575 * True if Dialog is currently displayed on screen.
1579 * True if Dialog is currently displayed on screen.
1576 */
1580 */
1577 open: boolean;
1581 open: boolean;
1578
1582
1579 /**
1583 /**
1580 * The time in milliseconds it takes the dialog to fade in and out
1584 * The time in milliseconds it takes the dialog to fade in and out
1581 */
1585 */
1582 duration: number;
1586 duration: number;
1583
1587
1584 /**
1588 /**
1585 * A Toggle to modify the default focus behavior of a Dialog, which
1589 * A Toggle to modify the default focus behavior of a Dialog, which
1586 * is to re-focus the element which had focus before being opened.
1590 * is to re-focus the element which had focus before being opened.
1587 * False will disable refocusing. Default: true
1591 * False will disable refocusing. Default: true
1588 */
1592 */
1589 refocus: boolean;
1593 refocus: boolean;
1590
1594
1591 /**
1595 /**
1592 * A Toggle to modify the default focus behavior of a Dialog, which
1596 * A Toggle to modify the default focus behavior of a Dialog, which
1593 * is to focus on the first dialog element after opening the dialog.
1597 * is to focus on the first dialog element after opening the dialog.
1594 * False will disable autofocusing. Default: true
1598 * False will disable autofocusing. Default: true
1595 */
1599 */
1596 autofocus: boolean;
1600 autofocus: boolean;
1597
1601
1598 /**
1602 /**
1599 * Toggles the movable aspect of the Dialog. If true, Dialog
1603 * Toggles the movable aspect of the Dialog. If true, Dialog
1600 * can be dragged by it's title. If false it will remain centered
1604 * can be dragged by it's title. If false it will remain centered
1601 * in the viewport.
1605 * in the viewport.
1602 */
1606 */
1603 draggable: boolean;
1607 draggable: boolean;
1604
1608
1605 /**
1609 /**
1606 * Maximum size to allow the dialog to expand to, relative to viewport size
1610 * Maximum size to allow the dialog to expand to, relative to viewport size
1607 */
1611 */
1608 maxRatio: number;
1612 maxRatio: number;
1609
1613
1610 /**
1614 /**
1611 * Dialog show [x] icon to close itself, and ESC key will close the dialog.
1615 * Dialog show [x] icon to close itself, and ESC key will close the dialog.
1612 */
1616 */
1613 closable: boolean;
1617 closable: boolean;
1614 postMixInProperties(): void;
1618 postMixInProperties(): void;
1615 postCreate(): void;
1619 postCreate(): void;
1616
1620
1617 /**
1621 /**
1618 * Called when data has been loaded from an href.
1622 * Called when data has been loaded from an href.
1619 * Unlike most other callbacks, this function can be connected to (via `dojo.connect`)
1623 * Unlike most other callbacks, this function can be connected to (via `dojo.connect`)
1620 * but should *not* be overridden.
1624 * but should *not* be overridden.
1621 */
1625 */
1622 onLoad(data?: any): void;
1626 onLoad(data?: any): void;
1623
1627
1624 focus(): void;
1628 focus(): void;
1625
1629
1626 /* Not entirely sure of the resolution type of these promises */
1630 /* Not entirely sure of the resolution type of these promises */
1627
1631
1628 /**
1632 /**
1629 * Display the dialog
1633 * Display the dialog
1630 */
1634 */
1631 show(): dojo.promise.Promise<any>;
1635 show(): dojo.promise.Promise<any>;
1632
1636
1633 /**
1637 /**
1634 * Hide the dialog
1638 * Hide the dialog
1635 */
1639 */
1636 hide(): dojo.promise.Promise<any>;
1640 hide(): dojo.promise.Promise<any>;
1637
1641
1638 /**
1642 /**
1639 * Called with no argument when viewport scrolled or viewport size changed. Adjusts Dialog as
1643 * Called with no argument when viewport scrolled or viewport size changed. Adjusts Dialog as
1640 * necessary to keep it visible.
1644 * necessary to keep it visible.
1641 *
1645 *
1642 * Can also be called with an argument (by dojox/layout/ResizeHandle etc.) to explicitly set the
1646 * Can also be called with an argument (by dojox/layout/ResizeHandle etc.) to explicitly set the
1643 * size of the dialog.
1647 * size of the dialog.
1644 */
1648 */
1645 resize(dim?: dojo.DomGeometryWidthHeight): void;
1649 resize(dim?: dojo.DomGeometryWidthHeight): void;
1646
1650
1647 destroy(preserveDom?: boolean): void;
1651 destroy(preserveDom?: boolean): void;
1648 }
1652 }
1649
1653
1650 interface _DialogBaseConstructor extends _WidgetBaseConstructor<_DialogBase> { }
1654 interface _DialogBaseConstructor extends _WidgetBaseConstructor<_DialogBase> { }
1651
1655
1652 interface Dialog extends layout.ContentPane, _DialogBase {
1656 interface Dialog extends layout.ContentPane, _DialogBase {
1653 /* overrides conflicting methods */
1657 /* overrides conflicting methods */
1654 resize(dim?: dojo.DomGeometryWidthHeight): void;
1658 resize(dim?: dojo.DomGeometryWidthHeight): void;
1655 }
1659 }
1656
1660
1657 interface DialogLevelManager {
1661 interface DialogLevelManager {
1658 _beginZIndex: number;
1662 _beginZIndex: number;
1659
1663
1660 /**
1664 /**
1661 * Call right before fade-in animation for new dialog.
1665 * Call right before fade-in animation for new dialog.
1662 *
1666 *
1663 * Saves current focus, displays/adjusts underlay for new dialog,
1667 * Saves current focus, displays/adjusts underlay for new dialog,
1664 * and sets the z-index of the dialog itself.
1668 * and sets the z-index of the dialog itself.
1665 *
1669 *
1666 * New dialog will be displayed on top of all currently displayed dialogs.
1670 * New dialog will be displayed on top of all currently displayed dialogs.
1667 * Caller is responsible for setting focus in new dialog after the fade-in
1671 * Caller is responsible for setting focus in new dialog after the fade-in
1668 * animation completes.
1672 * animation completes.
1669 */
1673 */
1670 show(dialog: _WidgetBase, underlayAttrs: Object): void;
1674 show(dialog: _WidgetBase, underlayAttrs: Object): void;
1671
1675
1672 /**
1676 /**
1673 * Called when the specified dialog is hidden/destroyed, after the fade-out
1677 * Called when the specified dialog is hidden/destroyed, after the fade-out
1674 * animation ends, in order to reset page focus, fix the underlay, etc.
1678 * animation ends, in order to reset page focus, fix the underlay, etc.
1675 * If the specified dialog isn't open then does nothing.
1679 * If the specified dialog isn't open then does nothing.
1676 *
1680 *
1677 * Caller is responsible for either setting display:none on the dialog domNode,
1681 * Caller is responsible for either setting display:none on the dialog domNode,
1678 * or calling dijit/popup.hide(), or removing it from the page DOM.
1682 * or calling dijit/popup.hide(), or removing it from the page DOM.
1679 */
1683 */
1680 hide(dialog: _WidgetBase): void;
1684 hide(dialog: _WidgetBase): void;
1681
1685
1682 /**
1686 /**
1683 * Returns true if specified Dialog is the top in the task
1687 * Returns true if specified Dialog is the top in the task
1684 */
1688 */
1685 isTop(dialog: _WidgetBase): boolean;
1689 isTop(dialog: _WidgetBase): boolean;
1686 }
1690 }
1687
1691
1688 interface DialogConstructor extends _WidgetBaseConstructor<Dialog> {
1692 interface DialogConstructor extends _WidgetBaseConstructor<Dialog> {
1689 /**
1693 /**
1690 * for monkey patching and dojox/widget/DialogSimple
1694 * for monkey patching and dojox/widget/DialogSimple
1691 */
1695 */
1692 _DialogBase: _DialogBaseConstructor;
1696 _DialogBase: _DialogBaseConstructor;
1693 _DialogLevelManager: DialogLevelManager;
1697 _DialogLevelManager: DialogLevelManager;
1694 _dialogStack: {
1698 _dialogStack: {
1695 dialog: _WidgetBase,
1699 dialog: _WidgetBase,
1696 focus: any,
1700 focus: any,
1697 underlayAttrs: any
1701 underlayAttrs: any
1698 }[];
1702 }[];
1699 }
1703 }
1700
1704
1701 /* dijit/ConfirmDialog */
1705 /* dijit/ConfirmDialog */
1702
1706
1703 interface ConfirmDialog extends _ConfirmDialogMixin { }
1707 interface ConfirmDialog extends _ConfirmDialogMixin { }
1704
1708
1705 interface ConfirmDialogConstructor extends DialogConstructor { }
1709 interface ConfirmDialogConstructor extends DialogConstructor { }
1706
1710
1707 /* dijit/DropDownMenu */
1711 /* dijit/DropDownMenu */
1708
1712
1709 /**
1713 /**
1710 * A menu, without features for context menu (Meaning, drop down menu)
1714 * A menu, without features for context menu (Meaning, drop down menu)
1711 */
1715 */
1712 interface DropDownMenu extends _MenuBase { }
1716 interface DropDownMenu extends _MenuBase { }
1713
1717
1714 interface DropDownMenuConstructor extends _WidgetBaseConstructor<DropDownMenu> { }
1718 interface DropDownMenuConstructor extends _WidgetBaseConstructor<DropDownMenu> { }
1715
1719
1716 /* dijit/Fieldset */
1720 /* dijit/Fieldset */
1717
1721
1718 /**
1722 /**
1719 * An accessible fieldset that can be expanded or collapsed via
1723 * An accessible fieldset that can be expanded or collapsed via
1720 * its legend. Fieldset extends `dijit.TitlePane`.
1724 * its legend. Fieldset extends `dijit.TitlePane`.
1721 */
1725 */
1722 interface Fieldset extends TitlePane {
1726 interface Fieldset extends TitlePane {
1723 open: boolean;
1727 open: boolean;
1724 }
1728 }
1725
1729
1726 interface FieldsetConstructor extends _WidgetBaseConstructor<Fieldset> { }
1730 interface FieldsetConstructor extends _WidgetBaseConstructor<Fieldset> { }
1727
1731
1728 /* dijit/Menu */
1732 /* dijit/Menu */
1729
1733
1730 /**
1734 /**
1731 * A context menu you can assign to multiple elements
1735 * A context menu you can assign to multiple elements
1732 */
1736 */
1733 interface Menu extends dijit.DropDownMenu {
1737 interface Menu extends dijit.DropDownMenu {
1734 /**
1738 /**
1735 * Array of dom node ids of nodes to attach to.
1739 * Array of dom node ids of nodes to attach to.
1736 * Fill this with nodeIds upon widget creation and it becomes context menu for those nodes.
1740 * Fill this with nodeIds upon widget creation and it becomes context menu for those nodes.
1737 */
1741 */
1738 targetNodeIds: string[];
1742 targetNodeIds: string[];
1739
1743
1740 /**
1744 /**
1741 * CSS expression to apply this Menu to descendants of targetNodeIds, rather than to
1745 * CSS expression to apply this Menu to descendants of targetNodeIds, rather than to
1742 * the nodes specified by targetNodeIds themselves. Useful for applying a Menu to
1746 * the nodes specified by targetNodeIds themselves. Useful for applying a Menu to
1743 * a range of rows in a table, tree, etc.
1747 * a range of rows in a table, tree, etc.
1744 *
1748 *
1745 * The application must require() an appropriate level of dojo/query to handle the selector.
1749 * The application must require() an appropriate level of dojo/query to handle the selector.
1746 */
1750 */
1747 selector: string;
1751 selector: string;
1748
1752
1749 /**
1753 /**
1750 * If true, right clicking anywhere on the window will cause this context menu to open.
1754 * If true, right clicking anywhere on the window will cause this context menu to open.
1751 * If false, must specify targetNodeIds.
1755 * If false, must specify targetNodeIds.
1752 */
1756 */
1753 contextMenuForWindow: boolean;
1757 contextMenuForWindow: boolean;
1754
1758
1755 /**
1759 /**
1756 * If true, menu will open on left click instead of right click, similar to a file menu.
1760 * If true, menu will open on left click instead of right click, similar to a file menu.
1757 */
1761 */
1758 leftClickToOpen: boolean;
1762 leftClickToOpen: boolean;
1759
1763
1760 /**
1764 /**
1761 * When this menu closes, re-focus the element which had focus before it was opened.
1765 * When this menu closes, re-focus the element which had focus before it was opened.
1762 */
1766 */
1763 refocus: boolean;
1767 refocus: boolean;
1764
1768
1765 /**
1769 /**
1766 * Attach menu to given node
1770 * Attach menu to given node
1767 */
1771 */
1768 bindDomNode(node: string | Node): void;
1772 bindDomNode(node: string | Node): void;
1769
1773
1770 /**
1774 /**
1771 * Detach menu from given node
1775 * Detach menu from given node
1772 */
1776 */
1773 unBindDomNode(nodeName: string | Node): void;
1777 unBindDomNode(nodeName: string | Node): void;
1774 }
1778 }
1775
1779
1776 interface MenuConstructor extends _WidgetBaseConstructor<Menu> { }
1780 interface MenuConstructor extends _WidgetBaseConstructor<Menu> { }
1777
1781
1778 /* dijit/MenuBar */
1782 /* dijit/MenuBar */
1779 interface MenuBar extends _MenuBase {
1783 interface MenuBar extends _MenuBase {
1780 baseClass: 'dijitMenuBar';
1784 baseClass: 'dijitMenuBar';
1781 popupDelay: number;
1785 popupDelay: number;
1782 _isMenuBar: true;
1786 _isMenuBar: true;
1783 _orient: string[];
1787 _orient: string[];
1784 _moveToPopup(evt: Event): void;
1788 _moveToPopup(evt: Event): void;
1785 focusChild(item: _WidgetBase): void;
1789 focusChild(item: _WidgetBase): void;
1786 _onChildDeselect(item: _WidgetBase): void;
1790 _onChildDeselect(item: _WidgetBase): void;
1787 _onLeftArrow(): void;
1791 _onLeftArrow(): void;
1788 _onRightArrow(): void;
1792 _onRightArrow(): void;
1789 _onDownArrow(): void;
1793 _onDownArrow(): void;
1790 _onUpArrow(): void;
1794 _onUpArrow(): void;
1791 onItemClick(item: _WidgetBase, evt: Event): void;
1795 onItemClick(item: _WidgetBase, evt: Event): void;
1792 }
1796 }
1793
1797
1794 interface MenuBarConstructor extends _WidgetBaseConstructor<MenuBar> { }
1798 interface MenuBarConstructor extends _WidgetBaseConstructor<MenuBar> { }
1795
1799
1796 /* dijit/MenuBarItem */
1800 /* dijit/MenuBarItem */
1797 interface MenuBarItem extends MenuItem { }
1801 interface MenuBarItem extends MenuItem { }
1798
1802
1799 interface MenuBarItemConstructor extends _WidgetBaseConstructor<MenuBarItem> { }
1803 interface MenuBarItemConstructor extends _WidgetBaseConstructor<MenuBarItem> { }
1800
1804
1801 /* dijit/MenuItem */
1805 /* dijit/MenuItem */
1802 interface MenuItem extends _Widget, _TemplatedMixin, _Contained, _CssStateMixin {
1806 interface MenuItem extends _Widget, _TemplatedMixin, _Contained, _CssStateMixin {
1803 /**
1807 /**
1804 * 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.
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.
1805 *
1809 *
1806 * Note that although Menu can display accelerator keys, there is no infrastructure to actually catch and execute those accelerators.
1810 * Note that although Menu can display accelerator keys, there is no infrastructure to actually catch and execute those accelerators.
1807 */
1811 */
1808 accelKey: string;
1812 accelKey: string;
1809
1813
1810 /**
1814 /**
1811 * If true, the menu item is disabled.
1815 * If true, the menu item is disabled.
1812 * If false, the menu item is enabled.
1816 * If false, the menu item is enabled.
1813 */
1817 */
1814 disabled: boolean;
1818 disabled: boolean;
1815
1819
1816 /** Menu text as HTML */
1820 /** Menu text as HTML */
1817 label: string;
1821 label: string;
1818
1822
1819 /**
1823 /**
1820 * Class to apply to DOMNode to make it display an icon.
1824 * Class to apply to DOMNode to make it display an icon.
1821 */
1825 */
1822 iconClass: string;
1826 iconClass: string;
1823
1827
1824 /**
1828 /**
1825 * Hook for attr('accelKey', ...) to work.
1829 * Hook for attr('accelKey', ...) to work.
1826 * Set accelKey on this menu item.
1830 * Set accelKey on this menu item.
1827 */
1831 */
1828 _setAccelKeyAttr(value: string): void;
1832 _setAccelKeyAttr(value: string): void;
1829
1833
1830 /**
1834 /**
1831 * Hook for attr('disabled', ...) to work.
1835 * Hook for attr('disabled', ...) to work.
1832 * Enable or disable this menu item.
1836 * Enable or disable this menu item.
1833 */
1837 */
1834 _setDisabledAttr(value: boolean): void;
1838 _setDisabledAttr(value: boolean): void;
1835
1839
1836 _setLabelAttr(val: string): void;
1840 _setLabelAttr(val: string): void;
1837 _setIconClassAttr(val: string): void;
1841 _setIconClassAttr(val: string): void;
1838
1842
1839 _fillContent(source: Element): void;
1843 _fillContent(source: Element): void;
1840
1844
1841 /**
1845 /**
1842 * Indicate that this node is the currently selected one
1846 * Indicate that this node is the currently selected one
1843 */
1847 */
1844 _setSelected(selected: boolean): void;
1848 _setSelected(selected: boolean): void;
1845
1849
1846 focus(): void;
1850 focus(): void;
1847
1851
1848 /**
1852 /**
1849 * Deprecated.
1853 * Deprecated.
1850 * Use set('disabled', bool) instead.
1854 * Use set('disabled', bool) instead.
1851 */
1855 */
1852 setDisabled(disabled: boolean): void;
1856 setDisabled(disabled: boolean): void;
1853
1857
1854 /**
1858 /**
1855 * Deprecated.
1859 * Deprecated.
1856 * Use set('label', ...) instead.
1860 * Use set('label', ...) instead.
1857 */
1861 */
1858 setLabel(content: string): void;
1862 setLabel(content: string): void;
1859 }
1863 }
1860
1864
1861 interface MenuItemConstructor extends _WidgetBaseConstructor<MenuItem> { }
1865 interface MenuItemConstructor extends _WidgetBaseConstructor<MenuItem> { }
1862
1866
1863 /* dijit/MenuSeparator */
1867 /* dijit/MenuSeparator */
1864 interface MenuSeparator extends _WidgetBase, _TemplatedMixin, _Contained { }
1868 interface MenuSeparator extends _WidgetBase, _TemplatedMixin, _Contained { }
1865
1869
1866 interface MenuSeparatorConstructor extends _WidgetBaseConstructor<MenuSeparator> { }
1870 interface MenuSeparatorConstructor extends _WidgetBaseConstructor<MenuSeparator> { }
1867
1871
1868 /* dijit/place */
1872 /* dijit/place */
1869
1873
1870 interface PlacePosition {
1874 interface PlacePosition {
1871 x: number;
1875 x: number;
1872 y: number;
1876 y: number;
1873 }
1877 }
1874
1878
1875 interface PlaceWidthHeight {
1879 interface PlaceWidthHeight {
1876 w: number;
1880 w: number;
1877 h: number;
1881 h: number;
1878 }
1882 }
1879
1883
1880 interface PlaceRectangle extends PlacePosition, PlaceWidthHeight { }
1884 interface PlaceRectangle extends PlacePosition, PlaceWidthHeight { }
1881
1885
1882 type PlaceCorner = 'BL' | 'TR' | 'BR' | 'TL';
1886 type PlaceCorner = 'BL' | 'TR' | 'BR' | 'TL';
1883
1887
1884 type PlacePositions = 'before' | 'after' | 'before-centered' | 'after-centered' | 'above-centered' | 'above' | 'above-alt' | 'below-centered' | 'below' | 'below-alt';
1888 type PlacePositions = 'before' | 'after' | 'before-centered' | 'after-centered' | 'above-centered' | 'above' | 'above-alt' | 'below-centered' | 'below' | 'below-alt';
1885
1889
1886 interface PlaceChoice {
1890 interface PlaceChoice {
1887 corner: PlaceCorner;
1891 corner: PlaceCorner;
1888 pos: PlacePosition;
1892 pos: PlacePosition;
1889 aroundCorner?: PlaceCorner;
1893 aroundCorner?: PlaceCorner;
1890 }
1894 }
1891
1895
1892 interface PlaceLocation extends PlaceRectangle {
1896 interface PlaceLocation extends PlaceRectangle {
1893 corner: PlaceCorner;
1897 corner: PlaceCorner;
1894 aroundCorner: PlaceCorner;
1898 aroundCorner: PlaceCorner;
1895 overflow: number;
1899 overflow: number;
1896 spaceAvailable: PlaceWidthHeight;
1900 spaceAvailable: PlaceWidthHeight;
1897 }
1901 }
1898
1902
1899 interface LayoutNodeFunction {
1903 interface LayoutNodeFunction {
1900 (node: HTMLElement, aroundCorner: string, corner: string, spaceAvailable: PlaceWidthHeight, aroundNodeCoords: PlaceWidthHeight): number;
1904 (node: HTMLElement, aroundCorner: string, corner: string, spaceAvailable: PlaceWidthHeight, aroundNodeCoords: PlaceWidthHeight): number;
1901 }
1905 }
1902
1906
1903 interface Place {
1907 interface Place {
1904 /**
1908 /**
1905 * Positions node kitty-corner to the rectangle centered at (pos.x, pos.y) with width and height of
1909 * Positions node kitty-corner to the rectangle centered at (pos.x, pos.y) with width and height of
1906 * padding.x * 2 and padding.y * 2, or zero if padding not specified. Picks first corner in corners[]
1910 * padding.x * 2 and padding.y * 2, or zero if padding not specified. Picks first corner in corners[]
1907 * where node is fully visible, or the corner where it's most visible.
1911 * where node is fully visible, or the corner where it's most visible.
1908 *
1912 *
1909 * Node is assumed to be absolutely or relatively positioned.
1913 * Node is assumed to be absolutely or relatively positioned.
1910 */
1914 */
1911 at(node: Element, pos?: PlacePosition, corners?: PlaceCorner[], padding?: PlacePosition, layoutNode?: LayoutNodeFunction): PlaceLocation;
1915 at(node: Element, pos?: PlacePosition, corners?: PlaceCorner[], padding?: PlacePosition, layoutNode?: LayoutNodeFunction): PlaceLocation;
1912
1916
1913 /**
1917 /**
1914 * Position node adjacent or kitty-corner to anchor
1918 * Position node adjacent or kitty-corner to anchor
1915 * such that it's fully visible in viewport.
1919 * such that it's fully visible in viewport.
1916 */
1920 */
1917 around(node: Element, anchor: Element | PlaceRectangle, positions: PlacePositions[], leftToRight?: boolean, layoutNode?: LayoutNodeFunction): PlaceLocation;
1921 around(node: Element, anchor: Element | PlaceRectangle, positions: PlacePositions[], leftToRight?: boolean, layoutNode?: LayoutNodeFunction): PlaceLocation;
1918 }
1922 }
1919
1923
1920 /* dijit/popup */
1924 /* dijit/popup */
1921
1925
1922 interface PopupOpenArgs {
1926 interface PopupOpenArgs {
1923 /**
1927 /**
1924 * widget to display
1928 * widget to display
1925 */
1929 */
1926 popup?: _WidgetBase;
1930 popup?: _WidgetBase;
1927
1931
1928 /**
1932 /**
1929 * the button etc. that is displaying this popup
1933 * the button etc. that is displaying this popup
1930 */
1934 */
1931 parent?: _WidgetBase;
1935 parent?: _WidgetBase;
1932
1936
1933 /**
1937 /**
1934 * DOM node (typically a button); place popup relative to this node. (Specify this *or* "x" and "y" parameters.)
1938 * DOM node (typically a button); place popup relative to this node. (Specify this *or* "x" and "y" parameters.)
1935 */
1939 */
1936 around?: HTMLElement;
1940 around?: HTMLElement;
1937
1941
1938 /**
1942 /**
1939 * Absolute horizontal position (in pixels) to place node at. (Specify this *or* "around" parameter.)
1943 * Absolute horizontal position (in pixels) to place node at. (Specify this *or* "around" parameter.)
1940 */
1944 */
1941 x?: number;
1945 x?: number;
1942
1946
1943 /**
1947 /**
1944 * Absolute vertical position (in pixels) to place node at. (Specify this *or* "around" parameter.)
1948 * Absolute vertical position (in pixels) to place node at. (Specify this *or* "around" parameter.)
1945 */
1949 */
1946 y?: number;
1950 y?: number;
1947
1951
1948 /**
1952 /**
1949 * When the around parameter is specified, orient should be a list of positions to try
1953 * When the around parameter is specified, orient should be a list of positions to try
1950 */
1954 */
1951 orient?: string | string[] | { BL?: string; TR?: string; TL?: string; BR?: string; };
1955 orient?: string | string[] | { BL?: string; TR?: string; TL?: string; BR?: string; };
1952
1956
1953 /**
1957 /**
1954 * callback when user has canceled the popup by:
1958 * callback when user has canceled the popup by:
1955 *
1959 *
1956 * 1. hitting ESC or
1960 * 1. hitting ESC or
1957 * 2. by using the popup widget's proprietary cancel mechanism (like a cancel button in a dialog);
1961 * 2. by using the popup widget's proprietary cancel mechanism (like a cancel button in a dialog);
1958 * i.e. whenever popupWidget.onCancel() is called, args.onCancel is called
1962 * i.e. whenever popupWidget.onCancel() is called, args.onCancel is called
1959 */
1963 */
1960 onCancel?: () => void;
1964 onCancel?: () => void;
1961
1965
1962 /**
1966 /**
1963 * callback whenever this popup is closed
1967 * callback whenever this popup is closed
1964 */
1968 */
1965 onClose?: () => void;
1969 onClose?: () => void;
1966
1970
1967 /**
1971 /**
1968 * callback when user "executed" on the popup/sub-popup by selecting a menu choice, etc. (top menu only)
1972 * callback when user "executed" on the popup/sub-popup by selecting a menu choice, etc. (top menu only)
1969 */
1973 */
1970 onExecute?: () => void;
1974 onExecute?: () => void;
1971
1975
1972 /**
1976 /**
1973 * adding a buffer around the opening position. This is only useful when around is not set.
1977 * adding a buffer around the opening position. This is only useful when around is not set.
1974 */
1978 */
1975 padding?: PlacePosition;
1979 padding?: PlacePosition;
1976
1980
1977 /**
1981 /**
1978 * The max height for the popup. Any popup taller than this will have scrollbars.
1982 * The max height for the popup. Any popup taller than this will have scrollbars.
1979 * Set to Infinity for no max height. Default is to limit height to available space in viewport,
1983 * Set to Infinity for no max height. Default is to limit height to available space in viewport,
1980 * above or below the aroundNode or specified x/y position.
1984 * above or below the aroundNode or specified x/y position.
1981 */
1985 */
1982 maxHeight?: number;
1986 maxHeight?: number;
1983 }
1987 }
1984
1988
1985 interface PopupManager {
1989 interface PopupManager {
1986 /**
1990 /**
1987 * Stack of currently popped up widgets.
1991 * Stack of currently popped up widgets.
1988 * (someone opened _stack[0], and then it opened _stack[1], etc.)
1992 * (someone opened _stack[0], and then it opened _stack[1], etc.)
1989 */
1993 */
1990 _stack: _WidgetBase[];
1994 _stack: _WidgetBase[];
1991
1995
1992 /**
1996 /**
1993 * Z-index of the first popup. (If first popup opens other
1997 * Z-index of the first popup. (If first popup opens other
1994 * popups they get a higher z-index.)
1998 * popups they get a higher z-index.)
1995 */
1999 */
1996 _beginZIndex: number;
2000 _beginZIndex: number;
1997
2001
1998 _idGen: number;
2002 _idGen: number;
1999
2003
2000 /**
2004 /**
2001 * If screen has been scrolled, reposition all the popups in the stack.
2005 * If screen has been scrolled, reposition all the popups in the stack.
2002 * Then set timer to check again later.
2006 * Then set timer to check again later.
2003 */
2007 */
2004 _repositionAll(): void;
2008 _repositionAll(): void;
2005
2009
2006 /**
2010 /**
2007 * Initialization for widgets that will be used as popups.
2011 * Initialization for widgets that will be used as popups.
2008 * Puts widget inside a wrapper DIV (if not already in one),
2012 * Puts widget inside a wrapper DIV (if not already in one),
2009 * and returns pointer to that wrapper DIV.
2013 * and returns pointer to that wrapper DIV.
2010 */
2014 */
2011 _createWrapper(widget: _WidgetBase): HTMLDivElement;
2015 _createWrapper(widget: _WidgetBase): HTMLDivElement;
2012
2016
2013 /**
2017 /**
2014 * Moves the popup widget off-screen.
2018 * Moves the popup widget off-screen.
2015 * Do not use this method to hide popups when not in use, because
2019 * Do not use this method to hide popups when not in use, because
2016 * that will create an accessibility issue: the offscreen popup is
2020 * that will create an accessibility issue: the offscreen popup is
2017 * still in the tabbing order.
2021 * still in the tabbing order.
2018 */
2022 */
2019 moveOffScreen(widget: _WidgetBase): HTMLDivElement;
2023 moveOffScreen(widget: _WidgetBase): HTMLDivElement;
2020
2024
2021 /**
2025 /**
2022 * Hide this popup widget (until it is ready to be shown).
2026 * Hide this popup widget (until it is ready to be shown).
2023 * Initialization for widgets that will be used as popups
2027 * Initialization for widgets that will be used as popups
2024 *
2028 *
2025 * Also puts widget inside a wrapper DIV (if not already in one)
2029 * Also puts widget inside a wrapper DIV (if not already in one)
2026 *
2030 *
2027 * If popup widget needs to layout it should
2031 * If popup widget needs to layout it should
2028 * do so when it is made visible, and popup._onShow() is called.
2032 * do so when it is made visible, and popup._onShow() is called.
2029 */
2033 */
2030 hide(widget: _WidgetBase): void;
2034 hide(widget: _WidgetBase): void;
2031
2035
2032 /**
2036 /**
2033 * Compute the closest ancestor popup that's *not* a child of another popup.
2037 * Compute the closest ancestor popup that's *not* a child of another popup.
2034 * Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button.
2038 * Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button.
2035 */
2039 */
2036 getTopPopup(): _WidgetBase;
2040 getTopPopup(): _WidgetBase;
2037
2041
2038 /**
2042 /**
2039 * Popup the widget at the specified position
2043 * Popup the widget at the specified position
2040 */
2044 */
2041 open(args: PopupOpenArgs): PlaceLocation;
2045 open(args: PopupOpenArgs): PlaceLocation;
2042
2046
2043 /**
2047 /**
2044 * Close specified popup and any popups that it parented.
2048 * Close specified popup and any popups that it parented.
2045 * If no popup is specified, closes all popups.
2049 * If no popup is specified, closes all popups.
2046 */
2050 */
2047 close(popup?: _WidgetBase): void;
2051 close(popup?: _WidgetBase): void;
2048 }
2052 }
2049
2053
2050 /* dijit/PopupMenuBarItem */
2054 /* dijit/PopupMenuBarItem */
2051
2055
2052 interface PopupMenuBarItem extends PopupMenuItem { }
2056 interface PopupMenuBarItem extends PopupMenuItem { }
2053
2057
2054 interface PopupMenuBarItemConstructor extends _WidgetBaseConstructor<PopupMenuBarItem> { }
2058 interface PopupMenuBarItemConstructor extends _WidgetBaseConstructor<PopupMenuBarItem> { }
2055
2059
2056 /** dijit/PopupMenuItem */
2060 /** dijit/PopupMenuItem */
2057
2061
2058 /**
2062 /**
2059 * An item in a Menu that spawn a drop down (usually a drop down menu)
2063 * An item in a Menu that spawn a drop down (usually a drop down menu)
2060 */
2064 */
2061 interface PopupMenuItem extends MenuItem {
2065 interface PopupMenuItem extends MenuItem {
2062 /**
2066 /**
2063 * When Menu is declared in markup, this code gets the menu label and the popup widget from the srcNodeRef.
2067 * When Menu is declared in markup, this code gets the menu label and the popup widget from the srcNodeRef.
2064 *
2068 *
2065 * srcNodeRef.innerHTML contains both the menu item text and a popup widget
2069 * srcNodeRef.innerHTML contains both the menu item text and a popup widget
2066 * The first part holds the menu item text and the second part is the popup
2070 * The first part holds the menu item text and the second part is the popup
2067 */
2071 */
2068 _fillContent(source: Element): void;
2072 _fillContent(source: Element): void;
2069
2073
2070 /**
2074 /**
2071 * Open the popup to the side of/underneath this MenuItem, and optionally focus first item
2075 * Open the popup to the side of/underneath this MenuItem, and optionally focus first item
2072 */
2076 */
2073 _openPopup(params: { around?: Element; popup?: Function }, focus?: boolean): void;
2077 _openPopup(params: { around?: Element; popup?: Function }, focus?: boolean): void;
2074
2078
2075 _closePopup(): void;
2079 _closePopup(): void;
2076 }
2080 }
2077
2081
2078 interface PopupMenuItemConstructor extends _WidgetBaseConstructor<PopupMenuItem> { }
2082 interface PopupMenuItemConstructor extends _WidgetBaseConstructor<PopupMenuItem> { }
2079
2083
2080 /* dijit/registry */
2084 /* dijit/registry */
2081
2085
2082 interface Registry {
2086 interface Registry {
2083 /**
2087 /**
2084 * Number of registered widgets
2088 * Number of registered widgets
2085 */
2089 */
2086 length: number;
2090 length: number;
2087
2091
2088 /**
2092 /**
2089 * Add a widget to the registry. If a duplicate ID is detected, a error is thrown.
2093 * Add a widget to the registry. If a duplicate ID is detected, a error is thrown.
2090 */
2094 */
2091 add(widget: _WidgetBase): void;
2095 add(widget: _WidgetBase): void;
2092
2096
2093 /**
2097 /**
2094 * Remove a widget from the registry. Does not destroy the widget; simply
2098 * Remove a widget from the registry. Does not destroy the widget; simply
2095 * removes the reference.
2099 * removes the reference.
2096 */
2100 */
2097 remove(id: string): void;
2101 remove(id: string): void;
2098
2102
2099 /**
2103 /**
2100 * Find a widget by it's id.
2104 * Find a widget by it's id.
2101 * If passed a widget then just returns the widget.
2105 * If passed a widget then just returns the widget.
2102 */
2106 */
2103 byId(id: string | _WidgetBase): _WidgetBase;
2107 byId(id: string | _WidgetBase): _WidgetBase;
2104
2108
2105 /**
2109 /**
2106 * Returns the widget corresponding to the given DOMNode
2110 * Returns the widget corresponding to the given DOMNode
2107 */
2111 */
2108 byNode(node: Element | Node): _WidgetBase;
2112 byNode(node: Element | Node): _WidgetBase;
2109
2113
2110 /**
2114 /**
2111 * Convert registry into a true Array
2115 * Convert registry into a true Array
2112 */
2116 */
2113 toArray(): _WidgetBase[];
2117 toArray(): _WidgetBase[];
2114
2118
2115 /**
2119 /**
2116 * Generates a unique id for a given widgetType
2120 * Generates a unique id for a given widgetType
2117 */
2121 */
2118 getUniqueId(widgetType: string): string;
2122 getUniqueId(widgetType: string): string;
2119
2123
2120 /**
2124 /**
2121 * Search subtree under root returning widgets found.
2125 * Search subtree under root returning widgets found.
2122 * Doesn't search for nested widgets (ie, widgets inside other widgets).
2126 * Doesn't search for nested widgets (ie, widgets inside other widgets).
2123 */
2127 */
2124 findWidgets(root: Node, skipNode?: Node): _WidgetBase[];
2128 findWidgets(root: Node, skipNode?: Node): _WidgetBase[];
2125
2129
2126 /**
2130 /**
2127 * Returns the widget whose DOM tree contains the specified DOMNode, or null if
2131 * Returns the widget whose DOM tree contains the specified DOMNode, or null if
2128 * the node is not contained within the DOM tree of any widget
2132 * the node is not contained within the DOM tree of any widget
2129 */
2133 */
2130 getEnclosingWidget(node: Element | Node): _WidgetBase;
2134 getEnclosingWidget(node: Element | Node): _WidgetBase;
2131 }
2135 }
2132
2136
2133 /* dijit/TitlePane */
2137 /* dijit/TitlePane */
2134
2138
2135 interface TitlePane extends dijit.layout.ContentPane, _TemplatedMixin, _CssStateMixin {
2139 interface TitlePane extends dijit.layout.ContentPane, _TemplatedMixin, _CssStateMixin {
2136 /**
2140 /**
2137 * Whether pane can be opened or closed by clicking the title bar.
2141 * Whether pane can be opened or closed by clicking the title bar.
2138 */
2142 */
2139 toggleable: boolean;
2143 toggleable: boolean;
2140
2144
2141 /**
2145 /**
2142 * Tabindex setting for the title (so users can tab to the title then use space/enter to open/close the title pane)
2146 * Tabindex setting for the title (so users can tab to the title then use space/enter to open/close the title pane)
2143 */
2147 */
2144 tabIndex: string;
2148 tabIndex: string;
2145
2149
2146 /**
2150 /**
2147 * Time in milliseconds to fade in/fade out
2151 * Time in milliseconds to fade in/fade out
2148 */
2152 */
2149 duration: number;
2153 duration: number;
2150
2154
2151 /**
2155 /**
2152 * Don't change this parameter from the default value.
2156 * Don't change this parameter from the default value.
2153 *
2157 *
2154 * 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.
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.
2155 */
2159 */
2156 doLayout: boolean;
2160 doLayout: boolean;
2157
2161
2158 /**
2162 /**
2159 * Switches between opened and closed state
2163 * Switches between opened and closed state
2160 */
2164 */
2161 toggle(): void;
2165 toggle(): void;
2162
2166
2163 /**
2167 /**
2164 * Set the open/close css state for the TitlePane
2168 * Set the open/close css state for the TitlePane
2165 */
2169 */
2166 _setCss(): void;
2170 _setCss(): void;
2167
2171
2168 /**
2172 /**
2169 * Handler for when user hits a key
2173 * Handler for when user hits a key
2170 */
2174 */
2171 _onTitleKey(e: Event): void;
2175 _onTitleKey(e: Event): void;
2172
2176
2173 /**
2177 /**
2174 * Handler when user clicks the title bar
2178 * Handler when user clicks the title bar
2175 */
2179 */
2176 _onTitleClick(): void;
2180 _onTitleClick(): void;
2177
2181
2178 /**
2182 /**
2179 * Deprecated. Use set('title', ...) instead.
2183 * Deprecated. Use set('title', ...) instead.
2180 */
2184 */
2181 setTitle(): void;
2185 setTitle(): void;
2182 }
2186 }
2183
2187
2184 interface TitlePaneConstructor extends _WidgetBaseConstructor<TitlePane> { }
2188 interface TitlePaneConstructor extends _WidgetBaseConstructor<TitlePane> { }
2185
2189
2186 /* dijit/Toolbar */
2190 /* dijit/Toolbar */
2187
2191
2188 interface Toolbar extends dijit._Widget, dijit._TemplatedMixin, dijit._KeyNavContainer { }
2192 interface Toolbar extends dijit._Widget, dijit._TemplatedMixin, dijit._KeyNavContainer { }
2189
2193
2190 interface ToolbarConstructor extends _WidgetBaseConstructor<Toolbar> { }
2194 interface ToolbarConstructor extends _WidgetBaseConstructor<Toolbar> { }
2191
2195
2192 /* dijit/ToolbarSeparator */
2196 /* dijit/ToolbarSeparator */
2193
2197
2194 interface ToolbarSeparator extends dijit._Widget, dijit._TemplatedMixin { }
2198 interface ToolbarSeparator extends dijit._Widget, dijit._TemplatedMixin { }
2195
2199
2196 interface ToolbarSeparatorConstructor extends _WidgetBaseConstructor<ToolbarSeparator> { }
2200 interface ToolbarSeparatorConstructor extends _WidgetBaseConstructor<ToolbarSeparator> { }
2197
2201
2198 /* dijit/Tooltip */
2202 /* dijit/Tooltip */
2199
2203
2200 interface Tooltip extends _Widget {
2204 interface Tooltip extends _Widget {
2201 /**
2205 /**
2202 * HTML to display in the tooltip.
2206 * HTML to display in the tooltip.
2203 * Specified as innerHTML when creating the widget from markup.
2207 * Specified as innerHTML when creating the widget from markup.
2204 */
2208 */
2205 label: string;
2209 label: string;
2206
2210
2207 /**
2211 /**
2208 * Number of milliseconds to wait after hovering over/focusing on the object, before
2212 * Number of milliseconds to wait after hovering over/focusing on the object, before
2209 * the tooltip is displayed.
2213 * the tooltip is displayed.
2210 */
2214 */
2211 showDelay: number;
2215 showDelay: number;
2212
2216
2213 /**
2217 /**
2214 * Number of milliseconds to wait after unhovering the object, before
2218 * Number of milliseconds to wait after unhovering the object, before
2215 * the tooltip is hidden. Note that blurring an object hides the tooltip immediately.
2219 * the tooltip is hidden. Note that blurring an object hides the tooltip immediately.
2216 */
2220 */
2217 hideDelay: number;
2221 hideDelay: number;
2218
2222
2219 /**
2223 /**
2220 * Id of domNode(s) to attach the tooltip to.
2224 * Id of domNode(s) to attach the tooltip to.
2221 * When user hovers over specified dom node(s), the tooltip will appear.
2225 * When user hovers over specified dom node(s), the tooltip will appear.
2222 */
2226 */
2223 connectId: dojo.NodeOrString | dojo.NodeOrString[];
2227 connectId: dojo.NodeOrString | dojo.NodeOrString[];
2224
2228
2225 /**
2229 /**
2226 * See description of `dijit/Tooltip.defaultPosition` for details on position parameter.
2230 * See description of `dijit/Tooltip.defaultPosition` for details on position parameter.
2227 */
2231 */
2228 position: string;
2232 position: string;
2229
2233
2230 /**
2234 /**
2231 * CSS expression to apply this Tooltip to descendants of connectIds, rather than to
2235 * CSS expression to apply this Tooltip to descendants of connectIds, rather than to
2232 * the nodes specified by connectIds themselves. Useful for applying a Tooltip to
2236 * the nodes specified by connectIds themselves. Useful for applying a Tooltip to
2233 * a range of rows in a table, tree, etc. Use in conjunction with getContent() parameter.
2237 * a range of rows in a table, tree, etc. Use in conjunction with getContent() parameter.
2234 * Ex: connectId: myTable, selector: "tr", getContent: function(node){ return ...; }
2238 * Ex: connectId: myTable, selector: "tr", getContent: function(node){ return ...; }
2235 *
2239 *
2236 * The application must require() an appropriate level of dojo/query to handle the selector.
2240 * The application must require() an appropriate level of dojo/query to handle the selector.
2237 */
2241 */
2238 selector: string;
2242 selector: string;
2239
2243
2240 /**
2244 /**
2241 * Attach tooltip to specified node if it's not already connected
2245 * Attach tooltip to specified node if it's not already connected
2242 */
2246 */
2243 addTarget(node: dojo.NodeOrString): void;
2247 addTarget(node: dojo.NodeOrString): void;
2244
2248
2245 /**
2249 /**
2246 * Detach tooltip from specified node
2250 * Detach tooltip from specified node
2247 */
2251 */
2248 removeTarget(node: dojo.NodeOrString): void;
2252 removeTarget(node: dojo.NodeOrString): void;
2249
2253
2250 /**
2254 /**
2251 * User overridable function that return the text to display in the tooltip.
2255 * User overridable function that return the text to display in the tooltip.
2252 */
2256 */
2253 getContent(node: Node): Node;
2257 getContent(node: Node): Node;
2254
2258
2255 /**
2259 /**
2256 * Display the tooltip; usually not called directly.
2260 * Display the tooltip; usually not called directly.
2257 */
2261 */
2258 open(target: Node): void;
2262 open(target: Node): void;
2259
2263
2260 /**
2264 /**
2261 * Hide the tooltip or cancel timer for show of tooltip
2265 * Hide the tooltip or cancel timer for show of tooltip
2262 */
2266 */
2263 close(): void;
2267 close(): void;
2264
2268
2265 /**
2269 /**
2266 * Called when the tooltip is shown
2270 * Called when the tooltip is shown
2267 */
2271 */
2268 onShow(): void;
2272 onShow(): void;
2269
2273
2270 /**
2274 /**
2271 * Called when the tooltip is hidden
2275 * Called when the tooltip is hidden
2272 */
2276 */
2273 onHide(): void;
2277 onHide(): void;
2274 }
2278 }
2275
2279
2276 interface TooltipConstructor extends _WidgetBaseConstructor<Tooltip> {
2280 interface TooltipConstructor extends _WidgetBaseConstructor<Tooltip> {
2277 /**
2281 /**
2278 * This variable controls the position of tooltips, if the position is not specified to
2282 * This variable controls the position of tooltips, if the position is not specified to
2279 * the Tooltip widget or *TextBox widget itself. It's an array of strings with the values
2283 * the Tooltip widget or *TextBox widget itself. It's an array of strings with the values
2280 * possible for `dijit/place.around()`. The recommended values are:
2284 * possible for `dijit/place.around()`. The recommended values are:
2281 *
2285 *
2282 * - before-centered: centers tooltip to the left of the anchor node/widget, or to the right
2286 * - before-centered: centers tooltip to the left of the anchor node/widget, or to the right
2283 * in the case of RTL scripts like Hebrew and Arabic
2287 * in the case of RTL scripts like Hebrew and Arabic
2284 * - after-centered: centers tooltip to the right of the anchor node/widget, or to the left
2288 * - after-centered: centers tooltip to the right of the anchor node/widget, or to the left
2285 * in the case of RTL scripts like Hebrew and Arabic
2289 * in the case of RTL scripts like Hebrew and Arabic
2286 * - above-centered: tooltip is centered above anchor node
2290 * - above-centered: tooltip is centered above anchor node
2287 * - below-centered: tooltip is centered above anchor node
2291 * - below-centered: tooltip is centered above anchor node
2288 *
2292 *
2289 * The list is positions is tried, in order, until a position is found where the tooltip fits
2293 * The list is positions is tried, in order, until a position is found where the tooltip fits
2290 * within the viewport.
2294 * within the viewport.
2291 *
2295 *
2292 * Be careful setting this parameter. A value of "above-centered" may work fine until the user scrolls
2296 * Be careful setting this parameter. A value of "above-centered" may work fine until the user scrolls
2293 * the screen so that there's no room above the target node. Nodes with drop downs, like
2297 * the screen so that there's no room above the target node. Nodes with drop downs, like
2294 * DropDownButton or FilteringSelect, are especially problematic, in that you need to be sure
2298 * DropDownButton or FilteringSelect, are especially problematic, in that you need to be sure
2295 * that the drop down and tooltip don't overlap, even when the viewport is scrolled so that there
2299 * that the drop down and tooltip don't overlap, even when the viewport is scrolled so that there
2296 * is only room below (or above) the target node, but not both.
2300 * is only room below (or above) the target node, but not both.
2297 */
2301 */
2298 defaultPosition: [string];
2302 defaultPosition: [string];
2299
2303
2300 /**
2304 /**
2301 * Static method to display tooltip w/specified contents in specified position.
2305 * Static method to display tooltip w/specified contents in specified position.
2302 * See description of dijit/Tooltip.defaultPosition for details on position parameter.
2306 * See description of dijit/Tooltip.defaultPosition for details on position parameter.
2303 * If position is not specified then dijit/Tooltip.defaultPosition is used.
2307 * If position is not specified then dijit/Tooltip.defaultPosition is used.
2304 */
2308 */
2305 show(innerHTML: string, aroundNode: PlaceRectangle, position?: [string], rtl?: boolean, textDir?: string, onMouseEnter?: Function, onMouseLeave?: Function): void;
2309 show(innerHTML: string, aroundNode: PlaceRectangle, position?: [string], rtl?: boolean, textDir?: string, onMouseEnter?: Function, onMouseLeave?: Function): void;
2306
2310
2307 /**
2311 /**
2308 * Hide the tooltip
2312 * Hide the tooltip
2309 */
2313 */
2310 hide(aroundNode: PlaceRectangle): void;
2314 hide(aroundNode: PlaceRectangle): void;
2311 }
2315 }
2312
2316
2313 /* dijit/TooltipDialog */
2317 /* dijit/TooltipDialog */
2314
2318
2315 interface TooltipDialog extends layout.ContentPane, _TemplatedMixin, form._FormMixin, _DialogMixin {
2319 interface TooltipDialog extends layout.ContentPane, _TemplatedMixin, form._FormMixin, _DialogMixin {
2316 /**
2320 /**
2317 * Description of tooltip dialog (required for a11y)
2321 * Description of tooltip dialog (required for a11y)
2318 */
2322 */
2319 title: string;
2323 title: string;
2320
2324
2321 /**
2325 /**
2322 * Don't change this parameter from the default value.
2326 * Don't change this parameter from the default value.
2323 * This ContentPane parameter doesn't make sense for TooltipDialog, since TooltipDialog
2327 * This ContentPane parameter doesn't make sense for TooltipDialog, since TooltipDialog
2324 * is never a child of a layout container, nor can you specify the size of
2328 * is never a child of a layout container, nor can you specify the size of
2325 * TooltipDialog in order to control the size of an inner widget.
2329 * TooltipDialog in order to control the size of an inner widget.
2326 */
2330 */
2327 doLayout: boolean;
2331 doLayout: boolean;
2328
2332
2329 /**
2333 /**
2330 * A Toggle to modify the default focus behavior of a Dialog, which
2334 * A Toggle to modify the default focus behavior of a Dialog, which
2331 * is to focus on the first dialog element after opening the dialog.
2335 * is to focus on the first dialog element after opening the dialog.
2332 * False will disable autofocusing. Default: true.
2336 * False will disable autofocusing. Default: true.
2333 */
2337 */
2334 autofocus: boolean;
2338 autofocus: boolean;
2335
2339
2336 /**
2340 /**
2337 * The pointer to the first focusable node in the dialog.
2341 * The pointer to the first focusable node in the dialog.
2338 */
2342 */
2339 _firstFocusItem: any;
2343 _firstFocusItem: any;
2340
2344
2341 /**
2345 /**
2342 * The pointer to which node has focus prior to our dialog.
2346 * The pointer to which node has focus prior to our dialog.
2343 */
2347 */
2344 _lastFocusItem: any;
2348 _lastFocusItem: any;
2345
2349
2346 /**
2350 /**
2347 * Configure widget to be displayed in given position relative to the button.
2351 * Configure widget to be displayed in given position relative to the button.
2348 *
2352 *
2349 * This is called from the dijit.popup code, and should not be called directly.
2353 * This is called from the dijit.popup code, and should not be called directly.
2350 */
2354 */
2351 orient(node: Node | HTMLElement, aroundCorner: PlaceCorner, tooltipCorner: PlaceCorner): void;
2355 orient(node: Node | HTMLElement, aroundCorner: PlaceCorner, tooltipCorner: PlaceCorner): void;
2352
2356
2353 /**
2357 /**
2354 * Focus on first field
2358 * Focus on first field
2355 */
2359 */
2356 focus(): void;
2360 focus(): void;
2357
2361
2358 /**
2362 /**
2359 * Called when dialog is displayed.
2363 * Called when dialog is displayed.
2360 *
2364 *
2361 * This is called from the dijit.popup code, and should not be called directly.
2365 * This is called from the dijit.popup code, and should not be called directly.
2362 */
2366 */
2363 onOpen(pos: {
2367 onOpen(pos: {
2364 aroundCorner: PlaceCorner
2368 aroundCorner: PlaceCorner
2365 aroundNodePos: PlacePosition
2369 aroundNodePos: PlacePosition
2366 corner: PlaceCorner
2370 corner: PlaceCorner
2367 x: number
2371 x: number
2368 y: number
2372 y: number
2369 }): void;
2373 }): void;
2370
2374
2371 /**
2375 /**
2372 * Handler for keydown events
2376 * Handler for keydown events
2373 *
2377 *
2374 * Keep keyboard focus in dialog; close dialog on escape key
2378 * Keep keyboard focus in dialog; close dialog on escape key
2375 */
2379 */
2376 _onKey(evt: KeyboardEvent): void;
2380 _onKey(evt: KeyboardEvent): void;
2377 }
2381 }
2378
2382
2379 interface TooltipDialogConstructor extends _WidgetBaseConstructor<TooltipDialog> { }
2383 interface TooltipDialogConstructor extends _WidgetBaseConstructor<TooltipDialog> { }
2380 }
2384 }
@@ -1,1889 +1,1889
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, C extends Constraints, T> {
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> {
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> {
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, Q extends dojo.store.api.BaseQueryType, O extends 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> 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>(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> {
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 }
458 }
459
459
460 interface _FormMixinConstructor extends dojo._base.DeclareConstructor<_FormMixin> { }
460 interface _FormMixinConstructor extends dojo._base.DeclareConstructor<_FormMixin> { }
461
461
462 /* dijit/form/_FormSelectWidget */
462 /* dijit/form/_FormSelectWidget */
463
463
464 interface SelectOption {
464 interface SelectOption {
465 value?: string;
465 value?: string;
466 label: string;
466 label: string;
467 selected?: boolean;
467 selected?: boolean;
468 disabled?: boolean;
468 disabled?: boolean;
469 }
469 }
470
470
471 interface _FormSelectWidget<T extends Object, Q extends dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions> extends _FormValueWidget {
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 {
472 /**
472 /**
473 * Whether or not we are multi-valued
473 * Whether or not we are multi-valued
474 */
474 */
475 multiple: boolean;
475 multiple: boolean;
476
476
477 /**
477 /**
478 * The set of options for our select item. Roughly corresponds to
478 * The set of options for our select item. Roughly corresponds to
479 * the html `<option>` tag.
479 * the html `<option>` tag.
480 */
480 */
481 options: SelectOption[];
481 options: SelectOption[];
482
482
483 /**
483 /**
484 * A store to use for getting our list of options - rather than reading them
484 * A store to use for getting our list of options - rather than reading them
485 * from the `<option>` html tags. Should support getIdentity().
485 * from the `<option>` html tags. Should support getIdentity().
486 * For back-compat store can also be a dojo/data/api/Identity.
486 * For back-compat store can also be a dojo/data/api/Identity.
487 */
487 */
488 store: dojo.store.api.Store<T, Q, O>;
488 store: dojo.store.api.Store<T, Q, O>;
489
489
490 /**
490 /**
491 * A query to use when fetching items from our store
491 * A query to use when fetching items from our store
492 */
492 */
493 query: Q;
493 query: Q;
494
494
495 /**
495 /**
496 * Query options to use when fetching from the store
496 * Query options to use when fetching from the store
497 */
497 */
498 queryOptions: O;
498 queryOptions: O;
499
499
500 /**
500 /**
501 * The entries in the drop down list come from this attribute in the dojo.store items.
501 * 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
502 * 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.
503 * dojo.data store rather than a new dojo/store.
504 */
504 */
505 labelAttr: string;
505 labelAttr: string;
506
506
507 /**
507 /**
508 * A callback to do with an onFetch - but before any items are actually
508 * 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)
509 * iterated over (i.e. to filter even further what you want to add)
510 */
510 */
511 onFetch: (items: T[]) => void;
511 onFetch: (items: T[]) => void;
512
512
513 /**
513 /**
514 * Flag to sort the options returned from a store by the label of
514 * Flag to sort the options returned from a store by the label of
515 * the store.
515 * the store.
516 */
516 */
517 sortByLabel: boolean;
517 sortByLabel: boolean;
518
518
519 /**
519 /**
520 * By default loadChildren is called when the items are fetched from the
520 * By default loadChildren is called when the items are fetched from the
521 * store. This property allows delaying loadChildren (and the creation
521 * store. This property allows delaying loadChildren (and the creation
522 * of the options/menuitems) until the user clicks the button to open the
522 * of the options/menuitems) until the user clicks the button to open the
523 * dropdown.
523 * dropdown.
524 */
524 */
525 loadChildrenOnOpen: boolean;
525 loadChildrenOnOpen: boolean;
526
526
527 /**
527 /**
528 * This is the `dojo.Deferred` returned by setStore().
528 * This is the `dojo.Deferred` returned by setStore().
529 * Calling onLoadDeferred.then() registers your
529 * Calling onLoadDeferred.then() registers your
530 * callback to be called only once, when the prior setStore completes.
530 * callback to be called only once, when the prior setStore completes.
531 */
531 */
532 onLoadDeferred: dojo.Deferred<void>;
532 onLoadDeferred: dojo.Deferred<void>;
533
533
534 /**
534 /**
535 * Returns a given option (or options).
535 * Returns a given option (or options).
536 */
536 */
537 getOptions(valueOrIdx: string): SelectOption;
537 getOptions(valueOrIdx: string): SelectOption;
538 getOptions(valueOrIdx: number): SelectOption;
538 getOptions(valueOrIdx: number): SelectOption;
539 getOptions(valueOrIdx: SelectOption): SelectOption;
539 getOptions(valueOrIdx: SelectOption): SelectOption;
540 getOptions(valueOrIdx: (string | number | SelectOption)[]): SelectOption[];
540 getOptions(valueOrIdx: (string | number | SelectOption)[]): SelectOption[];
541 getOptions(): SelectOption[];
541 getOptions(): SelectOption[];
542
542
543 /**
543 /**
544 * Adds an option or options to the end of the select. If value
544 * Adds an option or options to the end of the select. If value
545 * of the option is empty or missing, a separator is created instead.
545 * of the option is empty or missing, a separator is created instead.
546 * Passing in an array of options will yield slightly better performance
546 * Passing in an array of options will yield slightly better performance
547 * since the children are only loaded once.
547 * since the children are only loaded once.
548 */
548 */
549 addOption(option: SelectOption | SelectOption[]): void;
549 addOption(option: SelectOption | SelectOption[]): void;
550
550
551 /**
551 /**
552 * Removes the given option or options. You can remove by string
552 * Removes the given option or options. You can remove by string
553 * (in which case the value is removed), number (in which case the
553 * (in which case the value is removed), number (in which case the
554 * index in the options array is removed), or select option (in
554 * index in the options array is removed), or select option (in
555 * which case, the select option with a matching value is removed).
555 * which case, the select option with a matching value is removed).
556 * You can also pass in an array of those values for a slightly
556 * You can also pass in an array of those values for a slightly
557 * better performance since the children are only loaded once.
557 * better performance since the children are only loaded once.
558 * For numeric option values, specify {value: number} as the argument.
558 * For numeric option values, specify {value: number} as the argument.
559 */
559 */
560 removeOption(option: string | number | SelectOption | (string | number | SelectOption)[]): void;
560 removeOption(option: string | number | SelectOption | (string | number | SelectOption)[]): void;
561
561
562 /**
562 /**
563 * Updates the values of the given option. The option to update
563 * Updates the values of the given option. The option to update
564 * is matched based on the value of the entered option. Passing
564 * is matched based on the value of the entered option. Passing
565 * in an array of new options will yield better performance since
565 * in an array of new options will yield better performance since
566 * the children will only be loaded once.
566 * the children will only be loaded once.
567 */
567 */
568 updateOption(newOption: SelectOption | SelectOption[]): void;
568 updateOption(newOption: SelectOption | SelectOption[]): void;
569
569
570 /**
570 /**
571 * Deprecated!
571 * Deprecated!
572 */
572 */
573 setStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
573 setStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
574 query: Q;
574 query: Q;
575 queryOptions: O;
575 queryOptions: O;
576 onFetch: (items: T[], fetchArgs?: any) => void;
576 onFetch: (items: T[], fetchArgs?: any) => void;
577 }): dojo.store.api.Store<T, Q, O>;
577 }): dojo.store.api.Store<T, Q, O>;
578
578
579 /**
579 /**
580 * Sets the store you would like to use with this select widget.
580 * Sets the store you would like to use with this select widget.
581 * The selected value is the value of the new store to set. This
581 * The selected value is the value of the new store to set. This
582 * function returns the original store, in case you want to reuse
582 * function returns the original store, in case you want to reuse
583 * it or something.
583 * it or something.
584 */
584 */
585 _deprecatedSetStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
585 _deprecatedSetStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
586 query: Q;
586 query: Q;
587 queryOptions: O;
587 queryOptions: O;
588 onFetch: (items: T[], fetchArgs?: any) => void;
588 onFetch: (items: T[], fetchArgs?: any) => void;
589 }): dojo.store.api.Store<T, Q, O>;
589 }): dojo.store.api.Store<T, Q, O>;
590
590
591 /**
591 /**
592 * Loads the children represented by this widget's options.
592 * Loads the children represented by this widget's options.
593 * reset the menu to make it populatable on the next click
593 * reset the menu to make it populatable on the next click
594 */
594 */
595 _loadChildren(): void;
595 _loadChildren(): void;
596
596
597 /**
597 /**
598 * Sets the "selected" class on the item for styling purposes
598 * Sets the "selected" class on the item for styling purposes
599 */
599 */
600 _updateSelection(): void;
600 _updateSelection(): void;
601
601
602 /**
602 /**
603 * Returns the value of the widget by reading the options for
603 * Returns the value of the widget by reading the options for
604 * the selected flag
604 * the selected flag
605 */
605 */
606 _getValueFromOpts(): string;
606 _getValueFromOpts(): string;
607
607
608 buildRendering(): void;
608 buildRendering(): void;
609
609
610 /**
610 /**
611 * Loads our options and sets up our dropdown correctly. We
611 * Loads our options and sets up our dropdown correctly. We
612 * don't want any content, so we don't call any inherit chain
612 * don't want any content, so we don't call any inherit chain
613 * function.
613 * function.
614 */
614 */
615 _fillContent(): void;
615 _fillContent(): void;
616
616
617 /**
617 /**
618 * sets up our event handling that we need for functioning
618 * sets up our event handling that we need for functioning
619 * as a select
619 * as a select
620 */
620 */
621 postCreate(): void;
621 postCreate(): void;
622
622
623 startup(): void;
623 startup(): void;
624
624
625 /**
625 /**
626 * Clean up our connections
626 * Clean up our connections
627 */
627 */
628 destroy(preserveDom?: boolean): void;
628 destroy(preserveDom?: boolean): void;
629
629
630 /**
630 /**
631 * User-overridable function which, for the given option, adds an
631 * User-overridable function which, for the given option, adds an
632 * item to the select. If the option doesn't have a value, then a
632 * item to the select. If the option doesn't have a value, then a
633 * separator is added in that place. Make sure to store the option
633 * separator is added in that place. Make sure to store the option
634 * in the created option widget.
634 * in the created option widget.
635 */
635 */
636 _addOptionItem(option: SelectOption): void;
636 _addOptionItem(option: SelectOption): void;
637
637
638 /**
638 /**
639 * User-overridable function which, for the given option, removes
639 * User-overridable function which, for the given option, removes
640 * its item from the select.
640 * its item from the select.
641 */
641 */
642 _removeOptionItem(option: SelectOption): void;
642 _removeOptionItem(option: SelectOption): void;
643
643
644 /**
644 /**
645 * Overridable function which will set the display for the
645 * Overridable function which will set the display for the
646 * widget. newDisplay is either a string (in the case of
646 * widget. newDisplay is either a string (in the case of
647 * single selects) or array of strings (in the case of multi-selects)
647 * single selects) or array of strings (in the case of multi-selects)
648 */
648 */
649 _setDisplay(newDisplay: string | string[]): void;
649 _setDisplay(newDisplay: string | string[]): void;
650
650
651 /**
651 /**
652 * Overridable function to return the children that this widget contains.
652 * Overridable function to return the children that this widget contains.
653 */
653 */
654 _getChildren(): any[];
654 _getChildren(): any[];
655
655
656 /**
656 /**
657 * hooks into this.attr to provide a mechanism for getting the
657 * hooks into this.attr to provide a mechanism for getting the
658 * option items for the current value of the widget.
658 * option items for the current value of the widget.
659 */
659 */
660 _getSelectedOptionsAttr(): SelectOption[];
660 _getSelectedOptionsAttr(): SelectOption[];
661
661
662 /**
662 /**
663 * a function that will "fake" loading children, if needed, and
663 * a function that will "fake" loading children, if needed, and
664 * if we have set to not load children until the widget opens.
664 * if we have set to not load children until the widget opens.
665 */
665 */
666 _pseudoLoadChildren(items: T[]): void;
666 _pseudoLoadChildren(items: T[]): void;
667
667
668 /**
668 /**
669 * a function that can be connected to in order to receive a
669 * a function that can be connected to in order to receive a
670 * notification that the store has finished loading and all options
670 * notification that the store has finished loading and all options
671 * from that store are available
671 * from that store are available
672 */
672 */
673 onSetStore(): void;
673 onSetStore(): void;
674 }
674 }
675
675
676 /* dijit/form/_FormValueMixin */
676 /* dijit/form/_FormValueMixin */
677
677
678 interface _FormValueMixin extends _FormWidgetMixin {
678 interface _FormValueMixin extends _FormWidgetMixin {
679
679
680 /**
680 /**
681 * Should this widget respond to user input?
681 * Should this widget respond to user input?
682 * In markup, this is specified as "readOnly".
682 * In markup, this is specified as "readOnly".
683 * Similar to disabled except readOnly form values are submitted.
683 * Similar to disabled except readOnly form values are submitted.
684 */
684 */
685 readOnly: boolean;
685 readOnly: boolean;
686
686
687 postCreate(): void;
687 postCreate(): void;
688
688
689 /**
689 /**
690 * Restore the value to the last value passed to onChange
690 * Restore the value to the last value passed to onChange
691 */
691 */
692 undo(): void;
692 undo(): void;
693
693
694 /**
694 /**
695 * Reset the widget's value to what it was at initialization time
695 * Reset the widget's value to what it was at initialization time
696 */
696 */
697 reset(): void;
697 reset(): void;
698
698
699 _hasBeenBlurred?: boolean;
699 _hasBeenBlurred?: boolean;
700 }
700 }
701
701
702 /* dijit/form/_FormValueWidget */
702 /* dijit/form/_FormValueWidget */
703
703
704 interface _FormValueWidget extends _FormWidget, _FormValueMixin {
704 interface _FormValueWidget extends _FormWidget, _FormValueMixin {
705 /**
705 /**
706 * Work around table sizing bugs on IE7 by forcing redraw
706 * Work around table sizing bugs on IE7 by forcing redraw
707 */
707 */
708 _layoutHackIE7(): void;
708 _layoutHackIE7(): void;
709
709
710 // set(name: string, value: any): this;
710 // set(name: string, value: any): this;
711 // set(values: Object): this;
711 // set(values: Object): this;
712 }
712 }
713
713
714 interface _FormValueWidgetConstructor extends _WidgetBaseConstructor<_FormValueWidget> { }
714 interface _FormValueWidgetConstructor extends _WidgetBaseConstructor<_FormValueWidget> { }
715
715
716 /* dijit/form/_FormWidget */
716 /* dijit/form/_FormWidget */
717
717
718 interface _FormWidget extends _Widget, _TemplatedMixin, _CssStateMixin, _FormWidgetMixin {
718 interface _FormWidget extends _Widget, _TemplatedMixin, _CssStateMixin, _FormWidgetMixin {
719 setDisabled(disabled: boolean): void;
719 setDisabled(disabled: boolean): void;
720 setValue(value: string): void;
720 setValue(value: string): void;
721 postMixInProperties(): void;
721 postMixInProperties(): void;
722
722
723 // set(name: 'value', value: string): this;
723 // set(name: 'value', value: string): this;
724 // set(name: string, value: any): this;
724 // set(name: string, value: any): this;
725 // set(values: Object): this;
725 // set(values: Object): this;
726 }
726 }
727
727
728 interface _FormWidgetConstructor extends _WidgetBaseConstructor<_FormWidget> { }
728 interface _FormWidgetConstructor extends _WidgetBaseConstructor<_FormWidget> { }
729
729
730 /* dijit/form/_FormWidgetMixin */
730 /* dijit/form/_FormWidgetMixin */
731
731
732 interface _FormWidgetMixin {
732 interface _FormWidgetMixin {
733 /**
733 /**
734 * Name used when submitting form; same as "name" attribute or plain HTML elements
734 * Name used when submitting form; same as "name" attribute or plain HTML elements
735 */
735 */
736 name: string;
736 name: string;
737
737
738 /**
738 /**
739 * Corresponds to the native HTML `<input>` element's attribute.
739 * Corresponds to the native HTML `<input>` element's attribute.
740 */
740 */
741 alt: string;
741 alt: string;
742
742
743 /**
743 /**
744 * Corresponds to the native HTML `<input>` element's attribute.
744 * Corresponds to the native HTML `<input>` element's attribute.
745 */
745 */
746 value: any;
746 value: any;
747
747
748 /**
748 /**
749 * Corresponds to the native HTML `<input>` element's attribute.
749 * Corresponds to the native HTML `<input>` element's attribute.
750 */
750 */
751 type: string;
751 type: string;
752
752
753 /**
753 /**
754 * Apply aria-label in markup to the widget's focusNode
754 * Apply aria-label in markup to the widget's focusNode
755 */
755 */
756 'aria-label': string;
756 'aria-label': string;
757
757
758 /**
758 /**
759 * Order fields are traversed when user hits the tab key
759 * Order fields are traversed when user hits the tab key
760 */
760 */
761 tabIndex: number;
761 tabIndex: number;
762
762
763 /**
763 /**
764 * Should this widget respond to user input?
764 * Should this widget respond to user input?
765 * In markup, this is specified as "disabled='disabled'", or just "disabled".
765 * In markup, this is specified as "disabled='disabled'", or just "disabled".
766 */
766 */
767 disabled: boolean;
767 disabled: boolean;
768
768
769 /**
769 /**
770 * Fires onChange for each value change or only on demand
770 * Fires onChange for each value change or only on demand
771 */
771 */
772 intermediateChanges: boolean;
772 intermediateChanges: boolean;
773
773
774 /**
774 /**
775 * On focus, should this widget scroll into view?
775 * On focus, should this widget scroll into view?
776 */
776 */
777 scrollOnFocus: boolean;
777 scrollOnFocus: boolean;
778
778
779 /**
779 /**
780 * Tells if this widget is focusable or not. Used internally by dijit.
780 * Tells if this widget is focusable or not. Used internally by dijit.
781 */
781 */
782 isFocusable(): boolean;
782 isFocusable(): boolean;
783
783
784 /**
784 /**
785 * Put focus on this widget
785 * Put focus on this widget
786 */
786 */
787 focus(): void;
787 focus(): void;
788
788
789 /**
789 /**
790 * Compare 2 values (as returned by get('value') for this widget).
790 * Compare 2 values (as returned by get('value') for this widget).
791 */
791 */
792 compare(val1: any, val2: any): number;
792 compare(val1: any, val2: any): number;
793
793
794 /**
794 /**
795 * Callback when this widget's value is changed.
795 * Callback when this widget's value is changed.
796 */
796 */
797 onChange(value: string): void;
797 onChange(value: string): void;
798
798
799 /**
799 /**
800 * Overrides _Widget.create()
800 * Overrides _Widget.create()
801 */
801 */
802 create(params?: any, srcNodeRef?: HTMLElement): void;
802 create(params?: any, srcNodeRef?: HTMLElement): void;
803
803
804 destroy(preserveDom?: boolean): void;
804 destroy(preserveDom?: boolean): void;
805
805
806 // set(name: 'disabled', value: boolean): this;
806 // set(name: 'disabled', value: boolean): this;
807 // set(name: string, value: any): this;
807 // set(name: string, value: any): this;
808 // set(values: Object): this;
808 // set(values: Object): this;
809 }
809 }
810
810
811 /* dijit/form/_ListBase */
811 /* dijit/form/_ListBase */
812
812
813 interface _ListBase {
813 interface _ListBase {
814 /**
814 /**
815 * currently selected node
815 * currently selected node
816 */
816 */
817 selected: HTMLElement;
817 selected: HTMLElement;
818
818
819 /**
819 /**
820 * Select the first displayed item in the list.
820 * Select the first displayed item in the list.
821 */
821 */
822 selectFirstNode(): void;
822 selectFirstNode(): void;
823
823
824 /**
824 /**
825 * Select the last displayed item in the list
825 * Select the last displayed item in the list
826 */
826 */
827 selectLastNode(): void;
827 selectLastNode(): void;
828
828
829 /**
829 /**
830 * Select the item just below the current selection.
830 * Select the item just below the current selection.
831 * If nothing selected, select first node.
831 * If nothing selected, select first node.
832 */
832 */
833 selectNextNode(): void;
833 selectNextNode(): void;
834
834
835 /**
835 /**
836 * Select the item just above the current selection.
836 * Select the item just above the current selection.
837 * If nothing selected, select last node (if
837 * If nothing selected, select last node (if
838 * you select Previous and try to keep scrolling up the list).
838 * you select Previous and try to keep scrolling up the list).
839 */
839 */
840 selectPreviousNode(): void;
840 selectPreviousNode(): void;
841
841
842 // set(name: 'selected', value: HTMLElement): this;
842 // set(name: 'selected', value: HTMLElement): this;
843 // set(name: string, value: any): this;
843 // set(name: string, value: any): this;
844 // set(values: Object): this;
844 // set(values: Object): this;
845 }
845 }
846
846
847 /* dijit/form/_ListMouseMixin */
847 /* dijit/form/_ListMouseMixin */
848
848
849 interface _ListMouseMixin extends _ListBase {
849 interface _ListMouseMixin extends _ListBase {
850 postCreate(): void;
850 postCreate(): void;
851 }
851 }
852
852
853 /* dijit/form/_RadioButtonMixin */
853 /* dijit/form/_RadioButtonMixin */
854
854
855 interface _RadioButtonMixin {
855 interface _RadioButtonMixin {
856 /**
856 /**
857 * type attribute on `<input>` node.
857 * type attribute on `<input>` node.
858 * Users should not change this value.
858 * Users should not change this value.
859 */
859 */
860 type: string;
860 type: string;
861 }
861 }
862
862
863 /* dijit/form/_SearchMixin */
863 /* dijit/form/_SearchMixin */
864
864
865 interface _SearchMixin<T extends Object, Q extends dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions> {
865 interface _SearchMixin<T extends Object, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> {
866 /**
866 /**
867 * Argument to data provider.
867 * Argument to data provider.
868 * Specifies maximum number of search results to return per query
868 * Specifies maximum number of search results to return per query
869 */
869 */
870 pageSize: number;
870 pageSize: number;
871
871
872 /**
872 /**
873 * Reference to data provider object used by this ComboBox.
873 * Reference to data provider object used by this ComboBox.
874 * The store must accept an object hash of properties for its query. See `query` and `queryExpr` for details.
874 * The store must accept an object hash of properties for its query. See `query` and `queryExpr` for details.
875 */
875 */
876 store: dojo.store.api.Store<T, Q, O>;
876 store: dojo.store.api.Store<T, Q, O>;
877
877
878 /**
878 /**
879 * Mixin to the store's fetch.
879 * Mixin to the store's fetch.
880 * For example, to set the sort order of the ComboBox menu, pass:
880 * For example, to set the sort order of the ComboBox menu, pass:
881 * { sort: [{attribute:"name",descending: true}] }
881 * { sort: [{attribute:"name",descending: true}] }
882 * To override the default queryOptions so that deep=false, do:
882 * To override the default queryOptions so that deep=false, do:
883 * { queryOptions: {ignoreCase: true, deep: false} }
883 * { queryOptions: {ignoreCase: true, deep: false} }
884 */
884 */
885 fetchProperties: { [property: string]: any };
885 fetchProperties: { [property: string]: any };
886
886
887 /**
887 /**
888 * A query that can be passed to `store` to initially filter the items.
888 * A query that can be passed to `store` to initially filter the items.
889 * ComboBox overwrites any reference to the `searchAttr` and sets it to the `queryExpr` with the user's input substituted.
889 * ComboBox overwrites any reference to the `searchAttr` and sets it to the `queryExpr` with the user's input substituted.
890 */
890 */
891 query: Q;
891 query: Q;
892
892
893 /**
893 /**
894 * Alternate to specifying a store. Id of a dijit/form/DataList widget.
894 * Alternate to specifying a store. Id of a dijit/form/DataList widget.
895 */
895 */
896 list: string;
896 list: string;
897
897
898 /**
898 /**
899 * Delay in milliseconds between when user types something and we start
899 * Delay in milliseconds between when user types something and we start
900 * searching based on that value
900 * searching based on that value
901 */
901 */
902 searchDelay: number;
902 searchDelay: number;
903
903
904 /**
904 /**
905 * Search for items in the data store where this attribute (in the item)
905 * Search for items in the data store where this attribute (in the item)
906 * matches what the user typed
906 * matches what the user typed
907 */
907 */
908 searchAttr: string;
908 searchAttr: string;
909
909
910 /**
910 /**
911 * This specifies what query is sent to the data store,
911 * This specifies what query is sent to the data store,
912 * based on what the user has typed. Changing this expression will modify
912 * based on what the user has typed. Changing this expression will modify
913 * whether the results are only exact matches, a "starting with" match,
913 * whether the results are only exact matches, a "starting with" match,
914 * etc.
914 * etc.
915 * `${0}` will be substituted for the user text.
915 * `${0}` will be substituted for the user text.
916 * `*` is used for wildcards.
916 * `*` is used for wildcards.
917 * `${0}*` means "starts with", `*${0}*` means "contains", `${0}` means "is"
917 * `${0}*` means "starts with", `*${0}*` means "contains", `${0}` means "is"
918 */
918 */
919 queryExpr: string;
919 queryExpr: string;
920
920
921 /**
921 /**
922 * Set true if the query should ignore case when matching possible items
922 * Set true if the query should ignore case when matching possible items
923 */
923 */
924 ignoreCase: boolean;
924 ignoreCase: boolean;
925
925
926 /**
926 /**
927 * Helper function to convert a simple pattern to a regular expression for matching.
927 * Helper function to convert a simple pattern to a regular expression for matching.
928 */
928 */
929 _patternToRegExp(pattern: string): RegExp;
929 _patternToRegExp(pattern: string): RegExp;
930
930
931 _abortQuery(): void;
931 _abortQuery(): void;
932
932
933 /**
933 /**
934 * Handles input (keyboard/paste) events
934 * Handles input (keyboard/paste) events
935 */
935 */
936 _processInput(e: KeyboardEvent): void;
936 _processInput(e: KeyboardEvent): void;
937
937
938 /**
938 /**
939 * Callback when a search completes.
939 * Callback when a search completes.
940 */
940 */
941 onSearch(results: T[], query: Q, options: O): void;
941 onSearch(results: T[], query: Q, options: O): void;
942
942
943 _startSearchFromInput(): void;
943 _startSearchFromInput(): void;
944
944
945 /**
945 /**
946 * Starts a search for elements matching text (text=="" means to return all items
946 * Starts a search for elements matching text (text=="" means to return all items
947 * and calls onSearch(...) when the search completes, to display the results.
947 * and calls onSearch(...) when the search completes, to display the results.
948 */
948 */
949 _startSearch(text: string): void;
949 _startSearch(text: string): void;
950
950
951 postMixInProperties(): void;
951 postMixInProperties(): void;
952
952
953 // set(name: 'list', value: string): this;
953 // set(name: 'list', value: string): this;
954 // set(name: string, value: any): this;
954 // set(name: string, value: any): this;
955 // set(values: Object): this;
955 // set(values: Object): this;
956 }
956 }
957
957
958 /* dijit/form/_Spinner */
958 /* dijit/form/_Spinner */
959
959
960 interface AdjustFunction {
960 interface AdjustFunction {
961 (val: any, delta: number): any;
961 (val: any, delta: number): any;
962 }
962 }
963
963
964 interface _Spinner extends RangeBoundTextBox {
964 interface _Spinner extends RangeBoundTextBox {
965 /**
965 /**
966 * Number of milliseconds before a held arrow key or up/down button becomes typematic
966 * Number of milliseconds before a held arrow key or up/down button becomes typematic
967 */
967 */
968 defaultTimeout: number;
968 defaultTimeout: number;
969
969
970 /**
970 /**
971 * minimum number of milliseconds that typematic event fires when held key or button is held
971 * minimum number of milliseconds that typematic event fires when held key or button is held
972 */
972 */
973 minimumTimeout: number;
973 minimumTimeout: number;
974
974
975 /**
975 /**
976 * Fraction of time used to change the typematic timer between events.
976 * Fraction of time used to change the typematic timer between events.
977 * 1.0 means that each typematic event fires at defaultTimeout intervals.
977 * 1.0 means that each typematic event fires at defaultTimeout intervals.
978 * Less than 1.0 means that each typematic event fires at an increasing faster rate.
978 * Less than 1.0 means that each typematic event fires at an increasing faster rate.
979 */
979 */
980 timeoutChangeRate: number;
980 timeoutChangeRate: number;
981
981
982 /**
982 /**
983 * Adjust the value by this much when spinning using the arrow keys/buttons
983 * Adjust the value by this much when spinning using the arrow keys/buttons
984 */
984 */
985 smallDelta: number;
985 smallDelta: number;
986
986
987 /**
987 /**
988 * Adjust the value by this much when spinning using the PgUp/Dn keys
988 * Adjust the value by this much when spinning using the PgUp/Dn keys
989 */
989 */
990 largeDelta: number;
990 largeDelta: number;
991
991
992 templateString: string;
992 templateString: string;
993 baseClass: string;
993 baseClass: string;
994 cssStateNodes: CSSStateNodes;
994 cssStateNodes: CSSStateNodes;
995
995
996 /**
996 /**
997 * Overridable function used to adjust a primitive value(Number/Date/...) by the delta amount specified.
997 * Overridable function used to adjust a primitive value(Number/Date/...) by the delta amount specified.
998 * The val is adjusted in a way that makes sense to the object type.
998 * The val is adjusted in a way that makes sense to the object type.
999 */
999 */
1000 adjust: AdjustFunction;
1000 adjust: AdjustFunction;
1001
1001
1002 postCreate(): void;
1002 postCreate(): void;
1003 }
1003 }
1004
1004
1005 interface _SpinnerConstrctor extends _WidgetBaseConstructor<_Spinner> { }
1005 interface _SpinnerConstrctor extends _WidgetBaseConstructor<_Spinner> { }
1006
1006
1007 /* dijit/form/_TextBoxMixin */
1007 /* dijit/form/_TextBoxMixin */
1008
1008
1009 interface _TextBoxMixin<C extends Constraints> {
1009 interface _TextBoxMixin<C extends Constraints = Constraints> {
1010 /**
1010 /**
1011 * Removes leading and trailing whitespace if true. Default is false.
1011 * Removes leading and trailing whitespace if true. Default is false.
1012 */
1012 */
1013 trim: boolean;
1013 trim: boolean;
1014
1014
1015 /**
1015 /**
1016 * Converts all characters to uppercase if true. Default is false.
1016 * Converts all characters to uppercase if true. Default is false.
1017 */
1017 */
1018 uppercase: boolean;
1018 uppercase: boolean;
1019
1019
1020 /**
1020 /**
1021 * Converts all characters to lowercase if true. Default is false.
1021 * Converts all characters to lowercase if true. Default is false.
1022 */
1022 */
1023 lowercase: boolean;
1023 lowercase: boolean;
1024
1024
1025 /**
1025 /**
1026 * Converts the first character of each word to uppercase if true.
1026 * Converts the first character of each word to uppercase if true.
1027 */
1027 */
1028 propercase: boolean;
1028 propercase: boolean;
1029
1029
1030 /**
1030 /**
1031 * HTML INPUT tag maxLength declaration.
1031 * HTML INPUT tag maxLength declaration.
1032 */
1032 */
1033 maxLength: string;
1033 maxLength: string;
1034
1034
1035 /**
1035 /**
1036 * If true, all text will be selected when focused with mouse
1036 * If true, all text will be selected when focused with mouse
1037 */
1037 */
1038 selectOnClick: boolean;
1038 selectOnClick: boolean;
1039
1039
1040 /**
1040 /**
1041 * Defines a hint to help users fill out the input field (as defined in HTML 5).
1041 * Defines a hint to help users fill out the input field (as defined in HTML 5).
1042 * This should only contain plain text (no html markup).
1042 * This should only contain plain text (no html markup).
1043 */
1043 */
1044 placeHolder: string;
1044 placeHolder: string;
1045
1045
1046 /**
1046 /**
1047 * For subclasses like ComboBox where the displayed value
1047 * For subclasses like ComboBox where the displayed value
1048 * (ex: Kentucky) and the serialized value (ex: KY) are different,
1048 * (ex: Kentucky) and the serialized value (ex: KY) are different,
1049 * this represents the displayed value.
1049 * this represents the displayed value.
1050 *
1050 *
1051 * Setting 'displayedValue' through set('displayedValue', ...)
1051 * Setting 'displayedValue' through set('displayedValue', ...)
1052 * updates 'value', and vice-versa. Otherwise 'value' is updated
1052 * updates 'value', and vice-versa. Otherwise 'value' is updated
1053 * from 'displayedValue' periodically, like onBlur etc.
1053 * from 'displayedValue' periodically, like onBlur etc.
1054 */
1054 */
1055 displayedValue: string;
1055 displayedValue: string;
1056
1056
1057 /**
1057 /**
1058 * Replaceable function to convert a value to a properly formatted string.
1058 * Replaceable function to convert a value to a properly formatted string.
1059 */
1059 */
1060 format: ConstrainedValueFunction<any, C, any>;
1060 format: ConstrainedValueFunction<any, C, any>;
1061
1061
1062 /**
1062 /**
1063 * Replaceable function to convert a formatted string to a value
1063 * Replaceable function to convert a formatted string to a value
1064 */
1064 */
1065 parse: ConstrainedValueFunction<any, C, any>;
1065 parse: ConstrainedValueFunction<any, C, any>;
1066
1066
1067 /**
1067 /**
1068 * Connect to this function to receive notifications of various user data-input events.
1068 * Connect to this function to receive notifications of various user data-input events.
1069 * Return false to cancel the event and prevent it from being processed.
1069 * Return false to cancel the event and prevent it from being processed.
1070 * Note that although for historical reasons this method is called `onInput()`, it doesn't
1070 * Note that although for historical reasons this method is called `onInput()`, it doesn't
1071 * correspond to the standard DOM "input" event, because it occurs before the input has been processed.
1071 * correspond to the standard DOM "input" event, because it occurs before the input has been processed.
1072 */
1072 */
1073 onInput(e: InputEvent): void;
1073 onInput(e: InputEvent): void;
1074
1074
1075 postCreate(): void;
1075 postCreate(): void;
1076
1076
1077 /**
1077 /**
1078 * if the textbox is blank, what value should be reported
1078 * if the textbox is blank, what value should be reported
1079 */
1079 */
1080 _blankValue: string;
1080 _blankValue: string;
1081
1081
1082 /**
1082 /**
1083 * Auto-corrections (such as trimming) that are applied to textbox
1083 * Auto-corrections (such as trimming) that are applied to textbox
1084 * value on blur or form submit.
1084 * value on blur or form submit.
1085 */
1085 */
1086 filter<T>(val: T): T;
1086 filter<T>(val: T): T;
1087 filter<T extends number>(value: T): T;
1087 filter<T extends number>(value: T): T;
1088
1088
1089 _setBlurValue(): void;
1089 _setBlurValue(): void;
1090
1090
1091 reset(): void;
1091 reset(): void;
1092 }
1092 }
1093
1093
1094 /* dijit/form/_ToggleButtonMixin */
1094 /* dijit/form/_ToggleButtonMixin */
1095
1095
1096 interface _ToggleButtonMixin {
1096 interface _ToggleButtonMixin {
1097 /**
1097 /**
1098 * Corresponds to the native HTML `<input>` element's attribute.
1098 * Corresponds to the native HTML `<input>` element's attribute.
1099 * In markup, specified as "checked='checked'" or just "checked".
1099 * In markup, specified as "checked='checked'" or just "checked".
1100 * True if the button is depressed, or the checkbox is checked,
1100 * True if the button is depressed, or the checkbox is checked,
1101 * or the radio button is selected, etc.
1101 * or the radio button is selected, etc.
1102 */
1102 */
1103 checked: boolean;
1103 checked: boolean;
1104
1104
1105 postCreate(): void;
1105 postCreate(): void;
1106
1106
1107 /**
1107 /**
1108 * Reset the widget's value to what it was at initialization time
1108 * Reset the widget's value to what it was at initialization time
1109 */
1109 */
1110 reset(): void;
1110 reset(): void;
1111
1111
1112 _hasBeenBlurred?: boolean;
1112 _hasBeenBlurred?: boolean;
1113 }
1113 }
1114
1114
1115 /* dijit/form/Button */
1115 /* dijit/form/Button */
1116
1116
1117 interface Button extends _FormWidget, _ButtonMixin {
1117 interface Button extends _FormWidget, _ButtonMixin {
1118 /**
1118 /**
1119 * Set this to true to hide the label text and display only the icon.
1119 * Set this to true to hide the label text and display only the icon.
1120 * (If showLabel=false then iconClass must be specified.)
1120 * (If showLabel=false then iconClass must be specified.)
1121 * Especially useful for toolbars.
1121 * Especially useful for toolbars.
1122 * If showLabel=true, the label will become the title (a.k.a. tooltip/hint)
1122 * If showLabel=true, the label will become the title (a.k.a. tooltip/hint)
1123 */
1123 */
1124 showLabel: boolean;
1124 showLabel: boolean;
1125
1125
1126 /**
1126 /**
1127 * Class to apply to DOMNode in button to make it display an icon
1127 * Class to apply to DOMNode in button to make it display an icon
1128 */
1128 */
1129 iconClass: string;
1129 iconClass: string;
1130
1130
1131 baseClass: string;
1131 baseClass: string;
1132 templateString: string;
1132 templateString: string;
1133 postCreate(): void;
1133 postCreate(): void;
1134 setLabel(content: string): void;
1134 setLabel(content: string): void;
1135 onLabelSet(e: Event): void;
1135 onLabelSet(e: Event): void;
1136
1136
1137 onClick(e: MouseEvent): boolean | void;
1137 onClick(e: MouseEvent): boolean | void;
1138
1138
1139 // set(name: 'showLabel', value: boolean): this;
1139 // set(name: 'showLabel', value: boolean): this;
1140 // set(name: 'value', value: string): this;
1140 // set(name: 'value', value: string): this;
1141 // set(name: 'name', value: string): this;
1141 // set(name: 'name', value: string): this;
1142 // set(name: 'label', value: string): this;
1142 // set(name: 'label', value: string): this;
1143 // set(name: string, value: any): this;
1143 // set(name: string, value: any): this;
1144 // set(values: Object): this;
1144 // set(values: Object): this;
1145 }
1145 }
1146
1146
1147 interface ButtonConstructor extends _WidgetBaseConstructor<Button> { }
1147 interface ButtonConstructor extends _WidgetBaseConstructor<Button> { }
1148
1148
1149 /* dijit/form/CheckBox */
1149 /* dijit/form/CheckBox */
1150
1150
1151 interface CheckBox extends ToggleButton, _CheckBoxMixin {
1151 interface CheckBox extends ToggleButton, _CheckBoxMixin {
1152 templateString: string;
1152 templateString: string;
1153 baseClass: string;
1153 baseClass: string;
1154 postMixInProperties(): void;
1154 postMixInProperties(): void;
1155 value: string;
1155 value: string;
1156
1156
1157 // set(name: 'value', value: string | boolean): this;
1157 // set(name: 'value', value: string | boolean): this;
1158 // set(name: string, value: any): this;
1158 // set(name: string, value: any): this;
1159 // set(values: Object): this;
1159 // set(values: Object): this;
1160 }
1160 }
1161
1161
1162 interface CheckBoxConstructor extends _WidgetBaseConstructor<CheckBox> { }
1162 interface CheckBoxConstructor extends _WidgetBaseConstructor<CheckBox> { }
1163
1163
1164 /* dijit/form/ComboBox */
1164 /* dijit/form/ComboBox */
1165
1165
1166 interface ComboBox<T extends Object, Q extends dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions, C extends Constraints> extends ValidationTextBox<C>, ComboBoxMixin<T, Q, O> {
1166 interface ComboBox<T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions, C extends Constraints = Constraints> extends ValidationTextBox<C>, ComboBoxMixin<T, Q, O> {
1167 // set(name: string, value: any): this;
1167 // set(name: string, value: any): this;
1168 // set(values: Object): this;
1168 // set(values: Object): this;
1169 }
1169 }
1170
1170
1171 interface ComboBoxConstructor extends _WidgetBaseConstructor<ComboBox<any, any, any, any>> {
1171 interface ComboBoxConstructor extends _WidgetBaseConstructor<ComboBox<any>> {
1172 new <T extends Object, Q extends dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions, C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): ComboBox<T, Q, O, C>;
1172 new <T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions, C extends Constraints = Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): ComboBox<T, Q, O, C>;
1173 }
1173 }
1174
1174
1175 /* dijit/form/ComboBoxMixin */
1175 /* dijit/form/ComboBoxMixin */
1176
1176
1177 interface ComboBoxMixin<T extends Object, Q extends dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions> extends _HasDropDown<_ComboBoxMenu<T>>, _AutoCompleterMixin<T, Q, O> {
1177 interface ComboBoxMixin<T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> extends _HasDropDown<_ComboBoxMenu<T>>, _AutoCompleterMixin<T, Q, O> {
1178
1178
1179 /**
1179 /**
1180 * Dropdown widget class used to select a date/time.
1180 * Dropdown widget class used to select a date/time.
1181 * Subclasses should specify this.
1181 * Subclasses should specify this.
1182 */
1182 */
1183 dropDownClass: _ComboBoxMenu<T>;
1183 dropDownClass: _ComboBoxMenu<T>;
1184
1184
1185 /**
1185 /**
1186 * Set this textbox to have a down arrow button, to display the drop down list.
1186 * Set this textbox to have a down arrow button, to display the drop down list.
1187 * Defaults to true.
1187 * Defaults to true.
1188 */
1188 */
1189 hasDownArrow: boolean;
1189 hasDownArrow: boolean;
1190
1190
1191 templateString: string;
1191 templateString: string;
1192 baseClass: string;
1192 baseClass: string;
1193
1193
1194 /**
1194 /**
1195 * Reference to data provider object used by this ComboBox.
1195 * Reference to data provider object used by this ComboBox.
1196 *
1196 *
1197 * Should be dojo/store/api/Store, but dojo/data/api/Read supported
1197 * Should be dojo/store/api/Store, but dojo/data/api/Read supported
1198 * for backwards compatibility.
1198 * for backwards compatibility.
1199 */
1199 */
1200 store: dojo.store.api.Store<T, Q, O>;
1200 store: dojo.store.api.Store<T, Q, O>;
1201
1201
1202 cssStateNodes: CSSStateNodes;
1202 cssStateNodes: CSSStateNodes;
1203 postMixInProperties(): void;
1203 postMixInProperties(): void;
1204 buildRendering(): void;
1204 buildRendering(): void;
1205 }
1205 }
1206
1206
1207 interface ComboBoxMixinConstructor<T, U extends dojo.store.api.BaseQueryType, V> extends _WidgetBaseConstructor<ComboBoxMixin<T, U, V>> { }
1207 interface ComboBoxMixinConstructor<T = any, U extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, V = any> extends _WidgetBaseConstructor<ComboBoxMixin<T, U, V>> { }
1208
1208
1209 /* dijit/form/CurrencyTextBox */
1209 /* dijit/form/CurrencyTextBox */
1210
1210
1211 interface CurrencyTextBoxConstraints extends NumberTextBoxConstraints, dojo.CurrencyFormatOptions, dojo.CurrencyParseOptions {
1211 interface CurrencyTextBoxConstraints extends NumberTextBoxConstraints, dojo.CurrencyFormatOptions, dojo.CurrencyParseOptions {
1212 }
1212 }
1213
1213
1214 interface CurrencyTextBox extends NumberTextBox {
1214 interface CurrencyTextBox extends NumberTextBox {
1215 /**
1215 /**
1216 * the [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD"
1216 * the [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD"
1217 */
1217 */
1218 currency: string;
1218 currency: string;
1219
1219
1220 /**
1220 /**
1221 * Despite the name, this parameter specifies both constraints on the input
1221 * Despite the name, this parameter specifies both constraints on the input
1222 * (including minimum/maximum allowed values) as well as
1222 * (including minimum/maximum allowed values) as well as
1223 * formatting options. See `dijit/form/CurrencyTextBox.__Constraints` for details.
1223 * formatting options. See `dijit/form/CurrencyTextBox.__Constraints` for details.
1224 */
1224 */
1225 constraints: CurrencyTextBoxConstraints;
1225 constraints: CurrencyTextBoxConstraints;
1226
1226
1227 baseClass: string;
1227 baseClass: string;
1228
1228
1229 _formatter: (value: number, options?: dojo.CurrencyFormatOptions) => string;
1229 _formatter: (value: number, options?: dojo.CurrencyFormatOptions) => string;
1230 _parser: (expression: string, options?: dojo.CurrencyParseOptions) => number;
1230 _parser: (expression: string, options?: dojo.CurrencyParseOptions) => number;
1231 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1231 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1232
1232
1233 /**
1233 /**
1234 * Parses string value as a Currency, according to the constraints object
1234 * Parses string value as a Currency, according to the constraints object
1235 */
1235 */
1236 parse(value: string, constraints: CurrencyTextBoxConstraints): string;
1236 parse(value: string, constraints: CurrencyTextBoxConstraints): string;
1237 }
1237 }
1238
1238
1239 interface CurrencyTextBoxConstructor extends _WidgetBaseConstructor<CurrencyTextBox> { }
1239 interface CurrencyTextBoxConstructor extends _WidgetBaseConstructor<CurrencyTextBox> { }
1240
1240
1241 /* dijit/form/DataList */
1241 /* dijit/form/DataList */
1242
1242
1243 interface DataList<T extends Object> extends dojo.store.Memory<T> {
1243 interface DataList<T extends Object> extends dojo.store.Memory<T> {
1244 /**
1244 /**
1245 * Get the option marked as selected, like `<option selected>`.
1245 * Get the option marked as selected, like `<option selected>`.
1246 * Not part of dojo.data API.
1246 * Not part of dojo.data API.
1247 */
1247 */
1248 fetchSelectedItem(): T;
1248 fetchSelectedItem(): T;
1249 }
1249 }
1250
1250
1251 interface DataListConstructor {
1251 interface DataListConstructor {
1252 new <T extends Object>(params: Object, srcNodeRef: dojo.NodeOrString): DataList<T>;
1252 new <T extends Object>(params: Object, srcNodeRef: dojo.NodeOrString): DataList<T>;
1253 }
1253 }
1254
1254
1255 /* dijit/form/DateTextBox */
1255 /* dijit/form/DateTextBox */
1256
1256
1257 interface DateTextBox extends _DateTimeTextBox<Calendar> {
1257 interface DateTextBox extends _DateTimeTextBox<Calendar> {
1258 baseClass: string;
1258 baseClass: string;
1259 popupClass: CalendarConstructor;
1259 popupClass: CalendarConstructor;
1260 _selector: string;
1260 _selector: string;
1261 maxHeight: number;
1261 maxHeight: number;
1262
1262
1263 /**
1263 /**
1264 * The value of this widget as a JavaScript Date object, with only year/month/day specified.`
1264 * The value of this widget as a JavaScript Date object, with only year/month/day specified.`
1265 */
1265 */
1266 value: Date;
1266 value: Date;
1267 }
1267 }
1268
1268
1269 interface DateTextBoxConstructor extends _WidgetBaseConstructor<DateTextBox> { }
1269 interface DateTextBoxConstructor extends _WidgetBaseConstructor<DateTextBox> { }
1270
1270
1271 /* dijit/form/DropDownButton */
1271 /* dijit/form/DropDownButton */
1272
1272
1273 interface DropDownButton<T extends _WidgetBase> extends Button, _Container, _HasDropDown<T> {
1273 interface DropDownButton<T extends _WidgetBase> extends Button, _Container, _HasDropDown<T> {
1274 baseClass: string;
1274 baseClass: string;
1275 templateString: string;
1275 templateString: string;
1276
1276
1277 /**
1277 /**
1278 * Overrides _TemplatedMixin#_fillContent().
1278 * Overrides _TemplatedMixin#_fillContent().
1279 * My inner HTML possibly contains both the button label and/or a drop down widget, like
1279 * My inner HTML possibly contains both the button label and/or a drop down widget, like
1280 * <DropDownButton> <span>push me</span> <Menu> ... </Menu> </DropDownButton>
1280 * <DropDownButton> <span>push me</span> <Menu> ... </Menu> </DropDownButton>
1281 */
1281 */
1282 _fillContent(): void;
1282 _fillContent(): void;
1283 startup(): void;
1283 startup(): void;
1284
1284
1285 /**
1285 /**
1286 * Returns whether or not we are loaded - if our dropdown has an href,
1286 * Returns whether or not we are loaded - if our dropdown has an href,
1287 * then we want to check that.
1287 * then we want to check that.
1288 */
1288 */
1289 isLoaded(): boolean;
1289 isLoaded(): boolean;
1290
1290
1291 /**
1291 /**
1292 * Default implementation assumes that drop down already exists,
1292 * Default implementation assumes that drop down already exists,
1293 * but hasn't loaded it's data (ex: ContentPane w/href).
1293 * but hasn't loaded it's data (ex: ContentPane w/href).
1294 * App must override if the drop down is lazy-created.
1294 * App must override if the drop down is lazy-created.
1295 */
1295 */
1296 loadDropDown(callback: () => void): void;
1296 loadDropDown(callback: () => void): void;
1297
1297
1298 /**
1298 /**
1299 * Overridden so that focus is handled by the _HasDropDown mixin, not by
1299 * Overridden so that focus is handled by the _HasDropDown mixin, not by
1300 * the _FormWidget mixin.
1300 * the _FormWidget mixin.
1301 */
1301 */
1302 isFocusable(): boolean;
1302 isFocusable(): boolean;
1303 }
1303 }
1304
1304
1305 interface DropDownButtonConstructor extends _WidgetBaseConstructor<DropDownButton<any>> {
1305 interface DropDownButtonConstructor extends _WidgetBaseConstructor<DropDownButton<any>> {
1306 new <T extends _WidgetBase>(params: Object, srcNodeRef: dojo.NodeOrString): DropDownButton<T>;
1306 new <T extends _WidgetBase>(params: Object, srcNodeRef: dojo.NodeOrString): DropDownButton<T>;
1307 }
1307 }
1308
1308
1309 /* dijit/form/FilteringSelect */
1309 /* dijit/form/FilteringSelect */
1310
1310
1311 interface FilteringSelect<C extends Constraints, T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions> extends MappedTextBox<C>, ComboBoxMixin<T, Q, O> {
1311 interface FilteringSelect<C extends Constraints, T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions> extends MappedTextBox<C>, ComboBoxMixin<T, Q, O> {
1312 /**
1312 /**
1313 * True (default) if user is required to enter a value into this field.
1313 * True (default) if user is required to enter a value into this field.
1314 */
1314 */
1315 required: boolean;
1315 required: boolean;
1316
1316
1317 _lastDisplayedValue: string;
1317 _lastDisplayedValue: string;
1318 _isValidSubset(): boolean;
1318 _isValidSubset(): boolean;
1319 isValid(): boolean;
1319 isValid(): boolean;
1320 _refreshState(): void;
1320 _refreshState(): void;
1321
1321
1322 /**
1322 /**
1323 * Callback from dojo.store after lookup of user entered value finishes
1323 * Callback from dojo.store after lookup of user entered value finishes
1324 */
1324 */
1325 _callbackSetLabel(result: T[], query: Q, options: O, priorityChange?: boolean): void;
1325 _callbackSetLabel(result: T[], query: Q, options: O, priorityChange?: boolean): void;
1326
1326
1327 _openResultList(results: T[], query: Q, options: O): void;
1327 _openResultList(results: T[], query: Q, options: O): void;
1328 undo(): void;
1328 undo(): void;
1329
1329
1330 // set(name: 'displayedValue', value: string): this;
1330 // set(name: 'displayedValue', value: string): this;
1331 // set(name: 'item', value: T): this;
1331 // set(name: 'item', value: T): this;
1332 // set(name: string, value: any): this;
1332 // set(name: string, value: any): this;
1333 // set(values: Object): this;
1333 // set(values: Object): this;
1334 }
1334 }
1335
1335
1336 interface FilteringSelectConstructor extends _WidgetBaseConstructor<FilteringSelect<any, any, any, any>> {
1336 interface FilteringSelectConstructor extends _WidgetBaseConstructor<FilteringSelect<any, any, any, any>> {
1337 new <C extends Constraints, T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions>(params: Object, srcNodeRef: dojo.NodeOrString): FilteringSelect<C, T, Q, O>;
1337 new <C extends Constraints, T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions>(params: Object, srcNodeRef: dojo.NodeOrString): FilteringSelect<C, T, Q, O>;
1338 }
1338 }
1339
1339
1340 /* dijit/form/Form */
1340 /* dijit/form/Form */
1341
1341
1342 interface Form extends _Widget, _TemplatedMixin, _FormMixin, layout._ContentPaneResizeMixin {
1342 interface Form extends _Widget, _TemplatedMixin, _FormMixin, layout._ContentPaneResizeMixin {
1343 name?: string;
1343 name?: string;
1344 action?: string;
1344 action?: string;
1345 method?: string;
1345 method?: string;
1346 encType?: string;
1346 encType?: string;
1347 'accept-charset'?: string;
1347 'accept-charset'?: string;
1348 accept?: string;
1348 accept?: string;
1349 target?: string;
1349 target?: string;
1350 templateString: string;
1350 templateString: string;
1351
1351
1352 /**
1352 /**
1353 * Deprecated: use submit()
1353 * Deprecated: use submit()
1354 */
1354 */
1355 execute(formContents: Object): void;
1355 execute(formContents: Object): void;
1356
1356
1357 /**
1357 /**
1358 * Deprecated: use onSubmit()
1358 * Deprecated: use onSubmit()
1359 */
1359 */
1360 onExecute(): void;
1360 onExecute(): void;
1361
1361
1362 /**
1362 /**
1363 * restores all widget values back to their init values,
1363 * restores all widget values back to their init values,
1364 * calls onReset() which can cancel the reset by returning false
1364 * calls onReset() which can cancel the reset by returning false
1365 */
1365 */
1366 reset(e?: Event): void;
1366 reset(e?: Event): void;
1367
1367
1368 /**
1368 /**
1369 * Callback when user resets the form. This method is intended
1369 * Callback when user resets the form. This method is intended
1370 * to be over-ridden. When the `reset` method is called
1370 * to be over-ridden. When the `reset` method is called
1371 * programmatically, the return value from `onReset` is used
1371 * programmatically, the return value from `onReset` is used
1372 * to compute whether or not resetting should proceed
1372 * to compute whether or not resetting should proceed
1373 */
1373 */
1374 onReset(e?: Event): boolean;
1374 onReset(e?: Event): boolean;
1375
1375
1376 /**
1376 /**
1377 * Callback when user submits the form.
1377 * Callback when user submits the form.
1378 */
1378 */
1379 onSubmit(e?: Event): boolean;
1379 onSubmit(e?: Event): boolean;
1380
1380
1381 /**
1381 /**
1382 * programmatically submit form if and only if the `onSubmit` returns true
1382 * programmatically submit form if and only if the `onSubmit` returns true
1383 */
1383 */
1384 submit(): void;
1384 submit(): void;
1385 }
1385 }
1386
1386
1387 interface FormConstructor extends _WidgetBaseConstructor<Form> { }
1387 interface FormConstructor extends _WidgetBaseConstructor<Form> { }
1388
1388
1389 /* dijit/form/HorizontalRule */
1389 /* dijit/form/HorizontalRule */
1390
1390
1391 /**
1391 /**
1392 * Hash marks for `dijit/form/HorizontalSlider`
1392 * Hash marks for `dijit/form/HorizontalSlider`
1393 */
1393 */
1394 interface HorizontalRule extends _Widget, _TemplatedMixin {
1394 interface HorizontalRule extends _Widget, _TemplatedMixin {
1395 /**
1395 /**
1396 * Number of hash marks to generate
1396 * Number of hash marks to generate
1397 */
1397 */
1398 count: number;
1398 count: number;
1399
1399
1400 /**
1400 /**
1401 * For HorizontalSlider, this is either "topDecoration" or "bottomDecoration", and indicates whether this rule goes above or below the slider.
1401 * For HorizontalSlider, this is either "topDecoration" or "bottomDecoration", and indicates whether this rule goes above or below the slider.
1402 */
1402 */
1403 container: string;
1403 container: string;
1404
1404
1405 /**
1405 /**
1406 * CSS style to apply to individual hash marks
1406 * CSS style to apply to individual hash marks
1407 */
1407 */
1408 ruleStyle: string;
1408 ruleStyle: string;
1409
1409
1410 _positionPrefix: string;
1410 _positionPrefix: string;
1411 _positionSuffix: string;
1411 _positionSuffix: string;
1412 _suffix: string;
1412 _suffix: string;
1413
1413
1414 _genHTML(pos: number): string;
1414 _genHTML(pos: number): string;
1415
1415
1416 /**
1416 /**
1417 * VerticalRule will override this...
1417 * VerticalRule will override this...
1418 */
1418 */
1419 _isHorizontal: boolean;
1419 _isHorizontal: boolean;
1420 }
1420 }
1421
1421
1422 interface HorizontalRuleConstructor extends _WidgetBaseConstructor<HorizontalRule> { }
1422 interface HorizontalRuleConstructor extends _WidgetBaseConstructor<HorizontalRule> { }
1423
1423
1424 /* dijit/form/HorizontalRuleLabels */
1424 /* dijit/form/HorizontalRuleLabels */
1425
1425
1426 /**
1426 /**
1427 * Labels for `dijit/form/HorizontalSlider`
1427 * Labels for `dijit/form/HorizontalSlider`
1428 */
1428 */
1429 interface HorizontalRuleLabels extends HorizontalRule {
1429 interface HorizontalRuleLabels extends HorizontalRule {
1430 /**
1430 /**
1431 * CSS style to apply to individual text labels
1431 * CSS style to apply to individual text labels
1432 */
1432 */
1433 labelStyle: string;
1433 labelStyle: string;
1434
1434
1435 /**
1435 /**
1436 * Array of text labels to render - evenly spaced from left-to-right or bottom-to-top.
1436 * Array of text labels to render - evenly spaced from left-to-right or bottom-to-top.
1437 * Alternately, minimum and maximum can be specified, to get numeric labels.
1437 * Alternately, minimum and maximum can be specified, to get numeric labels.
1438 */
1438 */
1439 labels: string[];
1439 labels: string[];
1440
1440
1441 /**
1441 /**
1442 * Number of generated numeric labels that should be rendered as '' on the ends when labels[] are not specified
1442 * Number of generated numeric labels that should be rendered as '' on the ends when labels[] are not specified
1443 */
1443 */
1444 numericMargin: number;
1444 numericMargin: number;
1445
1445
1446 /**
1446 /**
1447 * Leftmost label value for generated numeric labels when labels[] are not specified
1447 * Leftmost label value for generated numeric labels when labels[] are not specified
1448 */
1448 */
1449 minimum: number;
1449 minimum: number;
1450
1450
1451 /**
1451 /**
1452 * Rightmost label value for generated numeric labels when labels[] are not specified
1452 * Rightmost label value for generated numeric labels when labels[] are not specified
1453 */
1453 */
1454 maximum: number;
1454 maximum: number;
1455
1455
1456 /**
1456 /**
1457 * pattern, places, lang, et al (see dojo.number) for generated numeric labels when labels[] are not specified
1457 * pattern, places, lang, et al (see dojo.number) for generated numeric labels when labels[] are not specified
1458 */
1458 */
1459 constraints: { pattern: string };
1459 constraints: { pattern: string };
1460
1460
1461 /**
1461 /**
1462 * Returns the value to be used in HTML for the label as part of the left: attribute
1462 * Returns the value to be used in HTML for the label as part of the left: attribute
1463 */
1463 */
1464 _calcPosition(pos: number): number;
1464 _calcPosition(pos: number): number;
1465
1465
1466 _genHTML(pos: number, ndx?: number): string;
1466 _genHTML(pos: number, ndx?: number): string;
1467
1467
1468 /**
1468 /**
1469 * extension point for bidi code
1469 * extension point for bidi code
1470 */
1470 */
1471 _genDirectionHTML(label: string): string;
1471 _genDirectionHTML(label: string): string;
1472
1472
1473 /**
1473 /**
1474 * Overridable function to return array of labels to use for this slider.
1474 * Overridable function to return array of labels to use for this slider.
1475 * Can specify a getLabels() method instead of a labels[] array, or min/max attributes.
1475 * Can specify a getLabels() method instead of a labels[] array, or min/max attributes.
1476 */
1476 */
1477 getLabels(): string[];
1477 getLabels(): string[];
1478 }
1478 }
1479
1479
1480 interface HorizontalRuleLabelsConstructor extends _WidgetBaseConstructor<HorizontalRuleLabels> { }
1480 interface HorizontalRuleLabelsConstructor extends _WidgetBaseConstructor<HorizontalRuleLabels> { }
1481
1481
1482 /* dijit/form/HorizontalSlider */
1482 /* dijit/form/HorizontalSlider */
1483
1483
1484 interface _SliderMover extends dojo.dnd.Mover { }
1484 interface _SliderMover extends dojo.dnd.Mover { }
1485
1485
1486 /**
1486 /**
1487 * A form widget that allows one to select a value with a horizontally draggable handle
1487 * A form widget that allows one to select a value with a horizontally draggable handle
1488 */
1488 */
1489 interface HorizontalSlider extends _FormValueWidget, _Container {
1489 interface HorizontalSlider extends _FormValueWidget, _Container {
1490 /**
1490 /**
1491 * Show increment/decrement buttons at the ends of the slider?
1491 * Show increment/decrement buttons at the ends of the slider?
1492 */
1492 */
1493 showButtons: boolean;
1493 showButtons: boolean;
1494
1494
1495 /**
1495 /**
1496 * The minimum value the slider can be set to.
1496 * The minimum value the slider can be set to.
1497 */
1497 */
1498 minimum: number;
1498 minimum: number;
1499
1499
1500 /**
1500 /**
1501 * The maximum value the slider can be set to.
1501 * The maximum value the slider can be set to.
1502 */
1502 */
1503 maximum: number;
1503 maximum: number;
1504
1504
1505 /**
1505 /**
1506 * If specified, indicates that the slider handle has only 'discreteValues' possible positions, and that after dragging the handle, it will snap to the nearest possible position.
1506 * If specified, indicates that the slider handle has only 'discreteValues' possible positions, and that after dragging the handle, it will snap to the nearest possible position.
1507 * Thus, the slider has only 'discreteValues' possible values.
1507 * Thus, the slider has only 'discreteValues' possible values.
1508 *
1508 *
1509 * For example, if minimum=10, maxiumum=30, and discreteValues=3, then the slider handle has three possible positions, representing values 10, 20, or 30.
1509 * For example, if minimum=10, maxiumum=30, and discreteValues=3, then the slider handle has three possible positions, representing values 10, 20, or 30.
1510 *
1510 *
1511 * If discreteValues is not specified or if it's value is higher than the number of pixels in the slider bar, then the slider handle can be moved freely, and the slider's value will be computed/reported based on pixel position (in this case it will likely be fractional, such as 123.456789).
1511 * If discreteValues is not specified or if it's value is higher than the number of pixels in the slider bar, then the slider handle can be moved freely, and the slider's value will be computed/reported based on pixel position (in this case it will likely be fractional, such as 123.456789).
1512 */
1512 */
1513 discreteValues: number;
1513 discreteValues: number;
1514
1514
1515 /**
1515 /**
1516 * If discreteValues is also specified, this indicates the amount of clicks (ie, snap positions) that the slider handle is moved via pageup/pagedown keys.
1516 * If discreteValues is also specified, this indicates the amount of clicks (ie, snap positions) that the slider handle is moved via pageup/pagedown keys.
1517 * If discreteValues is not specified, it indicates the number of pixels.
1517 * If discreteValues is not specified, it indicates the number of pixels.
1518 */
1518 */
1519 pageIncrement: number;
1519 pageIncrement: number;
1520
1520
1521 /**
1521 /**
1522 * If clicking the slider bar changes the value or not
1522 * If clicking the slider bar changes the value or not
1523 */
1523 */
1524 clickSelect: boolean;
1524 clickSelect: boolean;
1525
1525
1526 /**
1526 /**
1527 * The time in ms to take to animate the slider handle from 0% to 100%, when clicking the slider bar to make the handle move.
1527 * The time in ms to take to animate the slider handle from 0% to 100%, when clicking the slider bar to make the handle move.
1528 */
1528 */
1529 slideDuration: number;
1529 slideDuration: number;
1530
1530
1531 _mousePixelCoord: string;
1531 _mousePixelCoord: string;
1532 _pixelCount: string;
1532 _pixelCount: string;
1533 _startingPixelCoord: string;
1533 _startingPixelCoord: string;
1534 _handleOffsetCoord: string;
1534 _handleOffsetCoord: string;
1535 _progressPixelSize: string;
1535 _progressPixelSize: string;
1536
1536
1537 _onKeyUp(e: Event): void;
1537 _onKeyUp(e: Event): void;
1538 _onKeyDown(e: Event): void;
1538 _onKeyDown(e: Event): void;
1539 _onHandleClick(e: Event): void;
1539 _onHandleClick(e: Event): void;
1540
1540
1541 /**
1541 /**
1542 * Returns true if direction is from right to left
1542 * Returns true if direction is from right to left
1543 */
1543 */
1544 _isReversed(): boolean;
1544 _isReversed(): boolean;
1545
1545
1546 _onBarClick(e: Event): void;
1546 _onBarClick(e: Event): void;
1547
1547
1548 _setPixelValue(pixelValue: number, maxPixels: number, priorityChange?: boolean): void;
1548 _setPixelValue(pixelValue: number, maxPixels: number, priorityChange?: boolean): void;
1549
1549
1550 _setValueAttr(value: number, priorityChange?: boolean): void;
1550 _setValueAttr(value: number, priorityChange?: boolean): void;
1551
1551
1552 _bumpValue(signedChange: number, priorityChange: boolean): void;
1552 _bumpValue(signedChange: number, priorityChange: boolean): void;
1553
1553
1554 _onClkBumper(val: any): void;
1554 _onClkBumper(val: any): void;
1555 _onClkIncBumper(): void;
1555 _onClkIncBumper(): void;
1556 _onClkDecBumper(): void;
1556 _onClkDecBumper(): void;
1557
1557
1558 decrement(e: Event): void;
1558 decrement(e: Event): void;
1559 increment(e: Event): void;
1559 increment(e: Event): void;
1560
1560
1561 _mouseWheeled(evt: Event): void;
1561 _mouseWheeled(evt: Event): void;
1562
1562
1563 _typematicCallback(count: number, button: Element, e: Event): void;
1563 _typematicCallback(count: number, button: Element, e: Event): void;
1564 }
1564 }
1565
1565
1566 interface HorizontalSliderConstructor extends _WidgetBaseConstructor<HorizontalSlider> {
1566 interface HorizontalSliderConstructor extends _WidgetBaseConstructor<HorizontalSlider> {
1567 /**
1567 /**
1568 * for monkey patching
1568 * for monkey patching
1569 */
1569 */
1570 _Mover: _SliderMover;
1570 _Mover: _SliderMover;
1571 }
1571 }
1572
1572
1573 /* dijit/form/MappedTextBox */
1573 /* dijit/form/MappedTextBox */
1574
1574
1575 interface MappedTextBox<C extends Constraints> extends ValidationTextBox<C> {
1575 interface MappedTextBox<C extends Constraints> extends ValidationTextBox<C> {
1576 postMixInProperties(): void;
1576 postMixInProperties(): void;
1577 serialize: SerializationFunction;
1577 serialize: SerializationFunction;
1578 toString(): string;
1578 toString(): string;
1579 validate(isFocused?: boolean): boolean;
1579 validate(isFocused?: boolean): boolean;
1580 buildRendering(): void;
1580 buildRendering(): void;
1581 reset(): void;
1581 reset(): void;
1582 }
1582 }
1583
1583
1584 interface MappedTextBoxConstructor extends _WidgetBaseConstructor<MappedTextBox<Constraints>> {
1584 interface MappedTextBoxConstructor extends _WidgetBaseConstructor<MappedTextBox<Constraints>> {
1585 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): MappedTextBox<C>;
1585 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): MappedTextBox<C>;
1586 }
1586 }
1587
1587
1588 /* dijit/form/NumberSpinner */
1588 /* dijit/form/NumberSpinner */
1589
1589
1590 interface NumberSpinner extends _Spinner, NumberTextBoxMixin {
1590 interface NumberSpinner extends _Spinner, NumberTextBoxMixin {
1591 constraints: NumberTextBoxConstraints;
1591 constraints: NumberTextBoxConstraints;
1592 baseClass: string;
1592 baseClass: string;
1593 adjust(val: any, delta: number): any;
1593 adjust(val: any, delta: number): any;
1594
1594
1595 /* overrides */
1595 /* overrides */
1596 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1596 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1597 parse(value: string, constraints: NumberTextBoxConstraints): string;
1597 parse(value: string, constraints: NumberTextBoxConstraints): string;
1598 format(value: number, constraints: NumberTextBoxConstraints): string;
1598 format(value: number, constraints: NumberTextBoxConstraints): string;
1599 filter(value: number): number;
1599 filter(value: number): number;
1600 value: number;
1600 value: number;
1601 }
1601 }
1602
1602
1603 interface NumberSpinnerConstructor extends _WidgetBaseConstructor<NumberSpinner> { }
1603 interface NumberSpinnerConstructor extends _WidgetBaseConstructor<NumberSpinner> { }
1604
1604
1605 /* dijit/form/NumberTextBox */
1605 /* dijit/form/NumberTextBox */
1606
1606
1607 interface NumberTextBoxConstraints extends RangeBoundTextBoxConstraints, dojo.NumberFormatOptions, dojo.NumberParseOptions { }
1607 interface NumberTextBoxConstraints extends RangeBoundTextBoxConstraints, dojo.NumberFormatOptions, dojo.NumberParseOptions { }
1608
1608
1609 interface NumberTextBoxMixin {
1609 interface NumberTextBoxMixin {
1610 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1610 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1611 constraints: NumberTextBoxConstraints;
1611 constraints: NumberTextBoxConstraints;
1612 value: number;
1612 value: number;
1613 editOptions: { pattern: string };
1613 editOptions: { pattern: string };
1614 _formatter: (value: number, options?: dojo.NumberFormatOptions) => string;
1614 _formatter: (value: number, options?: dojo.NumberFormatOptions) => string;
1615 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1615 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1616 _decimalInfo: (constraints: Constraints) => { sep: string; places: number; };
1616 _decimalInfo: (constraints: Constraints) => { sep: string; places: number; };
1617 postMixInProperties(): void;
1617 postMixInProperties(): void;
1618 format(value: number, constraints: NumberTextBoxConstraints): string;
1618 format(value: number, constraints: NumberTextBoxConstraints): string;
1619 _parser: (expression: string, options?: dojo.NumberParseOptions) => number;
1619 _parser: (expression: string, options?: dojo.NumberParseOptions) => number;
1620 parse(value: string, constraints: dojo.NumberParseOptions): string;
1620 parse(value: string, constraints: dojo.NumberParseOptions): string;
1621 filter(value: number): number;
1621 filter(value: number): number;
1622 serialize: SerializationFunction;
1622 serialize: SerializationFunction;
1623 isValid(isFocused: boolean): boolean;
1623 isValid(isFocused: boolean): boolean;
1624 }
1624 }
1625
1625
1626 interface NumberTextBoxMixinConstructor extends _WidgetBaseConstructor<NumberTextBoxMixin> { }
1626 interface NumberTextBoxMixinConstructor extends _WidgetBaseConstructor<NumberTextBoxMixin> { }
1627
1627
1628 interface NumberTextBox extends RangeBoundTextBox, NumberTextBoxMixin {
1628 interface NumberTextBox extends RangeBoundTextBox, NumberTextBoxMixin {
1629 constraints: NumberTextBoxConstraints;
1629 constraints: NumberTextBoxConstraints;
1630 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1630 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1631 parse(value: string, constraints: dojo.NumberParseOptions): string;
1631 parse(value: string, constraints: dojo.NumberParseOptions): string;
1632 format(value: number, constraints: dojo.NumberFormatOptions): string;
1632 format(value: number, constraints: dojo.NumberFormatOptions): string;
1633 value: number;
1633 value: number;
1634 filter(value: number): number;
1634 filter(value: number): number;
1635 }
1635 }
1636
1636
1637 interface NumberTextBoxConstructor extends _WidgetBaseConstructor<NumberTextBox> {
1637 interface NumberTextBoxConstructor extends _WidgetBaseConstructor<NumberTextBox> {
1638 Mixin: NumberTextBoxMixinConstructor;
1638 Mixin: NumberTextBoxMixinConstructor;
1639 }
1639 }
1640
1640
1641 /* dijit/form/RadioButton */
1641 /* dijit/form/RadioButton */
1642
1642
1643 interface RadioButton extends CheckBox, _RadioButtonMixin {
1643 interface RadioButton extends CheckBox, _RadioButtonMixin {
1644 baseClass: string;
1644 baseClass: string;
1645 }
1645 }
1646
1646
1647 interface RadioButtonConstructor extends _WidgetBaseConstructor<RadioButton> { }
1647 interface RadioButtonConstructor extends _WidgetBaseConstructor<RadioButton> { }
1648
1648
1649 /* dijit/form/RangeBoundTextBox */
1649 /* dijit/form/RangeBoundTextBox */
1650
1650
1651 interface RangeBoundTextBoxConstraints extends Constraints {
1651 interface RangeBoundTextBoxConstraints extends Constraints {
1652 min?: number;
1652 min?: number;
1653 max?: number;
1653 max?: number;
1654 }
1654 }
1655
1655
1656 interface RangeBoundTextBox extends MappedTextBox<RangeBoundTextBoxConstraints> {
1656 interface RangeBoundTextBox extends MappedTextBox<RangeBoundTextBoxConstraints> {
1657 /**
1657 /**
1658 * The message to display if value is out-of-range
1658 * The message to display if value is out-of-range
1659 */
1659 */
1660 rangeMessage: string;
1660 rangeMessage: string;
1661
1661
1662 /**
1662 /**
1663 * Overridable function used to validate the range of the numeric input value.
1663 * Overridable function used to validate the range of the numeric input value.
1664 */
1664 */
1665 rangeCheck(primative: number, constraints: RangeBoundTextBoxConstraints): boolean;
1665 rangeCheck(primative: number, constraints: RangeBoundTextBoxConstraints): boolean;
1666
1666
1667 /**
1667 /**
1668 * Tests if the value is in the min/max range specified in constraints
1668 * Tests if the value is in the min/max range specified in constraints
1669 */
1669 */
1670 isInRange(isFocused: boolean): boolean;
1670 isInRange(isFocused: boolean): boolean;
1671
1671
1672 /**
1672 /**
1673 * Returns true if the value is out of range and will remain
1673 * Returns true if the value is out of range and will remain
1674 * out of range even if the user types more characters
1674 * out of range even if the user types more characters
1675 */
1675 */
1676 _isDefinitelyOutOfRange(): boolean;
1676 _isDefinitelyOutOfRange(): boolean;
1677
1677
1678 isValid(isFocused: boolean): boolean;
1678 isValid(isFocused: boolean): boolean;
1679 getErrorMessage(isFocused: boolean): string;
1679 getErrorMessage(isFocused: boolean): string;
1680 postMixInProperties(): void;
1680 postMixInProperties(): void;
1681 }
1681 }
1682
1682
1683 interface RangeBoundTextBoxConstructor extends _WidgetBaseConstructor<RangeBoundTextBox> { }
1683 interface RangeBoundTextBoxConstructor extends _WidgetBaseConstructor<RangeBoundTextBox> { }
1684
1684
1685 /* dijit/form/Select */
1685 /* dijit/form/Select */
1686
1686
1687 interface Select<T extends Object, Q extends dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions, U extends dijit._WidgetBase> extends _FormSelectWidget<T, Q, O>, _HasDropDown<U>, _KeyNavMixin {
1687 interface Select<T extends Object, Q extends dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions, U extends dijit._WidgetBase> extends _FormSelectWidget<T, Q, O>, _HasDropDown<U>, _KeyNavMixin {
1688 baseClass: string;
1688 baseClass: string;
1689
1689
1690 /**
1690 /**
1691 * What to display in an "empty" drop down.
1691 * What to display in an "empty" drop down.
1692 */
1692 */
1693 emptyLabel: string;
1693 emptyLabel: string;
1694
1694
1695 /**
1695 /**
1696 * Specifies how to interpret the labelAttr in the data store items.
1696 * Specifies how to interpret the labelAttr in the data store items.
1697 */
1697 */
1698 labelType: string;
1698 labelType: string;
1699
1699
1700 /**
1700 /**
1701 * Currently displayed error/prompt message
1701 * Currently displayed error/prompt message
1702 */
1702 */
1703 message: string;
1703 message: string;
1704
1704
1705 /**
1705 /**
1706 * Can be true or false, default is false.
1706 * Can be true or false, default is false.
1707 */
1707 */
1708 required: boolean;
1708 required: boolean;
1709
1709
1710 /**
1710 /**
1711 * "Incomplete" if this select is required but unset (i.e. blank value), "" otherwise
1711 * "Incomplete" if this select is required but unset (i.e. blank value), "" otherwise
1712 */
1712 */
1713 state: string;
1713 state: string;
1714
1714
1715 /**
1715 /**
1716 * Order fields are traversed when user hits the tab key
1716 * Order fields are traversed when user hits the tab key
1717 */
1717 */
1718 tabIndex: any;
1718 tabIndex: any;
1719 templateString: any;
1719 templateString: any;
1720
1720
1721 /**
1721 /**
1722 * See the description of dijit/Tooltip.defaultPosition for details on this parameter.
1722 * See the description of dijit/Tooltip.defaultPosition for details on this parameter.
1723 */
1723 */
1724 tooltipPosition: any;
1724 tooltipPosition: any;
1725
1725
1726 childSelector(node: Element | Node): boolean;
1726 childSelector(node: Element | Node): boolean;
1727 destroy(preserveDom: boolean): void;
1727 destroy(preserveDom: boolean): void;
1728 focus(): void;
1728 focus(): void;
1729
1729
1730 /**
1730 /**
1731 * Sets the value to the given option, used during search by letter.
1731 * Sets the value to the given option, used during search by letter.
1732 * @param widget Reference to option's widget
1732 * @param widget Reference to option's widget
1733 */
1733 */
1734 focusChild(widget: dijit._WidgetBase): void;
1734 focusChild(widget: dijit._WidgetBase): void;
1735 isLoaded(): boolean;
1735 isLoaded(): boolean;
1736
1736
1737 /**
1737 /**
1738 * Whether or not this is a valid value.
1738 * Whether or not this is a valid value.
1739 * @param isFocused
1739 * @param isFocused
1740 */
1740 */
1741 isValid(isFocused: boolean): boolean;
1741 isValid(isFocused: boolean): boolean;
1742
1742
1743 /**
1743 /**
1744 * populates the menu
1744 * populates the menu
1745 * @param loadCallback
1745 * @param loadCallback
1746 */
1746 */
1747 loadDropDown(loadCallback: () => any): void;
1747 loadDropDown(loadCallback: () => any): void;
1748 postCreate(): void;
1748 postCreate(): void;
1749
1749
1750 /**
1750 /**
1751 * set the missing message
1751 * set the missing message
1752 */
1752 */
1753 postMixInProperties(): void;
1753 postMixInProperties(): void;
1754
1754
1755 /**
1755 /**
1756 * Overridden so that the state will be cleared.
1756 * Overridden so that the state will be cleared.
1757 */
1757 */
1758 reset(): void;
1758 reset(): void;
1759 startup(): void;
1759 startup(): void;
1760
1760
1761 /**
1761 /**
1762 * Called by oninit, onblur, and onkeypress, and whenever required/disabled state changes
1762 * Called by oninit, onblur, and onkeypress, and whenever required/disabled state changes
1763 * @param isFocused
1763 * @param isFocused
1764 */
1764 */
1765 validate(isFocused: boolean): boolean;
1765 validate(isFocused: boolean): boolean;
1766
1766
1767 /**
1767 /**
1768 * When a key is pressed that matches a child item,
1768 * When a key is pressed that matches a child item,
1769 * this method is called so that a widget can take
1769 * this method is called so that a widget can take
1770 * appropriate action is necessary.
1770 * appropriate action is necessary.
1771 * @param item
1771 * @param item
1772 * @param evt
1772 * @param evt
1773 * @param searchString
1773 * @param searchString
1774 * @param numMatches
1774 * @param numMatches
1775 */
1775 */
1776 onKeyboardSearch(item: dijit._WidgetBase, evt: Event, searchString: string, numMatches: number): void;
1776 onKeyboardSearch(item: dijit._WidgetBase, evt: Event, searchString: string, numMatches: number): void;
1777 }
1777 }
1778
1778
1779 interface SelectConstructor extends _WidgetBaseConstructor<Select<any, any, any, any>> { }
1779 interface SelectConstructor extends _WidgetBaseConstructor<Select<any, any, any, any>> { }
1780
1780
1781 /* dijit/form/SimpleTextarea */
1781 /* dijit/form/SimpleTextarea */
1782
1782
1783 interface SimpleTextarea extends TextBox {
1783 interface SimpleTextarea extends TextBox {
1784 baseClass: string;
1784 baseClass: string;
1785 rows: string;
1785 rows: string;
1786 cols: string;
1786 cols: string;
1787 templateString: string;
1787 templateString: string;
1788 postMixInProperties(): void;
1788 postMixInProperties(): void;
1789 buildRendering(): void;
1789 buildRendering(): void;
1790 filter(value: string): string;
1790 filter(value: string): string;
1791 }
1791 }
1792
1792
1793 interface SimpleTextareaConstructor extends _WidgetBaseConstructor<SimpleTextarea> {
1793 interface SimpleTextareaConstructor extends _WidgetBaseConstructor<SimpleTextarea> {
1794 new (params: Object, srcNodeRef: dojo.NodeOrString): SimpleTextarea;
1794 new (params: Object, srcNodeRef: dojo.NodeOrString): SimpleTextarea;
1795 }
1795 }
1796
1796
1797 /* dijit/form/Textarea */
1797 /* dijit/form/Textarea */
1798
1798
1799 interface Textarea extends SimpleTextarea, _ExpandingTextAreaMixin {
1799 interface Textarea extends SimpleTextarea, _ExpandingTextAreaMixin {
1800 baseClass: string;
1800 baseClass: string;
1801 cols: string;
1801 cols: string;
1802 buildRendering(): void;
1802 buildRendering(): void;
1803 }
1803 }
1804
1804
1805 interface TextareaConstructor extends _WidgetBaseConstructor<Textarea> { }
1805 interface TextareaConstructor extends _WidgetBaseConstructor<Textarea> { }
1806
1806
1807 /* dijit/form/TextBox */
1807 /* dijit/form/TextBox */
1808
1808
1809 interface TextBox extends _FormValueWidget, _TextBoxMixin<Constraints> {
1809 interface TextBox extends _FormValueWidget, _TextBoxMixin<Constraints> {
1810 // set(name: 'displayedValue', value: string): this;
1810 // set(name: 'displayedValue', value: string): this;
1811 // set(name: 'disabled', value: boolean): this;
1811 // set(name: 'disabled', value: boolean): this;
1812 // set(name: 'value', value: string): this;
1812 // set(name: 'value', value: string): this;
1813 // set(name: string, value: any): this;
1813 // set(name: string, value: any): this;
1814 // set(values: Object): this;
1814 // set(values: Object): this;
1815
1815
1816 // get(name: 'displayedValue'): string;
1816 // get(name: 'displayedValue'): string;
1817 // get(name: 'value'): string;
1817 // get(name: 'value'): string;
1818 // get(name: string): any;
1818 // get(name: string): any;
1819 }
1819 }
1820
1820
1821 interface TextBoxConstructor extends _WidgetBaseConstructor<TextBox> { }
1821 interface TextBoxConstructor extends _WidgetBaseConstructor<TextBox> { }
1822
1822
1823 /* dijit/form/ToggleButton */
1823 /* dijit/form/ToggleButton */
1824
1824
1825 interface ToggleButton extends Button, _ToggleButtonMixin {
1825 interface ToggleButton extends Button, _ToggleButtonMixin {
1826 baseClass: string;
1826 baseClass: string;
1827
1827
1828 setChecked(checked: boolean): void;
1828 setChecked(checked: boolean): void;
1829
1829
1830 // set(name: 'checked', value: boolean): this;
1830 // set(name: 'checked', value: boolean): this;
1831 // set(name: string, value: any): this;
1831 // set(name: string, value: any): this;
1832 // set(values: Object): this;
1832 // set(values: Object): this;
1833 }
1833 }
1834
1834
1835 interface ToggleButtonConstructor extends _WidgetBaseConstructor<ToggleButton> { }
1835 interface ToggleButtonConstructor extends _WidgetBaseConstructor<ToggleButton> { }
1836
1836
1837 /* dijit/form/ValidationTextBox */
1837 /* dijit/form/ValidationTextBox */
1838
1838
1839 interface IsValidFunction {
1839 interface IsValidFunction {
1840 (isFocused?: boolean): boolean;
1840 (isFocused?: boolean): boolean;
1841 }
1841 }
1842
1842
1843 interface ValidationTextBox<C extends Constraints> extends TextBox {
1843 interface ValidationTextBox<C extends Constraints = Constraints> extends TextBox {
1844 templateString: string;
1844 templateString: string;
1845 required: boolean;
1845 required: boolean;
1846 promptMessage: string;
1846 promptMessage: string;
1847 invalidMessage: string;
1847 invalidMessage: string;
1848 missingMessage: string;
1848 missingMessage: string;
1849 message: string;
1849 message: string;
1850 constraints: C;
1850 constraints: C;
1851 pattern: string | ConstraintsToRegExpString<C>;
1851 pattern: string | ConstraintsToRegExpString<C>;
1852 regExp: string;
1852 regExp: string;
1853 regExpGen(constraints: C): void;
1853 regExpGen(constraints: C): void;
1854 state: string;
1854 state: string;
1855 tooltipPosition: string[];
1855 tooltipPosition: string[];
1856 validator: ConstrainedValidFunction<C>;
1856 validator: ConstrainedValidFunction<C>;
1857 isValid: IsValidFunction;
1857 isValid: IsValidFunction;
1858 getErrorMessage(isFocused: boolean): string;
1858 getErrorMessage(isFocused: boolean): string;
1859 getPromptMessage(isFocused: boolean): string;
1859 getPromptMessage(isFocused: boolean): string;
1860 validate(isFocused: boolean): boolean;
1860 validate(isFocused: boolean): boolean;
1861 displayMessage(message: string): void;
1861 displayMessage(message: string): void;
1862
1862
1863 startup(): void;
1863 startup(): void;
1864 postMixInProperties(): void;
1864 postMixInProperties(): void;
1865
1865
1866 reset(): void;
1866 reset(): void;
1867
1867
1868 destroy(preserveDom?: boolean): void;
1868 destroy(preserveDom?: boolean): void;
1869
1869
1870 // set(name: 'constraints', value: Constraints): this;
1870 // set(name: 'constraints', value: Constraints): this;
1871 // set(name: 'disabled', value: boolean): this;
1871 // set(name: 'disabled', value: boolean): this;
1872 // set(name: 'message', value: string): this;
1872 // set(name: 'message', value: string): this;
1873 // set(name: 'pattern', value: string | ConstraintsToRegExpString<C>): this;
1873 // set(name: 'pattern', value: string | ConstraintsToRegExpString<C>): this;
1874 // set(name: 'regExp', value: string): this;
1874 // set(name: 'regExp', value: string): this;
1875 // set(name: 'regExpGen', value: Constraints): this;
1875 // set(name: 'regExpGen', value: Constraints): this;
1876 // set(name: 'required', value: boolean): this;
1876 // set(name: 'required', value: boolean): this;
1877 // set(name: 'value', value: string): this;
1877 // set(name: 'value', value: string): this;
1878 // set(name: string, value: any): this;
1878 // set(name: string, value: any): this;
1879 // set(values: Object): this;
1879 // set(values: Object): this;
1880
1880
1881 // get(name: 'pattern'): string | ConstraintsToRegExpString<C>;
1881 // get(name: 'pattern'): string | ConstraintsToRegExpString<C>;
1882 // get(name: string): any;
1882 // get(name: string): any;
1883 }
1883 }
1884
1884
1885 interface ValidationTextBoxConstructor extends _WidgetBaseConstructor<ValidationTextBox<Constraints>> {
1885 interface ValidationTextBoxConstructor extends _WidgetBaseConstructor<ValidationTextBox<Constraints>> {
1886 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): ValidationTextBox<C>;
1886 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): ValidationTextBox<C>;
1887 }
1887 }
1888 }
1888 }
1889 }
1889 }
@@ -1,670 +1,670
1 declare namespace dijit {
1 declare namespace dijit {
2
2
3 namespace layout {
3 namespace layout {
4
4
5 /* dijit/_LayoutWidget */
5 /* dijit/_LayoutWidget */
6
6
7 /* tslint:disable:class-name */
7 /* tslint:disable:class-name */
8 interface _LayoutWidget extends _Widget, _Container, _Contained {
8 interface _LayoutWidget extends _Widget, _Container, _Contained {
9
9
10 /**
10 /**
11 * Base class for a _Container widget which is responsible for laying
11 * Base class for a _Container widget which is responsible for laying
12 * out its children. Widgets which mixin this code must define layout()
12 * out its children. Widgets which mixin this code must define layout()
13 * to manage placement and sizing of the children.
13 * to manage placement and sizing of the children.
14 */
14 */
15 baseClass: string;
15 baseClass: string;
16 /**
16 /**
17 * Indicates that this widget is going to call resize() on its
17 * Indicates that this widget is going to call resize() on its
18 * children widgets, setting their size, when they become visible.
18 * children widgets, setting their size, when they become visible.
19 */
19 */
20 isLayoutContainer: boolean;
20 isLayoutContainer: boolean;
21
21
22 /**
22 /**
23 * Call this to resize a widget, or after its size has changed.
23 * Call this to resize a widget, or after its size has changed.
24 *
24 *
25 * ####Change size mode:
25 * ####Change size mode:
26 *
26 *
27 * When changeSize is specified, changes the marginBox of this widget
27 * When changeSize is specified, changes the marginBox of this widget
28 * and forces it to re-layout its contents accordingly.
28 * and forces it to re-layout its contents accordingly.
29 * changeSize may specify height, width, or both.
29 * changeSize may specify height, width, or both.
30 *
30 *
31 * If resultSize is specified it indicates the size the widget will
31 * If resultSize is specified it indicates the size the widget will
32 * become after changeSize has been applied.
32 * become after changeSize has been applied.
33 *
33 *
34 * ####Notification mode:
34 * ####Notification mode:
35 *
35 *
36 * When changeSize is null, indicates that the caller has already changed
36 * When changeSize is null, indicates that the caller has already changed
37 * the size of the widget, or perhaps it changed because the browser
37 * the size of the widget, or perhaps it changed because the browser
38 * window was resized. Tells widget to re-layout its contents accordingly.
38 * window was resized. Tells widget to re-layout its contents accordingly.
39 *
39 *
40 * If resultSize is also specified it indicates the size the widget has
40 * If resultSize is also specified it indicates the size the widget has
41 * become.
41 * become.
42 *
42 *
43 * In either mode, this method also:
43 * In either mode, this method also:
44 *
44 *
45 * 1. Sets this._borderBox and this._contentBox to the new size of
45 * 1. Sets this._borderBox and this._contentBox to the new size of
46 * the widget. Queries the current domNode size if necessary.
46 * the widget. Queries the current domNode size if necessary.
47 * 2. Calls layout() to resize contents (and maybe adjust child widgets).
47 * 2. Calls layout() to resize contents (and maybe adjust child widgets).
48 */
48 */
49 resize(changeSize?: dojo.DomGeometryBox, resultSize?: dojo.DomGeometryWidthHeight): void;
49 resize(changeSize?: dojo.DomGeometryBox, resultSize?: dojo.DomGeometryWidthHeight): void;
50
50
51 /**
51 /**
52 * Widgets override this method to size and position their contents/children.
52 * Widgets override this method to size and position their contents/children.
53 * When this is called, this._contentBox is guaranteed to be set (see resize()).
53 * When this is called, this._contentBox is guaranteed to be set (see resize()).
54 *
54 *
55 * This is called after startup(), and also when the widget's size has been
55 * This is called after startup(), and also when the widget's size has been
56 * changed.
56 * changed.
57 */
57 */
58 layout(): void;
58 layout(): void;
59 }
59 }
60
60
61 interface _LayoutWidgetConstructor extends _WidgetBaseConstructor<_LayoutWidget> { }
61 interface _LayoutWidgetConstructor extends _WidgetBaseConstructor<_LayoutWidget> { }
62
62
63 /* dijit/layout/_TabContainerBase */
63 /* dijit/layout/_TabContainerBase */
64
64
65 interface _TabContainerBase extends StackContainer, _TemplatedMixin {
65 interface _TabContainerBase extends StackContainer, _TemplatedMixin {
66 /**
66 /**
67 * Defines where tabs go relative to tab content.
67 * Defines where tabs go relative to tab content.
68 * "top", "bottom", "left-h", "right-h"
68 * "top", "bottom", "left-h", "right-h"
69 */
69 */
70 tabPosition: string;
70 tabPosition: string;
71 // tabPosition: 'top' | 'bottom' | 'left-h' | 'right-h';
71 // tabPosition: 'top' | 'bottom' | 'left-h' | 'right-h';
72
72
73 /**
73 /**
74 * Defines whether the tablist gets an extra class for layouting, putting a border/shading
74 * Defines whether the tablist gets an extra class for layouting, putting a border/shading
75 * around the set of tabs. Not supported by claro theme.
75 * around the set of tabs. Not supported by claro theme.
76 */
76 */
77 tabStrip: boolean;
77 tabStrip: boolean;
78
78
79 /**
79 /**
80 * If true, use styling for a TabContainer nested inside another TabContainer.
80 * If true, use styling for a TabContainer nested inside another TabContainer.
81 * For tundra etc., makes tabs look like links, and hides the outer
81 * For tundra etc., makes tabs look like links, and hides the outer
82 * border since the outer TabContainer already has a border.
82 * border since the outer TabContainer already has a border.
83 */
83 */
84 nested: boolean;
84 nested: boolean;
85 }
85 }
86
86
87 /* dijit/layout/LayoutContainer */
87 /* dijit/layout/LayoutContainer */
88
88
89 interface LayoutContainer extends _LayoutWidget {
89 interface LayoutContainer extends _LayoutWidget {
90 /**
90 /**
91 * Which design is used for the layout:
91 * Which design is used for the layout:
92 *
92 *
93 * - "headline" (default) where the top and bottom extend the full width of the container
93 * - "headline" (default) where the top and bottom extend the full width of the container
94 * - "sidebar" where the left and right sides extend from top to bottom.
94 * - "sidebar" where the left and right sides extend from top to bottom.
95 *
95 *
96 * However, a `layoutPriority` setting on child panes overrides the `design` attribute on the parent.
96 * However, a `layoutPriority` setting on child panes overrides the `design` attribute on the parent.
97 * In other words, if the top and bottom sections have a lower `layoutPriority` than the left and right
97 * In other words, if the top and bottom sections have a lower `layoutPriority` than the left and right
98 * panes, the top and bottom panes will extend the entire width of the box.
98 * panes, the top and bottom panes will extend the entire width of the box.
99 */
99 */
100 design: string;
100 design: string;
101 // design: 'headline' | 'sidebar';
101 // design: 'headline' | 'sidebar';
102
102
103 addChild<T extends _WidgetBase>(child: T, insertIndex?: number): void;
103 addChild<T extends _WidgetBase>(child: T, insertIndex?: number): void;
104 removeChild<T extends _WidgetBase>(child: T): void;
104 removeChild<T extends _WidgetBase>(child: T): void;
105 }
105 }
106
106
107 interface LayoutContainerConstructor extends _WidgetBaseConstructor<LayoutContainer> { }
107 interface LayoutContainerConstructor extends _WidgetBaseConstructor<LayoutContainer> { }
108
108
109 /* dijit/layout/AccordionContainer */
109 /* dijit/layout/AccordionContainer */
110
110
111 interface _AccordionButton extends _WidgetBase, _TemplatedMixin, _CssStateMixin {
111 interface _AccordionButton extends _WidgetBase, _TemplatedMixin, _CssStateMixin {
112 /**
112 /**
113 * Title of the pane.
113 * Title of the pane.
114 */
114 */
115 label: string;
115 label: string;
116
116
117 /**
117 /**
118 * Tooltip that appears on hover.
118 * Tooltip that appears on hover.
119 */
119 */
120 title: string;
120 title: string;
121
121
122 /**
122 /**
123 * CSS class for icon to left of label.
123 * CSS class for icon to left of label.
124 */
124 */
125 iconClassAttr: string;
125 iconClassAttr: string;
126
126
127 /**
127 /**
128 * Returns the height of the title dom node.
128 * Returns the height of the title dom node.
129 */
129 */
130 getTitleHeight(): number;
130 getTitleHeight(): number;
131 }
131 }
132
132
133 interface _AccordionButtonConstructor extends _WidgetBaseConstructor<_AccordionButton> { }
133 interface _AccordionButtonConstructor extends _WidgetBaseConstructor<_AccordionButton> { }
134
134
135 interface AccordionContainer extends StackContainer {
135 interface AccordionContainer extends StackContainer {
136 /**
136 /**
137 * Amount of time (in ms) it takes to slide panes.
137 * Amount of time (in ms) it takes to slide panes.
138 */
138 */
139 duration: number;
139 duration: number;
140
140
141 /**
141 /**
142 * The name of the widget used to display the title of each pane.
142 * The name of the widget used to display the title of each pane.
143 */
143 */
144 buttonWidget: _AccordionButtonConstructor;
144 buttonWidget: _AccordionButtonConstructor;
145 }
145 }
146
146
147 interface AccordionContainerConstructor extends _WidgetBaseConstructor<AccordionContainer> { }
147 interface AccordionContainerConstructor extends _WidgetBaseConstructor<AccordionContainer> { }
148
148
149 /* dijit/layout/AccordionPane */
149 /* dijit/layout/AccordionPane */
150
150
151 interface AccordionPane extends ContentPane {
151 interface AccordionPane extends ContentPane {
152 /**
152 /**
153 * Called when this pane is selected.
153 * Called when this pane is selected.
154 */
154 */
155 onSelected(): void;
155 onSelected(): void;
156 }
156 }
157
157
158 interface AccordionPaneConstructor extends _WidgetBaseConstructor<AccordionPane> { }
158 interface AccordionPaneConstructor extends _WidgetBaseConstructor<AccordionPane> { }
159
159
160 /* dijit/layout/BorderContainer */
160 /* dijit/layout/BorderContainer */
161
161
162 interface BorderContainer extends LayoutContainer {
162 interface BorderContainer extends LayoutContainer {
163 /**
163 /**
164 * Give each pane a border and margin.
164 * Give each pane a border and margin.
165 * Margin determined by domNode.paddingLeft.
165 * Margin determined by domNode.paddingLeft.
166 * When false, only resizable panes have a gutter (i.e. draggable splitter) for resizing.
166 * When false, only resizable panes have a gutter (i.e. draggable splitter) for resizing.
167 */
167 */
168 gutters: boolean;
168 gutters: boolean;
169
169
170 /**
170 /**
171 * Specifies whether splitters resize as you drag (true) or only upon mouseup (false)
171 * Specifies whether splitters resize as you drag (true) or only upon mouseup (false)
172 */
172 */
173 liveSplitters: boolean;
173 liveSplitters: boolean;
174
174
175 /**
175 /**
176 * Save splitter positions in a cookie.
176 * Save splitter positions in a cookie.
177 */
177 */
178 persist: boolean;
178 persist: boolean;
179
179
180 /**
180 /**
181 * Returns the widget responsible for rendering the splitter associated with region.with
181 * Returns the widget responsible for rendering the splitter associated with region.with
182 */
182 */
183 getSplitter(region: string): any;
183 getSplitter(region: string): any;
184
184
185 destroyRecursive(): void;
185 destroyRecursive(): void;
186 }
186 }
187
187
188 interface BorderContainerConstructor extends _WidgetBaseConstructor<BorderContainer> { }
188 interface BorderContainerConstructor extends _WidgetBaseConstructor<BorderContainer> { }
189
189
190 /* dijit/ContentPane */
190 /* dijit/ContentPane */
191
191
192 interface ContentPane extends _Widget, _Container, _ContentPaneResizeMixin {
192 interface ContentPane extends _Widget, _Container, _ContentPaneResizeMixin {
193
193
194 /**
194 /**
195 * The href of the content that displays now
195 * The href of the content that displays now
196 * Set this at construction if you want to load data externally when th
196 * Set this at construction if you want to load data externally when th
197 * pane is shown. (Set preload=true to load it immediately.
197 * pane is shown. (Set preload=true to load it immediately.
198 * Changing href after creation doesn't have any effect; Use set('href', ...);
198 * Changing href after creation doesn't have any effect; Use set('href', ...);
199 */
199 */
200 href: string;
200 href: string;
201
201
202 /**
202 /**
203 * The innerHTML of the ContentPane
203 * The innerHTML of the ContentPane
204 * Note that the initialization parameter / argument to set("content", ...
204 * Note that the initialization parameter / argument to set("content", ...
205 * can be a String, DomNode, Nodelist, or _Widget.
205 * can be a String, DomNode, Nodelist, or _Widget.
206 */
206 */
207 content: dojo.ContentSetterContent | dijit._Widget;
207 content: any;
208
208
209 /**
209 /**
210 * Extract visible content from inside of `<body> .... </body>`
210 * Extract visible content from inside of `<body> .... </body>`
211 * I.e., strip `<html>` and `<head>` (and it's contents) from the href
211 * I.e., strip `<html>` and `<head>` (and it's contents) from the href
212 */
212 */
213 extractContent: boolean;
213 extractContent: boolean;
214
214
215 /**
215 /**
216 * Parse content and create the widgets, if any.
216 * Parse content and create the widgets, if any.
217 */
217 */
218 parseOnLoad: boolean;
218 parseOnLoad: boolean;
219
219
220 /**
220 /**
221 * Flag passed to parser. Root for attribute names to search for. If scopeName is dojo
221 * Flag passed to parser. Root for attribute names to search for. If scopeName is dojo
222 * will search for data-dojo-type (or dojoType). For backwards compatibilit
222 * will search for data-dojo-type (or dojoType). For backwards compatibilit
223 * reasons defaults to dojo._scopeName (which is "dojo" except whe
223 * reasons defaults to dojo._scopeName (which is "dojo" except whe
224 * multi-version support is used, when it will be something like dojo16, dojo20, etc.)
224 * multi-version support is used, when it will be something like dojo16, dojo20, etc.)
225 */
225 */
226 parserScope: string;
226 parserScope: string;
227
227
228 /**
228 /**
229 * Prevent caching of data from href's by appending a timestamp to the href.
229 * Prevent caching of data from href's by appending a timestamp to the href.
230 */
230 */
231 preventCache: boolean;
231 preventCache: boolean;
232
232
233 /**
233 /**
234 * Force load of data on initialization even if pane is hidden.
234 * Force load of data on initialization even if pane is hidden.
235 */
235 */
236 preload: boolean;
236 preload: boolean;
237
237
238 /**
238 /**
239 * Refresh (re-download) content when pane goes from hidden to shown
239 * Refresh (re-download) content when pane goes from hidden to shown
240 */
240 */
241 refreshOnShow: boolean;
241 refreshOnShow: boolean;
242
242
243 /**
243 /**
244 * Message that shows while downloading
244 * Message that shows while downloading
245 */
245 */
246 loadingMessage: string;
246 loadingMessage: string;
247
247
248 /**
248 /**
249 * Message that shows if an error occurs
249 * Message that shows if an error occurs
250 */
250 */
251 errorMessage: string;
251 errorMessage: string;
252
252
253 /**
253 /**
254 * True if the ContentPane has data in it, either specifie
254 * True if the ContentPane has data in it, either specifie
255 * during initialization (via href or inline content), or se
255 * during initialization (via href or inline content), or se
256 * via set('content', ...) / set('href', ...
256 * via set('content', ...) / set('href', ...
257 * False if it doesn't have any content, or if ContentPane i
257 * False if it doesn't have any content, or if ContentPane i
258 * still in the process of downloading href.
258 * still in the process of downloading href.
259 */
259 */
260 isLoaded: boolean;
260 isLoaded: boolean;
261
261
262 baseClass: string;
262 baseClass: string;
263
263
264 /**
264 /**
265 * Function that should grab the content specified via href.
265 * Function that should grab the content specified via href.
266 */
266 */
267 ioMethod<T>(url: string, options?: dojo.request.XhrBaseOptions): dojo.request.Promise<T>;
267 ioMethod<T>(url: string, options?: dojo.request.XhrBaseOptions): dojo.request.Promise<T>;
268
268
269 /**
269 /**
270 * Parameters to pass to xhrGet() request, for example:
270 * Parameters to pass to xhrGet() request, for example:
271 * | <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="href: './bar', ioArgs: {timeout: 500}">
271 * | <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="href: './bar', ioArgs: {timeout: 500}">
272 */
272 */
273 ioArgs: { [arg: string]: string | number };
273 ioArgs: { [arg: string]: string | number };
274
274
275 /**
275 /**
276 * This is the `dojo.Deferred` returned by set('href', ...) and refresh()
276 * This is the `dojo.Deferred` returned by set('href', ...) and refresh()
277 * Calling onLoadDeferred.then() registers you
277 * Calling onLoadDeferred.then() registers you
278 * callback to be called only once, when the prior set('href', ...) call o
278 * callback to be called only once, when the prior set('href', ...) call o
279 * the initial href parameter to the constructor finishes loading
279 * the initial href parameter to the constructor finishes loading
280 * This is different than an onLoad() handler which gets called any time any hre
280 * This is different than an onLoad() handler which gets called any time any hre
281 * or content is loaded.
281 * or content is loaded.
282 */
282 */
283 onLoadDeferred: dojo.Deferred<any>;
283 onLoadDeferred: dojo.Deferred<any>;
284
284
285 /**
285 /**
286 * Flag to parser that I'll parse my contents, so it shouldn't.
286 * Flag to parser that I'll parse my contents, so it shouldn't.
287 */
287 */
288 stopParser: boolean;
288 stopParser: boolean;
289
289
290 /**
290 /**
291 * Flag from the parser that this ContentPane is inside a templat
291 * Flag from the parser that this ContentPane is inside a templat
292 * so the contents are pre-parsed.
292 * so the contents are pre-parsed.
293 */
293 */
294 template: boolean;
294 template: boolean;
295
295
296 markupFactory<T>(params: any, node: HTMLElement, ctor: dojo.GenericConstructor<T>): T;
296 markupFactory<T>(params: any, node: HTMLElement, ctor: dojo.GenericConstructor<T>): T;
297 postMixInProperties(): void;
297 postMixInProperties(): void;
298 buildRendering(): void;
298 buildRendering(): void;
299
299
300 /**
300 /**
301 * Call startup() on all children including non _Widget ones like dojo/dnd/Source objects
301 * Call startup() on all children including non _Widget ones like dojo/dnd/Source objects
302 */
302 */
303 startup(): void;
303 startup(): void;
304
304
305 /**
305 /**
306 * Deprecated. Use set('href', ...) instead.
306 * Deprecated. Use set('href', ...) instead.
307 */
307 */
308 setHref(href: string | URL): ContentPane;
308 setHref(href: string | URL): ContentPane;
309
309
310 /**
310 /**
311 * Deprecated. Use set('content', ...) instead.
311 * Deprecated. Use set('content', ...) instead.
312 */
312 */
313 setContent(data: dojo.ContentSetterContent): ContentPane;
313 setContent(data: dojo.ContentSetterContent): ContentPane;
314
314
315 /**
315 /**
316 * Cancels an in-flight download of content
316 * Cancels an in-flight download of content
317 */
317 */
318 cancel(): void;
318 cancel(): void;
319
319
320 /**
320 /**
321 * [Re]download contents of href and display
321 * [Re]download contents of href and display
322 */
322 */
323 refresh(): dojo.Deferred<any>;
323 refresh(): dojo.Deferred<any>;
324
324
325 /**
325 /**
326 * Destroy all the widgets inside the ContentPane and empty containerNode
326 * Destroy all the widgets inside the ContentPane and empty containerNode
327 */
327 */
328 destroyDescendants(preserveDom?: boolean): void;
328 destroyDescendants(preserveDom?: boolean): void;
329
329
330 /**
330 /**
331 * Event hook, is called after everything is loaded and widgetified
331 * Event hook, is called after everything is loaded and widgetified
332 */
332 */
333 onLoad(data?: any): void;
333 onLoad(data?: any): void;
334
334
335 /**
335 /**
336 * Event hook, is called before old content is cleared
336 * Event hook, is called before old content is cleared
337 */
337 */
338 onUnload(): void;
338 onUnload(): void;
339
339
340 /**
340 /**
341 * Called before download starts.
341 * Called before download starts.
342 */
342 */
343 onDownloadStart(): string;
343 onDownloadStart(): string;
344
344
345 /**
345 /**
346 * Called on DOM faults, require faults etc. in content.
346 * Called on DOM faults, require faults etc. in content.
347 * In order to display an error message in the pane, return
347 * In order to display an error message in the pane, return
348 * the error message from this method, as an HTML string.
348 * the error message from this method, as an HTML string.
349 * By default (if this method is not overriden), it returns
349 * By default (if this method is not overriden), it returns
350 * nothing, so the error message is just printed to the console.
350 * nothing, so the error message is just printed to the console.
351 */
351 */
352 onContentError(error: Error): void;
352 onContentError(error: Error): void;
353
353
354 /**
354 /**
355 * Called when download error occurs.
355 * Called when download error occurs.
356 * In order to display an error message in the pane, return
356 * In order to display an error message in the pane, return
357 * the error message from this method, as an HTML string.
357 * the error message from this method, as an HTML string.
358 * Default behavior (if this method is not overriden) is to display
358 * Default behavior (if this method is not overriden) is to display
359 * the error message inside the pane.
359 * the error message inside the pane.
360 */
360 */
361 onDownloadError(error: Error): void;
361 onDownloadError(error: Error): void;
362
362
363 /**
363 /**
364 * Called when download is finished.
364 * Called when download is finished.
365 */
365 */
366 onDownloadEnd(): void;
366 onDownloadEnd(): void;
367 }
367 }
368
368
369 interface ContentPaneConstructor extends _WidgetBaseConstructor<ContentPane> { }
369 interface ContentPaneConstructor extends _WidgetBaseConstructor<ContentPane> { }
370
370
371 /* dijit/layout/_ContentPaneResizeMixin */
371 /* dijit/layout/_ContentPaneResizeMixin */
372
372
373 /* tslint:disable:class-name */
373 /* tslint:disable:class-name */
374 interface _ContentPaneResizeMixin {
374 interface _ContentPaneResizeMixin {
375
375
376 /**
376 /**
377 * - false - don't adjust size of children
377 * - false - don't adjust size of children
378 * - true - if there is a single visible child widget, set it's size to however big the ContentPane is
378 * - true - if there is a single visible child widget, set it's size to however big the ContentPane is
379 */
379 */
380 doLayout: boolean;
380 doLayout: boolean;
381
381
382 /**
382 /**
383 * Indicates that this widget will call resize() on it's child widgets
383 * Indicates that this widget will call resize() on it's child widgets
384 * when they become visible.
384 * when they become visible.
385 */
385 */
386 isLayoutContainer: boolean;
386 isLayoutContainer: boolean;
387
387
388 /**
388 /**
389 * See `dijit/layout/_LayoutWidget.startup()` for description.
389 * See `dijit/layout/_LayoutWidget.startup()` for description.
390 * Although ContentPane doesn't extend _LayoutWidget, it does implement
390 * Although ContentPane doesn't extend _LayoutWidget, it does implement
391 * the same API.
391 * the same API.
392 */
392 */
393 startup(): void;
393 startup(): void;
394
394
395 /**
395 /**
396 * See `dijit/layout/_LayoutWidget.resize()` for description.
396 * See `dijit/layout/_LayoutWidget.resize()` for description.
397 * Although ContentPane doesn't extend _LayoutWidget, it does implement
397 * Although ContentPane doesn't extend _LayoutWidget, it does implement
398 * the same API.
398 * the same API.
399 */
399 */
400 resize(changeSize?: dojo.DomGeometryBox, resultSize?: dojo.DomGeometryWidthHeight): void;
400 resize(changeSize?: dojo.DomGeometryBox, resultSize?: dojo.DomGeometryWidthHeight): void;
401 }
401 }
402
402
403 interface _ContentPaneResizeMixinConstructor extends _WidgetBaseConstructor<_ContentPaneResizeMixin> { }
403 interface _ContentPaneResizeMixinConstructor extends _WidgetBaseConstructor<_ContentPaneResizeMixin> { }
404
404
405 /* dijit/layout/LinkPane */
405 /* dijit/layout/LinkPane */
406
406
407 interface LinkPane extends ContentPane, _TemplatedMixin {
407 interface LinkPane extends ContentPane, _TemplatedMixin {
408 /**
408 /**
409 * A ContentPane with an href where (when declared in markup) the
409 * A ContentPane with an href where (when declared in markup) the
410 * title is specified as innerHTML rather than as a title attribute.
410 * title is specified as innerHTML rather than as a title attribute.
411 */
411 */
412 }
412 }
413
413
414 interface LinkPaneConstructor extends _WidgetBaseConstructor<LinkPane> { }
414 interface LinkPaneConstructor extends _WidgetBaseConstructor<LinkPane> { }
415
415
416 /* dijit/layout/ScrollingTabController */
416 /* dijit/layout/ScrollingTabController */
417
417
418 interface ScrollingTabController extends TabController, _WidgetsInTemplateMixin {
418 interface ScrollingTabController extends TabController, _WidgetsInTemplateMixin {
419 /**
419 /**
420 * True if a menu should be used to select tabs when they are too
420 * True if a menu should be used to select tabs when they are too
421 * wide to fit the TabContainer, false otherwise.
421 * wide to fit the TabContainer, false otherwise.
422 */
422 */
423 useMenu: boolean;
423 useMenu: boolean;
424
424
425 /**
425 /**
426 * True if a slider should be used to select tabs when they are too
426 * True if a slider should be used to select tabs when they are too
427 * wide to fit the TabContainer, false otherwise.
427 * wide to fit the TabContainer, false otherwise.
428 */
428 */
429 useSlider: boolean;
429 useSlider: boolean;
430
430
431 /**
431 /**
432 * The css class to apply to the tab strip, if it is visible.
432 * The css class to apply to the tab strip, if it is visible.
433 */
433 */
434 tabStripClass: string;
434 tabStripClass: string;
435
435
436 /**
436 /**
437 * Creates an Animation object that smoothly scrolls the tab list
437 * Creates an Animation object that smoothly scrolls the tab list
438 * either to a fixed horizontal pixel value, or to the selected tab.
438 * either to a fixed horizontal pixel value, or to the selected tab.
439 */
439 */
440 createSmoothScroll(pixels?: number): dojo._base.Animation;
440 createSmoothScroll(pixels?: number): dojo._base.Animation;
441
441
442 /**
442 /**
443 * Scrolls the menu to the right.
443 * Scrolls the menu to the right.
444 */
444 */
445 doSlideRight(e: MouseEvent): void;
445 doSlideRight(e: MouseEvent): void;
446
446
447 /**
447 /**
448 * Scrolls the menu to the left.
448 * Scrolls the menu to the left.
449 */
449 */
450 doSlideLeft(e: MouseEvent): void;
450 doSlideLeft(e: MouseEvent): void;
451
451
452 /**
452 /**
453 * Scrolls the tab list to the left or right by 75% of the widget
453 * Scrolls the tab list to the left or right by 75% of the widget
454 * width.
454 * width.
455 */
455 */
456 doSlide(direction: number, node: HTMLElement): void;
456 doSlide(direction: number, node: HTMLElement): void;
457 }
457 }
458
458
459 interface ScrollingTabControllerConstructor extends _WidgetBaseConstructor<ScrollingTabController> { }
459 interface ScrollingTabControllerConstructor extends _WidgetBaseConstructor<ScrollingTabController> { }
460
460
461 /* dijit/layout/StackContainer */
461 /* dijit/layout/StackContainer */
462
462
463 interface StackContainer extends _LayoutWidget {
463 interface StackContainer extends _LayoutWidget {
464 /**
464 /**
465 * If true, change the size of my currently displayed child to match my size.
465 * If true, change the size of my currently displayed child to match my size.
466 */
466 */
467 doLayout: boolean;
467 doLayout: boolean;
468
468
469 /**
469 /**
470 * Remembers the selected child across sessions.
470 * Remembers the selected child across sessions.
471 */
471 */
472 persist: boolean;
472 persist: boolean;
473
473
474 /**
474 /**
475 * References the currently selected child widget, if any.
475 * References the currently selected child widget, if any.
476 * Adjust selected child with selectChild() method.
476 * Adjust selected child with selectChild() method.
477 */
477 */
478 selectedChildWidget: _Widget;
478 selectedChildWidget: _Widget;
479
479
480 selectChild<T extends _WidgetBase>(page: T | string, animate: boolean): dojo.promise.Promise<any>;
480 selectChild<T extends _WidgetBase>(page: T | string, animate: boolean): dojo.promise.Promise<any>;
481
481
482 forward(): dojo.promise.Promise<any>;
482 forward(): dojo.promise.Promise<any>;
483
483
484 back(): dojo.promise.Promise<any>;
484 back(): dojo.promise.Promise<any>;
485
485
486 closeChild<T extends _WidgetBase>(page: T): void;
486 closeChild<T extends _WidgetBase>(page: T): void;
487
487
488 /**
488 /**
489 * Destroy all the widgets inside the StackContainer and empty containerNode
489 * Destroy all the widgets inside the StackContainer and empty containerNode
490 */
490 */
491 destroyDescendants(preserveDom?: boolean): void;
491 destroyDescendants(preserveDom?: boolean): void;
492 }
492 }
493
493
494 interface StackContainerConstructor extends _WidgetBaseConstructor<StackContainer> { }
494 interface StackContainerConstructor extends _WidgetBaseConstructor<StackContainer> { }
495
495
496 interface StackContainerChildWidget extends _WidgetBase {
496 interface StackContainerChildWidget extends _WidgetBase {
497 /**
497 /**
498 * Specifies that this widget should be the initially displayed pane.
498 * Specifies that this widget should be the initially displayed pane.
499 * Note: to change the selected child use `dijit/layout/StackContainer.selectChild`
499 * Note: to change the selected child use `dijit/layout/StackContainer.selectChild`
500 */
500 */
501 selected: boolean;
501 selected: boolean;
502
502
503 /**
503 /**
504 * Specifies that the button to select this pane should be disabled.
504 * Specifies that the button to select this pane should be disabled.
505 * Doesn't affect programmatic selection of the pane, nor does it deselect the pane if it is currently selected.
505 * Doesn't affect programmatic selection of the pane, nor does it deselect the pane if it is currently selected.
506 */
506 */
507 disabled: boolean;
507 disabled: boolean;
508
508
509 /**
509 /**
510 * True if user can close (destroy) this child, such as (for example) clicking the X on the tab.
510 * True if user can close (destroy) this child, such as (for example) clicking the X on the tab.
511 */
511 */
512 closable: boolean;
512 closable: boolean;
513
513
514 /**
514 /**
515 * CSS class specifying icon to use in label associated with this pane.
515 * CSS class specifying icon to use in label associated with this pane.
516 */
516 */
517 iconClass: string;
517 iconClass: string;
518
518
519 /**
519 /**
520 * When true, display title of this widget as tab label etc., rather than just using
520 * When true, display title of this widget as tab label etc., rather than just using
521 * icon specified in iconClass.
521 * icon specified in iconClass.
522 */
522 */
523 showTitle: boolean;
523 showTitle: boolean;
524 }
524 }
525
525
526 /* dijit/layout/StackController */
526 /* dijit/layout/StackController */
527
527
528 interface _StackButton extends dijit.form.ToggleButton {
528 interface _StackButton extends dijit.form.ToggleButton {
529 /**
529 /**
530 * When true, display close button for this tab.
530 * When true, display close button for this tab.
531 */
531 */
532 closeButton: boolean;
532 closeButton: boolean;
533 }
533 }
534
534
535 interface _StackButtonConstructor extends _WidgetBaseConstructor<_StackButton> { }
535 interface _StackButtonConstructor extends _WidgetBaseConstructor<_StackButton> { }
536
536
537 interface StackControllerBase extends _Widget, _TemplatedMixin, _Container {
537 interface StackControllerBase extends _Widget, _TemplatedMixin, _Container {
538
538
539 /**
539 /**
540 * The id of the page container I point to.
540 * The id of the page container I point to.
541 */
541 */
542 containerId: string;
542 containerId: string;
543
543
544 /**
544 /**
545 * CSS class of [x] close icon used by event delegation code to tell when
545 * CSS class of [x] close icon used by event delegation code to tell when
546 * the close button was clicked.
546 * the close button was clicked.
547 */
547 */
548 buttonWidgetCloseClass: string;
548 buttonWidgetCloseClass: string;
549
549
550 /**
550 /**
551 * Returns the button corresponding to the pane with the given id.
551 * Returns the button corresponding to the pane with the given id.
552 */
552 */
553 pane2button<T extends _WidgetBase>(id: string): T;
553 pane2button<T extends _WidgetBase>(id: string): T;
554
554
555 /**
555 /**
556 * Called after the StackContainer has finished initializing.
556 * Called after the StackContainer has finished initializing.
557 */
557 */
558 onStartup(info: Object): void;
558 onStartup(info: Object): void;
559
559
560 /**
560 /**
561 * Called whenever a page is added to the container. Create button
561 * Called whenever a page is added to the container. Create button
562 * corresponding to the page.
562 * corresponding to the page.
563 */
563 */
564 onAddChild<T extends _WidgetBase>(page: T, insertIndex?: number): void;
564 onAddChild<T extends _WidgetBase>(page: T, insertIndex?: number): void;
565
565
566 /**
566 /**
567 * Called whenever a page is removed from the container. Remove the
567 * Called whenever a page is removed from the container. Remove the
568 * button corresponding to the page.
568 * button corresponding to the page.
569 */
569 */
570 onRemoveChild<T extends _WidgetBase>(page: T): void;
570 onRemoveChild<T extends _WidgetBase>(page: T): void;
571
571
572 /**
572 /**
573 * Called when a page has been selected in the StackContainer, either
573 * Called when a page has been selected in the StackContainer, either
574 * by me or by another StackController.
574 * by me or by another StackController.
575 */
575 */
576 onSelectChild<T extends _WidgetBase>(page: T): void;
576 onSelectChild<T extends _WidgetBase>(page: T): void;
577
577
578 /**
578 /**
579 * Called whenever one of my child buttons is pressed in an attempt to
579 * Called whenever one of my child buttons is pressed in an attempt to
580 * select a page.
580 * select a page.
581 */
581 */
582 onButtonClick<T extends _WidgetBase>(page: T): void;
582 onButtonClick<T extends _WidgetBase>(page: T): void;
583
583
584 /**
584 /**
585 * Called whenever one of my child buttons [X] is pressed in an attempt
585 * Called whenever one of my child buttons [X] is pressed in an attempt
586 * to close a page.
586 * to close a page.
587 */
587 */
588 onCloseButtonClick<T extends _WidgetBase>(page: T): void;
588 onCloseButtonClick<T extends _WidgetBase>(page: T): void;
589
589
590 /**
590 /**
591 * Helper for onkeydown to find next/previous button.
591 * Helper for onkeydown to find next/previous button.
592 */
592 */
593 adjacent(forward: boolean): _WidgetBase;
593 adjacent(forward: boolean): _WidgetBase;
594
594
595 /**
595 /**
596 * Handle keystrokes on the page list, for advancing to next/previous
596 * Handle keystrokes on the page list, for advancing to next/previous
597 * button and closing the page in the page is closable.
597 * button and closing the page in the page is closable.
598 */
598 */
599 onkeydown(e: Event, fromContainer?: boolean): void;
599 onkeydown(e: Event, fromContainer?: boolean): void;
600
600
601 /**
601 /**
602 * Called when there was a keydown on the container.
602 * Called when there was a keydown on the container.
603 */
603 */
604 onContainerKeyDown(info: Object): void;
604 onContainerKeyDown(info: Object): void;
605 }
605 }
606
606
607 interface StackController extends StackControllerBase {
607 interface StackController extends StackControllerBase {
608 /**
608 /**
609 * The button widget to create to correspond to each page.
609 * The button widget to create to correspond to each page.
610 */
610 */
611 buttonWidget: _StackButtonConstructor;
611 buttonWidget: _StackButtonConstructor;
612 }
612 }
613
613
614 interface StackControllerConstructor extends _WidgetBaseConstructor<StackController> { }
614 interface StackControllerConstructor extends _WidgetBaseConstructor<StackController> { }
615
615
616 /* dijit/layout/TabContainer */
616 /* dijit/layout/TabContainer */
617
617
618 interface TabContainer extends _TabContainerBase {
618 interface TabContainer extends _TabContainerBase {
619
619
620 /**
620 /**
621 * True if a menu should be used to select tabs when they are too
621 * True if a menu should be used to select tabs when they are too
622 * wide to fit the TabContainer, false otherwise.
622 * wide to fit the TabContainer, false otherwise.
623 */
623 */
624 useMenu: boolean;
624 useMenu: boolean;
625
625
626 /**
626 /**
627 * True if a slider should be used to select tabs when they are too
627 * True if a slider should be used to select tabs when they are too
628 * wide to fit the TabContainer, false otherwise.
628 * wide to fit the TabContainer, false otherwise.
629 */
629 */
630 useSlider: boolean;
630 useSlider: boolean;
631
631
632 /**
632 /**
633 * An optional parameter to override the widget used to display the tab labels.
633 * An optional parameter to override the widget used to display the tab labels.
634 */
634 */
635 controllerWidget: string;
635 controllerWidget: string;
636 }
636 }
637
637
638 interface TabContainerConstructor extends _WidgetBaseConstructor<TabContainer> { }
638 interface TabContainerConstructor extends _WidgetBaseConstructor<TabContainer> { }
639
639
640 /* dijit/layout/TabController */
640 /* dijit/layout/TabController */
641
641
642 interface _TabButton extends _StackButton { }
642 interface _TabButton extends _StackButton { }
643
643
644 interface _TabButtonConstructor extends _WidgetBaseConstructor<_TabButton> { }
644 interface _TabButtonConstructor extends _WidgetBaseConstructor<_TabButton> { }
645
645
646 interface TabController extends StackControllerBase {
646 interface TabController extends StackControllerBase {
647 /**
647 /**
648 * Defines where tabs go relative to the content.
648 * Defines where tabs go relative to the content.
649 * "top", "bottom", "left-h", "right-h"
649 * "top", "bottom", "left-h", "right-h"
650 */
650 */
651 tabPosition: string;
651 tabPosition: string;
652 // tabPosition: 'top' | 'bottom' | 'left-h' | 'right-h';
652 // tabPosition: 'top' | 'bottom' | 'left-h' | 'right-h';
653
653
654 /**
654 /**
655 * The tab widget to create to correspond to each page.
655 * The tab widget to create to correspond to each page.
656 */
656 */
657 buttonWidget: _TabButtonConstructor;
657 buttonWidget: _TabButtonConstructor;
658
658
659 /**
659 /**
660 * Class of [x] close icon, used by event delegation code to tell
660 * Class of [x] close icon, used by event delegation code to tell
661 * when close button was clicked.
661 * when close button was clicked.
662 */
662 */
663 buttonWidgetCloseClass: string;
663 buttonWidgetCloseClass: string;
664 }
664 }
665
665
666 interface TabControllerConstructor extends _WidgetBaseConstructor<TabController> {
666 interface TabControllerConstructor extends _WidgetBaseConstructor<TabController> {
667 TabButton: _TabButton;
667 TabButton: _TabButton;
668 }
668 }
669 }
669 }
670 }
670 }
@@ -1,487 +1,487
1 /// <reference path="index.d.ts" />
1 /// <reference path="index.d.ts" />
2
2
3 declare module 'dijit/_Widget' {
3 declare module 'dijit/_Widget' {
4 type _Widget = dijit._Widget;
4 type _Widget = dijit._Widget;
5 const _Widget: dijit._WidgetBaseConstructor<_Widget>;
5 const _Widget: dijit._WidgetBaseConstructor<_Widget>;
6 export = _Widget;
6 export = _Widget;
7 }
7 }
8
8
9 declare module 'dijit/_WidgetBase' {
9 declare module 'dijit/_WidgetBase' {
10 type _WidgetBase<E extends { [k in keyof E]: Event } = {}> = dijit._WidgetBase<E & GlobalEventHandlersEventMap>;
10 type _WidgetBase<E extends { [k in keyof E]: Event } = {}> = dijit._WidgetBase<E & GlobalEventHandlersEventMap>;
11
11
12 // individual _WidgetBase constructor to keep type parameters
12 // individual _WidgetBase constructor to keep type parameters
13 interface _WidgetBaseConstructor {
13 interface _WidgetBaseConstructor {
14 new <A = {}, E extends { [k in keyof E]: Event } = {}>(params?: Partial<_WidgetBase<E> & A>, srcNodeRef?: dojo.NodeOrString): _WidgetBase<E> & dojo._base.DeclareCreatedObject;
14 new <A = {}, E extends { [k in keyof E]: Event } = {}>(params?: Partial<_WidgetBase<E> & A>, srcNodeRef?: dojo.NodeOrString): _WidgetBase<E> & dojo._base.DeclareCreatedObject;
15 prototype: _WidgetBase<any>;
15 prototype: _WidgetBase<any>;
16 }
16 }
17 const _WidgetBase: _WidgetBaseConstructor;
17 const _WidgetBase: _WidgetBaseConstructor;
18 export = _WidgetBase;
18 export = _WidgetBase;
19 }
19 }
20
20
21 declare module 'dijit/_AttachMixin' {
21 declare module 'dijit/_AttachMixin' {
22 type _AttachMixin = dijit._AttachMixin;
22 type _AttachMixin = dijit._AttachMixin;
23 const _AttachMixin: dijit._AttachMixinConstructor;
23 const _AttachMixin: dijit._AttachMixinConstructor;
24 export = _AttachMixin;
24 export = _AttachMixin;
25 }
25 }
26
26
27 declare module 'dijit/_CssStateMixin' {
27 declare module 'dijit/_CssStateMixin' {
28 type _CssStateMixin = dijit._CssStateMixin;
28 type _CssStateMixin = dijit._CssStateMixin;
29 const _CssStateMixin: dijit._CssStateMixinConstructor;
29 const _CssStateMixin: dijit._CssStateMixinConstructor;
30 export = _CssStateMixin;
30 export = _CssStateMixin;
31 }
31 }
32
32
33 declare module 'dijit/_Contained' {
33 declare module 'dijit/_Contained' {
34 type _Contained = dijit._Contained;
34 type _Contained = dijit._Contained;
35 const _Contained: dijit._ContainedConstructor;
35 const _Contained: dijit._ContainedConstructor;
36 export = _Contained;
36 export = _Contained;
37 }
37 }
38
38
39 declare module 'dijit/_Container' {
39 declare module 'dijit/_Container' {
40 type _Container = dijit._Container;
40 type _Container = dijit._Container;
41 const _Container: dijit._ContainerConstructor;
41 const _Container: dijit._ContainerConstructor;
42 export = _Container;
42 export = _Container;
43 }
43 }
44
44
45 declare module 'dijit/_KeyNavContainer' {
45 declare module 'dijit/_KeyNavContainer' {
46 type _KeyNavContainer = dijit._KeyNavContainer;
46 type _KeyNavContainer = dijit._KeyNavContainer;
47 const _KeyNavContainer: dijit._KeyNavContainerConstructor;
47 const _KeyNavContainer: dijit._KeyNavContainerConstructor;
48 export = _KeyNavContainer;
48 export = _KeyNavContainer;
49 }
49 }
50
50
51 declare module 'dijit/_KeyNavMixin' {
51 declare module 'dijit/_KeyNavMixin' {
52 type _KeyNavMixin = dijit._KeyNavMixin;
52 type _KeyNavMixin = dijit._KeyNavMixin;
53 const _KeyNavMixin: dijit._KeyNavMixinConstructor;
53 const _KeyNavMixin: dijit._KeyNavMixinConstructor;
54 export = _KeyNavMixin;
54 export = _KeyNavMixin;
55 }
55 }
56
56
57 declare module 'dijit/_MenuBase' {
57 declare module 'dijit/_MenuBase' {
58 type _MenuBase = dijit._MenuBase;
58 type _MenuBase = dijit._MenuBase;
59 const _MenuBase: dijit._MenuBaseConstructor;
59 const _MenuBase: dijit._MenuBaseConstructor;
60 export = _MenuBase;
60 export = _MenuBase;
61 }
61 }
62
62
63 declare module 'dijit/_TemplatedMixin' {
63 declare module 'dijit/_TemplatedMixin' {
64 type _TemplatedMixin = dijit._TemplatedMixin;
64 type _TemplatedMixin = dijit._TemplatedMixin;
65 const _TemplatedMixin: dijit._TemplatedMixinConstructor;
65 const _TemplatedMixin: dijit._TemplatedMixinConstructor;
66 export = _TemplatedMixin;
66 export = _TemplatedMixin;
67 }
67 }
68
68
69 declare module 'dijit/_WidgetsInTemplateMixin' {
69 declare module 'dijit/_WidgetsInTemplateMixin' {
70 type _WidgetsInTemplateMixin = dijit._WidgetsInTemplateMixin;
70 type _WidgetsInTemplateMixin = dijit._WidgetsInTemplateMixin;
71 const _WidgetsInTemplateMixin: dijit._WidgetsInTemplateMixinConstructor;
71 const _WidgetsInTemplateMixin: dijit._WidgetsInTemplateMixinConstructor;
72 export = _WidgetsInTemplateMixin;
72 export = _WidgetsInTemplateMixin;
73 }
73 }
74
74
75 declare module 'dijit/ConfirmDialog' {
75 declare module 'dijit/ConfirmDialog' {
76 type ConfirmDialog = dijit.ConfirmDialog;
76 type ConfirmDialog = dijit.ConfirmDialog;
77 const ConfirmDialog: dijit.ConfirmDialogConstructor;
77 const ConfirmDialog: dijit.ConfirmDialogConstructor;
78 export = ConfirmDialog;
78 export = ConfirmDialog;
79 }
79 }
80
80
81 declare module 'dijit/Calendar' {
81 declare module 'dijit/Calendar' {
82 type Calendar = dijit.Calendar;
82 type Calendar = dijit.Calendar;
83 const Calendar: dijit.CalendarConstructor;
83 const Calendar: dijit.CalendarConstructor;
84 export = Calendar;
84 export = Calendar;
85 }
85 }
86
86
87 declare module 'dijit/CalendarLite' {
87 declare module 'dijit/CalendarLite' {
88 type CalendarLite = dijit.CalendarLite;
88 type CalendarLite = dijit.CalendarLite;
89 const CalendarLite: dijit.CalendarLiteConstructor;
89 const CalendarLite: dijit.CalendarLiteConstructor;
90 export = CalendarLite;
90 export = CalendarLite;
91 }
91 }
92
92
93 declare module 'dijit/Destroyable' {
93 declare module 'dijit/Destroyable' {
94 type Destroyable = dijit.Destroyable;
94 type Destroyable = dijit.Destroyable;
95 const Destroyable: dijit.DestroyableConstructor;
95 const Destroyable: dijit.DestroyableConstructor;
96 export = Destroyable;
96 export = Destroyable;
97 }
97 }
98
98
99 declare module 'dijit/Dialog' {
99 declare module 'dijit/Dialog' {
100 type Dialog = dijit.Dialog;
100 type Dialog = dijit.Dialog;
101 const Dialog: dijit.DialogConstructor;
101 const Dialog: dijit.DialogConstructor;
102 export = Dialog;
102 export = Dialog;
103 }
103 }
104
104
105 declare module 'dijit/DropDownMenu' {
105 declare module 'dijit/DropDownMenu' {
106 type DropDownMenu = dijit.DropDownMenu;
106 type DropDownMenu = dijit.DropDownMenu;
107 const DropDownMenu: dijit.DropDownMenuConstructor;
107 const DropDownMenu: dijit.DropDownMenuConstructor;
108 export = DropDownMenu;
108 export = DropDownMenu;
109 }
109 }
110
110
111 declare module 'dijit/Fieldset' {
111 declare module 'dijit/Fieldset' {
112 type Fieldset = dijit.Fieldset;
112 type Fieldset = dijit.Fieldset;
113 const Fieldset: dijit.FieldsetConstructor;
113 const Fieldset: dijit.FieldsetConstructor;
114 export = Fieldset;
114 export = Fieldset;
115 }
115 }
116
116
117 declare module 'dijit/Menu' {
117 declare module 'dijit/Menu' {
118 type Menu = dijit.Menu;
118 type Menu = dijit.Menu;
119 const Menu: dijit.MenuConstructor;
119 const Menu: dijit.MenuConstructor;
120 export = Menu;
120 export = Menu;
121 }
121 }
122
122
123 declare module 'dijit/MenuBar' {
123 declare module 'dijit/MenuBar' {
124 type MenuBar = dijit.MenuBar;
124 type MenuBar = dijit.MenuBar;
125 const MenuBar: dijit.MenuBarConstructor;
125 const MenuBar: dijit.MenuBarConstructor;
126 export = MenuBar;
126 export = MenuBar;
127 }
127 }
128
128
129 declare module 'dijit/MenuBarItem' {
129 declare module 'dijit/MenuBarItem' {
130 type MenuBarItem = dijit.MenuBarItem;
130 type MenuBarItem = dijit.MenuBarItem;
131 const MenuBarItem: dijit.MenuBarItemConstructor;
131 const MenuBarItem: dijit.MenuBarItemConstructor;
132 export = MenuBarItem;
132 export = MenuBarItem;
133 }
133 }
134
134
135 declare module 'dijit/MenuItem' {
135 declare module 'dijit/MenuItem' {
136 type MenuItem = dijit.MenuItem;
136 type MenuItem = dijit.MenuItem;
137 const MenuItem: dijit.MenuItemConstructor;
137 const MenuItem: dijit.MenuItemConstructor;
138 export = MenuItem;
138 export = MenuItem;
139 }
139 }
140
140
141 declare module 'dijit/MenuSeparator' {
141 declare module 'dijit/MenuSeparator' {
142 type MenuSeparator = dijit.MenuSeparator;
142 type MenuSeparator = dijit.MenuSeparator;
143 const MenuSeparator: dijit.MenuSeparatorConstructor;
143 const MenuSeparator: dijit.MenuSeparatorConstructor;
144 export = MenuSeparator;
144 export = MenuSeparator;
145 }
145 }
146
146
147 declare module 'dijit/place' {
147 declare module 'dijit/place' {
148 const place: dijit.Place;
148 const place: dijit.Place;
149 export = place;
149 export = place;
150 }
150 }
151
151
152 declare module 'dijit/popup' {
152 declare module 'dijit/popup' {
153 const popup: dijit.PopupManager;
153 const popup: dijit.PopupManager;
154 export = popup;
154 export = popup;
155 }
155 }
156
156
157 declare module 'dijit/PopupMenuBarItem' {
157 declare module 'dijit/PopupMenuBarItem' {
158 type PopupMenuBarItem = dijit.PopupMenuBarItem;
158 type PopupMenuBarItem = dijit.PopupMenuBarItem;
159 const PopupMenuBarItem: dijit.PopupMenuBarItemConstructor;
159 const PopupMenuBarItem: dijit.PopupMenuBarItemConstructor;
160 export = PopupMenuBarItem;
160 export = PopupMenuBarItem;
161 }
161 }
162
162
163 declare module 'dijit/PopupMenuItem' {
163 declare module 'dijit/PopupMenuItem' {
164 type PopupMenuItem = dijit.PopupMenuItem;
164 type PopupMenuItem = dijit.PopupMenuItem;
165 const PopupMenuItem: dijit.PopupMenuItemConstructor;
165 const PopupMenuItem: dijit.PopupMenuItemConstructor;
166 export = PopupMenuItem;
166 export = PopupMenuItem;
167 }
167 }
168
168
169 declare module 'dijit/registry' {
169 declare module 'dijit/registry' {
170 const registry: dijit.Registry;
170 const registry: dijit.Registry;
171 export = registry;
171 export = registry;
172 }
172 }
173
173
174 declare module 'dijit/TitlePane' {
174 declare module 'dijit/TitlePane' {
175 type TitlePane = dijit.TitlePane;
175 type TitlePane = dijit.TitlePane;
176 const TitlePane: dijit.TitlePaneConstructor;
176 const TitlePane: dijit.TitlePaneConstructor;
177 export = TitlePane;
177 export = TitlePane;
178 }
178 }
179
179
180 declare module 'dijit/Toolbar' {
180 declare module 'dijit/Toolbar' {
181 type Toolbar = dijit.Toolbar;
181 type Toolbar = dijit.Toolbar;
182 const Toolbar: dijit.ToolbarConstructor;
182 const Toolbar: dijit.ToolbarConstructor;
183 export = Toolbar;
183 export = Toolbar;
184 }
184 }
185
185
186 declare module 'dijit/ToolbarSeparator' {
186 declare module 'dijit/ToolbarSeparator' {
187 type ToolbarSeparator = dijit.ToolbarSeparator;
187 type ToolbarSeparator = dijit.ToolbarSeparator;
188 const ToolbarSeparator: dijit.ToolbarSeparatorConstructor;
188 const ToolbarSeparator: dijit.ToolbarSeparatorConstructor;
189 export = ToolbarSeparator;
189 export = ToolbarSeparator;
190 }
190 }
191
191
192 declare module 'dijit/Tooltip' {
192 declare module 'dijit/Tooltip' {
193 type Tooltip = dijit.Tooltip;
193 type Tooltip = dijit.Tooltip;
194 const Tooltip: dijit.TooltipConstructor;
194 const Tooltip: dijit.TooltipConstructor;
195 export = Tooltip;
195 export = Tooltip;
196 }
196 }
197
197
198 declare module 'dijit/TooltipDialog' {
198 declare module 'dijit/TooltipDialog' {
199 type TooltipDialog = dijit.TooltipDialog;
199 type TooltipDialog = dijit.TooltipDialog;
200 const TooltipDialog: dijit.TooltipDialogConstructor;
200 const TooltipDialog: dijit.TooltipDialogConstructor;
201 export = TooltipDialog;
201 export = TooltipDialog;
202 }
202 }
203
203
204 declare module 'dijit/_base/focus' {
204 declare module 'dijit/_base/focus' {
205 const focus: dijit._base.Focus;
205 const focus: dijit._base.Focus;
206 export = focus;
206 export = focus;
207 }
207 }
208
208
209 declare module 'dijit/_base/manager' {
209 declare module 'dijit/_base/manager' {
210 const manager: dijit._base.Manager;
210 const manager: dijit._base.Manager;
211 export = manager;
211 export = manager;
212 }
212 }
213
213
214 declare module 'dijit/_base/place' {
214 declare module 'dijit/_base/place' {
215 const place: dijit._base.Place;
215 const place: dijit._base.Place;
216 export = place;
216 export = place;
217 }
217 }
218
218
219 declare module 'dijit/_base/popup' {
219 declare module 'dijit/_base/popup' {
220 const popup: dijit._base.Popup;
220 const popup: dijit._base.Popup;
221 export = popup;
221 export = popup;
222 }
222 }
223
223
224 declare module 'dijit/_base/scroll' {
224 declare module 'dijit/_base/scroll' {
225 const scroll: dijit._base.Scroll;
225 const scroll: dijit._base.Scroll;
226 export = scroll;
226 export = scroll;
227 }
227 }
228
228
229 declare module 'dijit/_base/sniff' {
229 declare module 'dijit/_base/sniff' {
230 const sniff: dijit._base.Sniff;
230 const sniff: dijit._base.Sniff;
231 export = sniff;
231 export = sniff;
232 }
232 }
233
233
234 declare module 'dijit/_base/typematic' {
234 declare module 'dijit/_base/typematic' {
235 const typematic: dijit._base.Typematic;
235 const typematic: dijit._base.Typematic;
236 export = typematic;
236 export = typematic;
237 }
237 }
238
238
239 declare module 'dijit/_base/wai' {
239 declare module 'dijit/_base/wai' {
240 const wai: dijit._base.Wai;
240 const wai: dijit._base.Wai;
241 export = wai;
241 export = wai;
242 }
242 }
243
243
244 declare module 'dijit/_base/window' {
244 declare module 'dijit/_base/window' {
245 const window: dijit._base.Window;
245 const window: dijit._base.Window;
246 export = window;
246 export = window;
247 }
247 }
248
248
249 declare module 'dijit/form/_FormMixin' {
249 declare module 'dijit/form/_FormMixin' {
250 type _FormMixin = dijit.form._FormMixin;
250 type _FormMixin = dijit.form._FormMixin;
251 const _FormMixin: dijit.form._FormMixinConstructor;
251 const _FormMixin: dijit.form._FormMixinConstructor;
252 export = _FormMixin;
252 export = _FormMixin;
253 }
253 }
254
254
255 declare module 'dijit/form/_FormValueWidget' {
255 declare module 'dijit/form/_FormValueWidget' {
256 type _FormValueWidget = dijit.form._FormValueWidget;
256 type _FormValueWidget = dijit.form._FormValueWidget;
257 const _FormValueWidget: dijit.form._FormValueWidgetConstructor;
257 const _FormValueWidget: dijit.form._FormValueWidgetConstructor;
258 export = _FormValueWidget;
258 export = _FormValueWidget;
259 }
259 }
260
260
261 declare module 'dijit/form/_FormWidget' {
261 declare module 'dijit/form/_FormWidget' {
262 type _FormWidget = dijit.form._FormWidget;
262 type _FormWidget = dijit.form._FormWidget;
263 const _FormWidget: dijit.form._FormWidgetConstructor;
263 const _FormWidget: dijit.form._FormWidgetConstructor;
264 export = _FormWidget;
264 export = _FormWidget;
265 }
265 }
266
266
267 declare module 'dijit/form/Button' {
267 declare module 'dijit/form/Button' {
268 type Button = dijit.form.Button;
268 type Button = dijit.form.Button;
269 const Button: dijit.form.ButtonConstructor;
269 const Button: dijit.form.ButtonConstructor;
270 export = Button;
270 export = Button;
271 }
271 }
272
272
273 declare module 'dijit/form/CheckBox' {
273 declare module 'dijit/form/CheckBox' {
274 type CheckBox = dijit.form.CheckBox;
274 type CheckBox = dijit.form.CheckBox;
275 const CheckBox: dijit.form.CheckBoxConstructor;
275 const CheckBox: dijit.form.CheckBoxConstructor;
276 export = CheckBox;
276 export = CheckBox;
277 }
277 }
278
278
279 declare module 'dijit/form/ComboBox' {
279 declare module 'dijit/form/ComboBox' {
280 type ComboBox = dijit.form.TextBox;
280 type ComboBox = dijit.form.TextBox;
281 const ComboBox: dijit.form.ComboBoxConstructor;
281 const ComboBox: dijit.form.ComboBoxConstructor;
282 export = ComboBox;
282 export = ComboBox;
283 }
283 }
284
284
285 declare module 'dijit/form/ComboBoxMixin' {
285 declare module 'dijit/form/ComboBoxMixin' {
286 type ComboBoxMixin<T, U extends dojo.store.api.BaseQueryType, V> = dijit.form.ComboBoxMixin<T, U, V>;
286 type ComboBoxMixin<T = any, U extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, V = any> = dijit.form.ComboBoxMixin<T, U, V>;
287 const ComboBoxMixin: dijit.form.ComboBoxConstructor;
287 const ComboBoxMixin: dijit.form.ComboBoxConstructor;
288 export = ComboBoxMixin;
288 export = ComboBoxMixin;
289 }
289 }
290
290
291 declare module 'dijit/form/CurrencyTextBox' {
291 declare module 'dijit/form/CurrencyTextBox' {
292 type CurrencyTextBox = dijit.form.CurrencyTextBox;
292 type CurrencyTextBox = dijit.form.CurrencyTextBox;
293 const CurrencyTextBox: dijit.form.CurrencyTextBoxConstructor;
293 const CurrencyTextBox: dijit.form.CurrencyTextBoxConstructor;
294 export = CurrencyTextBox;
294 export = CurrencyTextBox;
295 }
295 }
296
296
297 declare module 'dijit/form/DataList' {
297 declare module 'dijit/form/DataList' {
298 type DataList<T> = dijit.form.DataList<T>;
298 type DataList<T> = dijit.form.DataList<T>;
299 const DataList: dijit.form.DataListConstructor;
299 const DataList: dijit.form.DataListConstructor;
300 export = DataList;
300 export = DataList;
301 }
301 }
302
302
303 declare module 'dijit/form/DateTextBox' {
303 declare module 'dijit/form/DateTextBox' {
304 type DateTextBox = dijit.form.DateTextBox;
304 type DateTextBox = dijit.form.DateTextBox;
305 const DateTextBox: dijit.form.DateTextBoxConstructor;
305 const DateTextBox: dijit.form.DateTextBoxConstructor;
306 export = DateTextBox;
306 export = DateTextBox;
307 }
307 }
308
308
309 declare module 'dijit/form/DropDownButton' {
309 declare module 'dijit/form/DropDownButton' {
310 type DropDownButton<T extends dijit._WidgetBase> = dijit.form.DropDownButton<T>;
310 type DropDownButton<T extends dijit._WidgetBase> = dijit.form.DropDownButton<T>;
311 const DropDownButton: dijit.form.DropDownButtonConstructor;
311 const DropDownButton: dijit.form.DropDownButtonConstructor;
312 export = DropDownButton;
312 export = DropDownButton;
313 }
313 }
314
314
315 declare module 'dijit/form/FilteringSelect' {
315 declare module 'dijit/form/FilteringSelect' {
316 type FilteringSelect<C extends dijit.form.Constraints, T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions> = dijit.form.FilteringSelect<C, T, Q, O>;
316 type FilteringSelect<C extends dijit.form.Constraints, T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions> = dijit.form.FilteringSelect<C, T, Q, O>;
317 const FilteringSelect: dijit.form.FilteringSelectConstructor;
317 const FilteringSelect: dijit.form.FilteringSelectConstructor;
318 export = FilteringSelect;
318 export = FilteringSelect;
319 }
319 }
320
320
321 declare module 'dijit/form/Form' {
321 declare module 'dijit/form/Form' {
322 type Form = dijit.form.Form;
322 type Form = dijit.form.Form;
323 const Form: dijit.form.FormConstructor;
323 const Form: dijit.form.FormConstructor;
324 export = Form;
324 export = Form;
325 }
325 }
326
326
327 declare module 'dijit/form/HorizontalRule' {
327 declare module 'dijit/form/HorizontalRule' {
328 type HorizontalRule = dijit.form.HorizontalRule;
328 type HorizontalRule = dijit.form.HorizontalRule;
329 const HorizontalRule: dijit.form.HorizontalRuleConstructor;
329 const HorizontalRule: dijit.form.HorizontalRuleConstructor;
330 export = HorizontalRule;
330 export = HorizontalRule;
331 }
331 }
332
332
333 declare module 'dijit/form/HorizontalRuleLabels' {
333 declare module 'dijit/form/HorizontalRuleLabels' {
334 type HorizontalRuleLabels = dijit.form.HorizontalRuleLabels;
334 type HorizontalRuleLabels = dijit.form.HorizontalRuleLabels;
335 const HorizontalRuleLabels: dijit.form.HorizontalRuleLabelsConstructor;
335 const HorizontalRuleLabels: dijit.form.HorizontalRuleLabelsConstructor;
336 export = HorizontalRuleLabels;
336 export = HorizontalRuleLabels;
337 }
337 }
338
338
339 declare module 'dijit/form/HorizontalSlider' {
339 declare module 'dijit/form/HorizontalSlider' {
340 type HorizontalSlider = dijit.form.HorizontalSlider;
340 type HorizontalSlider = dijit.form.HorizontalSlider;
341 const HorizontalSlider: dijit.form.HorizontalSliderConstructor;
341 const HorizontalSlider: dijit.form.HorizontalSliderConstructor;
342 export = HorizontalSlider;
342 export = HorizontalSlider;
343 }
343 }
344
344
345 declare module 'dijit/form/MappedTextBox' {
345 declare module 'dijit/form/MappedTextBox' {
346 type MappedTextBox<C extends dijit.form.Constraints> = dijit.form.MappedTextBox<C>;
346 type MappedTextBox<C extends dijit.form.Constraints = dijit.form.Constraints> = dijit.form.MappedTextBox<C>;
347 const MappedTextBox: dijit.form.MappedTextBoxConstructor;
347 const MappedTextBox: dijit.form.MappedTextBoxConstructor;
348 export = MappedTextBox;
348 export = MappedTextBox;
349 }
349 }
350
350
351 declare module 'dijit/form/NumberSpinner' {
351 declare module 'dijit/form/NumberSpinner' {
352 type NumberSpinner = dijit.form.NumberSpinner;
352 type NumberSpinner = dijit.form.NumberSpinner;
353 const NumberSpinner: dijit.form.NumberSpinnerConstructor;
353 const NumberSpinner: dijit.form.NumberSpinnerConstructor;
354 export = NumberSpinner;
354 export = NumberSpinner;
355 }
355 }
356
356
357 declare module 'dijit/form/NumberTextBox' {
357 declare module 'dijit/form/NumberTextBox' {
358 type NumberTextBox = dijit.form.NumberTextBox;
358 type NumberTextBox = dijit.form.NumberTextBox;
359 const NumberTextBox: dijit.form.NumberTextBoxConstructor;
359 const NumberTextBox: dijit.form.NumberTextBoxConstructor;
360 export = NumberTextBox;
360 export = NumberTextBox;
361 }
361 }
362
362
363 declare module 'dijit/form/RadioButton' {
363 declare module 'dijit/form/RadioButton' {
364 type RadioButton = dijit.form.RadioButton;
364 type RadioButton = dijit.form.RadioButton;
365 const RadioButton: dijit.form.RadioButtonConstructor;
365 const RadioButton: dijit.form.RadioButtonConstructor;
366 export = RadioButton;
366 export = RadioButton;
367 }
367 }
368
368
369 declare module 'dijit/form/RangeBoundTextBox' {
369 declare module 'dijit/form/RangeBoundTextBox' {
370 type RangeBoundTextBox = dijit.form.RangeBoundTextBox;
370 type RangeBoundTextBox = dijit.form.RangeBoundTextBox;
371 const RangeBoundTextBox: dijit.form.RangeBoundTextBoxConstructor;
371 const RangeBoundTextBox: dijit.form.RangeBoundTextBoxConstructor;
372 export = RangeBoundTextBox;
372 export = RangeBoundTextBox;
373 }
373 }
374
374
375 declare module 'dijit/form/Select' {
375 declare module 'dijit/form/Select' {
376 type Select<T, Q extends dojo.store.api.BaseQueryType, O, U extends dijit._WidgetBase> = dijit.form.Select<T, Q, O, U>;
376 type Select<T, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O = any, U extends dijit._WidgetBase = dijit._WidgetBase> = dijit.form.Select<T, Q, O, U>;
377 const Select: dijit.form.SelectConstructor;
377 const Select: dijit.form.SelectConstructor;
378 export = Select;
378 export = Select;
379 }
379 }
380
380
381 declare module 'dijit/form/SimpleTextarea' {
381 declare module 'dijit/form/SimpleTextarea' {
382 type SimpleTextarea = dijit.form.SimpleTextarea;
382 type SimpleTextarea = dijit.form.SimpleTextarea;
383 const SimpleTextarea: dijit.form.SimpleTextareaConstructor;
383 const SimpleTextarea: dijit.form.SimpleTextareaConstructor;
384 export = SimpleTextarea;
384 export = SimpleTextarea;
385 }
385 }
386
386
387 declare module 'dijit/form/Textarea' {
387 declare module 'dijit/form/Textarea' {
388 type Textarea = dijit.form.Textarea;
388 type Textarea = dijit.form.Textarea;
389 const Textarea: dijit.form.TextareaConstructor;
389 const Textarea: dijit.form.TextareaConstructor;
390 export = Textarea;
390 export = Textarea;
391 }
391 }
392
392
393 declare module 'dijit/form/TextBox' {
393 declare module 'dijit/form/TextBox' {
394 type TextBox = dijit.form.TextBox;
394 type TextBox = dijit.form.TextBox;
395 const TextBox: dijit.form.TextBoxConstructor;
395 const TextBox: dijit.form.TextBoxConstructor;
396 export = TextBox;
396 export = TextBox;
397 }
397 }
398
398
399 declare module 'dijit/form/ToggleButton' {
399 declare module 'dijit/form/ToggleButton' {
400 type ToggleButton = dijit.form.ToggleButton;
400 type ToggleButton = dijit.form.ToggleButton;
401 const ToggleButton: dijit.form.ToggleButtonConstructor;
401 const ToggleButton: dijit.form.ToggleButtonConstructor;
402 export = ToggleButton;
402 export = ToggleButton;
403 }
403 }
404
404
405 declare module 'dijit/form/ValidationTextBox' {
405 declare module 'dijit/form/ValidationTextBox' {
406 type ValidationTextBox<C extends dijit.form.Constraints> = dijit.form.ValidationTextBox<C>;
406 type ValidationTextBox<C extends dijit.form.Constraints = dijit.form.Constraints> = dijit.form.ValidationTextBox<C>;
407 const ValidationTextBox: dijit.form.ValidationTextBoxConstructor;
407 const ValidationTextBox: dijit.form.ValidationTextBoxConstructor;
408 export = ValidationTextBox;
408 export = ValidationTextBox;
409 }
409 }
410
410
411 declare module 'dijit/layout/_LayoutWidget' {
411 declare module 'dijit/layout/_LayoutWidget' {
412 type _LayoutWidget = dijit.layout._LayoutWidget;
412 type _LayoutWidget = dijit.layout._LayoutWidget;
413 const _LayoutWidget: dijit.layout._LayoutWidgetConstructor;
413 const _LayoutWidget: dijit.layout._LayoutWidgetConstructor;
414 export = _LayoutWidget;
414 export = _LayoutWidget;
415 }
415 }
416
416
417 declare module 'dijit/layout/AccordionContainer' {
417 declare module 'dijit/layout/AccordionContainer' {
418 type AccordionContainer = dijit.layout.AccordionContainer;
418 type AccordionContainer = dijit.layout.AccordionContainer;
419 const AccordionContainer: dijit.layout.AccordionContainerConstructor;
419 const AccordionContainer: dijit.layout.AccordionContainerConstructor;
420 export = AccordionContainer;
420 export = AccordionContainer;
421 }
421 }
422
422
423 declare module 'dijit/layout/AccordionPane' {
423 declare module 'dijit/layout/AccordionPane' {
424 type AccordionPane = dijit.layout.AccordionPane;
424 type AccordionPane = dijit.layout.AccordionPane;
425 const AccordionPane: dijit.layout.AccordionPaneConstructor;
425 const AccordionPane: dijit.layout.AccordionPaneConstructor;
426 export = AccordionPane;
426 export = AccordionPane;
427 }
427 }
428
428
429 declare module 'dijit/layout/ContentPane' {
429 declare module 'dijit/layout/ContentPane' {
430 type ContentPane = dijit.layout.ContentPane;
430 type ContentPane = dijit.layout.ContentPane;
431 const ContentPane: dijit.layout.ContentPaneConstructor;
431 const ContentPane: dijit.layout.ContentPaneConstructor;
432 export = ContentPane;
432 export = ContentPane;
433 }
433 }
434
434
435 declare module 'dijit/layout/_ContentPaneResizeMixin' {
435 declare module 'dijit/layout/_ContentPaneResizeMixin' {
436 type _ContentPaneResizeMixin = dijit.layout._ContentPaneResizeMixin;
436 type _ContentPaneResizeMixin = dijit.layout._ContentPaneResizeMixin;
437 const _ContentPaneResizeMixin: dijit.layout._ContentPaneResizeMixinConstructor;
437 const _ContentPaneResizeMixin: dijit.layout._ContentPaneResizeMixinConstructor;
438 export = _ContentPaneResizeMixin;
438 export = _ContentPaneResizeMixin;
439 }
439 }
440
440
441 declare module 'dijit/layout/BorderContainer' {
441 declare module 'dijit/layout/BorderContainer' {
442 type BorderContainer = dijit.layout.BorderContainer;
442 type BorderContainer = dijit.layout.BorderContainer;
443 const BorderContainer: dijit.layout.BorderContainerConstructor;
443 const BorderContainer: dijit.layout.BorderContainerConstructor;
444 export = BorderContainer;
444 export = BorderContainer;
445 }
445 }
446
446
447 declare module 'dijit/layout/LayoutContainer' {
447 declare module 'dijit/layout/LayoutContainer' {
448 type LayoutContainer = dijit.layout.LayoutContainer;
448 type LayoutContainer = dijit.layout.LayoutContainer;
449 const LayoutContainer: dijit.layout.LayoutContainerConstructor;
449 const LayoutContainer: dijit.layout.LayoutContainerConstructor;
450 export = LayoutContainer;
450 export = LayoutContainer;
451 }
451 }
452
452
453 declare module 'dijit/layout/LinkPane' {
453 declare module 'dijit/layout/LinkPane' {
454 type LinkPane = dijit.layout.LinkPane;
454 type LinkPane = dijit.layout.LinkPane;
455 const LinkPane: dijit.layout.LinkPaneConstructor;
455 const LinkPane: dijit.layout.LinkPaneConstructor;
456 export = LinkPane;
456 export = LinkPane;
457 }
457 }
458
458
459 declare module 'dijit/layout/ScrollingTabController' {
459 declare module 'dijit/layout/ScrollingTabController' {
460 type ScrollingTabController = dijit.layout.ScrollingTabController;
460 type ScrollingTabController = dijit.layout.ScrollingTabController;
461 const ScrollingTabController: dijit.layout.ScrollingTabControllerConstructor;
461 const ScrollingTabController: dijit.layout.ScrollingTabControllerConstructor;
462 export = ScrollingTabController;
462 export = ScrollingTabController;
463 }
463 }
464
464
465 declare module 'dijit/layout/StackContainer' {
465 declare module 'dijit/layout/StackContainer' {
466 type StackContainer = dijit.layout.StackContainer;
466 type StackContainer = dijit.layout.StackContainer;
467 const StackContainer: dijit.layout.StackContainerConstructor;
467 const StackContainer: dijit.layout.StackContainerConstructor;
468 export = StackContainer;
468 export = StackContainer;
469 }
469 }
470
470
471 declare module 'dijit/layout/StackController' {
471 declare module 'dijit/layout/StackController' {
472 type StackController = dijit.layout.StackController;
472 type StackController = dijit.layout.StackController;
473 const StackController: dijit.layout.StackControllerConstructor;
473 const StackController: dijit.layout.StackControllerConstructor;
474 export = StackController;
474 export = StackController;
475 }
475 }
476
476
477 declare module 'dijit/layout/TabContainer' {
477 declare module 'dijit/layout/TabContainer' {
478 type TabContainer = dijit.layout.TabContainer;
478 type TabContainer = dijit.layout.TabContainer;
479 const TabContainer: dijit.layout.TabContainerConstructor;
479 const TabContainer: dijit.layout.TabContainerConstructor;
480 export = TabContainer;
480 export = TabContainer;
481 }
481 }
482
482
483 declare module 'dijit/layout/TabController' {
483 declare module 'dijit/layout/TabController' {
484 type TabController = dijit.layout.TabController;
484 type TabController = dijit.layout.TabController;
485 const TabController: dijit.layout.TabControllerConstructor;
485 const TabController: dijit.layout.TabControllerConstructor;
486 export = TabController;
486 export = TabController;
487 }
487 }
@@ -1,41 +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 declare class ScheduleWidget extends _WidgetBase<ScheduleWidgetAttrs, ScheduleWidgetEvents> {
17 class ScheduleWidget extends _WidgetBase<ScheduleWidgetAttrs, ScheduleWidgetEvents> {
18 data: string[];
18 data: string[];
19
20 _onClick() {
21 this.set("data", "", "");
22
23 const t = this.get("title");
24 this.set({
25 data: ["",""]
26 });
27 }
28
29 render(){
30 watch(this, "title", v => String(v) );
31 }
19 }
32 }
20
33
21 const w = new ScheduleWidget({title: "Year schedule", data: ["a", "b"] });
34 const w = new ScheduleWidget({title: "Year schedule", data: ["a", "b"] });
22
35
23 w.get("data");
36 w.get("data");
24
37
38 w.set("data", "a","b");
39 w.set({
40 data: ["a", "b"]
41 });
42
25 w.watch((p, o, n) => [p,o,n]);
43 w.watch((p, o, n) => [p,o,n]);
26
44
27 w.watch("data", (p, o, n) => [p,o,n]);
45 w.watch("data", (p, o, n) => [p,o,n]);
28
46
29 watch(w, "title", v => String(v) );
47 watch(w, "title", v => String(v) );
30 watch(w, "data", v => String(v) );
48 watch(w, "data", v => String(v) );
31
49
32 w.emit("scheduled", { detail: { startDate: new Date(), endDate: new Date()} });
50 w.emit("scheduled", { detail: { startDate: new Date(), endDate: new Date()} });
33
51
34 w.emit("click", {} );
52 w.emit("click", {} );
35
53
36 w.emit("click", {} );
54 w.emit("click", {} );
37
55
38 w.emit("some-extra-event", {});
56 w.emit("some-extra-event", {});
39
57
40 w.on("click", e => e);
58 w.on("click", e => e);
41 w.on("some-extra-event", e => e);
59 w.on("some-extra-event", e => e);
General Comments 0
You need to be logged in to leave comments. Login now