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 |
@@ -49,12 +49,20 npmPackMeta { | |||
|
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 |
@@ -123,11 +123,11 declare namespace dijit { | |||
|
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 */ |
@@ -214,8 +214,8 declare namespace dijit { | |||
|
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>> { |
@@ -271,9 +271,9 declare namespace dijit { | |||
|
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 */ |
@@ -361,15 +361,15 declare namespace dijit { | |||
|
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>> { } |
@@ -707,8 +707,8 declare namespace dijit { | |||
|
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> { } |
@@ -720,9 +720,9 declare namespace dijit { | |||
|
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> { } |
@@ -803,9 +803,9 declare namespace dijit { | |||
|
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 */ |
@@ -839,9 +839,9 declare namespace dijit { | |||
|
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 */ |
@@ -950,9 +950,9 declare namespace dijit { | |||
|
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 */ |
@@ -1136,12 +1136,12 declare namespace dijit { | |||
|
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> { } |
@@ -1154,9 +1154,9 declare namespace dijit { | |||
|
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> { } |
@@ -1164,8 +1164,8 declare namespace dijit { | |||
|
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>> { |
@@ -1327,10 +1327,10 declare namespace dijit { | |||
|
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>> { |
@@ -1807,15 +1807,15 declare namespace dijit { | |||
|
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> { } |
@@ -1827,9 +1827,9 declare namespace dijit { | |||
|
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> { } |
@@ -1867,19 +1867,19 declare namespace dijit { | |||
|
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>> { |
General Comments 0
You need to be logged in to leave comments.
Login now