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