##// END OF EJS Templates
Maintenance release...
cin -
r8:b71d8639b457 v1.0.1 default
parent child
Show More
@@ -0,0 +1,33
1 # dojo-typings
2
3 This project is forked from the original `dojo-typings` package to
4 improve it with more tight and customizable type definitions.
5
6 The primary aims are
7
8 * Parametrize collections with items type.
9 * Distinguish sync and async methods in stores.
10 * Parametrize widget typings with event and attribute maps.
11
12 ## Changes
13
14 ### 1.0.1
15
16 Maintenance release
17
18 * `NodeList-fx` added overloads to all methods to distinguish returned values
19 of different types (`Animation | this`).
20 * Added missing signatures to `NodeList` constructor
21 * Improved `dijit.form._FormWidgetMixin`
22 * Added module declarations `dijit/form/_FormWidgetMixin`,
23 `dijit/form/_FormValueMixin`, `dijit/_HasDropDown`
24
25 ### 1.0.0
26
27 Initial release
28
29 * Parametrized `dojo/Stateful`, `diji/_WidgetBase`
30 * split `dojo.store.api.Store` in two `SyncStore` and `AsyncStore` interfaces
31 * `dojo/store/Memory` implements `SyncStore` and can be used synchronously,
32 * `dojo/store/Rest` implements `AsyncStore` and all its methods are
33 returning explicit promises.
@@ -0,0 +1,8
1 import "dojo/NodeList-fx";
2
3 declare const nl: dojo.NodeList<Node>;
4
5 const anim: dojo._base.Animation = nl.fadeIn();
6 const anim2: dojo._base.Animation = nl.fadeIn({duration: 500});
7 const nl2: typeof nl = nl.fadeOut({auto: true, onEnd: () => {}});
8 const other = nl.fadeOut({auto: false}); No newline at end of file
This diff has been collapsed as it changes many lines, (3103 lines changed) Show them Hide them
@@ -1,1889 +1,1868
1 1 declare namespace dijit {
2 2
3 namespace form {
3 namespace form {
4 4
5 /* implied */
5 /* implied */
6 6
7 interface Constraints {
8 [prop: string]: any;
9 }
7 interface Constraints {
8 [prop: string]: any;
9 }
10 10
11 interface ConstrainedValueFunction<V = any, C extends Constraints = Constraints, T = any> {
12 /**
13 * Returns a value that has been constrained by the constraints
14 * @param value The value to constrain
15 * @param constraints The constraints to use
16 * @returns The constrained value
17 */
18 (value: V, constraints: C): T;
19 }
11 interface ConstrainedValueFunction<V = any, C extends Constraints = Constraints, T = any> {
12 /**
13 * Returns a value that has been constrained by the constraints
14 * @param value The value to constrain
15 * @param constraints The constraints to use
16 * @returns The constrained value
17 */
18 (value: V, constraints: C): T;
19 }
20 20
21 interface ConstrainedValidFunction<C extends Constraints = Constraints> {
22 /**
23 * Returns true if the value is valid based on the constraints, otherwise
24 * returns false.
25 * @param value The value to check
26 * @param constraints The constraints to use
27 * @returns true if valid, otherwise false
28 */
29 (value: any, constraints: C): boolean;
30 }
21 interface ConstrainedValidFunction<C extends Constraints = Constraints> {
22 /**
23 * Returns true if the value is valid based on the constraints, otherwise
24 * returns false.
25 * @param value The value to check
26 * @param constraints The constraints to use
27 * @returns true if valid, otherwise false
28 */
29 (value: any, constraints: C): boolean;
30 }
31 31
32 interface ConstraintsToRegExpString<C extends Constraints = Constraints> {
33 /**
34 * Takes a set of constraints and returns a RegExpString that can be used
35 * to match values against
36 * @param constraints The constraints to use
37 * @returns The RegExpString that represents the constraints
38 */
39 (constraints: C): string;
40 }
32 interface ConstraintsToRegExpString<C extends Constraints = Constraints> {
33 /**
34 * Takes a set of constraints and returns a RegExpString that can be used
35 * to match values against
36 * @param constraints The constraints to use
37 * @returns The RegExpString that represents the constraints
38 */
39 (constraints: C): string;
40 }
41 41
42 interface SerializationFunction {
43 (val: any, options?: Object): string;
44 }
42 interface SerializationFunction {
43 (val: any, options?: Object): string;
44 }
45 45
46 /* dijit/form/_AutoCompleterMixin */
46 /* dijit/form/_AutoCompleterMixin */
47 47
48 /* tslint:disable:class-name */
49 interface _AutoCompleterMixin<T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> extends _SearchMixin<T, Q, O> {
50 /**
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.
53 */
54 item: T;
48 /* tslint:disable:class-name */
49 interface _AutoCompleterMixin<T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> extends _SearchMixin<T, Q, O> {
50 /**
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.
53 */
54 item: T;
55 55
56 /**
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
59 * the `<input>` field
60 */
61 autoComplete: boolean;
56 /**
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
59 * the `<input>` field
60 */
61 autoComplete: boolean;
62 62
63 /**
64 * One of: "first", "all" or "none".
65 */
66 highlightMatch: string;
67 /* TODO: Uncomment for TS 1.8 and remove above */
68 /* highlightMatch: 'fisrt' | 'all' | 'none'; */
63 /**
64 * One of: "first", "all" or "none".
65 */
66 highlightMatch: string;
67 /* TODO: Uncomment for TS 1.8 and remove above */
68 /* highlightMatch: 'fisrt' | 'all' | 'none'; */
69 69
70 /**
71 * The entries in the drop down list come from this attribute in the
72 * dojo.data items.
73 * If not specified, the searchAttr attribute is used instead.
74 */
75 labelAttr: string;
70 /**
71 * The entries in the drop down list come from this attribute in the
72 * dojo.data items.
73 * If not specified, the searchAttr attribute is used instead.
74 */
75 labelAttr: string;
76 76
77 /**
78 * Specifies how to interpret the labelAttr in the data store items.
79 * Can be "html" or "text".
80 */
81 labelType: string;
77 /**
78 * Specifies how to interpret the labelAttr in the data store items.
79 * Can be "html" or "text".
80 */
81 labelType: string;
82 82
83 /**
84 * Flags to _HasDropDown to limit height of drop down to make it fit in viewport
85 */
86 maxHeight: number;
83 /**
84 * Flags to _HasDropDown to limit height of drop down to make it fit in viewport
85 */
86 maxHeight: number;
87 87
88 /**
89 * For backwards compatibility let onClick events propagate, even clicks on the down arrow button
90 */
91 _stopClickEvents: boolean;
88 /**
89 * For backwards compatibility let onClick events propagate, even clicks on the down arrow button
90 */
91 _stopClickEvents: boolean;
92 92
93 _getCaretPos(element: HTMLElement): number;
94 _setCaretPos(element: HTMLElement, location: number): void;
93 _getCaretPos(element: HTMLElement): number;
94 _setCaretPos(element: HTMLElement, location: number): void;
95 95
96 /**
97 * Overrides _HasDropDown.loadDropDown().
98 */
99 loadDropDown(loadCallback: () => void): void;
96 /**
97 * Overrides _HasDropDown.loadDropDown().
98 */
99 loadDropDown(loadCallback: () => void): void;
100 100
101 /**
102 * signal to _HasDropDown that it needs to call loadDropDown() to load the
103 * drop down asynchronously before displaying it
104 */
105 isLoaded(): boolean;
101 /**
102 * signal to _HasDropDown that it needs to call loadDropDown() to load the
103 * drop down asynchronously before displaying it
104 */
105 isLoaded(): boolean;
106 106
107 /**
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
110 * the button icon while the drop down is open. It's also called by other code.
111 */
112 closeDropDown(focus?: boolean): void;
107 /**
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
110 * the button icon while the drop down is open. It's also called by other code.
111 */
112 closeDropDown(focus?: boolean): void;
113 113
114 postMixInProperties(): void;
115 postCreate(): void;
114 postMixInProperties(): void;
115 postCreate(): void;
116 116
117 /**
118 * Highlights the string entered by the user in the menu. By default this
119 * highlights the first occurrence found. Override this method
120 * to implement your custom highlighting.
121 */
122 doHighlight(label: string, find: string): string;
123 reset(): void;
124 labelFunc(item: T, store: dojo.store.api.Store<T, Q, O>): string;
117 /**
118 * Highlights the string entered by the user in the menu. By default this
119 * highlights the first occurrence found. Override this method
120 * to implement your custom highlighting.
121 */
122 doHighlight(label: string, find: string): string;
123 reset(): void;
124 labelFunc(item: T, store: dojo.store.api.Store<T, Q, O>): string;
125 125
126 // set(name: 'value', value: string): this;
127 // set(name: 'item', value: T): this;
128 // set(name: 'disabled', value: boolean): this;
129 // set(name: string, value: any): this;
130 // set(values: Object): this;
131 }
126 // set(name: 'value', value: string): this;
127 // set(name: 'item', value: T): this;
128 // set(name: 'disabled', value: boolean): this;
129 // set(name: string, value: any): this;
130 // set(values: Object): this;
131 }
132 132
133 /* dijit/form/_ButtonMixin */
133 /* dijit/form/_ButtonMixin */
134 134
135 interface _ButtonMixin {
136 /**
137 * A mixin to add a thin standard API wrapper to a normal HTML button
138 */
139 label: string;
135 interface _ButtonMixin {
136 /**
137 * A mixin to add a thin standard API wrapper to a normal HTML button
138 */
139 label: string;
140 140
141 /**
142 * Type of button (submit, reset, button, checkbox, radio)
143 */
144 type: string;
145 postCreate(): void;
141 /**
142 * Type of button (submit, reset, button, checkbox, radio)
143 */
144 type: string;
145 postCreate(): void;
146 146
147 /**
148 * Callback for when button is clicked.
149 * If type="submit", return true to perform submit, or false to cancel it.
150 */
151 onClick(e: MouseEvent): boolean | void;
152 onSetLabel(e: Event): void;
153 }
147 /**
148 * Callback for when button is clicked.
149 * If type="submit", return true to perform submit, or false to cancel it.
150 */
151 onClick(e: MouseEvent): boolean | void;
152 onSetLabel(e: Event): void;
153 }
154 154
155 /* dijit/form/_CheckBoxMixin */
155 /* dijit/form/_CheckBoxMixin */
156 156
157 interface _CheckBoxMixin {
158 /**
159 * type attribute on `<input>` node.
160 * Overrides `dijit/form/Button.type`. Users should not change this value.
161 */
162 type: string;
157 interface _CheckBoxMixin {
158 /**
159 * type attribute on `<input>` node.
160 * Overrides `dijit/form/Button.type`. Users should not change this value.
161 */
162 type: string;
163 163
164 /**
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).
167 */
168 value: string;
164 /**
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).
167 */
168 value: string;
169 169
170 /**
171 * Should this widget respond to user input?
172 * In markup, this is specified as "readOnly".
173 * Similar to disabled except readOnly form values are submitted.
174 */
175 readOnly: boolean;
170 /**
171 * Should this widget respond to user input?
172 * In markup, this is specified as "readOnly".
173 * Similar to disabled except readOnly form values are submitted.
174 */
175 readOnly: boolean;
176 176
177 reset: () => void;
178 }
177 reset: () => void;
178 }
179 179
180 /* dijit/form/_ComboBoxMenu */
180 /* dijit/form/_ComboBoxMenu */
181 181
182 interface _ComboBoxMenu<T = any> extends _WidgetBase, _TemplatedMixin, _ListMouseMixin, _ComboBoxMenuMixin<T> {
183 templateString: string;
184 baseClass: string;
182 interface _ComboBoxMenu<T = any> extends _WidgetBase, _TemplatedMixin, _ListMouseMixin, _ComboBoxMenuMixin<T> {
183 templateString: string;
184 baseClass: string;
185 185
186 /**
187 * Add hover CSS
188 */
189 onHover(node: HTMLElement): void;
186 /**
187 * Add hover CSS
188 */
189 onHover(node: HTMLElement): void;
190 190
191 /**
192 * Remove hover CSS
193 */
194 onUnhover(node: HTMLElement): void;
191 /**
192 * Remove hover CSS
193 */
194 onUnhover(node: HTMLElement): void;
195 195
196 /**
197 * Add selected CSS
198 */
199 onSelect(node: HTMLElement): void;
196 /**
197 * Add selected CSS
198 */
199 onSelect(node: HTMLElement): void;
200 200
201 /**
202 * Remove selected CSS
203 */
204 onDeselect(node: HTMLElement): void;
201 /**
202 * Remove selected CSS
203 */
204 onDeselect(node: HTMLElement): void;
205 205
206 /**
207 * Handles page-up and page-down keypresses
208 */
209 _page(up?: boolean): void;
206 /**
207 * Handles page-up and page-down keypresses
208 */
209 _page(up?: boolean): void;
210 210
211 /**
212 * Handle keystroke event forwarded from ComboBox, returning false if it's
213 * a keystroke I recognize and process, true otherwise.
214 */
215 handleKey(evt: KeyboardEvent): boolean;
211 /**
212 * Handle keystroke event forwarded from ComboBox, returning false if it's
213 * a keystroke I recognize and process, true otherwise.
214 */
215 handleKey(evt: KeyboardEvent): boolean;
216 216
217 // set(name: string, value: any): this;
218 // set(values: Object): this;
219 }
217 // set(name: string, value: any): this;
218 // set(values: Object): this;
219 }
220 220
221 interface _ComboBoxMenuConstructor extends _WidgetBaseConstructor<_ComboBoxMenu<any>> {
222 new <T = any>(params: Object, srcNodeRef: dojo.NodeOrString): _ComboBoxMenu<T>;
223 }
221 interface _ComboBoxMenuConstructor extends _WidgetBaseConstructor<_ComboBoxMenu<any>> {
222 new <T = any>(params: Object, srcNodeRef: dojo.NodeOrString): _ComboBoxMenu<T>;
223 }
224 224
225 /* dijit/form/_ComboBoxMenuMixin */
225 /* dijit/form/_ComboBoxMenuMixin */
226 226
227 interface _ComboBoxMenuMixin<T = any> {
228 /**
229 * Holds "next" and "previous" text for paging buttons on drop down
230 */
231 _messages: { next: string; previous: string; };
232
233 onClick(node: HTMLElement): void;
227 interface _ComboBoxMenuMixin<T = any> {
228 /**
229 * Holds "next" and "previous" text for paging buttons on drop down
230 */
231 _messages: { next: string; previous: string; };
234 232
235 /**
236 * Notifies ComboBox/FilteringSelect that user selected an option.
237 */
238 onChange(direction: number): void;
233 onClick(node: HTMLElement): void;
239 234
240 /**
241 * Notifies ComboBox/FilteringSelect that user clicked to advance to next/previous page.
242 */
243 onPage(direction: number): void;
235 /**
236 * Notifies ComboBox/FilteringSelect that user selected an option.
237 */
238 onChange(direction: number): void;
244 239
245 /**
246 * Callback from dijit.popup code to this widget, notifying it that it closed
247 */
248 onClose(): void;
240 /**
241 * Notifies ComboBox/FilteringSelect that user clicked to advance to next/previous page.
242 */
243 onPage(direction: number): void;
249 244
250 /**
251 * Fills in the items in the drop down list
252 */
253 createOptions(results: T[], options: dojo.store.api.QueryOptions, labelFunc: (item: T) => { html: boolean; label: string; }): void;
245 /**
246 * Callback from dijit.popup code to this widget, notifying it that it closed
247 */
248 onClose(): void;
254 249
255 /**
256 * Clears the entries in the drop down list, but of course keeps the previous and next buttons.
257 */
258 clearResultList(): void;
250 /**
251 * Fills in the items in the drop down list
252 */
253 createOptions(results: T[], options: dojo.store.api.QueryOptions, labelFunc: (item: T) => { html: boolean; label: string; }): void;
259 254
260 /**
261 * Highlight the first real item in the list (not Previous Choices).
262 */
263 highlightFirstOption(): void;
255 /**
256 * Clears the entries in the drop down list, but of course keeps the previous and next buttons.
257 */
258 clearResultList(): void;
264 259
265 /**
266 * Highlight the last real item in the list (not More Choices).
267 */
268 highlightLastOption(): void;
260 /**
261 * Highlight the first real item in the list (not Previous Choices).
262 */
263 highlightFirstOption(): void;
264
265 /**
266 * Highlight the last real item in the list (not More Choices).
267 */
268 highlightLastOption(): void;
269 269
270 selectFirstNode(): void;
271 selectLastNode(): void;
272 getHighlightedOption(): HTMLElement;
270 selectFirstNode(): void;
271 selectLastNode(): void;
272 getHighlightedOption(): HTMLElement;
273 273
274 // set(name: 'value', value: Object): this;
275 // set(name: string, value: any): this;
276 // set(values: Object): this;
277 }
274 // set(name: 'value', value: Object): this;
275 // set(name: string, value: any): this;
276 // set(values: Object): this;
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> {
284 templateString: string;
283 interface _DateTimeTextBox<T extends _WidgetBase> extends RangeBoundTextBox, _HasDropDown<T> {
284 templateString: string;
285 285
286 /**
287 * Set this textbox to display a down arrow button, to open the drop down list.
288 */
289 hasDownArrow: boolean;
290 cssStateNodes: CSSStateNodes;
286 /**
287 * Set this textbox to display a down arrow button, to open the drop down list.
288 */
289 hasDownArrow: boolean;
290 cssStateNodes: CSSStateNodes;
291 291
292 /**
293 * Despite the name, this parameter specifies both constraints on the input
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)
296 * or short (ex: 12/25/2005) format. See `dijit/form/_DateTimeTextBox.__Constraints` for details.
297 */
298 constraints: DateTimeConstraints;
292 /**
293 * Despite the name, this parameter specifies both constraints on the input
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)
296 * or short (ex: 12/25/2005) format. See `dijit/form/_DateTimeTextBox.__Constraints` for details.
297 */
298 constraints: DateTimeConstraints;
299 299
300 /**
301 * The constraints without the min/max properties. Used by the compare() method
302 */
303 _unboundedConstraints: DateTimeConstraints;
300 /**
301 * The constraints without the min/max properties. Used by the compare() method
302 */
303 _unboundedConstraints: DateTimeConstraints;
304 304
305 pattern: (options?: dojo.date.DateLocaleFormatOptions | RangeBoundTextBoxConstraints) => string;
305 pattern: (options?: dojo.date.DateLocaleFormatOptions | RangeBoundTextBoxConstraints) => string;
306 306
307 /**
308 * JavaScript namespace to find calendar routines. If unspecified, uses Gregorian calendar routines
309 * at dojo/date and dojo/date/locale.
310 */
311 datePackage: string;
307 /**
308 * JavaScript namespace to find calendar routines. If unspecified, uses Gregorian calendar routines
309 * at dojo/date and dojo/date/locale.
310 */
311 datePackage: string;
312 312
313 postMixInProperties(): void;
314 compare(val1: Date, val2: Date): number;
315 autoWidth: boolean;
313 postMixInProperties(): void;
314 compare(val1: Date, val2: Date): number;
315 autoWidth: boolean;
316 316
317 /**
318 * Formats the value as a Date, according to specified locale (second argument)
319 */
320 format: ConstrainedValueFunction<Date, DateTimeConstraints, string>;
317 /**
318 * Formats the value as a Date, according to specified locale (second argument)
319 */
320 format: ConstrainedValueFunction<Date, DateTimeConstraints, string>;
321 321
322 /**
323 * Parses as string as a Date, according to constraints
324 */
325 parse: ConstrainedValueFunction<string, DateTimeConstraints, Date>;
322 /**
323 * Parses as string as a Date, according to constraints
324 */
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 /**
330 * The default value to focus in the popupClass widget when the textbox value is empty.
331 */
332 dropDownDefaultValue: Date;
329 /**
330 * The default value to focus in the popupClass widget when the textbox value is empty.
331 */
332 dropDownDefaultValue: Date;
333 333
334 /**
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()`
337 */
338 value: Date;
334 /**
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()`
337 */
338 value: Date;
339 339
340 _blankValue: string;
340 _blankValue: string;
341 341
342 /**
343 * Name of the popup widget class used to select a date/time.
344 * Subclasses should specify this.
345 */
346 popupClass: string | _WidgetBaseConstructor<T>;
342 /**
343 * Name of the popup widget class used to select a date/time.
344 * Subclasses should specify this.
345 */
346 popupClass: string | _WidgetBaseConstructor<T>;
347 347
348 /**
349 * Specifies constraints.selector passed to dojo.date functions, should be either
350 * "date" or "time".
351 * Subclass must specify this.
352 */
353 _selector: string;
354 /* TODO: uncomment for TS 1.8 */
355 /* _selector: 'data' | 'time'; */
348 /**
349 * Specifies constraints.selector passed to dojo.date functions, should be either
350 * "date" or "time".
351 * Subclass must specify this.
352 */
353 _selector: string;
354 /* TODO: uncomment for TS 1.8 */
355 /* _selector: 'data' | 'time'; */
356 356
357 buildRendering(): void;
357 buildRendering(): void;
358 358
359 /**
360 * Runs various tests on the value, checking for invalid conditions
361 */
362 _isInvalidDate(value: Date): boolean;
359 /**
360 * Runs various tests on the value, checking for invalid conditions
361 */
362 _isInvalidDate(value: Date): boolean;
363 363
364 // get(name: 'displayedValue'): string;
365 // get(name: string): any;
364 // get(name: 'displayedValue'): string;
365 // get(name: string): any;
366 366
367 // set(name: 'displayedValue', value: string): this;
368 // set(name: 'dropDownDefaultValue', value: Date): this;
369 // set(name: 'value', value: Date | string): this;
370 // set(name: 'constraints', value: DateTimeConstraints): this;
371 // set(name: string, value: any): this;
372 // set(values: Object): this;
373 }
374
375 interface _DateTimeTextBoxConstructor<T extends _WidgetBase> extends _WidgetBaseConstructor<_DateTimeTextBox<T>> { }
367 // set(name: 'displayedValue', value: string): this;
368 // set(name: 'dropDownDefaultValue', value: Date): this;
369 // set(name: 'value', value: Date | string): this;
370 // set(name: 'constraints', value: DateTimeConstraints): this;
371 // set(name: string, value: any): this;
372 // set(values: Object): this;
373 }
376 374
377 /* dijit/form/_ExpandingTextAreaMixin */
375 interface _DateTimeTextBoxConstructor<T extends _WidgetBase> extends _WidgetBaseConstructor<_DateTimeTextBox<T>> { }
376
377 /* dijit/form/_ExpandingTextAreaMixin */
378 378
379 interface _ExpandingTextAreaMixin {
380 postCreate(): void;
381 startup(): void;
382 resize(): void;
383 }
379 interface _ExpandingTextAreaMixin {
380 postCreate(): void;
381 startup(): void;
382 resize(): void;
383 }
384 384
385 /* dijit/form/_FormMixin */
386
387 interface OnValidStateChange {
388 (isValid?: boolean): void;
389 }
385 /* dijit/form/_FormMixin */
390 386
391 interface _FormMixin {
387 interface OnValidStateChange {
388 (isValid?: boolean): void;
389 }
390
391 interface _FormMixin {
392 392
393 /**
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, "",
396 * which indicates that the form is ready to be submitted.
397 */
398 state: '' | 'Error' | 'Incomplete';
393 /**
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, "",
396 * which indicates that the form is ready to be submitted.
397 */
398 state: '' | 'Error' | 'Incomplete';
399 399
400 /**
401 * Returns all form widget descendants, searching through non-form child widgets like BorderContainer
402 */
403 _getDescendantFormWidgets(children?: _WidgetBase[]): _FormWidget[];
404
405 reset(): void;
400 /**
401 * Returns all form widget descendants, searching through non-form child widgets like BorderContainer
402 */
403 _getDescendantFormWidgets(children?: _WidgetBase[]): _FormWidget[];
406 404
407 /**
408 * returns if the form is valid - same as isValid - but
409 * provides a few additional (ui-specific) features:
410 *
411 * 1. it will highlight any sub-widgets that are not valid
412 * 2. it will call focus() on the first invalid sub-widget
413 */
414 validate(): boolean;
405 reset(): void;
415 406
416 setValues(val: any): _FormMixin;
417 getValues(): any;
407 /**
408 * returns if the form is valid - same as isValid - but
409 * provides a few additional (ui-specific) features:
410 *
411 * 1. it will highlight any sub-widgets that are not valid
412 * 2. it will call focus() on the first invalid sub-widget
413 */
414 validate(): boolean;
415
416 setValues(val: any): _FormMixin;
417 getValues(): any;
418 418
419 /**
420 * Returns true if all of the widgets are valid.
421 * Deprecated, will be removed in 2.0. Use get("state") instead.
422 */
423 isValid(): boolean;
419 /**
420 * Returns true if all of the widgets are valid.
421 * Deprecated, will be removed in 2.0. Use get("state") instead.
422 */
423 isValid(): boolean;
424 424
425 /**
426 * Stub function to connect to if you want to do something
427 * (like disable/enable a submit button) when the valid
428 * state changes on the form as a whole.
429 *
430 * Deprecated. Will be removed in 2.0. Use watch("state", ...) instead.
431 */
432 onValidStateChange: OnValidStateChange;
433
434 /**
435 * Compute what this.state should be based on state of children
436 */
437 _getState(): '' | 'Error' | 'Incomplete';
425 /**
426 * Stub function to connect to if you want to do something
427 * (like disable/enable a submit button) when the valid
428 * state changes on the form as a whole.
429 *
430 * Deprecated. Will be removed in 2.0. Use watch("state", ...) instead.
431 */
432 onValidStateChange: OnValidStateChange;
438 433
439 /**
440 * Deprecated method. Applications no longer need to call this. Remove for 2.0.
441 */
442 disconnectChildren(): void;
434 /**
435 * Compute what this.state should be based on state of children
436 */
437 _getState(): '' | 'Error' | 'Incomplete';
443 438
444 /**
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
447 * initialized.
448 */
449 connectChildren(inStartup?: boolean): void;
439 /**
440 * Deprecated method. Applications no longer need to call this. Remove for 2.0.
441 */
442 disconnectChildren(): void;
450 443
451 /**
452 * Called when child's value or disabled state changes
453 */
454 _onChildChange(attr?: string): void;
455
456 startup(): void;
457 destroy(preserveDom?: boolean): void;
458 }
444 /**
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
447 * initialized.
448 */
449 connectChildren(inStartup?: boolean): void;
459 450
460 interface _FormMixinConstructor extends dojo._base.DeclareConstructor<_FormMixin> { }
461
462 /* dijit/form/_FormSelectWidget */
451 /**
452 * Called when child's value or disabled state changes
453 */
454 _onChildChange(attr?: string): void;
463 455
464 interface SelectOption {
465 value?: string;
466 label: string;
467 selected?: boolean;
468 disabled?: boolean;
469 }
456 startup(): void;
457 destroy(preserveDom?: boolean): void;
458 }
459
460 interface _FormMixinConstructor extends dojo._base.DeclareConstructor<_FormMixin> { }
461
462 /* dijit/form/_FormSelectWidget */
470 463
471 interface _FormSelectWidget<T extends Object, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> extends _FormValueWidget {
472 /**
473 * Whether or not we are multi-valued
474 */
475 multiple: boolean;
464 interface SelectOption {
465 value?: string;
466 label: string;
467 selected?: boolean;
468 disabled?: boolean;
469 }
476 470
477 /**
478 * The set of options for our select item. Roughly corresponds to
479 * the html `<option>` tag.
480 */
481 options: SelectOption[];
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 /**
473 * Whether or not we are multi-valued
474 */
475 multiple: boolean;
482 476
483 /**
484 * A store to use for getting our list of options - rather than reading them
485 * from the `<option>` html tags. Should support getIdentity().
486 * For back-compat store can also be a dojo/data/api/Identity.
487 */
488 store: dojo.store.api.Store<T, Q, O>;
477 /**
478 * The set of options for our select item. Roughly corresponds to
479 * the html `<option>` tag.
480 */
481 options: SelectOption[];
489 482
490 /**
491 * A query to use when fetching items from our store
492 */
493 query: Q;
483 /**
484 * A store to use for getting our list of options - rather than reading them
485 * from the `<option>` html tags. Should support getIdentity().
486 * For back-compat store can also be a dojo/data/api/Identity.
487 */
488 store: dojo.store.api.Store<T, Q, O>;
494 489
495 /**
496 * Query options to use when fetching from the store
497 */
498 queryOptions: O;
490 /**
491 * A query to use when fetching items from our store
492 */
493 query: Q;
499 494
500 /**
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
503 * dojo.data store rather than a new dojo/store.
504 */
505 labelAttr: string;
495 /**
496 * Query options to use when fetching from the store
497 */
498 queryOptions: O;
506 499
507 /**
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)
510 */
511 onFetch: (items: T[]) => void;
500 /**
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
503 * dojo.data store rather than a new dojo/store.
504 */
505 labelAttr: string;
512 506
513 /**
514 * Flag to sort the options returned from a store by the label of
515 * the store.
516 */
517 sortByLabel: boolean;
507 /**
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)
510 */
511 onFetch: (items: T[]) => void;
512
513 /**
514 * Flag to sort the options returned from a store by the label of
515 * the store.
516 */
517 sortByLabel: boolean;
518 518
519 /**
520 * By default loadChildren is called when the items are fetched from the
521 * store. This property allows delaying loadChildren (and the creation
522 * of the options/menuitems) until the user clicks the button to open the
523 * dropdown.
524 */
525 loadChildrenOnOpen: boolean;
519 /**
520 * By default loadChildren is called when the items are fetched from the
521 * store. This property allows delaying loadChildren (and the creation
522 * of the options/menuitems) until the user clicks the button to open the
523 * dropdown.
524 */
525 loadChildrenOnOpen: boolean;
526 526
527 /**
528 * This is the `dojo.Deferred` returned by setStore().
529 * Calling onLoadDeferred.then() registers your
530 * callback to be called only once, when the prior setStore completes.
531 */
532 onLoadDeferred: dojo.Deferred<void>;
527 /**
528 * This is the `dojo.Deferred` returned by setStore().
529 * Calling onLoadDeferred.then() registers your
530 * callback to be called only once, when the prior setStore completes.
531 */
532 onLoadDeferred: dojo.Deferred<void>;
533 533
534 /**
535 * Returns a given option (or options).
536 */
537 getOptions(valueOrIdx: string): SelectOption;
538 getOptions(valueOrIdx: number): SelectOption;
539 getOptions(valueOrIdx: SelectOption): SelectOption;
540 getOptions(valueOrIdx: (string | number | SelectOption)[]): SelectOption[];
541 getOptions(): SelectOption[];
534 /**
535 * Returns a given option (or options).
536 */
537 getOptions(valueOrIdx: string): SelectOption;
538 getOptions(valueOrIdx: number): SelectOption;
539 getOptions(valueOrIdx: SelectOption): SelectOption;
540 getOptions(valueOrIdx: (string | number | SelectOption)[]): SelectOption[];
541 getOptions(): SelectOption[];
542 542
543 /**
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.
546 * Passing in an array of options will yield slightly better performance
547 * since the children are only loaded once.
548 */
549 addOption(option: SelectOption | SelectOption[]): void;
543 /**
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.
546 * Passing in an array of options will yield slightly better performance
547 * since the children are only loaded once.
548 */
549 addOption(option: SelectOption | SelectOption[]): void;
550 550
551 /**
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
554 * index in the options array is removed), or select option (in
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
557 * better performance since the children are only loaded once.
558 * For numeric option values, specify {value: number} as the argument.
559 */
560 removeOption(option: string | number | SelectOption | (string | number | SelectOption)[]): void;
551 /**
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
554 * index in the options array is removed), or select option (in
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
557 * better performance since the children are only loaded once.
558 * For numeric option values, specify {value: number} as the argument.
559 */
560 removeOption(option: string | number | SelectOption | (string | number | SelectOption)[]): void;
561 561
562 /**
563 * Updates the values of the given option. The option to update
564 * is matched based on the value of the entered option. Passing
565 * in an array of new options will yield better performance since
566 * the children will only be loaded once.
567 */
568 updateOption(newOption: SelectOption | SelectOption[]): void;
562 /**
563 * Updates the values of the given option. The option to update
564 * is matched based on the value of the entered option. Passing
565 * in an array of new options will yield better performance since
566 * the children will only be loaded once.
567 */
568 updateOption(newOption: SelectOption | SelectOption[]): void;
569 569
570 /**
571 * Deprecated!
572 */
573 setStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
574 query: Q;
575 queryOptions: O;
576 onFetch: (items: T[], fetchArgs?: any) => void;
577 }): dojo.store.api.Store<T, Q, O>;
570 /**
571 * Deprecated!
572 */
573 setStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
574 query: Q;
575 queryOptions: O;
576 onFetch: (items: T[], fetchArgs?: any) => void;
577 }): dojo.store.api.Store<T, Q, O>;
578 578
579 /**
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
582 * function returns the original store, in case you want to reuse
583 * it or something.
584 */
585 _deprecatedSetStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
586 query: Q;
587 queryOptions: O;
588 onFetch: (items: T[], fetchArgs?: any) => void;
589 }): dojo.store.api.Store<T, Q, O>;
579 /**
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
582 * function returns the original store, in case you want to reuse
583 * it or something.
584 */
585 _deprecatedSetStore(store: dojo.store.api.Store<T, Q, O>, selectedValue?: T, fetchArgs?: {
586 query: Q;
587 queryOptions: O;
588 onFetch: (items: T[], fetchArgs?: any) => void;
589 }): dojo.store.api.Store<T, Q, O>;
590 590
591 /**
592 * Loads the children represented by this widget's options.
593 * reset the menu to make it populatable on the next click
594 */
595 _loadChildren(): void;
591 /**
592 * Loads the children represented by this widget's options.
593 * reset the menu to make it populatable on the next click
594 */
595 _loadChildren(): void;
596 596
597 /**
598 * Sets the "selected" class on the item for styling purposes
599 */
600 _updateSelection(): void;
597 /**
598 * Sets the "selected" class on the item for styling purposes
599 */
600 _updateSelection(): void;
601 601
602 /**
603 * Returns the value of the widget by reading the options for
604 * the selected flag
605 */
606 _getValueFromOpts(): string;
602 /**
603 * Returns the value of the widget by reading the options for
604 * the selected flag
605 */
606 _getValueFromOpts(): string;
607 607
608 buildRendering(): void;
608 buildRendering(): void;
609 609
610 /**
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
613 * function.
614 */
615 _fillContent(): void;
610 /**
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
613 * function.
614 */
615 _fillContent(): void;
616 616
617 /**
618 * sets up our event handling that we need for functioning
619 * as a select
620 */
621 postCreate(): void;
617 /**
618 * sets up our event handling that we need for functioning
619 * as a select
620 */
621 postCreate(): void;
622 622
623 startup(): void;
623 startup(): void;
624 624
625 /**
626 * Clean up our connections
627 */
628 destroy(preserveDom?: boolean): void;
625 /**
626 * Clean up our connections
627 */
628 destroy(preserveDom?: boolean): void;
629 629
630 /**
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
633 * separator is added in that place. Make sure to store the option
634 * in the created option widget.
635 */
636 _addOptionItem(option: SelectOption): void;
630 /**
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
633 * separator is added in that place. Make sure to store the option
634 * in the created option widget.
635 */
636 _addOptionItem(option: SelectOption): void;
637 637
638 /**
639 * User-overridable function which, for the given option, removes
640 * its item from the select.
641 */
642 _removeOptionItem(option: SelectOption): void;
638 /**
639 * User-overridable function which, for the given option, removes
640 * its item from the select.
641 */
642 _removeOptionItem(option: SelectOption): void;
643 643
644 /**
645 * Overridable function which will set the display for the
646 * widget. newDisplay is either a string (in the case of
647 * single selects) or array of strings (in the case of multi-selects)
648 */
649 _setDisplay(newDisplay: string | string[]): void;
644 /**
645 * Overridable function which will set the display for the
646 * widget. newDisplay is either a string (in the case of
647 * single selects) or array of strings (in the case of multi-selects)
648 */
649 _setDisplay(newDisplay: string | string[]): void;
650 650
651 /**
652 * Overridable function to return the children that this widget contains.
653 */
654 _getChildren(): any[];
651 /**
652 * Overridable function to return the children that this widget contains.
653 */
654 _getChildren(): any[];
655 655
656 /**
657 * hooks into this.attr to provide a mechanism for getting the
658 * option items for the current value of the widget.
659 */
660 _getSelectedOptionsAttr(): SelectOption[];
656 /**
657 * hooks into this.attr to provide a mechanism for getting the
658 * option items for the current value of the widget.
659 */
660 _getSelectedOptionsAttr(): SelectOption[];
661 661
662 /**
663 * a function that will "fake" loading children, if needed, and
664 * if we have set to not load children until the widget opens.
665 */
666 _pseudoLoadChildren(items: T[]): void;
662 /**
663 * a function that will "fake" loading children, if needed, and
664 * if we have set to not load children until the widget opens.
665 */
666 _pseudoLoadChildren(items: T[]): void;
667 667
668 /**
669 * a function that can be connected to in order to receive a
670 * notification that the store has finished loading and all options
671 * from that store are available
672 */
673 onSetStore(): void;
674 }
668 /**
669 * a function that can be connected to in order to receive a
670 * notification that the store has finished loading and all options
671 * from that store are available
672 */
673 onSetStore(): void;
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 /**
681 * Should this widget respond to user input?
682 * In markup, this is specified as "readOnly".
683 * Similar to disabled except readOnly form values are submitted.
684 */
685 readOnly: boolean;
680 /**
681 * Should this widget respond to user input?
682 * In markup, this is specified as "readOnly".
683 * Similar to disabled except readOnly form values are submitted.
684 */
685 readOnly: boolean;
686 686
687 postCreate(): void;
687 postCreate(): void;
688 688
689 /**
690 * Restore the value to the last value passed to onChange
691 */
692 undo(): void;
689 /**
690 * Restore the value to the last value passed to onChange
691 */
692 undo(): void;
693 693
694 /**
695 * Reset the widget's value to what it was at initialization time
696 */
697 reset(): void;
698
699 _hasBeenBlurred?: boolean;
700 }
701
702 /* dijit/form/_FormValueWidget */
694 /**
695 * Reset the widget's value to what it was at initialization time
696 */
697 reset(): void;
703 698
704 interface _FormValueWidget extends _FormWidget, _FormValueMixin {
705 /**
706 * Work around table sizing bugs on IE7 by forcing redraw
707 */
708 _layoutHackIE7(): void;
699 _hasBeenBlurred?: boolean;
700 }
701
702 /* dijit/form/_FormValueWidget */
709 703
710 // set(name: string, value: any): this;
711 // set(values: Object): this;
712 }
713
714 interface _FormValueWidgetConstructor extends _WidgetBaseConstructor<_FormValueWidget> { }
715
716 /* dijit/form/_FormWidget */
704 interface _FormValueWidget extends _FormWidget, _FormValueMixin {
705 /**
706 * Work around table sizing bugs on IE7 by forcing redraw
707 */
708 _layoutHackIE7(): void;
717 709
718 interface _FormWidget extends _Widget, _TemplatedMixin, _CssStateMixin, _FormWidgetMixin {
719 setDisabled(disabled: boolean): void;
720 setValue(value: string): void;
721 postMixInProperties(): void;
710 // set(name: string, value: any): this;
711 // set(values: Object): this;
712 }
713
714 interface _FormValueWidgetConstructor extends _WidgetBaseConstructor<_FormValueWidget> { }
722 715
723 // set(name: 'value', value: string): this;
724 // set(name: string, value: any): this;
725 // set(values: Object): this;
726 }
716 /* dijit/form/_FormWidget */
727 717
728 interface _FormWidgetConstructor extends _WidgetBaseConstructor<_FormWidget> { }
729
730 /* dijit/form/_FormWidgetMixin */
718 interface _FormWidget extends _Widget, _TemplatedMixin, _CssStateMixin, _FormWidgetMixin {
719 setDisabled(disabled: boolean): void;
720 setValue(value: string): void;
721 postMixInProperties(): void;
731 722
732 interface _FormWidgetMixin {
733 /**
734 * Name used when submitting form; same as "name" attribute or plain HTML elements
735 */
736 name: string;
723 // set(name: 'value', value: string): this;
724 // set(name: string, value: any): this;
725 // set(values: Object): this;
726 }
737 727
738 /**
739 * Corresponds to the native HTML `<input>` element's attribute.
740 */
741 alt: string;
728 interface _FormWidgetConstructor extends _WidgetBaseConstructor<_FormWidget> { }
729
730 /* dijit/form/_FormWidgetMixin */
742 731
743 /**
744 * Corresponds to the native HTML `<input>` element's attribute.
745 */
746 value: any;
747
748 /**
749 * Corresponds to the native HTML `<input>` element's attribute.
750 */
751 type: string;
732 /**
733 * Mixin for widgets corresponding to native HTML elements such as `<checkbox>` or `<button>`,
734 * which can be children of a `<form>` node or a `dijit/form/Form` widget.
735 *
736 * Represents a single HTML element.
737 * All these widgets should have these attributes just like native HTML input elements.
738 * You can set them during widget construction or afterwards, via `dijit/_WidgetBase.set()`.
739 *
740 * They also share some common methods.
741 */
742 interface _FormWidgetMixin {
743 /**
744 * Name used when submitting form; same as "name" attribute or plain HTML elements
745 */
746 name: string;
752 747
753 /**
754 * Apply aria-label in markup to the widget's focusNode
755 */
756 'aria-label': string;
757 748
758 /**
759 * Order fields are traversed when user hits the tab key
760 */
761 tabIndex: number;
749 /** Corresponds to the native HTML `<input>` element's attribute. */
750 alt: string;
751
752 /** Corresponds to the native HTML `<input>` element's attribute. */
753 value: any;
762 754
763 /**
764 * Should this widget respond to user input?
765 * In markup, this is specified as "disabled='disabled'", or just "disabled".
766 */
767 disabled: boolean;
755 /** Corresponds to the native HTML `<input>` element's attribute. */
756 type: string;
757
758 /** Apply aria-label in markup to the widget's focusNode */
759 "aria-label": "focusNode";
768 760
769 /**
770 * Fires onChange for each value change or only on demand
771 */
772 intermediateChanges: boolean;
761 /** Order fields are traversed when user hits the tab key */
762 tabIndex: number;
763
764 /** Should this widget respond to user input?
765 * In markup, this is specified as "disabled='disabled'", or just "disabled".
766 */
767 disabled: boolean;
773 768
774 /**
775 * On focus, should this widget scroll into view?
776 */
777 scrollOnFocus: boolean;
769 /** Fires onChange for each value change or only on demand */
770 intermediateChanges: boolean;
771
772 /** On focus, should this widget scroll into view? */
773 scrollOnFocus: boolean;
778 774
779 /**
780 * Tells if this widget is focusable or not. Used internally by dijit.
781 */
782 isFocusable(): boolean;
775 _setDisabledAttr(value: boolean): void;
776
777 _onFocus(by: string): void;
783 778
784 /**
785 * Put focus on this widget
786 */
787 focus(): void;
779 /** Tells if this widget is focusable or not. Used internally by dijit.
780 * @protected
781 */
782 isFocusable(): boolean;
788 783
789 /**
790 * Compare 2 values (as returned by get('value') for this widget).
791 */
792 compare(val1: any, val2: any): number;
784 /** Put focus on this widget */
785 focus(): void;
793 786
794 /**
795 * Callback when this widget's value is changed.
796 */
797 onChange(value: string): void;
787 /** Compare 2 values (as returned by get('value') for this widget).
788 * @protected
789 */
790 compare(val1: any, val2: any): number;
798 791
799 /**
800 * Overrides _Widget.create()
801 */
802 create(params?: any, srcNodeRef?: HTMLElement): void;
803
804 destroy(preserveDom?: boolean): void;
792 onChange(newValue: any): void;
805 793
806 // set(name: 'disabled', value: boolean): this;
807 // set(name: string, value: any): this;
808 // set(values: Object): this;
809 }
810
811 /* dijit/form/_ListBase */
794 /**
795 * Hook so set('value', value) works.
796 *
797 * Sets the value of the widget.
798 * If the value has changed, then fire onChange event, unless priorityChange
799 * is specified as null (or false?)
800 *
801 * @param value
802 * @param priorityChange
803 */
804 _setValueAttr(value: any, priorityChange?: boolean);
812 805
813 interface _ListBase {
814 /**
815 * currently selected node
816 */
817 selected: HTMLElement;
818
819 /**
820 * Select the first displayed item in the list.
821 */
822 selectFirstNode(): void;
806 /**
807 * Called when the value of the widget has changed. Saves the new value in this.value,
808 * and calls onChange() if appropriate. See _FormWidget._handleOnChange() for details.
809 *
810 * @param newValue
811 * @param priorityChange
812 */
813 _handleOnChange(newValue: any, priorityChange?: boolean);
814 }
823 815
824 /**
825 * Select the last displayed item in the list
826 */
827 selectLastNode(): void;
816 /* dijit/form/_ListBase */
828 817
829 /**
830 * Select the item just below the current selection.
831 * If nothing selected, select first node.
832 */
833 selectNextNode(): void;
818 interface _ListBase {
819 /**
820 * currently selected node
821 */
822 selected: HTMLElement;
834 823
835 /**
836 * Select the item just above the current selection.
837 * If nothing selected, select last node (if
838 * you select Previous and try to keep scrolling up the list).
839 */
840 selectPreviousNode(): void;
824 /**
825 * Select the first displayed item in the list.
826 */
827 selectFirstNode(): void;
841 828
842 // set(name: 'selected', value: HTMLElement): this;
843 // set(name: string, value: any): this;
844 // set(values: Object): this;
845 }
829 /**
830 * Select the last displayed item in the list
831 */
832 selectLastNode(): void;
846 833
847 /* dijit/form/_ListMouseMixin */
834 /**
835 * Select the item just below the current selection.
836 * If nothing selected, select first node.
837 */
838 selectNextNode(): void;
848 839
849 interface _ListMouseMixin extends _ListBase {
850 postCreate(): void;
851 }
852
853 /* dijit/form/_RadioButtonMixin */
840 /**
841 * Select the item just above the current selection.
842 * If nothing selected, select last node (if
843 * you select Previous and try to keep scrolling up the list).
844 */
845 selectPreviousNode(): void;
854 846
855 interface _RadioButtonMixin {
856 /**
857 * type attribute on `<input>` node.
858 * Users should not change this value.
859 */
860 type: string;
861 }
847 // set(name: 'selected', value: HTMLElement): this;
848 // set(name: string, value: any): this;
849 // set(values: Object): this;
850 }
851
852 /* dijit/form/_ListMouseMixin */
862 853
863 /* dijit/form/_SearchMixin */
854 interface _ListMouseMixin extends _ListBase {
855 postCreate(): void;
856 }
857
858 /* dijit/form/_RadioButtonMixin */
864 859
865 interface _SearchMixin<T extends Object, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> {
866 /**
867 * Argument to data provider.
868 * Specifies maximum number of search results to return per query
869 */
870 pageSize: number;
860 interface _RadioButtonMixin {
861 /**
862 * type attribute on `<input>` node.
863 * Users should not change this value.
864 */
865 type: string;
866 }
871 867
872 /**
873 * Reference to data provider object used by this ComboBox.
874 * The store must accept an object hash of properties for its query. See `query` and `queryExpr` for details.
875 */
876 store: dojo.store.api.Store<T, Q, O>;
868 /* dijit/form/_SearchMixin */
877 869
878 /**
879 * Mixin to the store's fetch.
880 * For example, to set the sort order of the ComboBox menu, pass:
881 * { sort: [{attribute:"name",descending: true}] }
882 * To override the default queryOptions so that deep=false, do:
883 * { queryOptions: {ignoreCase: true, deep: false} }
884 */
885 fetchProperties: { [property: string]: any };
870 interface _SearchMixin<T extends Object, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> {
871 /**
872 * Argument to data provider.
873 * Specifies maximum number of search results to return per query
874 */
875 pageSize: number;
886 876
887 /**
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.
890 */
891 query: Q;
877 /**
878 * Reference to data provider object used by this ComboBox.
879 * The store must accept an object hash of properties for its query. See `query` and `queryExpr` for details.
880 */
881 store: dojo.store.api.Store<T, Q, O>;
892 882
893 /**
894 * Alternate to specifying a store. Id of a dijit/form/DataList widget.
895 */
896 list: string;
883 /**
884 * Mixin to the store's fetch.
885 * For example, to set the sort order of the ComboBox menu, pass:
886 * { sort: [{attribute:"name",descending: true}] }
887 * To override the default queryOptions so that deep=false, do:
888 * { queryOptions: {ignoreCase: true, deep: false} }
889 */
890 fetchProperties: { [property: string]: any };
897 891
898 /**
899 * Delay in milliseconds between when user types something and we start
900 * searching based on that value
901 */
902 searchDelay: number;
892 /**
893 * A query that can be passed to `store` to initially filter the items.
894 * ComboBox overwrites any reference to the `searchAttr` and sets it to the `queryExpr` with the user's input substituted.
895 */
896 query: Q;
903 897
904 /**
905 * Search for items in the data store where this attribute (in the item)
906 * matches what the user typed
907 */
908 searchAttr: string;
898 /**
899 * Alternate to specifying a store. Id of a dijit/form/DataList widget.
900 */
901 list: string;
909 902
910 /**
911 * This specifies what query is sent to the data store,
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,
914 * etc.
915 * `${0}` will be substituted for the user text.
916 * `*` is used for wildcards.
917 * `${0}*` means "starts with", `*${0}*` means "contains", `${0}` means "is"
918 */
919 queryExpr: string;
903 /**
904 * Delay in milliseconds between when user types something and we start
905 * searching based on that value
906 */
907 searchDelay: number;
920 908
921 /**
922 * Set true if the query should ignore case when matching possible items
923 */
924 ignoreCase: boolean;
909 /**
910 * Search for items in the data store where this attribute (in the item)
911 * matches what the user typed
912 */
913 searchAttr: string;
925 914
926 /**
927 * Helper function to convert a simple pattern to a regular expression for matching.
928 */
929 _patternToRegExp(pattern: string): RegExp;
930
931 _abortQuery(): void;
915 /**
916 * This specifies what query is sent to the data store,
917 * based on what the user has typed. Changing this expression will modify
918 * whether the results are only exact matches, a "starting with" match,
919 * etc.
920 * `${0}` will be substituted for the user text.
921 * `*` is used for wildcards.
922 * `${0}*` means "starts with", `*${0}*` means "contains", `${0}` means "is"
923 */
924 queryExpr: string;
932 925
933 /**
934 * Handles input (keyboard/paste) events
935 */
936 _processInput(e: KeyboardEvent): void;
926 /**
927 * Set true if the query should ignore case when matching possible items
928 */
929 ignoreCase: boolean;
937 930
938 /**
939 * Callback when a search completes.
940 */
941 onSearch(results: T[], query: Q, options: O): void;
942
943 _startSearchFromInput(): void;
931 /**
932 * Helper function to convert a simple pattern to a regular expression for matching.
933 */
934 _patternToRegExp(pattern: string): RegExp;
944 935
945 /**
946 * Starts a search for elements matching text (text=="" means to return all items
947 * and calls onSearch(...) when the search completes, to display the results.
948 */
949 _startSearch(text: string): void;
936 _abortQuery(): void;
950 937
951 postMixInProperties(): void;
938 /**
939 * Handles input (keyboard/paste) events
940 */
941 _processInput(e: KeyboardEvent): void;
952 942
953 // set(name: 'list', value: string): this;
954 // set(name: string, value: any): this;
955 // set(values: Object): this;
956 }
943 /**
944 * Callback when a search completes.
945 */
946 onSearch(results: T[], query: Q, options: O): void;
957 947
958 /* dijit/form/_Spinner */
948 _startSearchFromInput(): void;
959 949
960 interface AdjustFunction {
961 (val: any, delta: number): any;
962 }
950 /**
951 * Starts a search for elements matching text (text=="" means to return all items
952 * and calls onSearch(...) when the search completes, to display the results.
953 */
954 _startSearch(text: string): void;
963 955
964 interface _Spinner extends RangeBoundTextBox {
965 /**
966 * Number of milliseconds before a held arrow key or up/down button becomes typematic
967 */
968 defaultTimeout: number;
956 postMixInProperties(): void;
969 957
970 /**
971 * minimum number of milliseconds that typematic event fires when held key or button is held
972 */
973 minimumTimeout: number;
958 // set(name: 'list', value: string): this;
959 // set(name: string, value: any): this;
960 // set(values: Object): this;
961 }
974 962
975 /**
976 * Fraction of time used to change the typematic timer between events.
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.
979 */
980 timeoutChangeRate: number;
963 /* dijit/form/_Spinner */
964
965 interface AdjustFunction {
966 (val: any, delta: number): any;
967 }
981 968
982 /**
983 * Adjust the value by this much when spinning using the arrow keys/buttons
984 */
985 smallDelta: number;
986
987 /**
988 * Adjust the value by this much when spinning using the PgUp/Dn keys
989 */
990 largeDelta: number;
969 interface _Spinner extends RangeBoundTextBox {
970 /**
971 * Number of milliseconds before a held arrow key or up/down button becomes typematic
972 */
973 defaultTimeout: number;
991 974
992 templateString: string;
993 baseClass: string;
994 cssStateNodes: CSSStateNodes;
975 /**
976 * minimum number of milliseconds that typematic event fires when held key or button is held
977 */
978 minimumTimeout: number;
995 979
996 /**
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.
999 */
1000 adjust: AdjustFunction;
980 /**
981 * Fraction of time used to change the typematic timer between events.
982 * 1.0 means that each typematic event fires at defaultTimeout intervals.
983 * Less than 1.0 means that each typematic event fires at an increasing faster rate.
984 */
985 timeoutChangeRate: number;
1001 986
1002 postCreate(): void;
1003 }
1004
1005 interface _SpinnerConstrctor extends _WidgetBaseConstructor<_Spinner> { }
987 /**
988 * Adjust the value by this much when spinning using the arrow keys/buttons
989 */
990 smallDelta: number;
1006 991
1007 /* dijit/form/_TextBoxMixin */
1008
1009 interface _TextBoxMixin<C extends Constraints = Constraints> {
1010 /**
1011 * Removes leading and trailing whitespace if true. Default is false.
1012 */
1013 trim: boolean;
992 /**
993 * Adjust the value by this much when spinning using the PgUp/Dn keys
994 */
995 largeDelta: number;
1014 996
1015 /**
1016 * Converts all characters to uppercase if true. Default is false.
1017 */
1018 uppercase: boolean;
997 templateString: string;
998 baseClass: string;
999 cssStateNodes: CSSStateNodes;
1019 1000
1020 /**
1021 * Converts all characters to lowercase if true. Default is false.
1022 */
1023 lowercase: boolean;
1001 /**
1002 * Overridable function used to adjust a primitive value(Number/Date/...) by the delta amount specified.
1003 * The val is adjusted in a way that makes sense to the object type.
1004 */
1005 adjust: AdjustFunction;
1024 1006
1025 /**
1026 * Converts the first character of each word to uppercase if true.
1027 */
1028 propercase: boolean;
1007 postCreate(): void;
1008 }
1009
1010 interface _SpinnerConstrctor extends _WidgetBaseConstructor<_Spinner> { }
1011
1012 /* dijit/form/_TextBoxMixin */
1029 1013
1030 /**
1031 * HTML INPUT tag maxLength declaration.
1032 */
1033 maxLength: string;
1014 interface _TextBoxMixin<C extends Constraints = Constraints> {
1015 /**
1016 * Removes leading and trailing whitespace if true. Default is false.
1017 */
1018 trim: boolean;
1034 1019
1035 /**
1036 * If true, all text will be selected when focused with mouse
1037 */
1038 selectOnClick: boolean;
1039
1040 /**
1041 * Defines a hint to help users fill out the input field (as defined in HTML 5).
1042 * This should only contain plain text (no html markup).
1043 */
1044 placeHolder: string;
1020 /**
1021 * Converts all characters to uppercase if true. Default is false.
1022 */
1023 uppercase: boolean;
1045 1024
1046 /**
1047 * For subclasses like ComboBox where the displayed value
1048 * (ex: Kentucky) and the serialized value (ex: KY) are different,
1049 * this represents the displayed value.
1050 *
1051 * Setting 'displayedValue' through set('displayedValue', ...)
1052 * updates 'value', and vice-versa. Otherwise 'value' is updated
1053 * from 'displayedValue' periodically, like onBlur etc.
1054 */
1055 displayedValue: string;
1025 /**
1026 * Converts all characters to lowercase if true. Default is false.
1027 */
1028 lowercase: boolean;
1029
1030 /**
1031 * Converts the first character of each word to uppercase if true.
1032 */
1033 propercase: boolean;
1056 1034
1057 /**
1058 * Replaceable function to convert a value to a properly formatted string.
1059 */
1060 format: ConstrainedValueFunction<any, C, any>;
1035 /**
1036 * HTML INPUT tag maxLength declaration.
1037 */
1038 maxLength: string;
1039
1040 /**
1041 * If true, all text will be selected when focused with mouse
1042 */
1043 selectOnClick: boolean;
1061 1044
1062 /**
1063 * Replaceable function to convert a formatted string to a value
1064 */
1065 parse: ConstrainedValueFunction<any, C, any>;
1066
1067 /**
1068 * Connect to this function to receive notifications of various user data-input events.
1069 * Return false to cancel the event and prevent it from being processed.
1070 * Note that although for historical reasons this method is called `onInput()`, it doesn't
1071 * correspond to the standard DOM "input" event, because it occurs before the input has been processed.
1072 */
1073 onInput(e: InputEvent): void;
1045 /**
1046 * Defines a hint to help users fill out the input field (as defined in HTML 5).
1047 * This should only contain plain text (no html markup).
1048 */
1049 placeHolder: string;
1074 1050
1075 postCreate(): void;
1076
1077 /**
1078 * if the textbox is blank, what value should be reported
1079 */
1080 _blankValue: string;
1051 /**
1052 * For subclasses like ComboBox where the displayed value
1053 * (ex: Kentucky) and the serialized value (ex: KY) are different,
1054 * this represents the displayed value.
1055 *
1056 * Setting 'displayedValue' through set('displayedValue', ...)
1057 * updates 'value', and vice-versa. Otherwise 'value' is updated
1058 * from 'displayedValue' periodically, like onBlur etc.
1059 */
1060 displayedValue: string;
1081 1061
1082 /**
1083 * Auto-corrections (such as trimming) that are applied to textbox
1084 * value on blur or form submit.
1085 */
1086 filter<T>(val: T): T;
1087 filter<T extends number>(value: T): T;
1062 /**
1063 * Replaceable function to convert a value to a properly formatted string.
1064 */
1065 format: ConstrainedValueFunction<any, C, any>;
1066
1067 /**
1068 * Replaceable function to convert a formatted string to a value
1069 */
1070 parse: ConstrainedValueFunction<any, C, any>;
1088 1071
1089 _setBlurValue(): void;
1072 /**
1073 * Connect to this function to receive notifications of various user data-input events.
1074 * Return false to cancel the event and prevent it from being processed.
1075 * Note that although for historical reasons this method is called `onInput()`, it doesn't
1076 * correspond to the standard DOM "input" event, because it occurs before the input has been processed.
1077 */
1078 onInput(e: InputEvent): void;
1090 1079
1091 reset(): void;
1092 }
1093
1094 /* dijit/form/_ToggleButtonMixin */
1080 postCreate(): void;
1095 1081
1096 interface _ToggleButtonMixin {
1097 /**
1098 * Corresponds to the native HTML `<input>` element's attribute.
1099 * In markup, specified as "checked='checked'" or just "checked".
1100 * True if the button is depressed, or the checkbox is checked,
1101 * or the radio button is selected, etc.
1102 */
1103 checked: boolean;
1082 /**
1083 * if the textbox is blank, what value should be reported
1084 */
1085 _blankValue: string;
1104 1086
1105 postCreate(): void;
1087 /**
1088 * Auto-corrections (such as trimming) that are applied to textbox
1089 * value on blur or form submit.
1090 */
1091 filter<T>(val: T): T;
1092 filter<T extends number>(value: T): T;
1106 1093
1107 /**
1108 * Reset the widget's value to what it was at initialization time
1109 */
1110 reset(): void;
1094 _setBlurValue(): void;
1111 1095
1112 _hasBeenBlurred?: boolean;
1113 }
1096 reset(): void;
1097 }
1114 1098
1115 /* dijit/form/Button */
1099 /* dijit/form/_ToggleButtonMixin */
1116 1100
1117 interface Button extends _FormWidget, _ButtonMixin {
1118 /**
1119 * Set this to true to hide the label text and display only the icon.
1120 * (If showLabel=false then iconClass must be specified.)
1121 * Especially useful for toolbars.
1122 * If showLabel=true, the label will become the title (a.k.a. tooltip/hint)
1123 */
1124 showLabel: boolean;
1101 interface _ToggleButtonMixin {
1102 /**
1103 * Corresponds to the native HTML `<input>` element's attribute.
1104 * In markup, specified as "checked='checked'" or just "checked".
1105 * True if the button is depressed, or the checkbox is checked,
1106 * or the radio button is selected, etc.
1107 */
1108 checked: boolean;
1125 1109
1126 /**
1127 * Class to apply to DOMNode in button to make it display an icon
1128 */
1129 iconClass: string;
1110 postCreate(): void;
1130 1111
1131 baseClass: string;
1132 templateString: string;
1133 postCreate(): void;
1134 setLabel(content: string): void;
1135 onLabelSet(e: Event): void;
1112 /**
1113 * Reset the widget's value to what it was at initialization time
1114 */
1115 reset(): void;
1136 1116
1137 onClick(e: MouseEvent): boolean | void;
1117 _hasBeenBlurred?: boolean;
1118 }
1138 1119
1139 // set(name: 'showLabel', value: boolean): this;
1140 // set(name: 'value', value: string): this;
1141 // set(name: 'name', value: string): this;
1142 // set(name: 'label', value: string): this;
1143 // set(name: string, value: any): this;
1144 // set(values: Object): this;
1145 }
1120 /* dijit/form/Button */
1121
1122 interface Button extends _FormWidget, _ButtonMixin {
1123 /**
1124 * Set this to true to hide the label text and display only the icon.
1125 * (If showLabel=false then iconClass must be specified.)
1126 * Especially useful for toolbars.
1127 * If showLabel=true, the label will become the title (a.k.a. tooltip/hint)
1128 */
1129 showLabel: boolean;
1146 1130
1147 interface ButtonConstructor extends _WidgetBaseConstructor<Button> { }
1148
1149 /* dijit/form/CheckBox */
1131 /**
1132 * Class to apply to DOMNode in button to make it display an icon
1133 */
1134 iconClass: string;
1150 1135
1151 interface CheckBox extends ToggleButton, _CheckBoxMixin {
1152 templateString: string;
1153 baseClass: string;
1154 postMixInProperties(): void;
1155 value: string;
1136 baseClass: string;
1137 templateString: string;
1138 postCreate(): void;
1139 setLabel(content: string): void;
1140 onLabelSet(e: Event): void;
1156 1141
1157 // set(name: 'value', value: string | boolean): this;
1158 // set(name: string, value: any): this;
1159 // set(values: Object): this;
1160 }
1142 onClick(e: MouseEvent): boolean | void;
1161 1143
1162 interface CheckBoxConstructor extends _WidgetBaseConstructor<CheckBox> { }
1163
1164 /* dijit/form/ComboBox */
1144 // set(name: 'showLabel', value: boolean): this;
1145 // set(name: 'value', value: string): this;
1146 // set(name: 'name', value: string): this;
1147 // set(name: 'label', value: string): this;
1148 // set(name: string, value: any): this;
1149 // set(values: Object): this;
1150 }
1165 1151
1166 interface ComboBox<T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions, C extends Constraints = Constraints> extends ValidationTextBox<C>, ComboBoxMixin<T, Q, O> {
1167 // set(name: string, value: any): this;
1168 // set(values: Object): this;
1169 }
1152 interface ButtonConstructor extends _WidgetBaseConstructor<Button> { }
1153
1154 /* dijit/form/CheckBox */
1170 1155
1171 interface ComboBoxConstructor extends _WidgetBaseConstructor<ComboBox<any>> {
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 }
1174
1175 /* dijit/form/ComboBoxMixin */
1176
1177 interface ComboBoxMixin<T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> extends _HasDropDown<_ComboBoxMenu<T>>, _AutoCompleterMixin<T, Q, O> {
1156 interface CheckBox extends ToggleButton, _CheckBoxMixin {
1157 templateString: string;
1158 baseClass: string;
1159 postMixInProperties(): void;
1160 value: string;
1178 1161
1179 /**
1180 * Dropdown widget class used to select a date/time.
1181 * Subclasses should specify this.
1182 */
1183 dropDownClass: _ComboBoxMenu<T>;
1162 // set(name: 'value', value: string | boolean): this;
1163 // set(name: string, value: any): this;
1164 // set(values: Object): this;
1165 }
1166
1167 interface CheckBoxConstructor extends _WidgetBaseConstructor<CheckBox> { }
1168
1169 /* dijit/form/ComboBox */
1170
1171 interface ComboBox<T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions, C extends Constraints = Constraints> extends ValidationTextBox<C>, ComboBoxMixin<T, Q, O> {
1172 // set(name: string, value: any): this;
1173 // set(values: Object): this;
1174 }
1184 1175
1185 /**
1186 * Set this textbox to have a down arrow button, to display the drop down list.
1187 * Defaults to true.
1188 */
1189 hasDownArrow: boolean;
1176 interface ComboBoxConstructor extends _WidgetBaseConstructor<ComboBox<any>> {
1177 new <T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions, C extends Constraints = Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): ComboBox<T, Q, O, C>;
1178 }
1179
1180 /* dijit/form/ComboBoxMixin */
1190 1181
1191 templateString: string;
1192 baseClass: string;
1182 interface ComboBoxMixin<T extends Object = any, Q extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions = dojo.store.api.QueryOptions> extends _HasDropDown<_ComboBoxMenu<T>>, _AutoCompleterMixin<T, Q, O> {
1193 1183
1194 /**
1195 * Reference to data provider object used by this ComboBox.
1196 *
1197 * Should be dojo/store/api/Store, but dojo/data/api/Read supported
1198 * for backwards compatibility.
1199 */
1200 store: dojo.store.api.Store<T, Q, O>;
1184 /**
1185 * Dropdown widget class used to select a date/time.
1186 * Subclasses should specify this.
1187 */
1188 dropDownClass: _ComboBoxMenu<T>;
1201 1189
1202 cssStateNodes: CSSStateNodes;
1203 postMixInProperties(): void;
1204 buildRendering(): void;
1205 }
1190 /**
1191 * Set this textbox to have a down arrow button, to display the drop down list.
1192 * Defaults to true.
1193 */
1194 hasDownArrow: boolean;
1206 1195
1207 interface ComboBoxMixinConstructor<T = any, U extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, V = any> extends _WidgetBaseConstructor<ComboBoxMixin<T, U, V>> { }
1208
1209 /* dijit/form/CurrencyTextBox */
1210
1211 interface CurrencyTextBoxConstraints extends NumberTextBoxConstraints, dojo.CurrencyFormatOptions, dojo.CurrencyParseOptions {
1212 }
1196 templateString: string;
1197 baseClass: string;
1213 1198
1214 interface CurrencyTextBox extends NumberTextBox {
1215 /**
1216 * the [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD"
1217 */
1218 currency: string;
1199 /**
1200 * Reference to data provider object used by this ComboBox.
1201 *
1202 * Should be dojo/store/api/Store, but dojo/data/api/Read supported
1203 * for backwards compatibility.
1204 */
1205 store: dojo.store.api.Store<T, Q, O>;
1219 1206
1220 /**
1221 * Despite the name, this parameter specifies both constraints on the input
1222 * (including minimum/maximum allowed values) as well as
1223 * formatting options. See `dijit/form/CurrencyTextBox.__Constraints` for details.
1224 */
1225 constraints: CurrencyTextBoxConstraints;
1207 cssStateNodes: CSSStateNodes;
1208 postMixInProperties(): void;
1209 buildRendering(): void;
1210 }
1226 1211
1227 baseClass: string;
1212 interface ComboBoxMixinConstructor<T = any, U extends dojo.store.api.BaseQueryType = dojo.store.api.BaseQueryType, V = any> extends _WidgetBaseConstructor<ComboBoxMixin<T, U, V>> { }
1228 1213
1229 _formatter: (value: number, options?: dojo.CurrencyFormatOptions) => string;
1230 _parser: (expression: string, options?: dojo.CurrencyParseOptions) => number;
1231 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1214 /* dijit/form/CurrencyTextBox */
1215
1216 interface CurrencyTextBoxConstraints extends NumberTextBoxConstraints, dojo.CurrencyFormatOptions, dojo.CurrencyParseOptions {
1217 }
1232 1218
1233 /**
1234 * Parses string value as a Currency, according to the constraints object
1235 */
1236 parse(value: string, constraints: CurrencyTextBoxConstraints): string;
1237 }
1219 interface CurrencyTextBox extends NumberTextBox {
1220 /**
1221 * the [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD"
1222 */
1223 currency: string;
1238 1224
1239 interface CurrencyTextBoxConstructor extends _WidgetBaseConstructor<CurrencyTextBox> { }
1240
1241 /* dijit/form/DataList */
1225 /**
1226 * Despite the name, this parameter specifies both constraints on the input
1227 * (including minimum/maximum allowed values) as well as
1228 * formatting options. See `dijit/form/CurrencyTextBox.__Constraints` for details.
1229 */
1230 constraints: CurrencyTextBoxConstraints;
1242 1231
1243 interface DataList<T extends Object> extends dojo.store.Memory<T> {
1244 /**
1245 * Get the option marked as selected, like `<option selected>`.
1246 * Not part of dojo.data API.
1247 */
1248 fetchSelectedItem(): T;
1249 }
1232 baseClass: string;
1233
1234 _formatter: (value: number, options?: dojo.CurrencyFormatOptions) => string;
1235 _parser: (expression: string, options?: dojo.CurrencyParseOptions) => number;
1236 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1250 1237
1251 interface DataListConstructor {
1252 new <T extends Object>(params: Object, srcNodeRef: dojo.NodeOrString): DataList<T>;
1253 }
1238 /**
1239 * Parses string value as a Currency, according to the constraints object
1240 */
1241 parse(value: string, constraints: CurrencyTextBoxConstraints): string;
1242 }
1254 1243
1255 /* dijit/form/DateTextBox */
1244 interface CurrencyTextBoxConstructor extends _WidgetBaseConstructor<CurrencyTextBox> { }
1245
1246 /* dijit/form/DataList */
1256 1247
1257 interface DateTextBox extends _DateTimeTextBox<Calendar> {
1258 baseClass: string;
1259 popupClass: CalendarConstructor;
1260 _selector: string;
1261 maxHeight: number;
1248 interface DataList<T extends Object> extends dojo.store.Memory<T> {
1249 /**
1250 * Get the option marked as selected, like `<option selected>`.
1251 * Not part of dojo.data API.
1252 */
1253 fetchSelectedItem(): T;
1254 }
1262 1255
1263 /**
1264 * The value of this widget as a JavaScript Date object, with only year/month/day specified.`
1265 */
1266 value: Date;
1267 }
1256 interface DataListConstructor {
1257 new <T extends Object>(params: Object, srcNodeRef: dojo.NodeOrString): DataList<T>;
1258 }
1268 1259
1269 interface DateTextBoxConstructor extends _WidgetBaseConstructor<DateTextBox> { }
1270
1271 /* dijit/form/DropDownButton */
1260 /* dijit/form/DateTextBox */
1272 1261
1273 interface DropDownButton<T extends _WidgetBase> extends Button, _Container, _HasDropDown<T> {
1274 baseClass: string;
1275 templateString: string;
1262 interface DateTextBox extends _DateTimeTextBox<Calendar> {
1263 baseClass: string;
1264 popupClass: CalendarConstructor;
1265 _selector: string;
1266 maxHeight: number;
1276 1267
1277 /**
1278 * Overrides _TemplatedMixin#_fillContent().
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>
1281 */
1282 _fillContent(): void;
1283 startup(): void;
1268 /**
1269 * The value of this widget as a JavaScript Date object, with only year/month/day specified.`
1270 */
1271 value: Date;
1272 }
1284 1273
1285 /**
1286 * Returns whether or not we are loaded - if our dropdown has an href,
1287 * then we want to check that.
1288 */
1289 isLoaded(): boolean;
1274 interface DateTextBoxConstructor extends _WidgetBaseConstructor<DateTextBox> { }
1275
1276 /* dijit/form/DropDownButton */
1290 1277
1291 /**
1292 * Default implementation assumes that drop down already exists,
1293 * but hasn't loaded it's data (ex: ContentPane w/href).
1294 * App must override if the drop down is lazy-created.
1295 */
1296 loadDropDown(callback: () => void): void;
1278 interface DropDownButton<T extends _WidgetBase> extends Button, _Container, _HasDropDown<T> {
1279 baseClass: string;
1280 templateString: string;
1281
1282 /**
1283 * Overrides _TemplatedMixin#_fillContent().
1284 * My inner HTML possibly contains both the button label and/or a drop down widget, like
1285 * <DropDownButton> <span>push me</span> <Menu> ... </Menu> </DropDownButton>
1286 */
1287 _fillContent(): void;
1288 startup(): void;
1297 1289
1298 /**
1299 * Overridden so that focus is handled by the _HasDropDown mixin, not by
1300 * the _FormWidget mixin.
1301 */
1302 isFocusable(): boolean;
1303 }
1290 /**
1291 * Returns whether or not we are loaded - if our dropdown has an href,
1292 * then we want to check that.
1293 */
1294 isLoaded(): boolean;
1304 1295
1305 interface DropDownButtonConstructor extends _WidgetBaseConstructor<DropDownButton<any>> {
1306 new <T extends _WidgetBase>(params: Object, srcNodeRef: dojo.NodeOrString): DropDownButton<T>;
1307 }
1308
1309 /* dijit/form/FilteringSelect */
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> {
1312 /**
1313 * True (default) if user is required to enter a value into this field.
1314 */
1315 required: boolean;
1296 /**
1297 * Default implementation assumes that drop down already exists,
1298 * but hasn't loaded it's data (ex: ContentPane w/href).
1299 * App must override if the drop down is lazy-created.
1300 */
1301 loadDropDown(callback: () => void): void;
1316 1302
1317 _lastDisplayedValue: string;
1318 _isValidSubset(): boolean;
1319 isValid(): boolean;
1320 _refreshState(): void;
1303 /**
1304 * Overridden so that focus is handled by the _HasDropDown mixin, not by
1305 * the _FormWidget mixin.
1306 */
1307 isFocusable(): boolean;
1308 }
1321 1309
1322 /**
1323 * Callback from dojo.store after lookup of user entered value finishes
1324 */
1325 _callbackSetLabel(result: T[], query: Q, options: O, priorityChange?: boolean): void;
1310 interface DropDownButtonConstructor extends _WidgetBaseConstructor<DropDownButton<any>> {
1311 new <T extends _WidgetBase>(params: Object, srcNodeRef: dojo.NodeOrString): DropDownButton<T>;
1312 }
1326 1313
1327 _openResultList(results: T[], query: Q, options: O): void;
1328 undo(): void;
1314 /* dijit/form/FilteringSelect */
1329 1315
1330 // set(name: 'displayedValue', value: string): this;
1331 // set(name: 'item', value: T): this;
1332 // set(name: string, value: any): this;
1333 // set(values: Object): this;
1334 }
1335
1336 interface FilteringSelectConstructor extends _WidgetBaseConstructor<FilteringSelect<any, any, any, any>> {
1337 new <C extends Constraints, T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions>(params: Object, srcNodeRef: dojo.NodeOrString): FilteringSelect<C, T, Q, O>;
1338 }
1316 interface FilteringSelect<C extends Constraints, T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions> extends MappedTextBox<C>, ComboBoxMixin<T, Q, O> {
1317 /**
1318 * True (default) if user is required to enter a value into this field.
1319 */
1320 required: boolean;
1339 1321
1340 /* dijit/form/Form */
1322 _lastDisplayedValue: string;
1323 _isValidSubset(): boolean;
1324 isValid(): boolean;
1325 _refreshState(): void;
1341 1326
1342 interface Form extends _Widget, _TemplatedMixin, _FormMixin, layout._ContentPaneResizeMixin {
1343 name?: string;
1344 action?: string;
1345 method?: string;
1346 encType?: string;
1347 'accept-charset'?: string;
1348 accept?: string;
1349 target?: string;
1350 templateString: string;
1327 /**
1328 * Callback from dojo.store after lookup of user entered value finishes
1329 */
1330 _callbackSetLabel(result: T[], query: Q, options: O, priorityChange?: boolean): void;
1331
1332 _openResultList(results: T[], query: Q, options: O): void;
1333 undo(): void;
1351 1334
1352 /**
1353 * Deprecated: use submit()
1354 */
1355 execute(formContents: Object): void;
1335 // set(name: 'displayedValue', value: string): this;
1336 // set(name: 'item', value: T): this;
1337 // set(name: string, value: any): this;
1338 // set(values: Object): this;
1339 }
1356 1340
1357 /**
1358 * Deprecated: use onSubmit()
1359 */
1360 onExecute(): void;
1341 interface FilteringSelectConstructor extends _WidgetBaseConstructor<FilteringSelect<any, any, any, any>> {
1342 new <C extends Constraints, T extends Object, Q extends string | Object | Function, O extends dojo.store.api.QueryOptions>(params: Object, srcNodeRef: dojo.NodeOrString): FilteringSelect<C, T, Q, O>;
1343 }
1344
1345 /* dijit/form/Form */
1361 1346
1362 /**
1363 * restores all widget values back to their init values,
1364 * calls onReset() which can cancel the reset by returning false
1365 */
1366 reset(e?: Event): void;
1347 interface Form extends _Widget, _TemplatedMixin, _FormMixin, layout._ContentPaneResizeMixin {
1348 name?: string;
1349 action?: string;
1350 method?: string;
1351 encType?: string;
1352 'accept-charset'?: string;
1353 accept?: string;
1354 target?: string;
1355 templateString: string;
1367 1356
1368 /**
1369 * Callback when user resets the form. This method is intended
1370 * to be over-ridden. When the `reset` method is called
1371 * programmatically, the return value from `onReset` is used
1372 * to compute whether or not resetting should proceed
1373 */
1374 onReset(e?: Event): boolean;
1375
1376 /**
1377 * Callback when user submits the form.
1378 */
1379 onSubmit(e?: Event): boolean;
1357 /**
1358 * Deprecated: use submit()
1359 */
1360 execute(formContents: Object): void;
1380 1361
1381 /**
1382 * programmatically submit form if and only if the `onSubmit` returns true
1383 */
1384 submit(): void;
1385 }
1362 /**
1363 * Deprecated: use onSubmit()
1364 */
1365 onExecute(): void;
1386 1366
1387 interface FormConstructor extends _WidgetBaseConstructor<Form> { }
1388
1389 /* dijit/form/HorizontalRule */
1367 /**
1368 * restores all widget values back to their init values,
1369 * calls onReset() which can cancel the reset by returning false
1370 */
1371 reset(e?: Event): void;
1390 1372
1391 /**
1392 * Hash marks for `dijit/form/HorizontalSlider`
1393 */
1394 interface HorizontalRule extends _Widget, _TemplatedMixin {
1395 /**
1396 * Number of hash marks to generate
1397 */
1398 count: number;
1373 /**
1374 * Callback when user resets the form. This method is intended
1375 * to be over-ridden. When the `reset` method is called
1376 * programmatically, the return value from `onReset` is used
1377 * to compute whether or not resetting should proceed
1378 */
1379 onReset(e?: Event): boolean;
1399 1380
1400 /**
1401 * For HorizontalSlider, this is either "topDecoration" or "bottomDecoration", and indicates whether this rule goes above or below the slider.
1402 */
1403 container: string;
1381 /**
1382 * Callback when user submits the form.
1383 */
1384 onSubmit(e?: Event): boolean;
1404 1385
1405 /**
1406 * CSS style to apply to individual hash marks
1407 */
1408 ruleStyle: string;
1386 /**
1387 * programmatically submit form if and only if the `onSubmit` returns true
1388 */
1389 submit(): void;
1390 }
1409 1391
1410 _positionPrefix: string;
1411 _positionSuffix: string;
1412 _suffix: string;
1392 interface FormConstructor extends _WidgetBaseConstructor<Form> { }
1413 1393
1414 _genHTML(pos: number): string;
1394 /* dijit/form/HorizontalRule */
1415 1395
1416 /**
1417 * VerticalRule will override this...
1418 */
1419 _isHorizontal: boolean;
1420 }
1421
1422 interface HorizontalRuleConstructor extends _WidgetBaseConstructor<HorizontalRule> { }
1423
1424 /* dijit/form/HorizontalRuleLabels */
1396 /**
1397 * Hash marks for `dijit/form/HorizontalSlider`
1398 */
1399 interface HorizontalRule extends _Widget, _TemplatedMixin {
1400 /**
1401 * Number of hash marks to generate
1402 */
1403 count: number;
1425 1404
1426 /**
1427 * Labels for `dijit/form/HorizontalSlider`
1428 */
1429 interface HorizontalRuleLabels extends HorizontalRule {
1430 /**
1431 * CSS style to apply to individual text labels
1432 */
1433 labelStyle: string;
1405 /**
1406 * For HorizontalSlider, this is either "topDecoration" or "bottomDecoration", and indicates whether this rule goes above or below the slider.
1407 */
1408 container: string;
1434 1409
1435 /**
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.
1438 */
1439 labels: string[];
1410 /**
1411 * CSS style to apply to individual hash marks
1412 */
1413 ruleStyle: string;
1414
1415 _positionPrefix: string;
1416 _positionSuffix: string;
1417 _suffix: string;
1418
1419 _genHTML(pos: number): string;
1440 1420
1441 /**
1442 * Number of generated numeric labels that should be rendered as '' on the ends when labels[] are not specified
1443 */
1444 numericMargin: number;
1421 /**
1422 * VerticalRule will override this...
1423 */
1424 _isHorizontal: boolean;
1425 }
1445 1426
1446 /**
1447 * Leftmost label value for generated numeric labels when labels[] are not specified
1448 */
1449 minimum: number;
1427 interface HorizontalRuleConstructor extends _WidgetBaseConstructor<HorizontalRule> { }
1450 1428
1451 /**
1452 * Rightmost label value for generated numeric labels when labels[] are not specified
1453 */
1454 maximum: number;
1429 /* dijit/form/HorizontalRuleLabels */
1455 1430
1456 /**
1457 * pattern, places, lang, et al (see dojo.number) for generated numeric labels when labels[] are not specified
1458 */
1459 constraints: { pattern: string };
1431 /**
1432 * Labels for `dijit/form/HorizontalSlider`
1433 */
1434 interface HorizontalRuleLabels extends HorizontalRule {
1435 /**
1436 * CSS style to apply to individual text labels
1437 */
1438 labelStyle: string;
1460 1439
1461 /**
1462 * Returns the value to be used in HTML for the label as part of the left: attribute
1463 */
1464 _calcPosition(pos: number): number;
1440 /**
1441 * Array of text labels to render - evenly spaced from left-to-right or bottom-to-top.
1442 * Alternately, minimum and maximum can be specified, to get numeric labels.
1443 */
1444 labels: string[];
1465 1445
1466 _genHTML(pos: number, ndx?: number): string;
1467
1468 /**
1469 * extension point for bidi code
1470 */
1471 _genDirectionHTML(label: string): string;
1446 /**
1447 * Number of generated numeric labels that should be rendered as '' on the ends when labels[] are not specified
1448 */
1449 numericMargin: number;
1472 1450
1473 /**
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.
1476 */
1477 getLabels(): string[];
1478 }
1451 /**
1452 * Leftmost label value for generated numeric labels when labels[] are not specified
1453 */
1454 minimum: number;
1479 1455
1480 interface HorizontalRuleLabelsConstructor extends _WidgetBaseConstructor<HorizontalRuleLabels> { }
1481
1482 /* dijit/form/HorizontalSlider */
1483
1484 interface _SliderMover extends dojo.dnd.Mover { }
1456 /**
1457 * Rightmost label value for generated numeric labels when labels[] are not specified
1458 */
1459 maximum: number;
1485 1460
1486 /**
1487 * A form widget that allows one to select a value with a horizontally draggable handle
1488 */
1489 interface HorizontalSlider extends _FormValueWidget, _Container {
1490 /**
1491 * Show increment/decrement buttons at the ends of the slider?
1492 */
1493 showButtons: boolean;
1461 /**
1462 * pattern, places, lang, et al (see dojo.number) for generated numeric labels when labels[] are not specified
1463 */
1464 constraints: { pattern: string };
1494 1465
1495 /**
1496 * The minimum value the slider can be set to.
1497 */
1498 minimum: number;
1466 /**
1467 * Returns the value to be used in HTML for the label as part of the left: attribute
1468 */
1469 _calcPosition(pos: number): number;
1470
1471 _genHTML(pos: number, ndx?: number): string;
1472
1473 /**
1474 * extension point for bidi code
1475 */
1476 _genDirectionHTML(label: string): string;
1499 1477
1500 /**
1501 * The maximum value the slider can be set to.
1502 */
1503 maximum: number;
1478 /**
1479 * Overridable function to return array of labels to use for this slider.
1480 * Can specify a getLabels() method instead of a labels[] array, or min/max attributes.
1481 */
1482 getLabels(): string[];
1483 }
1504 1484
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.
1507 * Thus, the slider has only 'discreteValues' possible values.
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.
1510 *
1511 * If discreteValues is not specified or if it's value is higher than the number of pixels in the slider bar, then the slider handle can be moved freely, and the slider's value will be computed/reported based on pixel position (in this case it will likely be fractional, such as 123.456789).
1512 */
1513 discreteValues: number;
1485 interface HorizontalRuleLabelsConstructor extends _WidgetBaseConstructor<HorizontalRuleLabels> { }
1486
1487 /* dijit/form/HorizontalSlider */
1488
1489 interface _SliderMover extends dojo.dnd.Mover { }
1514 1490
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.
1517 * If discreteValues is not specified, it indicates the number of pixels.
1518 */
1519 pageIncrement: number;
1491 /**
1492 * A form widget that allows one to select a value with a horizontally draggable handle
1493 */
1494 interface HorizontalSlider extends _FormValueWidget, _Container {
1495 /**
1496 * Show increment/decrement buttons at the ends of the slider?
1497 */
1498 showButtons: boolean;
1520 1499
1521 /**
1522 * If clicking the slider bar changes the value or not
1523 */
1524 clickSelect: boolean;
1500 /**
1501 * The minimum value the slider can be set to.
1502 */
1503 minimum: number;
1525 1504
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.
1528 */
1529 slideDuration: number;
1505 /**
1506 * The maximum value the slider can be set to.
1507 */
1508 maximum: number;
1530 1509
1531 _mousePixelCoord: string;
1532 _pixelCount: string;
1533 _startingPixelCoord: string;
1534 _handleOffsetCoord: string;
1535 _progressPixelSize: string;
1536
1537 _onKeyUp(e: Event): void;
1538 _onKeyDown(e: Event): void;
1539 _onHandleClick(e: Event): void;
1510 /**
1511 * If specified, indicates that the slider handle has only 'discreteValues' possible positions, and that after dragging the handle, it will snap to the nearest possible position.
1512 * Thus, the slider has only 'discreteValues' possible values.
1513 *
1514 * For example, if minimum=10, maxiumum=30, and discreteValues=3, then the slider handle has three possible positions, representing values 10, 20, or 30.
1515 *
1516 * If discreteValues is not specified or if it's value is higher than the number of pixels in the slider bar, then the slider handle can be moved freely, and the slider's value will be computed/reported based on pixel position (in this case it will likely be fractional, such as 123.456789).
1517 */
1518 discreteValues: number;
1540 1519
1541 /**
1542 * Returns true if direction is from right to left
1543 */
1544 _isReversed(): boolean;
1545
1546 _onBarClick(e: Event): void;
1520 /**
1521 * If discreteValues is also specified, this indicates the amount of clicks (ie, snap positions) that the slider handle is moved via pageup/pagedown keys.
1522 * If discreteValues is not specified, it indicates the number of pixels.
1523 */
1524 pageIncrement: number;
1547 1525
1548 _setPixelValue(pixelValue: number, maxPixels: number, priorityChange?: boolean): void;
1549
1550 _setValueAttr(value: number, priorityChange?: boolean): void;
1526 /**
1527 * If clicking the slider bar changes the value or not
1528 */
1529 clickSelect: boolean;
1551 1530
1552 _bumpValue(signedChange: number, priorityChange: boolean): void;
1553
1554 _onClkBumper(val: any): void;
1555 _onClkIncBumper(): void;
1556 _onClkDecBumper(): void;
1531 /**
1532 * The time in ms to take to animate the slider handle from 0% to 100%, when clicking the slider bar to make the handle move.
1533 */
1534 slideDuration: number;
1557 1535
1558 decrement(e: Event): void;
1559 increment(e: Event): void;
1560
1561 _mouseWheeled(evt: Event): void;
1536 _mousePixelCoord: string;
1537 _pixelCount: string;
1538 _startingPixelCoord: string;
1539 _handleOffsetCoord: string;
1540 _progressPixelSize: string;
1562 1541
1563 _typematicCallback(count: number, button: Element, e: Event): void;
1564 }
1542 _onKeyUp(e: Event): void;
1543 _onKeyDown(e: Event): void;
1544 _onHandleClick(e: Event): void;
1565 1545
1566 interface HorizontalSliderConstructor extends _WidgetBaseConstructor<HorizontalSlider> {
1567 /**
1568 * for monkey patching
1569 */
1570 _Mover: _SliderMover;
1571 }
1546 /**
1547 * Returns true if direction is from right to left
1548 */
1549 _isReversed(): boolean;
1550
1551 _onBarClick(e: Event): void;
1572 1552
1573 /* dijit/form/MappedTextBox */
1553 _setPixelValue(pixelValue: number, maxPixels: number, priorityChange?: boolean): void;
1554
1555 _setValueAttr(value: number, priorityChange?: boolean): void;
1556
1557 _bumpValue(signedChange: number, priorityChange: boolean): void;
1574 1558
1575 interface MappedTextBox<C extends Constraints> extends ValidationTextBox<C> {
1576 postMixInProperties(): void;
1577 serialize: SerializationFunction;
1578 toString(): string;
1579 validate(isFocused?: boolean): boolean;
1580 buildRendering(): void;
1581 reset(): void;
1582 }
1559 _onClkBumper(val: any): void;
1560 _onClkIncBumper(): void;
1561 _onClkDecBumper(): void;
1583 1562
1584 interface MappedTextBoxConstructor extends _WidgetBaseConstructor<MappedTextBox<Constraints>> {
1585 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): MappedTextBox<C>;
1586 }
1563 decrement(e: Event): void;
1564 increment(e: Event): void;
1587 1565
1588 /* dijit/form/NumberSpinner */
1566 _mouseWheeled(evt: Event): void;
1567
1568 _typematicCallback(count: number, button: Element, e: Event): void;
1569 }
1589 1570
1590 interface NumberSpinner extends _Spinner, NumberTextBoxMixin {
1591 constraints: NumberTextBoxConstraints;
1592 baseClass: string;
1593 adjust(val: any, delta: number): any;
1571 interface HorizontalSliderConstructor extends _WidgetBaseConstructor<HorizontalSlider> {
1572 /**
1573 * for monkey patching
1574 */
1575 _Mover: _SliderMover;
1576 }
1577
1578 /* dijit/form/MappedTextBox */
1594 1579
1595 /* overrides */
1596 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1597 parse(value: string, constraints: NumberTextBoxConstraints): string;
1598 format(value: number, constraints: NumberTextBoxConstraints): string;
1599 filter(value: number): number;
1600 value: number;
1601 }
1580 interface MappedTextBox<C extends Constraints> extends ValidationTextBox<C> {
1581 postMixInProperties(): void;
1582 serialize: SerializationFunction;
1583 toString(): string;
1584 validate(isFocused?: boolean): boolean;
1585 buildRendering(): void;
1586 reset(): void;
1587 }
1602 1588
1603 interface NumberSpinnerConstructor extends _WidgetBaseConstructor<NumberSpinner> { }
1589 interface MappedTextBoxConstructor extends _WidgetBaseConstructor<MappedTextBox<Constraints>> {
1590 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): MappedTextBox<C>;
1591 }
1604 1592
1605 /* dijit/form/NumberTextBox */
1593 /* dijit/form/NumberSpinner */
1606 1594
1607 interface NumberTextBoxConstraints extends RangeBoundTextBoxConstraints, dojo.NumberFormatOptions, dojo.NumberParseOptions { }
1595 interface NumberSpinner extends _Spinner, NumberTextBoxMixin {
1596 constraints: NumberTextBoxConstraints;
1597 baseClass: string;
1598 adjust(val: any, delta: number): any;
1608 1599
1609 interface NumberTextBoxMixin {
1610 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1611 constraints: NumberTextBoxConstraints;
1612 value: number;
1613 editOptions: { pattern: string };
1614 _formatter: (value: number, options?: dojo.NumberFormatOptions) => string;
1615 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1616 _decimalInfo: (constraints: Constraints) => { sep: string; places: number; };
1617 postMixInProperties(): void;
1618 format(value: number, constraints: NumberTextBoxConstraints): string;
1619 _parser: (expression: string, options?: dojo.NumberParseOptions) => number;
1620 parse(value: string, constraints: dojo.NumberParseOptions): string;
1621 filter(value: number): number;
1622 serialize: SerializationFunction;
1623 isValid(isFocused: boolean): boolean;
1624 }
1600 /* overrides */
1601 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1602 parse(value: string, constraints: NumberTextBoxConstraints): string;
1603 format(value: number, constraints: NumberTextBoxConstraints): string;
1604 filter(value: number): number;
1605 value: number;
1606 }
1625 1607
1626 interface NumberTextBoxMixinConstructor extends _WidgetBaseConstructor<NumberTextBoxMixin> { }
1608 interface NumberSpinnerConstructor extends _WidgetBaseConstructor<NumberSpinner> { }
1609
1610 /* dijit/form/NumberTextBox */
1611
1612 interface NumberTextBoxConstraints extends RangeBoundTextBoxConstraints, dojo.NumberFormatOptions, dojo.NumberParseOptions { }
1627 1613
1628 interface NumberTextBox extends RangeBoundTextBox, NumberTextBoxMixin {
1629 constraints: NumberTextBoxConstraints;
1630 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1631 parse(value: string, constraints: dojo.NumberParseOptions): string;
1632 format(value: number, constraints: dojo.NumberFormatOptions): string;
1633 value: number;
1634 filter(value: number): number;
1635 }
1614 interface NumberTextBoxMixin {
1615 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1616 constraints: NumberTextBoxConstraints;
1617 value: number;
1618 editOptions: { pattern: string };
1619 _formatter: (value: number, options?: dojo.NumberFormatOptions) => string;
1620 _regExpGenerator: (options?: dojo.NumberRegexpOptions) => string;
1621 _decimalInfo: (constraints: Constraints) => { sep: string; places: number; };
1622 postMixInProperties(): void;
1623 format(value: number, constraints: NumberTextBoxConstraints): string;
1624 _parser: (expression: string, options?: dojo.NumberParseOptions) => number;
1625 parse(value: string, constraints: dojo.NumberParseOptions): string;
1626 filter(value: number): number;
1627 serialize: SerializationFunction;
1628 isValid(isFocused: boolean): boolean;
1629 }
1636 1630
1637 interface NumberTextBoxConstructor extends _WidgetBaseConstructor<NumberTextBox> {
1638 Mixin: NumberTextBoxMixinConstructor;
1639 }
1640
1641 /* dijit/form/RadioButton */
1642
1643 interface RadioButton extends CheckBox, _RadioButtonMixin {
1644 baseClass: string;
1645 }
1646
1647 interface RadioButtonConstructor extends _WidgetBaseConstructor<RadioButton> { }
1648
1649 /* dijit/form/RangeBoundTextBox */
1631 interface NumberTextBoxMixinConstructor extends _WidgetBaseConstructor<NumberTextBoxMixin> { }
1650 1632
1651 interface RangeBoundTextBoxConstraints extends Constraints {
1652 min?: number;
1653 max?: number;
1654 }
1633 interface NumberTextBox extends RangeBoundTextBox, NumberTextBoxMixin {
1634 constraints: NumberTextBoxConstraints;
1635 pattern: ConstraintsToRegExpString<NumberTextBoxConstraints>;
1636 parse(value: string, constraints: dojo.NumberParseOptions): string;
1637 format(value: number, constraints: dojo.NumberFormatOptions): string;
1638 value: number;
1639 filter(value: number): number;
1640 }
1655 1641
1656 interface RangeBoundTextBox extends MappedTextBox<RangeBoundTextBoxConstraints> {
1657 /**
1658 * The message to display if value is out-of-range
1659 */
1660 rangeMessage: string;
1642 interface NumberTextBoxConstructor extends _WidgetBaseConstructor<NumberTextBox> {
1643 Mixin: NumberTextBoxMixinConstructor;
1644 }
1661 1645
1662 /**
1663 * Overridable function used to validate the range of the numeric input value.
1664 */
1665 rangeCheck(primative: number, constraints: RangeBoundTextBoxConstraints): boolean;
1646 /* dijit/form/RadioButton */
1647
1648 interface RadioButton extends CheckBox, _RadioButtonMixin {
1649 baseClass: string;
1650 }
1666 1651
1667 /**
1668 * Tests if the value is in the min/max range specified in constraints
1669 */
1670 isInRange(isFocused: boolean): boolean;
1652 interface RadioButtonConstructor extends _WidgetBaseConstructor<RadioButton> { }
1653
1654 /* dijit/form/RangeBoundTextBox */
1671 1655
1672 /**
1673 * Returns true if the value is out of range and will remain
1674 * out of range even if the user types more characters
1675 */
1676 _isDefinitelyOutOfRange(): boolean;
1656 interface RangeBoundTextBoxConstraints extends Constraints {
1657 min?: number;
1658 max?: number;
1659 }
1677 1660
1678 isValid(isFocused: boolean): boolean;
1679 getErrorMessage(isFocused: boolean): string;
1680 postMixInProperties(): void;
1681 }
1661 interface RangeBoundTextBox extends MappedTextBox<RangeBoundTextBoxConstraints> {
1662 /**
1663 * The message to display if value is out-of-range
1664 */
1665 rangeMessage: string;
1682 1666
1683 interface RangeBoundTextBoxConstructor extends _WidgetBaseConstructor<RangeBoundTextBox> { }
1684
1685 /* dijit/form/Select */
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 {
1688 baseClass: string;
1667 /**
1668 * Overridable function used to validate the range of the numeric input value.
1669 */
1670 rangeCheck(primative: number, constraints: RangeBoundTextBoxConstraints): boolean;
1689 1671
1690 /**
1691 * What to display in an "empty" drop down.
1692 */
1693 emptyLabel: string;
1672 /**
1673 * Tests if the value is in the min/max range specified in constraints
1674 */
1675 isInRange(isFocused: boolean): boolean;
1694 1676
1695 /**
1696 * Specifies how to interpret the labelAttr in the data store items.
1697 */
1698 labelType: string;
1677 /**
1678 * Returns true if the value is out of range and will remain
1679 * out of range even if the user types more characters
1680 */
1681 _isDefinitelyOutOfRange(): boolean;
1699 1682
1700 /**
1701 * Currently displayed error/prompt message
1702 */
1703 message: string;
1683 isValid(isFocused: boolean): boolean;
1684 getErrorMessage(isFocused: boolean): string;
1685 postMixInProperties(): void;
1686 }
1687
1688 interface RangeBoundTextBoxConstructor extends _WidgetBaseConstructor<RangeBoundTextBox> { }
1704 1689
1705 /**
1706 * Can be true or false, default is false.
1707 */
1708 required: boolean;
1690 /* dijit/form/Select */
1691
1692 interface Select<T extends Object, Q extends dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions, U extends dijit._WidgetBase> extends _FormSelectWidget<T, Q, O>, _HasDropDown<U>, _KeyNavMixin {
1693 baseClass: string;
1709 1694
1710 /**
1711 * "Incomplete" if this select is required but unset (i.e. blank value), "" otherwise
1712 */
1713 state: string;
1695 /**
1696 * What to display in an "empty" drop down.
1697 */
1698 emptyLabel: string;
1714 1699
1715 /**
1716 * Order fields are traversed when user hits the tab key
1717 */
1718 tabIndex: any;
1719 templateString: any;
1700 /**
1701 * Specifies how to interpret the labelAttr in the data store items.
1702 */
1703 labelType: string;
1720 1704
1721 /**
1722 * See the description of dijit/Tooltip.defaultPosition for details on this parameter.
1723 */
1724 tooltipPosition: any;
1705 /**
1706 * Currently displayed error/prompt message
1707 */
1708 message: string;
1725 1709
1726 childSelector(node: Element | Node): boolean;
1727 destroy(preserveDom: boolean): void;
1728 focus(): void;
1710 /**
1711 * Can be true or false, default is false.
1712 */
1713 required: boolean;
1729 1714
1730 /**
1731 * Sets the value to the given option, used during search by letter.
1732 * @param widget Reference to option's widget
1733 */
1734 focusChild(widget: dijit._WidgetBase): void;
1735 isLoaded(): boolean;
1715 /**
1716 * "Incomplete" if this select is required but unset (i.e. blank value), "" otherwise
1717 */
1718 state: string;
1736 1719
1737 /**
1738 * Whether or not this is a valid value.
1739 * @param isFocused
1740 */
1741 isValid(isFocused: boolean): boolean;
1720 /**
1721 * Order fields are traversed when user hits the tab key
1722 */
1723 tabIndex: any;
1724 templateString: any;
1725
1726 /**
1727 * See the description of dijit/Tooltip.defaultPosition for details on this parameter.
1728 */
1729 tooltipPosition: any;
1742 1730
1743 /**
1744 * populates the menu
1745 * @param loadCallback
1746 */
1747 loadDropDown(loadCallback: () => any): void;
1748 postCreate(): void;
1749
1750 /**
1751 * set the missing message
1752 */
1753 postMixInProperties(): void;
1731 childSelector(node: Element | Node): boolean;
1732 destroy(preserveDom: boolean): void;
1733 focus(): void;
1754 1734
1755 /**
1756 * Overridden so that the state will be cleared.
1757 */
1758 reset(): void;
1759 startup(): void;
1735 /**
1736 * Sets the value to the given option, used during search by letter.
1737 * @param widget Reference to option's widget
1738 */
1739 focusChild(widget: dijit._WidgetBase): void;
1740 isLoaded(): boolean;
1760 1741
1761 /**
1762 * Called by oninit, onblur, and onkeypress, and whenever required/disabled state changes
1763 * @param isFocused
1764 */
1765 validate(isFocused: boolean): boolean;
1742 /**
1743 * Whether or not this is a valid value.
1744 * @param isFocused
1745 */
1746 isValid(isFocused: boolean): boolean;
1766 1747
1767 /**
1768 * When a key is pressed that matches a child item,
1769 * this method is called so that a widget can take
1770 * appropriate action is necessary.
1771 * @param item
1772 * @param evt
1773 * @param searchString
1774 * @param numMatches
1775 */
1776 onKeyboardSearch(item: dijit._WidgetBase, evt: Event, searchString: string, numMatches: number): void;
1777 }
1748 /**
1749 * populates the menu
1750 * @param loadCallback
1751 */
1752 loadDropDown(loadCallback: () => any): void;
1753 postCreate(): void;
1778 1754
1779 interface SelectConstructor extends _WidgetBaseConstructor<Select<any, any, any, any>> { }
1755 /**
1756 * set the missing message
1757 */
1758 postMixInProperties(): void;
1780 1759
1781 /* dijit/form/SimpleTextarea */
1760 /**
1761 * Overridden so that the state will be cleared.
1762 */
1763 reset(): void;
1764 startup(): void;
1782 1765
1783 interface SimpleTextarea extends TextBox {
1784 baseClass: string;
1785 rows: string;
1786 cols: string;
1787 templateString: string;
1788 postMixInProperties(): void;
1789 buildRendering(): void;
1790 filter(value: string): string;
1791 }
1792
1793 interface SimpleTextareaConstructor extends _WidgetBaseConstructor<SimpleTextarea> {
1794 new (params: Object, srcNodeRef: dojo.NodeOrString): SimpleTextarea;
1795 }
1766 /**
1767 * Called by oninit, onblur, and onkeypress, and whenever required/disabled state changes
1768 * @param isFocused
1769 */
1770 validate(isFocused: boolean): boolean;
1796 1771
1797 /* dijit/form/Textarea */
1772 /**
1773 * When a key is pressed that matches a child item,
1774 * this method is called so that a widget can take
1775 * appropriate action is necessary.
1776 * @param item
1777 * @param evt
1778 * @param searchString
1779 * @param numMatches
1780 */
1781 onKeyboardSearch(item: dijit._WidgetBase, evt: Event, searchString: string, numMatches: number): void;
1782 }
1798 1783
1799 interface Textarea extends SimpleTextarea, _ExpandingTextAreaMixin {
1800 baseClass: string;
1801 cols: string;
1802 buildRendering(): void;
1803 }
1784 interface SelectConstructor extends _WidgetBaseConstructor<Select<any, any, any, any>> { }
1804 1785
1805 interface TextareaConstructor extends _WidgetBaseConstructor<Textarea> { }
1806
1807 /* dijit/form/TextBox */
1786 /* dijit/form/SimpleTextarea */
1808 1787
1809 interface TextBox extends _FormValueWidget, _TextBoxMixin<Constraints> {
1810 // set(name: 'displayedValue', value: string): this;
1811 // set(name: 'disabled', value: boolean): this;
1812 // set(name: 'value', value: string): this;
1813 // set(name: string, value: any): this;
1814 // set(values: Object): this;
1788 interface SimpleTextarea extends TextBox {
1789 baseClass: string;
1790 rows: string;
1791 cols: string;
1792 templateString: string;
1793 postMixInProperties(): void;
1794 buildRendering(): void;
1795 filter(value: string): string;
1796 }
1815 1797
1816 // get(name: 'displayedValue'): string;
1817 // get(name: 'value'): string;
1818 // get(name: string): any;
1819 }
1798 interface SimpleTextareaConstructor extends _WidgetBaseConstructor<SimpleTextarea> {
1799 new(params: Object, srcNodeRef: dojo.NodeOrString): SimpleTextarea;
1800 }
1820 1801
1821 interface TextBoxConstructor extends _WidgetBaseConstructor<TextBox> { }
1822
1823 /* dijit/form/ToggleButton */
1824
1825 interface ToggleButton extends Button, _ToggleButtonMixin {
1826 baseClass: string;
1802 /* dijit/form/Textarea */
1827 1803
1828 setChecked(checked: boolean): void;
1804 interface Textarea extends SimpleTextarea, _ExpandingTextAreaMixin {
1805 baseClass: string;
1806 cols: string;
1807 buildRendering(): void;
1808 }
1809
1810 interface TextareaConstructor extends _WidgetBaseConstructor<Textarea> { }
1829 1811
1830 // set(name: 'checked', value: boolean): this;
1831 // set(name: string, value: any): this;
1832 // set(values: Object): this;
1833 }
1812 /* dijit/form/TextBox */
1813
1814 interface TextBox extends _FormValueWidget, _TextBoxMixin<Constraints> {
1815
1816 }
1817
1818 interface TextBoxConstructor extends _WidgetBaseConstructor<TextBox> { }
1834 1819
1835 interface ToggleButtonConstructor extends _WidgetBaseConstructor<ToggleButton> { }
1820 /* dijit/form/ToggleButton */
1836 1821
1837 /* dijit/form/ValidationTextBox */
1822 interface ToggleButton extends Button, _ToggleButtonMixin {
1823 baseClass: string;
1824
1825 setChecked(checked: boolean): void;
1826 }
1838 1827
1839 interface IsValidFunction {
1840 (isFocused?: boolean): boolean;
1841 }
1828 interface ToggleButtonConstructor extends _WidgetBaseConstructor<ToggleButton> { }
1829
1830 /* dijit/form/ValidationTextBox */
1831
1832 interface IsValidFunction {
1833 (isFocused?: boolean): boolean;
1834 }
1842 1835
1843 interface ValidationTextBox<C extends Constraints = Constraints> extends TextBox {
1844 templateString: string;
1845 required: boolean;
1846 promptMessage: string;
1847 invalidMessage: string;
1848 missingMessage: string;
1849 message: string;
1850 constraints: C;
1851 pattern: string | ConstraintsToRegExpString<C>;
1852 regExp: string;
1853 regExpGen(constraints: C): void;
1854 state: string;
1855 tooltipPosition: string[];
1856 validator: ConstrainedValidFunction<C>;
1857 isValid: IsValidFunction;
1858 getErrorMessage(isFocused: boolean): string;
1859 getPromptMessage(isFocused: boolean): string;
1860 validate(isFocused: boolean): boolean;
1861 displayMessage(message: string): void;
1862
1863 startup(): void;
1864 postMixInProperties(): void;
1836 interface ValidationTextBox<C extends Constraints = Constraints> extends TextBox {
1837 templateString: string;
1838 required: boolean;
1839 promptMessage: string;
1840 invalidMessage: string;
1841 missingMessage: string;
1842 message: string;
1843 constraints: C;
1844 pattern: string | ConstraintsToRegExpString<C>;
1845 regExp: string;
1846 regExpGen(constraints: C): void;
1847 state: string;
1848 tooltipPosition: string[];
1849 validator: ConstrainedValidFunction<C>;
1850 isValid: IsValidFunction;
1851 getErrorMessage(isFocused: boolean): string;
1852 getPromptMessage(isFocused: boolean): string;
1853 validate(isFocused: boolean): boolean;
1854 displayMessage(message: string): void;
1865 1855
1866 reset(): void;
1856 startup(): void;
1857 postMixInProperties(): void;
1867 1858
1868 destroy(preserveDom?: boolean): void;
1859 reset(): void;
1869 1860
1870 // set(name: 'constraints', value: Constraints): this;
1871 // set(name: 'disabled', value: boolean): this;
1872 // set(name: 'message', value: string): this;
1873 // set(name: 'pattern', value: string | ConstraintsToRegExpString<C>): this;
1874 // set(name: 'regExp', value: string): this;
1875 // set(name: 'regExpGen', value: Constraints): this;
1876 // set(name: 'required', value: boolean): this;
1877 // set(name: 'value', value: string): this;
1878 // set(name: string, value: any): this;
1879 // set(values: Object): this;
1861 destroy(preserveDom?: boolean): void;
1862 }
1880 1863
1881 // get(name: 'pattern'): string | ConstraintsToRegExpString<C>;
1882 // get(name: string): any;
1883 }
1884
1885 interface ValidationTextBoxConstructor extends _WidgetBaseConstructor<ValidationTextBox<Constraints>> {
1886 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): ValidationTextBox<C>;
1887 }
1888 }
1864 interface ValidationTextBoxConstructor extends _WidgetBaseConstructor<ValidationTextBox<Constraints>> {
1865 new <C extends Constraints>(params: Object, srcNodeRef: dojo.NodeOrString): ValidationTextBox<C>;
1866 }
1867 }
1889 1868 }
@@ -102,6 +102,13 declare module 'dijit/Dialog' {
102 102 export = Dialog;
103 103 }
104 104
105 declare module "dijit/_HasDropDown" {
106 type _HasDropDown<T extends dijit._WidgetBase = dijit._WidgetBase> = dijit._HasDropDown<T>;
107 const _HasDropDown: dijit._WidgetBaseConstructor<_HasDropDown>;
108
109 export = _HasDropDown;
110 }
111
105 112 declare module 'dijit/DropDownMenu' {
106 113 type DropDownMenu = dijit.DropDownMenu;
107 114 const DropDownMenu: dijit.DropDownMenuConstructor;
@@ -252,6 +259,18 declare module 'dijit/form/_FormMixin' {
252 259 export = _FormMixin;
253 260 }
254 261
262 declare module "dijit/form/_FormWidgetMixin" {
263 type _FormWidgetMixin = dijit.form._FormWidgetMixin;
264 const _FormWidgetMixin: dijit._WidgetBaseConstructor<_FormWidgetMixin>;
265 export = _FormWidgetMixin;
266 }
267
268 declare module "dijit/form/_FormValueMixin" {
269 type _FormValueMixin = dijit.form._FormValueMixin;
270 const _FormValueMixin: dijit._WidgetBaseConstructor<_FormValueMixin>;
271 export = _FormValueMixin;
272 }
273
255 274 declare module 'dijit/form/_FormValueWidget' {
256 275 type _FormValueWidget = dijit.form._FormValueWidget;
257 276 const _FormValueWidget: dijit.form._FormValueWidgetConstructor;
@@ -4,55 +4,67
4 4
5 5 declare namespace dojo {
6 6
7 interface NodeListAnimationArgs extends _base.AnimationArguments {
8 auto?: boolean;
9 }
7 interface NodeListAnimationArgs extends Omit<_base.AnimationArguments, "node"> {
8 auto?: false;
9 }
10 10
11 interface NodeList<T extends Node> {
12 _anim(obj: any, method: string, args?: NodeListAnimationArgs): _base.Animation | this;
11 interface NodeListAutoAnimationArgs extends Omit<_base.AnimationArguments, "node"> {
12 auto: true;
13 }
14
15 interface NodeList<T extends Node> {
13 16
14 /**
15 * wipe in all elements of this NodeList via `dojo/fx.wipeIn()`
16 */
17 wipeIn(args: NodeListAnimationArgs): _base.Animation | this;
17 _anim(obj: any, method: string, args?: NodeListAnimationArgs): _base.Animation;
18 _anim(obj: any, method: string, args: NodeListAutoAnimationArgs): this;
18 19
19 /**
20 * wipe out all elements of this NodeList via `dojo/fx.wipeOut()`
21 */
22 wipeOut(args: NodeListAnimationArgs): _base.Animation | this;
20 /**
21 * wipe in all elements of this NodeList via `dojo/fx.wipeIn()`
22 */
23 wipeIn(args?: NodeListAnimationArgs): _base.Animation;
24 wipeIn(args: NodeListAutoAnimationArgs): this;
23 25
24 /**
25 * slide all elements of the node list to the specified place via `dojo/fx.slideTo()`
26 */
27 slideTo(args: NodeListAnimationArgs): _base.Animation | this;
26 /**
27 * wipe out all elements of this NodeList via `dojo/fx.wipeOut()`
28 */
29 wipeOut(args?: NodeListAnimationArgs): _base.Animation;
30 wipeOut(args: NodeListAutoAnimationArgs): this;
28 31
29 /**
30 * fade in all elements of this NodeList via `dojo.fadeIn`
31 */
32 fadeIn(args: NodeListAnimationArgs): _base.Animation | this;
32 /**
33 * slide all elements of the node list to the specified place via `dojo/fx.slideTo()`
34 */
35 slideTo(args?: NodeListAnimationArgs): _base.Animation;
36 slideTo(args: NodeListAutoAnimationArgs): this;
33 37
34 /**
35 * fade out all elements of this NodeList via `dojo.fadeOut`
36 */
37 fadeOut(args: NodeListAnimationArgs): _base.Animation | this;
38 /**
39 * fade in all elements of this NodeList via `dojo.fadeIn`
40 */
41 fadeIn(args?: NodeListAnimationArgs): _base.Animation;
42 fadeIn(args: NodeListAutoAnimationArgs): this;
38 43
39 /**
40 * Animate all elements of this NodeList across the properties specified.
41 * syntax identical to `dojo.animateProperty`
42 */
43 animateProperty(args: NodeListAnimationArgs): _base.Animation | this;
44 /**
45 * fade out all elements of this NodeList via `dojo.fadeOut`
46 */
47 fadeOut(args?: NodeListAnimationArgs): _base.Animation;
48 fadeOut(args: NodeListAutoAnimationArgs): this;
44 49
45 /**
46 * Animate one or more CSS properties for all nodes in this list.
47 * The returned animation object will already be playing when it
48 * is returned. See the docs for `dojo.anim` for full details.
49 */
50 anim(properties: _base.AnimationArgumentsProperties, duration?: number, easing?: (n?: number) => number, onEnd?: Function, delay?: number): _base.Animation;
51 }
50 /**
51 * Animate all elements of this NodeList across the properties specified.
52 * syntax identical to `dojo.animateProperty`
53 */
54 animateProperty(args?: NodeListAnimationArgs): _base.Animation;
55 animateProperty(args: NodeListAutoAnimationArgs): this;
56
57 /**
58 * Animate one or more CSS properties for all nodes in this list.
59 * The returned animation object will already be playing when it
60 * is returned. See the docs for `dojo.anim` for full details.
61 */
62 anim(properties: _base.AnimationArgumentsProperties, duration?: number, easing?: (n?: number) => number, onEnd?: Function, delay?: number): _base.Animation;
63 }
52 64 }
53 65
54 66 declare module 'dojo/NodeList-fx' {
55 type NodeList<T extends Node> = dojo.NodeList<T>;
56 const NodeList: dojo.NodeListConstructor;
57 export = NodeList;
67 type NodeList<T extends Node> = dojo.NodeList<T>;
68 const NodeList: dojo.NodeListConstructor;
69 export = NodeList;
58 70 }
@@ -1726,9 +1726,9 declare namespace dojo {
1726 1726 }
1727 1727
1728 1728 interface NodeListConstructor {
1729 new <T extends Node>(array: number | Array<T>): NodeList<T>;
1729 new <T extends Node>(array: number | Array<T> | NodeListOf<T>): NodeList<T>;
1730 1730 new <T extends Node>(...args: T[]): NodeList<T>;
1731 <T extends Node>(array: number | Array<T>): NodeList<T>;
1731 <T extends Node>(array: number | Array<T> | NodeListOf<T>): NodeList<T>;
1732 1732 <T extends Node>(...args: T[]): NodeList<T>;
1733 1733
1734 1734 prototype: NodeList<any>;
@@ -1770,6 +1770,9 declare namespace dojo {
1770 1770 * the search by. Returns an instance of NodeList.
1771 1771 */
1772 1772 <T extends Node>(query: string, root?: NodeOrString): NodeList<T>;
1773 <T extends Node>(root: Node): NodeList<T>;
1774
1775 NodeList: NodeListConstructor;
1773 1776
1774 1777 /**
1775 1778 * Test to see if a node matches a selector
@@ -10,7 +10,8
10 10 ],
11 11 "types": [
12 12 "requirejs",
13 "../main/typings"
13 "../main/typings",
14 "../main/typings/dojo/NodeList-fx"
14 15 ],
15 16 "module": "ESNext",
16 17 "target": "ESNext"
General Comments 0
You need to be logged in to leave comments. Login now