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