1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | interface JQuery {
|
16 | DataTable(opts?: DataTables.Settings): DataTables.Api;
|
17 | dataTable: DataTables.StaticFunctions;
|
18 | }
|
19 |
|
20 | declare namespace DataTables {
|
21 | interface JQueryDataTables extends JQuery {
|
22 | |
23 |
|
24 |
|
25 |
|
26 |
|
27 | api(): Api;
|
28 | }
|
29 |
|
30 | interface Api extends CoreMethods {
|
31 | |
32 |
|
33 |
|
34 | [key: number]: any;
|
35 | |
36 |
|
37 |
|
38 |
|
39 |
|
40 | (selector: string | Node | Node[] | JQuery): Api;
|
41 |
|
42 | |
43 |
|
44 |
|
45 | data(): Api;
|
46 |
|
47 | |
48 |
|
49 |
|
50 | order: OrderMethods;
|
51 |
|
52 |
|
53 |
|
54 | |
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 | cell(cellSelector: any, modifier?: ObjectSelectorModifier): CellMethods;
|
61 |
|
62 | |
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | cell(rowSelector: any, cellSelector: any, modifier?: ObjectSelectorModifier): CellMethods;
|
70 |
|
71 | |
72 |
|
73 |
|
74 |
|
75 |
|
76 | cells(modifier?: ObjectSelectorModifier): CellsMethods;
|
77 |
|
78 | |
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 | cells(cellSelector: any, modifier?: ObjectSelectorModifier): CellsMethods;
|
85 |
|
86 | |
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 | cells(rowSelector: any, cellSelector: any, modifier?: ObjectSelectorModifier): CellsMethods;
|
94 |
|
95 |
|
96 |
|
97 |
|
98 | |
99 |
|
100 |
|
101 | column: ColumnMethodsModel;
|
102 |
|
103 | |
104 |
|
105 |
|
106 | columns: ColumnsMethodsModel;
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 | |
113 |
|
114 |
|
115 | row: RowMethodsModel;
|
116 |
|
117 | |
118 |
|
119 |
|
120 | rows: RowsMethodsModel;
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 | |
127 |
|
128 |
|
129 |
|
130 |
|
131 | table(tableSelector: any): TableMethods;
|
132 |
|
133 | |
134 |
|
135 |
|
136 |
|
137 |
|
138 | tables(tableSelector?: any): TablesMethods;
|
139 |
|
140 |
|
141 | }
|
142 |
|
143 | interface DataTables extends CoreMethods {
|
144 | [index: number]: Api;
|
145 | }
|
146 |
|
147 | interface ObjectSelectorModifier {
|
148 | |
149 |
|
150 |
|
151 |
|
152 | order?: string;
|
153 |
|
154 | |
155 |
|
156 |
|
157 |
|
158 | search?: string;
|
159 |
|
160 | |
161 |
|
162 |
|
163 | searchPlaceholder?: string;
|
164 |
|
165 | |
166 |
|
167 |
|
168 |
|
169 | page?: string;
|
170 | }
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 | interface CoreMethods extends UtilityMethods {
|
177 | |
178 |
|
179 |
|
180 | $(selector: string | Node | Node[] | JQuery, modifier?: ObjectSelectorModifier): JQuery;
|
181 |
|
182 | |
183 |
|
184 |
|
185 | ajax: AjaxMethodModel;
|
186 |
|
187 | |
188 |
|
189 |
|
190 | clear(): Api;
|
191 |
|
192 | |
193 |
|
194 |
|
195 |
|
196 |
|
197 | destroy(remove?: boolean): Api;
|
198 |
|
199 | |
200 |
|
201 |
|
202 |
|
203 |
|
204 | draw(paging?: boolean | string): Api;
|
205 |
|
206 | |
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 |
|
215 | i18n(token: string, def: any, numeric?: number): string;
|
216 |
|
217 | |
218 |
|
219 |
|
220 | init(): Settings;
|
221 |
|
222 | |
223 |
|
224 |
|
225 |
|
226 |
|
227 |
|
228 | off(event: string, callback?: ((e: Event, ...args: any[]) => void)): Api;
|
229 |
|
230 | /**
|
231 | * Table events listener.
|
232 | *
|
233 | * @param event Event to listen for.
|
234 | * @param callback Specific callback function to remove if you want to unbind a single event listener.
|
235 | */
|
236 | on(event: string, callback: ((e: Event, ...args: any[]) => void)): Api;
|
237 |
|
238 | /**
|
239 | * Listen for a table event once and then remove the listener.
|
240 | *
|
241 | * @param event Event to listen for.
|
242 | * @param callback Specific callback function to remove if you want to unbind a single event listener.
|
243 | */
|
244 | one(event: string, callback: ((e: Event, ...args: any[]) => void)): Api;
|
245 |
|
246 | /**
|
247 | * Page Methods / object
|
248 | */
|
249 | page: PageMethods;
|
250 |
|
251 | /**
|
252 | * Get current search
|
253 | */
|
254 | search(): string;
|
255 |
|
256 | /**
|
257 | * Search for data in the table.
|
258 | *
|
259 | * @param input Search string to apply to the table.
|
260 | * @param regex Treat as a regular expression (true) or not (default, false).
|
261 | * @param smart Perform smart search.
|
262 | * @param caseInsen Do case-insensitive matching (default, true) or not (false).
|
263 | */
|
264 | search(input: string, regex?: boolean, smart?: boolean, caseInsen?: boolean): Api;
|
265 |
|
266 | /**
|
267 | * Obtain the table's settings object
|
268 | */
|
269 | settings(): Api;
|
270 |
|
271 | /**
|
272 | * Page Methods / object
|
273 | */
|
274 | state: StateMethods;
|
275 | }
|
276 |
|
277 | //#region "ajax-methods"
|
278 |
|
279 | interface AjaxMethods extends Api {
|
280 | /**
|
281 | * Reload the table data from the Ajax data source.
|
282 | *
|
283 | * @param callback Function which is executed when the data as been reloaded and the table fully redrawn.
|
284 | * @param resetPaging Reset (default action or true) or hold the current paging position (false).
|
285 | */
|
286 | load(callback?: ((json: any) => void), resetPaging?: boolean): Api;
|
287 | }
|
288 |
|
289 | interface AjaxMethodModel {
|
290 | /**
|
291 | * Get the latest JSON data obtained from the last Ajax request DataTables made
|
292 | */
|
293 | json(): object;
|
294 |
|
295 | /**
|
296 | * Get the data submitted by DataTables to the server in the last Ajax request
|
297 | */
|
298 | params(): object;
|
299 |
|
300 | /**
|
301 | * Reload the table data from the Ajax data source.
|
302 | *
|
303 | * @param callback Function which is executed when the data as been reloaded and the table fully redrawn.
|
304 | * @param resetPaging Reset (default action or true) or hold the current paging position (false).
|
305 | */
|
306 | reload(callback?: ((json: any) => void), resetPaging?: boolean): Api;
|
307 |
|
308 | /**
|
309 | * Reload the table data from the Ajax data source
|
310 | */
|
311 | url(): string;
|
312 |
|
313 | /**
|
314 | * Reload the table data from the Ajax data source
|
315 | *
|
316 | * @param url URL to set to be the Ajax data source for the table.
|
317 | */
|
318 | url(url: string): AjaxMethods;
|
319 | }
|
320 |
|
321 | //#endregion "ajax-methods"
|
322 |
|
323 | //#region "order-methods"
|
324 |
|
325 | interface OrderMethods {
|
326 | /**
|
327 | * Get the ordering applied to the table.
|
328 | */
|
329 | (): Array<Array<(string | number)>>;
|
330 |
|
331 | /**
|
332 | * Set the ordering applied to the table.
|
333 | *
|
334 | * @param order Order Model
|
335 | */
|
336 | (order?: Array<(string | number)> | Array<Array<(string | number)>>): Api;
|
337 | (order: Array<(string | number)>, ...args: any[]): Api;
|
338 |
|
339 | /**
|
340 | * Get the fixed ordering that is applied to the table. If there is more than one table in the API's context,
|
341 | * the ordering of the first table will be returned only (use table() if you require the ordering of a different table in the API's context).
|
342 | */
|
343 | fixed(): ObjectOrderFixed;
|
344 | /**
|
345 | * Set the table's fixed ordering. Note this doesn't actually perform the order, but rather queues it up - use draw() to perform the ordering.
|
346 | */
|
347 | fixed(order: ObjectOrderFixed): Api;
|
348 |
|
349 | /**
|
350 | * Add an ordering listener to an element, for a given column.
|
351 | *
|
352 | * @param node Selector
|
353 | * @param column Column index
|
354 | * @param callback Callback function
|
355 | */
|
356 | listener(node: string | Node | JQuery, column: number, callback: (() => void)): Api;
|
357 | }
|
358 | //#endregion "order-methods"
|
359 |
|
360 | //#region "page-methods"
|
361 |
|
362 | interface PageMethods {
|
363 | /**
|
364 | * Get the current page of the table.
|
365 | */
|
366 | (): number;
|
367 |
|
368 | /**
|
369 | * Set the current page of the table.
|
370 | *
|
371 | * @param page Index or 'first', 'next', 'previous', 'last'
|
372 | */
|
373 | (page: number | string): Api;
|
374 |
|
375 | /**
|
376 | * Get paging information about the table
|
377 | */
|
378 | info(): PageMethodeModelInfoReturn;
|
379 |
|
380 | /**
|
381 | * Get the table's page length.
|
382 | */
|
383 | len(): number;
|
384 |
|
385 | /**
|
386 | * Set the table's page length.
|
387 | *
|
388 | * @param length Page length to set. use -1 to show all records.
|
389 | */
|
390 | len(length: number): Api;
|
391 | }
|
392 |
|
393 | interface PageMethodeModelInfoReturn {
|
394 | page: number;
|
395 | pages: number;
|
396 | start: number;
|
397 | end: number;
|
398 | length: number;
|
399 | recordsTotal: number;
|
400 | recordsDisplay: number;
|
401 | serverSide: boolean;
|
402 | }
|
403 |
|
404 | //#endregion "page-methods"
|
405 |
|
406 | //#region "state-methods"
|
407 |
|
408 | interface StateMethods {
|
409 | /**
|
410 | * Get the last saved state of the table
|
411 | */
|
412 | (): StateReturnModel;
|
413 |
|
414 | /**
|
415 | * Clear the saved state of the table.
|
416 | */
|
417 | clear(): Api;
|
418 |
|
419 | /**
|
420 | * Get the table state that was loaded during initialisation.
|
421 | */
|
422 | loaded(): StateReturnModel;
|
423 |
|
424 | /**
|
425 | * Trigger a state save.
|
426 | */
|
427 | save(): Api;
|
428 | }
|
429 |
|
430 | interface StateReturnModel {
|
431 | time: number;
|
432 | start: number;
|
433 | length: number;
|
434 | order: Array<Array<(string | number)>>;
|
435 | search: SearchSettings;
|
436 | columns: StateReturnModelColumns[];
|
437 | }
|
438 |
|
439 | interface StateReturnModelColumns {
|
440 | search: SearchSettings;
|
441 | visible: boolean;
|
442 | }
|
443 |
|
444 | //#endregion "state-methods"
|
445 |
|
446 | //#endregion "core-methods"
|
447 |
|
448 | //#region "util-methods"
|
449 |
|
450 | interface UtilityMethods {
|
451 | /*
|
452 | * Get a boolean value to indicate if there are any entries in the API instance's result set (i.e. any data, selected rows, etc).
|
453 | */
|
454 | any(): boolean;
|
455 |
|
456 | /**
|
457 | * Concatenate two or more API instances together
|
458 | *
|
459 | * @param a API instance to concatenate to the initial instance.
|
460 | * @param b Additional API instance(s) to concatenate to the initial instance.
|
461 | */
|
462 | concat(a: object, ...b: object[]): Api;
|
463 |
|
464 | /**
|
465 | * Get the number of entries in an API instance's result set, regardless of multi-table grouping (e.g. any data, selected rows, etc). Since: 1.10.8
|
466 | */
|
467 | count(): number;
|
468 |
|
469 | /**
|
470 | * Iterate over the contents of the API result set.
|
471 | *
|
472 | * @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters
|
473 | */
|
474 | each(fn: ((value: any, index: number, dt: Api) => void)): Api;
|
475 |
|
476 | /**
|
477 | * Reduce an Api instance to a single context and result set.
|
478 | *
|
479 | * @param idx Index to select
|
480 | */
|
481 | eq(idx: number): Api;
|
482 |
|
483 | /**
|
484 | * Iterate over the result set of an API instance and test each item, creating a new instance from those items which pass.
|
485 | *
|
486 | * @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters.
|
487 | */
|
488 | filter(fn: ((value: any, index: number, dt: Api) => boolean)): Api;
|
489 |
|
490 | /**
|
491 | * Flatten a 2D array structured API instance to a 1D array structure.
|
492 | */
|
493 | flatten(): Api;
|
494 |
|
495 | /**
|
496 | * Find the first instance of a value in the API instance's result set.
|
497 | *
|
498 | * @param value Value to find in the instance's result set.
|
499 | */
|
500 | indexOf(value: any): number;
|
501 |
|
502 | /**
|
503 | * Join the elements in the result set into a string.
|
504 | *
|
505 | * @param separator The string that will be used to separate each element of the result set.
|
506 | */
|
507 | join(separator: string): string;
|
508 |
|
509 | /**
|
510 | * Find the last instance of a value in the API instance's result set.
|
511 | *
|
512 | * @param value Value to find in the instance's result set.
|
513 | */
|
514 | lastIndexOf(value: any): number;
|
515 |
|
516 | /**
|
517 | * Number of elements in an API instance's result set.
|
518 | */
|
519 | length: number;
|
520 |
|
521 | /**
|
522 | * Iterate over the result set of an API instance, creating a new API instance from the values returned by the callback.
|
523 | *
|
524 | * @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters.
|
525 | */
|
526 | map(fn: ((value: any, index: number, dt: Api) => any)): Api;
|
527 |
|
528 | /**
|
529 | * Iterate over the result set of an API instance, creating a new API instance from the values retrieved from the original elements.
|
530 | *
|
531 | * @param property object property name to use from the element in the original result set for the new result set.
|
532 | */
|
533 | pluck(property: number | string): Api;
|
534 |
|
535 | /**
|
536 | * Remove the last item from an API instance's result set.
|
537 | */
|
538 | pop(): any;
|
539 |
|
540 | /**
|
541 | * Add one or more items to the end of an API instance's result set.
|
542 | *
|
543 | * @param value_1 Item to add to the API instance's result set.
|
544 | */
|
545 | push(value_1: any, ...value_2: any[]): number;
|
546 |
|
547 | /**
|
548 | * Apply a callback function against and accumulator and each element in the Api's result set (left-to-right).
|
549 | *
|
550 | * @param fn Callback function which is called for each item in the API instance result set. The callback is called with four parameters.
|
551 | * @param initialValue Value to use as the first argument of the first call to the fn callback.
|
552 | */
|
553 | reduce(fn: ((current: number, value: any, index: number, dt: Api) => number), initialValue?: any): any;
|
554 |
|
555 | /**
|
556 | * Apply a callback function against and accumulator and each element in the Api's result set (right-to-left).
|
557 | *
|
558 | * @param fn Callback function which is called for each item in the API instance result set. The callback is called with four parameters.
|
559 | * @param initialValue Value to use as the first argument of the first call to the fn callback.
|
560 | */
|
561 | reduceRight(fn: ((current: number, value: any, index: number, dt: Api) => number), initialValue?: any): any;
|
562 |
|
563 | /**
|
564 | * Reverse the result set of the API instance and return the original array.
|
565 | */
|
566 | reverse(): Api;
|
567 |
|
568 | /**
|
569 | * Remove the first item from an API instance's result set.
|
570 | */
|
571 | shift(): any;
|
572 |
|
573 | /**
|
574 | * Sort the elements of the API instance's result set.
|
575 | *
|
576 | * @param fn This is a standard Javascript sort comparison function. It accepts two parameters.
|
577 | */
|
578 | sort(fn?: ((value1: any, value2: any) => number)): Api;
|
579 |
|
580 | /**
|
581 | * Modify the contents of an Api instance's result set, adding or removing items from it as required.
|
582 | *
|
583 | * @param index Index at which to start modifying the Api instance's result set.
|
584 | * @param howMany Number of elements to remove from the result set.
|
585 | * @param value_1 Item to add to the result set at the index specified by the first parameter.
|
586 | */
|
587 | splice(index: number, howMany: number, value_1?: any, ...value_2: any[]): any[];
|
588 |
|
589 | /**
|
590 | * Convert the API instance to a jQuery object, with the objects from the instance's result set in the jQuery result set.
|
591 | */
|
592 | to$(): JQuery;
|
593 |
|
594 | /**
|
595 | * Create a native Javascript array object from an API instance.
|
596 | */
|
597 | toArray(): any[];
|
598 |
|
599 | /**
|
600 | * Convert the API instance to a jQuery object, with the objects from the instance's result set in the jQuery result set.
|
601 | */
|
602 | toJQuery(): JQuery;
|
603 |
|
604 | /**
|
605 | * Create a new API instance containing only the unique items from a the elements in an instance's result set.
|
606 | */
|
607 | unique(): Api;
|
608 |
|
609 | /**
|
610 | * Add one or more items to the start of an API instance's result set.
|
611 | *
|
612 | * @param value_1 Item to add to the API instance's result set.
|
613 | */
|
614 | unshift(value_1: any, ...value_2: any[]): number;
|
615 | }
|
616 |
|
617 | //#endregion "util-methods"
|
618 |
|
619 | interface CommonSubMethods {
|
620 | /**
|
621 | * Get the DataTables cached data for the selected cell
|
622 | *
|
623 | * @param t Specify which cache the data should be read from. Can take one of two values: search or order
|
624 | */
|
625 | cache(t: string): Api;
|
626 | }
|
627 |
|
628 | //#region "cell-methods"
|
629 |
|
630 | interface CommonCellMethods extends CommonSubMethods {
|
631 | /**
|
632 | * Invalidate the data held in DataTables for the selected cells
|
633 | *
|
634 | * @param source Data source to read the new data from.
|
635 | */
|
636 | invalidate(source?: string): Api;
|
637 |
|
638 | /**
|
639 | * Get data for the selected cell
|
640 | *
|
641 | * @param f Data type to get. This can be one of: 'display', 'filter', 'sort', 'type'
|
642 | */
|
643 | render(t: string): any;
|
644 | }
|
645 |
|
646 | interface CellMethods extends CoreMethods, CommonCellMethods {
|
647 | /**
|
648 | * Get data for the selected cell
|
649 | */
|
650 | data(): any;
|
651 |
|
652 | /**
|
653 | * Get data for the selected cell
|
654 | *
|
655 | * @param data Value to assign to the data for the cell
|
656 | */
|
657 | data(data: any): Api;
|
658 |
|
659 | /**
|
660 | * Get index information about the selected cell
|
661 | */
|
662 | index(): CellIndexReturn;
|
663 |
|
664 | /**
|
665 | * Get the DOM element for the selected cell
|
666 | */
|
667 | node(): Node;
|
668 | }
|
669 |
|
670 | interface CellIndexReturn {
|
671 | row: number;
|
672 | column: number;
|
673 | columnVisible: number;
|
674 | }
|
675 |
|
676 | interface CellsMethods extends CoreMethods, CommonCellMethods {
|
677 | /**
|
678 | * Get data for the selected cells
|
679 | */
|
680 | data(): Api;
|
681 |
|
682 | /**
|
683 | * Iterate over each selected cell, with the function context set to be the cell in question. Since: DataTables 1.10.6
|
684 | *
|
685 | * @param fn Function to execute for every cell selected.
|
686 | */
|
687 | every(fn: (this: CellMethods, cellRowIdx: number, cellColIdx: number, tableLoop: number, cellLoop: number) => void): Api;
|
688 |
|
689 | /**
|
690 | * Get index information about the selected cells
|
691 | */
|
692 | indexes(): Api;
|
693 |
|
694 | /**
|
695 | * Get the DOM elements for the selected cells
|
696 | */
|
697 | nodes(): Api;
|
698 | }
|
699 | //#endregion "cell-methods"
|
700 |
|
701 | //#region "column-methods"
|
702 |
|
703 | interface CommonColumnMethod extends CommonSubMethods {
|
704 | /**
|
705 | * Get the footer th / td cell for the selected column.
|
706 | */
|
707 | footer(): HTMLElement;
|
708 |
|
709 | /**
|
710 | * Get the header th / td cell for a column.
|
711 | */
|
712 | header(): HTMLElement;
|
713 |
|
714 | /**
|
715 | * Order the table, in the direction specified, by the column selected by the column()DT selector.
|
716 | *
|
717 | * @param direction Direction of sort to apply to the selected column - desc (descending) or asc (ascending).
|
718 | */
|
719 | order(direction: string): Api;
|
720 |
|
721 | /**
|
722 | * Get the visibility of the selected column.
|
723 | */
|
724 | visible(): boolean;
|
725 |
|
726 | /**
|
727 | * Set the visibility of the selected column.
|
728 | *
|
729 | * @param show Specify if the column should be visible (true) or not (false).
|
730 | * @param redrawCalculations Indicate if DataTables should recalculate the column layout (true - default) or not (false).
|
731 | */
|
732 | visible(show: boolean, redrawCalculations?: boolean): Api;
|
733 | }
|
734 |
|
735 | interface ColumnMethodsModel {
|
736 | /**
|
737 | * Select the column found by a column selector
|
738 | *
|
739 | * @param cellSelector Cell selector.
|
740 | * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
|
741 | */
|
742 | (columnSelector: any, modifier?: ObjectSelectorModifier): ColumnMethods;
|
743 |
|
744 | /**
|
745 | * Convert from the input column index type to that required.
|
746 | *
|
747 | * @param t The type on conversion that should take place: 'fromVisible', 'toData', 'fromData', 'toVisible'
|
748 | * @param index The index to be converted
|
749 | */
|
750 | index(t: string, index: number): number;
|
751 | }
|
752 |
|
753 | interface ColumnMethods extends CoreMethods, CommonColumnMethod {
|
754 | /**
|
755 | * Get the data for the cells in the selected column.
|
756 | */
|
757 | data(): Api;
|
758 |
|
759 | /**
|
760 | * Get the data source property for the selected column
|
761 | */
|
762 | dataSrc(): number | string | (() => string);
|
763 |
|
764 | /**
|
765 | * Get index information about the selected cell
|
766 | *
|
767 | * @param t Specify if you want to get the column data index (default) or the visible index (visible).
|
768 | */
|
769 | index(t?: string): number;
|
770 |
|
771 | /**
|
772 | * Obtain the th / td nodes for the selected column
|
773 | */
|
774 | nodes(): Api;
|
775 | }
|
776 |
|
777 | interface ColumnsMethodsModel {
|
778 | /**
|
779 | * Select all columns
|
780 | *
|
781 | * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
|
782 | */
|
783 | (modifier?: ObjectSelectorModifier): ColumnsMethods;
|
784 |
|
785 | /**
|
786 | * Select columns found by a cell selector
|
787 | *
|
788 | * @param cellSelector Cell selector.
|
789 | * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
|
790 | */
|
791 | (columnSelector: any, modifier?: ObjectSelectorModifier): ColumnsMethods;
|
792 |
|
793 | /**
|
794 | * Recalculate the column widths for layout.
|
795 | */
|
796 | adjust(): Api;
|
797 | }
|
798 |
|
799 | interface ColumnsMethods extends CoreMethods, CommonColumnMethod {
|
800 | /**
|
801 | * Obtain the data for the columns from the selector
|
802 | */
|
803 | data(): Api;
|
804 |
|
805 | /**
|
806 | * Get the data source property for the selected columns.
|
807 | */
|
808 | dataSrc(): Api;
|
809 |
|
810 | /**
|
811 | * Iterate over each selected column, with the function context set to be the column in question. Since: DataTables 1.10.6
|
812 | *
|
813 | * @param fn Function to execute for every column selected.
|
814 | */
|
815 | every(fn: (this: ColumnMethods, colIdx: number, tableLoop: number, colLoop: number) => void): Api;
|
816 |
|
817 | /**
|
818 | * Get the column indexes of the selected columns.
|
819 | *
|
820 | * @param t Specify if you want to get the column data index (default) or the visible index (visible).
|
821 | */
|
822 | indexes(t?: string): Api;
|
823 |
|
824 | /**
|
825 | * Obtain the th / td nodes for the selected columns
|
826 | */
|
827 | nodes(): Api[][];
|
828 | }
|
829 | //#endregion "column-methods"
|
830 |
|
831 | //#region "row-methods"
|
832 |
|
833 | interface CommonRowMethod extends CommonSubMethods {
|
834 | /**
|
835 | * Obtain the th / td nodes for the selected column
|
836 | *
|
837 | * @param source Data source to read the new data from. Values: 'auto', 'data', 'dom'
|
838 | */
|
839 | invalidate(source?: string): Api;
|
840 | }
|
841 |
|
842 | interface RowChildMethodModel {
|
843 | /**
|
844 | * Get the child row(s) that have been set for a parent row
|
845 | */
|
846 | (): JQuery;
|
847 |
|
848 | /**
|
849 | * Get the child row(s) that have been set for a parent row
|
850 | *
|
851 | * @param showRemove This parameter can be given as true or false
|
852 | */
|
853 | (showRemove: boolean): RowChildMethods;
|
854 |
|
855 | /**
|
856 | * Set the data to show in the child row(s). Note that calling this method will replace any child rows which are already attached to the parent row.
|
857 | *
|
858 | * @param data The data to be shown in the child row can be given in multiple different ways.
|
859 | * @param className Class name that is added to the td cell node(s) of the child row(s). As of 1.10.1 it is also added to the tr row node of the child row(s).
|
860 | */
|
861 | (data: (string | Node | JQuery) | Array<(string | number | JQuery)>, className?: string): RowChildMethods;
|
862 |
|
863 | /**
|
864 | * Hide the child row(s) of a parent row
|
865 | */
|
866 | hide(): Api;
|
867 |
|
868 | /**
|
869 | * Check if the child rows of a parent row are visible
|
870 | */
|
871 | isShown(): Api;
|
872 |
|
873 | /**
|
874 | * Remove child row(s) from display and release any allocated memory
|
875 | */
|
876 | remove(): Api;
|
877 |
|
878 | /**
|
879 | * Show the child row(s) of a parent row
|
880 | */
|
881 | show(): Api;
|
882 | }
|
883 |
|
884 | interface RowChildMethods extends CoreMethods {
|
885 | /**
|
886 | * Hide the child row(s) of a parent row
|
887 | */
|
888 | hide(): Api;
|
889 |
|
890 | /**
|
891 | * Remove child row(s) from display and release any allocated memory
|
892 | */
|
893 | remove(): Api;
|
894 |
|
895 | /**
|
896 | * Make newly defined child rows visible
|
897 | */
|
898 | show(): Api;
|
899 | }
|
900 |
|
901 | interface RowMethodsModel {
|
902 | /**
|
903 | * Select a row found by a row selector
|
904 | *
|
905 | * @param rowSelector Row selector.
|
906 | * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
|
907 | */
|
908 | (rowSelector: any, modifier?: ObjectSelectorModifier): RowMethods;
|
909 |
|
910 | /**
|
911 | * Add a new row to the table using the given data
|
912 | *
|
913 | * @param data Data to use for the new row. This may be an array, object or Javascript object instance, but must be in the same format as the other data in the table
|
914 | */
|
915 | add(data: any[] | object): Api;
|
916 | }
|
917 |
|
918 | interface RowMethods extends CoreMethods, CommonRowMethod {
|
919 | /**
|
920 | * Order Methods / object
|
921 | */
|
922 | child: RowChildMethodModel;
|
923 |
|
924 | /**
|
925 | * Get the data for the selected row
|
926 | */
|
927 | data(): any[] | object;
|
928 |
|
929 | /**
|
930 | * Set the data for the selected row
|
931 | *
|
932 | * @param d Data to use for the row.
|
933 | */
|
934 | data(d: any[] | object): Api;
|
935 |
|
936 | /**
|
937 | * Get the id of the selected row. Since: 1.10.8
|
938 | *
|
939 | * @param hash true - Append a hash (#) to the start of the row id. This can be useful for then using the id as a selector
|
940 | * false - Do not modify the id value.
|
941 | * @returns Row id. If the row does not have an id available 'undefined' will be returned.
|
942 | */
|
943 | id(hash?: boolean): string;
|
944 |
|
945 | /**
|
946 | * Get the row index of the row column.
|
947 | */
|
948 | index(): number;
|
949 |
|
950 | /**
|
951 | * Obtain the tr node for the selected row
|
952 | */
|
953 | node(): Node;
|
954 |
|
955 | /**
|
956 | * Delete the selected row from the DataTable.
|
957 | */
|
958 | remove(): Node;
|
959 | }
|
960 |
|
961 | interface RowsMethodsModel {
|
962 | /**
|
963 | * Select all rows
|
964 | *
|
965 | * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
|
966 | */
|
967 | (modifier?: ObjectSelectorModifier): RowsMethods;
|
968 |
|
969 | /**
|
970 | * Select rows found by a row selector
|
971 | *
|
972 | * @param cellSelector Row selector.
|
973 | * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
|
974 | */
|
975 | (rowSelector: any, modifier?: ObjectSelectorModifier): RowsMethods;
|
976 |
|
977 | /**
|
978 | * Add new rows to the table using the data given
|
979 | *
|
980 | * @param data Array of data elements, with each one describing a new row to be added to the table
|
981 | */
|
982 | add(data: any[]): Api;
|
983 | }
|
984 |
|
985 | interface RowsMethods extends CoreMethods, CommonRowMethod {
|
986 | /**
|
987 | * Get / Set the data for the selected row
|
988 | *
|
989 | * @param d Data to use for the row.
|
990 | */
|
991 | data(d?: any[] | object): Api;
|
992 |
|
993 | /**
|
994 | * Iterate over each selected row, with the function context set to be the row in question. Since: DataTables 1.10.6
|
995 | *
|
996 | * @param fn Function to execute for every row selected.
|
997 | */
|
998 | every(fn: (this: RowMethods, rowIdx: number, tableLoop: number, rowLoop: number) => void): Api;
|
999 |
|
1000 | /**
|
1001 | * Get the ids of the selected rows. Since: 1.10.8
|
1002 | *
|
1003 | * @param hash true - Append a hash (#) to the start of each row id. This can be useful for then using the ids as selectors
|
1004 | * false - Do not modify the id value.
|
1005 | * @returns Api instance with the selected rows in its result set. If a row does not have an id available 'undefined' will be returned as the value.
|
1006 | */
|
1007 | ids(hash?: boolean): Api;
|
1008 |
|
1009 | /**
|
1010 | * Get the row indexes of the selected rows.
|
1011 | */
|
1012 | indexes(): Api;
|
1013 |
|
1014 | /**
|
1015 | * Obtain the tr nodes for the selected rows
|
1016 | */
|
1017 | nodes(): Api;
|
1018 |
|
1019 | /**
|
1020 | * Delete the selected rows from the DataTable.
|
1021 | */
|
1022 | remove(): Api;
|
1023 | }
|
1024 | //#endregion "row-methods"
|
1025 |
|
1026 | //#region "table-methods"
|
1027 |
|
1028 | interface TableMethods extends CoreMethods {
|
1029 | /**
|
1030 | * Get the tfoot node for the table in the API's context
|
1031 | */
|
1032 | footer(): Node;
|
1033 |
|
1034 | /**
|
1035 | * Get the thead node for the table in the API's context
|
1036 | */
|
1037 | header(): Node;
|
1038 |
|
1039 | /**
|
1040 | * Get the tbody node for the table in the API's context
|
1041 | */
|
1042 | body(): Node;
|
1043 |
|
1044 | /**
|
1045 | * Get the div container node for the table in the API's context
|
1046 | */
|
1047 | container(): Node;
|
1048 |
|
1049 | /**
|
1050 | * Get the table node for the table in the API's context
|
1051 | */
|
1052 | node(): Node;
|
1053 | }
|
1054 |
|
1055 | interface TablesMethods extends CoreMethods {
|
1056 | /**
|
1057 | * Get the tfoot nodes for the tables in the API's context
|
1058 | */
|
1059 | footer(): Api;
|
1060 |
|
1061 | /**
|
1062 | * Get the thead nodes for the tables in the API's context
|
1063 | */
|
1064 | header(): Api;
|
1065 |
|
1066 | /**
|
1067 | * Get the tbody nodes for the tables in the API's context
|
1068 | */
|
1069 | body(): Api;
|
1070 |
|
1071 | /**
|
1072 | * Get the div container nodes for the tables in the API's context
|
1073 | */
|
1074 | containers(): Api;
|
1075 |
|
1076 | /**
|
1077 | * Get the table nodes for the tables in the API's context
|
1078 | */
|
1079 | nodes(): Api;
|
1080 | }
|
1081 | //#endregion "table-methods"
|
1082 |
|
1083 | //#endregion "Namespaces"
|
1084 |
|
1085 | //#region "Static-Methods"
|
1086 |
|
1087 | interface StaticFunctions {
|
1088 | /**
|
1089 | * Returns JQuery object
|
1090 | *
|
1091 | * Usage:
|
1092 | * $( selector ).dataTable();
|
1093 | */
|
1094 | (): JQueryDataTables;
|
1095 |
|
1096 | /**
|
1097 | * Check if a table node is a DataTable already or not.
|
1098 | *
|
1099 | * Usage:
|
1100 | * $.fn.dataTable.isDataTable("selector");
|
1101 | * @param table The table to check.
|
1102 | */
|
1103 | isDataTable(table: string | Node | JQuery | Api): boolean;
|
1104 |
|
1105 | /**
|
1106 | * Helpers for `columns.render`.
|
1107 | *
|
1108 | * The options defined here can be used with the `columns.render` initialisation
|
1109 | * option to provide a display renderer.
|
1110 | */
|
1111 | render: StaticRenderFunctions;
|
1112 |
|
1113 | /**
|
1114 | * Get all DataTable tables that have been initialised - optionally you can select to get only currently visible tables and / or retrieve the tables as API instances.
|
1115 | *
|
1116 | * @param visible As a boolean value this options is used to indicate if you want all tables on the page should be returned (false), or visible tables only (true).
|
1117 | * Since 1.10.8 this option can also be given as an object.
|
1118 | */
|
1119 | tables(visible?: boolean | objectTablesStatic): Api[] | Api;
|
1120 |
|
1121 | /**
|
1122 | * Version number compatibility check function
|
1123 | *
|
1124 | * Usage:
|
1125 | * $.fn.dataTable.versionCheck("1.10.0");
|
1126 | * @param version Version string
|
1127 | */
|
1128 | versionCheck(version: string): boolean;
|
1129 |
|
1130 | /**
|
1131 | * Utils
|
1132 | */
|
1133 | util: StaticUtilFunctions;
|
1134 |
|
1135 | /**
|
1136 | * Get DataTable API instance
|
1137 | *
|
1138 | * @param table Selector string for table
|
1139 | */
|
1140 | Api: new (selector: string | Node | Node[] | JQuery | SettingsLegacy) => Api;
|
1141 |
|
1142 | |
1143 |
|
1144 |
|
1145 | defaults: Settings;
|
1146 |
|
1147 | |
1148 |
|
1149 |
|
1150 | ext: ExtSettings;
|
1151 | }
|
1152 |
|
1153 | interface ObjectOrderFixed {
|
1154 | |
1155 |
|
1156 |
|
1157 |
|
1158 |
|
1159 | pre?: any[];
|
1160 | |
1161 |
|
1162 |
|
1163 |
|
1164 |
|
1165 | post?: any[];
|
1166 | }
|
1167 |
|
1168 | interface StaticRenderFunctions {
|
1169 | |
1170 |
|
1171 |
|
1172 |
|
1173 |
|
1174 |
|
1175 |
|
1176 |
|
1177 |
|
1178 | number(thousands: string, decimal: string, precision: number, prefix?: string, postfix?: string): ObjectColumnRender;
|
1179 | |
1180 |
|
1181 |
|
1182 | text(): ObjectColumnRender;
|
1183 | }
|
1184 |
|
1185 | interface StaticUtilFunctions {
|
1186 | |
1187 |
|
1188 |
|
1189 |
|
1190 |
|
1191 | escapeRegex(str: string): string;
|
1192 |
|
1193 | |
1194 |
|
1195 |
|
1196 |
|
1197 |
|
1198 |
|
1199 | throttle(fn: FunctionThrottle, period?: number): (() => void);
|
1200 | }
|
1201 |
|
1202 | type FunctionThrottle = (data: any) => void;
|
1203 |
|
1204 | interface objectTablesStatic {
|
1205 | |
1206 |
|
1207 |
|
1208 | visible: boolean;
|
1209 |
|
1210 | |
1211 |
|
1212 |
|
1213 | api: boolean;
|
1214 | }
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 |
|
1220 | interface Settings {
|
1221 |
|
1222 |
|
1223 | |
1224 |
|
1225 |
|
1226 | autoWidth?: boolean;
|
1227 |
|
1228 | |
1229 |
|
1230 |
|
1231 | deferRender?: boolean;
|
1232 |
|
1233 | |
1234 |
|
1235 |
|
1236 | info?: boolean;
|
1237 |
|
1238 | |
1239 |
|
1240 |
|
1241 | jQueryUI?: boolean;
|
1242 |
|
1243 | |
1244 |
|
1245 |
|
1246 | lengthChange?: boolean;
|
1247 |
|
1248 | |
1249 |
|
1250 |
|
1251 | ordering?: boolean;
|
1252 |
|
1253 | |
1254 |
|
1255 |
|
1256 | paging?: boolean;
|
1257 |
|
1258 | |
1259 |
|
1260 |
|
1261 | processing?: boolean;
|
1262 |
|
1263 | |
1264 |
|
1265 |
|
1266 | scrollX?: boolean;
|
1267 |
|
1268 | |
1269 |
|
1270 |
|
1271 | scrollY?: string;
|
1272 |
|
1273 | |
1274 |
|
1275 |
|
1276 | searching?: boolean;
|
1277 |
|
1278 | |
1279 |
|
1280 |
|
1281 | serverSide?: boolean;
|
1282 |
|
1283 | |
1284 |
|
1285 |
|
1286 | stateSave?: boolean;
|
1287 |
|
1288 |
|
1289 |
|
1290 |
|
1291 |
|
1292 | |
1293 |
|
1294 |
|
1295 | ajax?: string | AjaxSettings | FunctionAjax;
|
1296 |
|
1297 | |
1298 |
|
1299 |
|
1300 | data?: any[];
|
1301 |
|
1302 |
|
1303 |
|
1304 |
|
1305 |
|
1306 | |
1307 |
|
1308 |
|
1309 | columns?: ColumnSettings[];
|
1310 |
|
1311 | |
1312 |
|
1313 |
|
1314 | columnDefs?: ColumnDefsSettings[];
|
1315 |
|
1316 | |
1317 |
|
1318 |
|
1319 | deferLoading?: number | number[];
|
1320 |
|
1321 | |
1322 |
|
1323 |
|
1324 | destroy?: boolean;
|
1325 |
|
1326 | |
1327 |
|
1328 |
|
1329 | displayStart?: number;
|
1330 |
|
1331 | |
1332 |
|
1333 |
|
1334 | dom?: string;
|
1335 |
|
1336 | |
1337 |
|
1338 |
|
1339 | lengthMenu?: Array<(number | string)> | Array<Array<(number | string)>>;
|
1340 |
|
1341 | |
1342 |
|
1343 |
|
1344 | orderCellsTop?: boolean;
|
1345 |
|
1346 | |
1347 |
|
1348 |
|
1349 | orderClasses?: boolean;
|
1350 |
|
1351 | |
1352 |
|
1353 |
|
1354 | order?: Array<(number | string)> | Array<Array<(number | string)>>;
|
1355 |
|
1356 | |
1357 |
|
1358 |
|
1359 | orderFixed?: Array<(number | string)> | Array<Array<(number | string)>> | object;
|
1360 |
|
1361 | |
1362 |
|
1363 |
|
1364 | orderMulti?: boolean;
|
1365 |
|
1366 | |
1367 |
|
1368 |
|
1369 | pageLength?: number;
|
1370 |
|
1371 | |
1372 |
|
1373 |
|
1374 | pagingType?: string;
|
1375 |
|
1376 | |
1377 |
|
1378 |
|
1379 | retrieve?: boolean;
|
1380 |
|
1381 | |
1382 |
|
1383 |
|
1384 | renderer?: string | RendererSettings;
|
1385 |
|
1386 | |
1387 |
|
1388 |
|
1389 | rowId?: string;
|
1390 |
|
1391 | |
1392 |
|
1393 |
|
1394 | scrollCollapse?: boolean;
|
1395 |
|
1396 | |
1397 |
|
1398 |
|
1399 | search?: SearchSettings | boolean;
|
1400 |
|
1401 | |
1402 |
|
1403 |
|
1404 | searchPlaceholder?: SearchSettings;
|
1405 |
|
1406 | |
1407 |
|
1408 |
|
1409 | searchCols?: SearchSettings[];
|
1410 |
|
1411 | |
1412 |
|
1413 |
|
1414 | searchDelay?: number;
|
1415 |
|
1416 | |
1417 |
|
1418 |
|
1419 | stateDuration?: number;
|
1420 |
|
1421 | |
1422 |
|
1423 |
|
1424 | stripeClasses?: string[];
|
1425 |
|
1426 | |
1427 |
|
1428 |
|
1429 | tabIndex?: number;
|
1430 |
|
1431 | |
1432 |
|
1433 |
|
1434 | responsive?: boolean | object;
|
1435 |
|
1436 |
|
1437 |
|
1438 |
|
1439 |
|
1440 | |
1441 |
|
1442 |
|
1443 | createdRow?: FunctionCreateRow;
|
1444 |
|
1445 | |
1446 |
|
1447 |
|
1448 | drawCallback?: FunctionDrawCallback;
|
1449 |
|
1450 | |
1451 |
|
1452 |
|
1453 | footerCallback?: FunctionFooterCallback;
|
1454 |
|
1455 | |
1456 |
|
1457 |
|
1458 | formatNumber?: FunctionFormatNumber;
|
1459 |
|
1460 | |
1461 |
|
1462 |
|
1463 | headerCallback?: FunctionHeaderCallback;
|
1464 |
|
1465 | |
1466 |
|
1467 |
|
1468 | infoCallback?: FunctionInfoCallback;
|
1469 |
|
1470 | |
1471 |
|
1472 |
|
1473 | initComplete?: FunctionInitComplete;
|
1474 |
|
1475 | |
1476 |
|
1477 |
|
1478 | preDrawCallback?: FunctionPreDrawCallback;
|
1479 |
|
1480 | |
1481 |
|
1482 |
|
1483 | rowCallback?: FunctionRowCallback;
|
1484 |
|
1485 | |
1486 |
|
1487 |
|
1488 | stateLoadCallback?: FunctionStateLoadCallback;
|
1489 |
|
1490 | |
1491 |
|
1492 |
|
1493 | stateLoaded?: FunctionStateLoaded;
|
1494 |
|
1495 | |
1496 |
|
1497 |
|
1498 | stateLoadParams?: FunctionStateLoadParams;
|
1499 |
|
1500 | |
1501 |
|
1502 |
|
1503 | stateSaveCallback?: FunctionStateSaveCallback;
|
1504 |
|
1505 | |
1506 |
|
1507 |
|
1508 | stateSaveParams?: FunctionStateSaveParams;
|
1509 |
|
1510 |
|
1511 |
|
1512 |
|
1513 |
|
1514 | language?: LanguageSettings;
|
1515 |
|
1516 |
|
1517 | }
|
1518 |
|
1519 |
|
1520 |
|
1521 | interface AjaxDataRequest {
|
1522 | draw: number;
|
1523 | start: number;
|
1524 | length: number;
|
1525 | data: any;
|
1526 | order: AjaxDataRequestOrder[];
|
1527 | columns: AjaxDataRequestColumn[];
|
1528 | search: AjaxDataRequestSearch;
|
1529 | }
|
1530 |
|
1531 | interface AjaxDataRequestSearch {
|
1532 | value: string;
|
1533 | regex: boolean;
|
1534 | }
|
1535 |
|
1536 | interface AjaxDataRequestOrder {
|
1537 | column: number;
|
1538 | dir: string;
|
1539 | }
|
1540 |
|
1541 | interface AjaxDataRequestColumn {
|
1542 | data: string | number;
|
1543 | name: string;
|
1544 | searchable: boolean;
|
1545 | orderable: boolean;
|
1546 | search: AjaxDataRequestSearch;
|
1547 | }
|
1548 |
|
1549 | interface AjaxData {
|
1550 | draw?: number;
|
1551 | recordsTotal?: number;
|
1552 | recordsFiltered?: number;
|
1553 | data: any;
|
1554 | error?: string;
|
1555 | }
|
1556 |
|
1557 | interface AjaxSettings extends JQueryAjaxSettings {
|
1558 | |
1559 |
|
1560 |
|
1561 | data?: object | FunctionAjaxData;
|
1562 |
|
1563 | |
1564 |
|
1565 |
|
1566 | dataSrc?: string | ((data: any) => any[]);
|
1567 | }
|
1568 |
|
1569 | type FunctionAjax = (data: object, callback: ((data: any) => void), settings: SettingsLegacy) => void;
|
1570 |
|
1571 | type FunctionAjaxData = (data: object, settings: Settings) => string | object;
|
1572 |
|
1573 |
|
1574 |
|
1575 |
|
1576 |
|
1577 | interface ColumnSettings {
|
1578 | |
1579 |
|
1580 |
|
1581 | cellType?: string;
|
1582 |
|
1583 | |
1584 |
|
1585 |
|
1586 | className?: string;
|
1587 |
|
1588 | |
1589 |
|
1590 |
|
1591 | contentPadding?: string;
|
1592 |
|
1593 | |
1594 |
|
1595 |
|
1596 | createdCell?: FunctionColumnCreatedCell;
|
1597 |
|
1598 | |
1599 |
|
1600 |
|
1601 | data?: number | string | ObjectColumnData | FunctionColumnData | null;
|
1602 |
|
1603 | |
1604 |
|
1605 |
|
1606 | defaultContent?: string;
|
1607 |
|
1608 | |
1609 |
|
1610 |
|
1611 | name?: string;
|
1612 |
|
1613 | |
1614 |
|
1615 |
|
1616 | orderable?: boolean;
|
1617 |
|
1618 | |
1619 |
|
1620 |
|
1621 | orderData?: number | number[];
|
1622 |
|
1623 | |
1624 |
|
1625 |
|
1626 | orderDataType?: string;
|
1627 |
|
1628 | |
1629 |
|
1630 |
|
1631 |
|
1632 |
|
1633 |
|
1634 |
|
1635 | orderFixed?: any[] | ObjectOrderFixed;
|
1636 |
|
1637 | |
1638 |
|
1639 |
|
1640 | orderSequence?: string[];
|
1641 |
|
1642 | |
1643 |
|
1644 |
|
1645 | render?: number | string | ObjectColumnData | FunctionColumnRender | ObjectColumnRender;
|
1646 |
|
1647 | |
1648 |
|
1649 |
|
1650 | searchable?: boolean;
|
1651 |
|
1652 | |
1653 |
|
1654 |
|
1655 | title?: string;
|
1656 |
|
1657 | |
1658 |
|
1659 |
|
1660 | type?: string;
|
1661 |
|
1662 | |
1663 |
|
1664 |
|
1665 | visible?: boolean;
|
1666 |
|
1667 | |
1668 |
|
1669 |
|
1670 | width?: string;
|
1671 | }
|
1672 |
|
1673 | interface ColumnDefsSettings extends ColumnSettings {
|
1674 | targets: string | number | Array<(number | string)>;
|
1675 | }
|
1676 |
|
1677 | type FunctionColumnCreatedCell = (cell: Node, cellData: any, rowData: any, row: number, col: number) => void;
|
1678 |
|
1679 | interface FunctionColumnData {
|
1680 | (row: any, t: 'set', s: any, meta: CellMetaSettings): void;
|
1681 | (row: any, t: 'display' | 'sort' | 'filter' | 'type', s: undefined, meta: CellMetaSettings): any;
|
1682 | }
|
1683 |
|
1684 | interface ObjectColumnData {
|
1685 | _: string | number | FunctionColumnData;
|
1686 | filter?: string | number | FunctionColumnData;
|
1687 | display?: string | number | FunctionColumnData;
|
1688 | type?: string | number | FunctionColumnData;
|
1689 | sort?: string | number | FunctionColumnData;
|
1690 | }
|
1691 |
|
1692 | type FunctionColumnRender = (data: any, type: any, row: any, meta: CellMetaSettings) => any;
|
1693 |
|
1694 | interface ObjectColumnRender {
|
1695 | _?: string | number | FunctionColumnRender;
|
1696 | filter?: string | number | FunctionColumnRender;
|
1697 | display?: string | number | FunctionColumnRender;
|
1698 | type?: string | number | FunctionColumnRender;
|
1699 | sort?: string | number | FunctionColumnRender;
|
1700 | }
|
1701 |
|
1702 | interface CellMetaSettings {
|
1703 | row: number;
|
1704 | col: number;
|
1705 | settings: Settings;
|
1706 | }
|
1707 |
|
1708 |
|
1709 |
|
1710 |
|
1711 |
|
1712 | interface RendererSettings {
|
1713 | header?: string;
|
1714 | pageButton?: string;
|
1715 | }
|
1716 |
|
1717 | interface SearchSettings {
|
1718 | |
1719 |
|
1720 |
|
1721 | caseInsensitive?: boolean;
|
1722 |
|
1723 | |
1724 |
|
1725 |
|
1726 | regex?: boolean;
|
1727 |
|
1728 | |
1729 |
|
1730 |
|
1731 | smart?: boolean;
|
1732 |
|
1733 | |
1734 |
|
1735 |
|
1736 | search?: string;
|
1737 |
|
1738 | |
1739 |
|
1740 |
|
1741 | searchPlaceholder?: string;
|
1742 | }
|
1743 |
|
1744 |
|
1745 |
|
1746 |
|
1747 |
|
1748 | type FunctionCreateRow = (row: Node, data: any[] | object, dataIndex: number) => void;
|
1749 |
|
1750 | type FunctionDrawCallback = (settings: SettingsLegacy) => void;
|
1751 |
|
1752 | type FunctionFooterCallback = (tfoot: Node, data: any[], start: number, end: number, display: any[]) => void;
|
1753 |
|
1754 | type FunctionFormatNumber = (formatNumber: number) => void;
|
1755 |
|
1756 | type FunctionHeaderCallback = (thead: Node, data: any[], start: number, end: number, display: any[]) => void;
|
1757 |
|
1758 | type FunctionInfoCallback = (settings: SettingsLegacy, start: number, end: number, mnax: number, total: number, pre: string) => void;
|
1759 |
|
1760 | type FunctionInitComplete = (settings: SettingsLegacy, json: object) => void;
|
1761 |
|
1762 | type FunctionPreDrawCallback = (settings: SettingsLegacy) => void;
|
1763 |
|
1764 | type FunctionRowCallback = (row: Node, data: any[] | object, index: number) => void;
|
1765 |
|
1766 | type FunctionStateLoadCallback = (settings: SettingsLegacy) => void;
|
1767 |
|
1768 | type FunctionStateLoaded = (settings: SettingsLegacy, data: object) => void;
|
1769 |
|
1770 | type FunctionStateLoadParams = (settings: SettingsLegacy, data: object) => void;
|
1771 |
|
1772 | type FunctionStateSaveCallback = (settings: SettingsLegacy, data: object) => void;
|
1773 |
|
1774 | type FunctionStateSaveParams = (settings: SettingsLegacy, data: object) => void;
|
1775 |
|
1776 |
|
1777 |
|
1778 |
|
1779 |
|
1780 |
|
1781 | interface LanguageSettings {
|
1782 | emptyTable?: string;
|
1783 | info?: string;
|
1784 | infoEmpty?: string;
|
1785 | infoFiltered?: string;
|
1786 | infoPostFix?: string;
|
1787 | decimal?: string;
|
1788 | thousands?: string;
|
1789 | lengthMenu?: string;
|
1790 | loadingRecords?: string;
|
1791 | processing?: string;
|
1792 | search?: string;
|
1793 | searchPlaceholder?: string;
|
1794 | zeroRecords?: string;
|
1795 | paginate?: LanguagePaginateSettings;
|
1796 | aria?: LanguageAriaSettings;
|
1797 | url?: string;
|
1798 | }
|
1799 |
|
1800 | interface LanguagePaginateSettings {
|
1801 | first: string;
|
1802 | last: string;
|
1803 | next: string;
|
1804 | previous: string;
|
1805 | }
|
1806 |
|
1807 | interface LanguageAriaSettings {
|
1808 | sortAscending: string;
|
1809 | sortDescending: string;
|
1810 | paginate?: LanguagePaginateSettings;
|
1811 | }
|
1812 |
|
1813 |
|
1814 |
|
1815 |
|
1816 |
|
1817 |
|
1818 |
|
1819 | interface ArrayStringNode {
|
1820 | [index: string]: Node;
|
1821 | }
|
1822 |
|
1823 | interface SettingsLegacy {
|
1824 | ajax: any;
|
1825 | oApi: any;
|
1826 | oFeatures: FeaturesLegacy;
|
1827 | oScroll: ScrollingLegacy;
|
1828 | oLanguage: LanguageLegacy;
|
1829 | oBrowser: BrowserLegacy;
|
1830 | aanFeatures: ArrayStringNode[][];
|
1831 | aoData: RowLegacy[];
|
1832 | aIds: any;
|
1833 | aiDisplay: number[];
|
1834 | aiDisplayMaster: number[];
|
1835 | aoColumns: ColumnLegacy[];
|
1836 | aoHeader: any[];
|
1837 | aoFooter: any[];
|
1838 | asDataSearch: string[];
|
1839 | oPreviousSearch: any;
|
1840 | aoPreSearchCols: any[];
|
1841 | aaSorting: any[][];
|
1842 | aaSortingFixed: any[][];
|
1843 | asStripeClasses: string[];
|
1844 | asDestroyStripes: string[];
|
1845 | sDestroyWidth: number;
|
1846 | aoRowCallback: FunctionRowCallback[];
|
1847 | aoHeaderCallback: FunctionHeaderCallback[];
|
1848 | aoFooterCallback: FunctionFooterCallback[];
|
1849 | aoDrawCallback: FunctionDrawCallback[];
|
1850 | aoRowCreatedCallback: FunctionCreateRow[];
|
1851 | aoPreDrawCallback: FunctionPreDrawCallback[];
|
1852 | aoInitComplete: FunctionInitComplete[];
|
1853 | aoStateSaveParams: FunctionStateSaveParams[];
|
1854 | aoStateLoadParams: FunctionStateLoadParams[];
|
1855 | aoStateLoaded: FunctionStateLoaded[];
|
1856 | sTableId: string;
|
1857 | nTable: Node;
|
1858 | nTHead: Node;
|
1859 | nTFoot: Node;
|
1860 | nTBody: Node;
|
1861 | nTableWrapper: Node;
|
1862 | bDeferLoading: boolean;
|
1863 | bInitialized: boolean;
|
1864 | aoOpenRows: any[];
|
1865 | sDom: string;
|
1866 | sPaginationType: string;
|
1867 | iCookieDuration: number;
|
1868 | sCookiePrefix: string;
|
1869 | fnCookieCallback: CookieCallbackLegacy;
|
1870 | aoStateSave: FunctionStateSaveCallback[];
|
1871 | aoStateLoad: FunctionStateLoadCallback[];
|
1872 | oLoadedState: any;
|
1873 | sAjaxSource: string;
|
1874 | sAjaxDataProp: string;
|
1875 | bAjaxDataGet: boolean;
|
1876 | jqXHR: any;
|
1877 | fnServerData: any;
|
1878 | aoServerParams: any[];
|
1879 | sServerMethod: string;
|
1880 | fnFormatNumber: FunctionFormatNumber;
|
1881 | aLengthMenu: any[];
|
1882 | iDraw: number;
|
1883 | bDrawing: boolean;
|
1884 | iDrawError: number;
|
1885 | _iDisplayLength: number;
|
1886 | _iDisplayStart: number;
|
1887 | _iDisplayEnd: number;
|
1888 | _iRecordsTotal: number;
|
1889 | _iRecordsDisplay: number;
|
1890 | bJUI: boolean;
|
1891 | oClasses: any;
|
1892 | bFiltered: boolean;
|
1893 | bSorted: boolean;
|
1894 | bSortCellsTop: boolean;
|
1895 | oInit: any;
|
1896 | aoDestroyCallback: any[];
|
1897 | fnRecordsTotal(): number;
|
1898 | fnRecordsDisplay(): number;
|
1899 | fnDisplayEnd(): number;
|
1900 | oInstance: any;
|
1901 | sInstance: string;
|
1902 | iTabIndex: number;
|
1903 | nScrollHead: Node;
|
1904 | nScrollFoot: Node;
|
1905 | rowIdFn(mSource: string | number | (() => void)): (() => void);
|
1906 | }
|
1907 |
|
1908 | interface BrowserLegacy {
|
1909 | barWidth: number;
|
1910 | bBounding: boolean;
|
1911 | bScrollbarLeft: boolean;
|
1912 | bScrollOversize: boolean;
|
1913 | }
|
1914 |
|
1915 | interface FeaturesLegacy {
|
1916 | bAutoWidth: boolean;
|
1917 | bDeferRender: boolean;
|
1918 | bFilter: boolean;
|
1919 | bInfo: boolean;
|
1920 | bLengthChange: boolean;
|
1921 | bPaginate: boolean;
|
1922 | bProcessing: boolean;
|
1923 | bServerSide: boolean;
|
1924 | bSort: boolean;
|
1925 | bSortClasses: boolean;
|
1926 | bStateSave: boolean;
|
1927 | }
|
1928 |
|
1929 | interface ScrollingLegacy {
|
1930 | bAutoCss: boolean;
|
1931 | bCollapse: boolean;
|
1932 | bInfinite: boolean;
|
1933 | iBarWidth: number;
|
1934 | iLoadGap: number;
|
1935 | sX: string;
|
1936 | sY: string;
|
1937 | }
|
1938 |
|
1939 | interface RowLegacy {
|
1940 | nTr: Node;
|
1941 | _aData: any;
|
1942 | _aSortData: any[];
|
1943 | _anHidden: Node[];
|
1944 | _sRowStripe: string;
|
1945 | }
|
1946 |
|
1947 | interface ColumnLegacy {
|
1948 | idx: number;
|
1949 | aDataSort: any;
|
1950 | asSorting: string[];
|
1951 | bSearchable: boolean;
|
1952 | bSortable: boolean;
|
1953 | bVisible: boolean;
|
1954 | _bAutoType: boolean;
|
1955 | fnCreatedCell: FunctionColumnCreatedCell;
|
1956 | fnGetData(data: any, specific: string): any;
|
1957 | fnSetData(data: any, value: any): void;
|
1958 | mData: any;
|
1959 | mRender: any;
|
1960 | nTh: Node;
|
1961 | nIf: Node;
|
1962 | sClass: string;
|
1963 | sContentPadding: string;
|
1964 | sDefaultContent: string;
|
1965 | sName: string;
|
1966 | sSortDataType: string;
|
1967 | sSortingClass: string;
|
1968 | sSortingClassJUI: string;
|
1969 | sTitle: string;
|
1970 | sType: string;
|
1971 | sWidth: string;
|
1972 | sWidthOrig: string;
|
1973 | }
|
1974 |
|
1975 | type CookieCallbackLegacy = (name: string, data: any, expires: string, path: string, cookie: string) => void;
|
1976 |
|
1977 | interface LanguageLegacy {
|
1978 | oAria?: LanguageAriaLegacy;
|
1979 | oPaginate?: LanguagePaginateLegacy;
|
1980 | sEmptyTable?: string;
|
1981 | sInfo?: string;
|
1982 | sInfoEmpty?: string;
|
1983 | sInfoFiltered?: string;
|
1984 | sInfoPostFix?: string;
|
1985 | sInfoThousands?: string;
|
1986 | sLengthMenu?: string;
|
1987 | sLoadingRecords?: string;
|
1988 | sProcessing?: string;
|
1989 | sSearch?: string;
|
1990 | sUrl?: string;
|
1991 | sZeroRecords?: string;
|
1992 | }
|
1993 |
|
1994 | interface LanguageAriaLegacy {
|
1995 | sSortAscending?: string;
|
1996 | sSortDescending?: string;
|
1997 | }
|
1998 |
|
1999 | interface LanguagePaginateLegacy {
|
2000 | sFirst?: string;
|
2001 | sLast?: string;
|
2002 | sNext?: string;
|
2003 | sPrevious?: string;
|
2004 | }
|
2005 |
|
2006 |
|
2007 |
|
2008 |
|
2009 | interface ExtSettings {
|
2010 | aTypes: any[];
|
2011 | afnFiltering: any[];
|
2012 | afnSortData: object;
|
2013 | aoFeatures: any[];
|
2014 | builder: string;
|
2015 | classes: ExtClassesSettings;
|
2016 | errMode: string;
|
2017 | feature: any[];
|
2018 | fnVersionCheck(version: string): string;
|
2019 | iApiIndex: number;
|
2020 | internal: object;
|
2021 | legacy: object;
|
2022 | oApi: object;
|
2023 | oJUIClasses: object;
|
2024 | oPagination: object;
|
2025 | oSort: object;
|
2026 | oStdClasses: ExtClassesSettings;
|
2027 | ofnSearch: object;
|
2028 | order: object;
|
2029 | pager: object;
|
2030 | renderer: object;
|
2031 | sVersion: string;
|
2032 | search: any[];
|
2033 | selector: object;
|
2034 | |
2035 |
|
2036 |
|
2037 | type: ExtTypeSettings;
|
2038 | }
|
2039 |
|
2040 | interface ExtClassesSettings {
|
2041 | |
2042 |
|
2043 |
|
2044 |
|
2045 | sTable?: string;
|
2046 |
|
2047 | |
2048 |
|
2049 |
|
2050 |
|
2051 | sNoFooter?: string;
|
2052 |
|
2053 | |
2054 |
|
2055 |
|
2056 |
|
2057 | sPageButton?: string;
|
2058 |
|
2059 | |
2060 |
|
2061 |
|
2062 |
|
2063 | sPageButtonActive?: string;
|
2064 |
|
2065 | |
2066 |
|
2067 |
|
2068 |
|
2069 | sPageButtonDisabled?: string;
|
2070 |
|
2071 | |
2072 |
|
2073 |
|
2074 |
|
2075 | sStripeOdd?: string;
|
2076 |
|
2077 | |
2078 |
|
2079 |
|
2080 |
|
2081 | sStripeEven?: string;
|
2082 |
|
2083 | |
2084 |
|
2085 |
|
2086 |
|
2087 | sRowEmpty?: string;
|
2088 |
|
2089 | |
2090 |
|
2091 |
|
2092 |
|
2093 | sWrapper?: string;
|
2094 |
|
2095 | |
2096 |
|
2097 |
|
2098 |
|
2099 | sFilter?: string;
|
2100 |
|
2101 | |
2102 |
|
2103 |
|
2104 |
|
2105 | sInfo?: string;
|
2106 |
|
2107 | |
2108 |
|
2109 |
|
2110 |
|
2111 | sPaging?: string;
|
2112 |
|
2113 | |
2114 |
|
2115 |
|
2116 |
|
2117 | sLength?: string;
|
2118 |
|
2119 | |
2120 |
|
2121 |
|
2122 |
|
2123 | sProcessing?: string;
|
2124 |
|
2125 | |
2126 |
|
2127 |
|
2128 |
|
2129 | sSortAsc?: string;
|
2130 |
|
2131 | |
2132 |
|
2133 |
|
2134 |
|
2135 | sSortDesc?: string;
|
2136 |
|
2137 | |
2138 |
|
2139 |
|
2140 |
|
2141 | sSortable?: string;
|
2142 |
|
2143 | |
2144 |
|
2145 |
|
2146 |
|
2147 | sSortableAsc?: string;
|
2148 |
|
2149 | |
2150 |
|
2151 |
|
2152 |
|
2153 | sSortableDesc?: string;
|
2154 |
|
2155 | |
2156 |
|
2157 |
|
2158 |
|
2159 | sSortableNone?: string;
|
2160 |
|
2161 | |
2162 |
|
2163 |
|
2164 |
|
2165 | sSortColumn?: string;
|
2166 |
|
2167 | sFilterInput?: string;
|
2168 | sLengthSelect?: string;
|
2169 |
|
2170 | |
2171 |
|
2172 |
|
2173 |
|
2174 | sScrollWrapper?: string;
|
2175 |
|
2176 | |
2177 |
|
2178 |
|
2179 |
|
2180 | sScrollHead?: string;
|
2181 |
|
2182 | |
2183 |
|
2184 |
|
2185 |
|
2186 | sScrollHeadInner?: string;
|
2187 |
|
2188 | |
2189 |
|
2190 |
|
2191 |
|
2192 | sScrollBody?: string;
|
2193 |
|
2194 | |
2195 |
|
2196 |
|
2197 |
|
2198 | sScrollFoot?: string;
|
2199 |
|
2200 | |
2201 |
|
2202 |
|
2203 |
|
2204 | sScrollFootInner?: string;
|
2205 |
|
2206 | sHeaderTH?: string;
|
2207 | sFooterTH?: string;
|
2208 | sSortJUIAsc?: string;
|
2209 | sSortJUIDesc?: string;
|
2210 | sSortJUI?: string;
|
2211 | sSortJUIAscAllowed?: string;
|
2212 | sSortJUIDescAllowed?: string;
|
2213 | sSortJUIWrapper?: string;
|
2214 | sSortIcon?: string;
|
2215 | sJUIHeader?: string;
|
2216 | sJUIFooter?: string;
|
2217 | }
|
2218 |
|
2219 |
|
2220 | interface ExtTypeSettings {
|
2221 | |
2222 |
|
2223 |
|
2224 |
|
2225 |
|
2226 | detect: FunctionExtTypeSettingsDetect[];
|
2227 | |
2228 |
|
2229 |
|
2230 |
|
2231 |
|
2232 |
|
2233 | order: object;
|
2234 | |
2235 |
|
2236 |
|
2237 |
|
2238 |
|
2239 |
|
2240 |
|
2241 |
|
2242 |
|
2243 | search: object;
|
2244 | }
|
2245 |
|
2246 | |
2247 |
|
2248 |
|
2249 |
|
2250 | type FunctionExtTypeSettingsDetect = (data: any, settings: Settings) => (string | null);
|
2251 | }
|