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