forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.dataTables.d.ts
executable file
·1835 lines (1512 loc) · 51.6 KB
/
jquery.dataTables.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for JQuery DataTables 1.10.5
// Project: http://www.datatables.net
// Definitions by: Kiarash Ghiaseddin <https://github.com/Silver-Connection/DefinitelyTyped>, Omid Rad <https://github.com/omidkrad>, Armin Sander <https://github.com/pragmatrix/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// missing:
// - Static methods that are defined in JQueryStatic.fn are not typed.
// - Plugin and extension definitions are not typed.
// - Some return types are not fully wokring
/// <reference path="../jquery/jquery.d.ts"/>
interface JQuery {
DataTable(param?: DataTables.Settings): DataTables.DataTable;
}
//TODO: Wrong, as jquery.d.ts has no interface for fn
//interface JQueryStatic {
// dataTable: DataTables.StaticFunctions;
//}
declare module DataTables {
export interface DataTable extends DataTableCore {
/**
* Get the data for the whole table.
*/
data(): DataTable;
/**
* Order Methods / Object
*/
order: OrderMethods;
//#region "Cell/Cells"
/**
* Select the cell found by a cell selector
*
* @param cellSelector Cell selector.
* @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
*/
cell(cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], modifier?: ObjectSelectorModifier): CellMethods;
/**
* Select the cell found by a cell selector
*
* @param rowSelector Row selector.
* @param cellSelector Cell selector.
* @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
*/
cell(rowSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], modifier?: ObjectSelectorModifier): CellMethods;
/**
* Select all cells
*
* @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
*/
cells(modifier?: ObjectSelectorModifier): CellsMethods;
/**
* Select cells found by a cell selector
*
* @param cellSelector Cell selector.
* @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
*/
cells(cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], modifier?: ObjectSelectorModifier): CellsMethods;
/**
* Select cells found by both row and column selectors
*
* @param rowSelector Row selector.
* @param cellSelector Cell selector.
* @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
*/
cells(rowSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], modifier?: ObjectSelectorModifier): CellsMethods;
//#endregion "Cell/Cells"
//#region "Column/Columns"
/**
* Column Methods / Object
*/
column: ColumnMethodsModel;
/**
* Columns Methods / Object
*/
columns: ColumnsMethodsModel;
//#endregion "Column/Columns"
//#region "Row/Rows"
/**
* Row Methode / Object
*/
row: RowMethodsModel
/**
* Rows Methods / Object
*/
rows: RowsMethodsModel
//#endregion "Row/Rows"
//#region "Table/Tables"
/**
* Select a table based on a selector from the API's context
*
* @param tableSelector Table selector.
*/
table(tableSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[]): TableMethods;
/**
* Select all tables
*/
tables(): TablesMethods;
/**
* Select tables based on the given selector
*
* @param tableSelector Table selector.
*/
tables(tableSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[]): TablesMethods;
//#endregion "Table/Tables"
}
export interface DataTables extends DataTableCore {
[index: number]: DataTable;
}
interface ObjectSelectorModifier {
/**
* The order modifier provides the ability to control which order the rows are processed in.
* Values: 'current', 'applied', 'index', 'original'
*/
order?: string;
/**
* The search modifier provides the ability to govern which rows are used by the selector using the search options that are applied to the table.
* Values: 'none', 'applied', 'removed'
*/
search?: string;
/**
* The page modifier allows you to control if the selector should consider all data in the table, regardless of paging, or if only the rows in the currently disabled page should be used.
* Values: 'all', 'current'
*/
page?: string;
}
//#region "Namespaces"
//#region "core-methods"
interface DataTableCore extends UtilityMethods {
/**
* Get jquery object
*/
$(selector: string | Node | Node[]| JQuery, modifier?: ObjectSelectorModifier): JQuery;
///// Almost identical to $ in operation, but in this case returns the data for the matched rows.
//_(selector: string | Node | Node[] | JQuery, modifier?: ObjectSelectorModifier): JQuery;
/**
* Ajax Methods
*/
ajax: AjaxMethodModel;
/**
* Clear the table of all data.
*/
clear(): DataTable;
/**
* Destroy the DataTables in the current context.
*
* @param remove Completely remove the table from the DOM (true) or leave it in the DOM in its original plain un-enhanced HTML state (default, false).
*/
destroy(remove?: boolean): DataTable;
/**
* Redraw the table.
*
* @param reset Reset (default) or hold the current paging position. A full re-sort and re-filter is performed when this method is called, which is why the pagination reset is the default action.
*/
draw(reset?: boolean): DataTable;
/**
* Table events removal.
*
* @param event Event name to remove.
* @param callback Specific callback function to remove if you want to unbind a single event listener.
*/
off(event: string, callback?: Function): DataTable;
/**
* Table events listener.
*
* @param event Event to listen for.
* @param callback Specific callback function to remove if you want to unbind a single event listener.
*/
on(event: string, callback: Function): DataTable;
/**
* Listen for a table event once and then remove the listener.
*
* @param event Event to listen for.
* @param callback Specific callback function to remove if you want to unbind a single event listener.
*/
one(event: string, callback: Function): DataTable;
/**
* Page Methods / Object
*/
page: PageMethods;
/**
* Get current search
*/
search(): string;
/**
* Search for data in the table.
*
* @param input Search string to apply to the table.
* @param regex Treat as a regular expression (true) or not (default, false).
* @param smart Perform smart search.
* @param caseInsen Do case-insensitive matching (default, true) or not (false).
*/
search(input: string, regex?: boolean, smart?: boolean, caseInsen?: boolean): DataTable;
/**
* Obtain the table's settings object
*/
settings(): DataTable;
/**
* Page Methods / Object
*/
state: StateMethods;
}
//#region "ajax-methods"
interface AjaxMethods extends DataTable {
/**
* Reload the table data from the Ajax data source.
*
* @param callback Function which is executed when the data as been reloaded and the table fully redrawn.
* @param resetPaging Reset (default action or true) or hold the current paging position (false).
*/
load(callback?: Function, resetPaging?: boolean): DataTable;
}
interface AjaxMethodModel {
/**
* Get the latest JSON data obtained from the last Ajax request DataTables made
*/
json(): Object;
/**
* Get the data submitted by DataTables to the server in the last Ajax request
*/
params(): Object;
/**
* Reload the table data from the Ajax data source.
*
* @param callback Function which is executed when the data as been reloaded and the table fully redrawn.
* @param resetPaging Reset (default action or true) or hold the current paging position (false).
*/
reload(callback?: Function, resetPaging?: boolean): DataTable;
/**
* Reload the table data from the Ajax data source
*/
url(): string;
/**
* Reload the table data from the Ajax data source
*
* @param url URL to set to be the Ajax data source for the table.
*/
url(url: string): AjaxMethods;
}
//#endregion "ajax-methods"
//#region "order-methods"
interface OrderMethods {
/**
* Get the ordering applied to the table.
*/
(): (string | number)[][];
/**
* Set the ordering applied to the table.
*
* @param order Order Model
*/
(order?: (string | number)[]): DataTable;
(order?: (string | number)[][]): DataTable;
(order: (string | number)[], ...args: any[]): DataTable;
/**
* Add an ordering listener to an element, for a given column.
*
* @param node Selector
* @param column Column index
* @param callback Callback function
*/
listener(node: string | Node | JQuery, column: number, callback: Function): DataTable;
}
//#endregion "order-methods"
//#region "page-methods"
interface PageMethods {
/**
* Get the current page of the table.
*/
(): number;
/**
* Set the current page of the table.
*
* @param page Index or 'first', 'next', 'previous', 'last'
*/
(page: number | string): DataTable;
/**
* Get paging information about the table
*/
info(): PageMethodeModelInfoReturn;
/**
* Get the table's page length.
*/
len(): number;
/**
* Set the table's page length.
*
* @param length Page length to set. use -1 to show all records.
*/
len(length: number): DataTable;
}
interface PageMethodeModelInfoReturn {
page: number;
pages: number;
start: number;
end: number;
length: number;
recordsTotal: number;
recordsDisplay: number;
}
//#endregion "page-methods"
//#region "state-methods"
interface StateMethods {
/**
* Get the last saved state of the table
*/
(): StateReturnModel;
/**
* Clear the saved state of the table.
*/
clear(): DataTable;
/**
* Get the table state that was loaded during initialisation.
*/
loaded(): StateReturnModel;
/**
* Trigger a state save.
*/
save(): DataTable;
}
interface StateReturnModel {
time: number;
start: number;
length: number;
order: (string | number)[][];
search: SearchSettings;
columns: StateReturnModelColumns[];
}
interface StateReturnModelColumns {
search: SearchSettings;
visible: boolean;
}
//#endregion "state-methods"
//#endregion "core-methods"
//#region "util-methods"
interface UtilityMethods {
/**
* Concatenate two or more API instances together
*
* @param a API instance to concatenate to the initial instance.
* @param b Additional API instance(s) to concatenate to the initial instance.
*/
concat(a: Object, ...b: Object[]): DataTable;
/**
* Iterate over the contents of the API result set.
*
* @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters
*/
each(fn: Function): DataTable;
/**
* Reduce an Api instance to a single context and result set.
*
* @param idx Index to select
*/
eq(idx: number): DataTable;
/**
* Iterate over the result set of an API instance and test each item, creating a new instance from those items which pass.
*
* @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters.
*/
filter(fn: Function): DataTable;
/**
* Flatten a 2D array structured API instance to a 1D array structure.
*/
flatten(): DataTable;
/**
* Find the first instance of a value in the API instance's result set.
*
* @param value Value to find in the instance's result set.
*/
indexOf(value: any): number;
/**
* Join the elements in the result set into a string.
*
* @param separator The string that will be used to separate each element of the result set.
*/
join(separator: string): string;
/**
* Find the last instance of a value in the API instance's result set.
*
* @param value Value to find in the instance's result set.
*/
lastIndexOf(value: any): number;
/**
* Number of elements in an API instance's result set.
*/
length: number;
/**
* Iterate over the result set of an API instance, creating a new API instance from the values returned by the callback.
*
* @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters.
*/
map(fn: Function): DataTable;
/**
* Iterate over the result set of an API instance, creating a new API instance from the values retrieved from the original elements.
*
* @param property Object property name to use from the element in the original result set for the new result set.
*/
pluck(property: number | string): DataTable;
/**
* Remove the last item from an API instance's result set.
*/
pop(): any;
/**
* Add one or more items to the end of an API instance's result set.
*
* @param value_1 Item to add to the API instance's result set.
*/
push(value_1: any | any[], ...value_2: any[]): number;
/**
* Apply a callback function against and accumulator and each element in the Api's result set (left-to-right).
*
* @param fn Callback function which is called for each item in the API instance result set. The callback is called with four parameters.
* @param initialValue Value to use as the first argument of the first call to the fn callback.
*/
reduce(fn: Function, initialValue?: any): any;
/**
* Apply a callback function against and accumulator and each element in the Api's result set (right-to-left).
*
* @param fn Callback function which is called for each item in the API instance result set. The callback is called with four parameters.
* @param initialValue Value to use as the first argument of the first call to the fn callback.
*/
reduceRight(fn: Function, initialValue?: any): any;
/**
* Reverse the result set of the API instance and return the original array.
*/
reverse(): DataTable;
/**
* Remove the first item from an API instance's result set.
*/
shift(): any;
/**
* Sort the elements of the API instance's result set.
*
* @param fn This is a standard Javascript sort comparison function. It accepts two parameters.
*/
sort(fn?: Function): DataTable;
/**
* Modify the contents of an Api instance's result set, adding or removing items from it as required.
*
* @param index Index at which to start modifying the Api instance's result set.
* @param howMany Number of elements to remove from the result set.
* @param value_1 Item to add to the result set at the index specified by the first parameter.
*/
splice(index: number, howMany: number, value_1?: any | any[], ...value_2: any[]): any[];
/**
* Convert the API instance to a jQuery object, with the objects from the instance's result set in the jQuery result set.
*/
to$(): JQuery;
/**
* Create a native Javascript array object from an API instance.
*/
toArray(): any[];
/**
* Convert the API instance to a jQuery object, with the objects from the instance's result set in the jQuery result set.
*/
toJQuery(): JQuery;
/**
* Create a new API instance containing only the unique items from a the elements in an instance's result set.
*/
unique(): DataTable;
/**
* Add one or more items to the start of an API instance's result set.
*
* @param value_1 Item to add to the API instance's result set.
*/
unshift(value_1: any | any[], ...value_2: any[]): number;
}
//#endregion "util-methods"
interface CommonSubMethods {
/**
* Get the DataTables cached data for the selected cell
*
* @param t Specify which cache the data should be read from. Can take one of two values: search or order
*/
cache(t: string): DataTable;
}
//#region "cell-methods"
interface CommonCellMethods extends CommonSubMethods {
/**
* Invalidate the data held in DataTables for the selected cells
*
* @param source Data source to read the new data from.
*/
invalidate(source?: string): DataTable;
/**
* Get data for the selected cell
*
* @param f Data type to get. This can be one of: 'display', 'filter', 'sort', 'type'
*/
render(t: string): any;
}
interface CellMethods extends DataTableCore, CommonCellMethods {
/**
* Get data for the selected cell
*/
data(): any;
/**
* Get data for the selected cell
*
* @param data Value to assign to the data for the cell
*/
data(data: any): DataTable;
/**
* Get index information about the selected cell
*/
index(): CellIndexReturn;
/**
* Get the DOM element for the selected cell
*/
node(): Node;
}
interface CellIndexReturn {
row: number;
column: number;
columnVisible: number;
}
interface CellsMethods extends DataTableCore, CommonCellMethods {
/**
* Get data for the selected cells
*/
data(): DataTable;
/**
* Get index information about the selected cells
*/
indexes(): DataTable;
/**
* Get the DOM elements for the selected cells
*/
nodes(): DataTable;
}
//#endregion "cell-methods"
//#region "column-methods"
interface CommonColumnMethod extends CommonSubMethods {
/**
* Get the footer th / td cell for the selected column.
*/
footer(): any;
/**
* Get the header th / td cell for a column.
*/
header(): Node;
/**
* Order the table, in the direction specified, by the column selected by the column()DT selector.
*
* @param direction Direction of sort to apply to the selected column - desc (descending) or asc (ascending).
*/
order(direction: string): DataTable;
/**
* Get the visibility of the selected column.
*/
visible(): boolean;
/**
* Set the visibility of the selected column.
*
* @param show Specify if the column should be visible (true) or not (false).
* @param redrawCalculations Indicate if DataTables should recalculate the column layout (true - default) or not (false). Typically this would be left as the default value, but it can be useful to disable when using the method in a loop - so the calculations are performed on every call as they can hamper performance.
*/
visible(show: boolean, redrawCalculations?: boolean): DataTable;
}
interface ColumnMethodsModel {
/**
* Select the column found by a column selector
*
* @param cellSelector Cell selector.
* @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
*/
(columnSelector: any, modifier?: ObjectSelectorModifier): ColumnMethods;
/**
* Convert from the input column index type to that required.
*
* @param t The type on conversion that should take place: 'fromVisible', 'toData', 'fromData', 'toVisible'
* @param index The index to be converted
*/
index(t: string, index: number): number;
}
interface ColumnMethods extends DataTableCore, CommonColumnMethod {
/**
* Get the data for the cells in the selected column.
*/
data(): DataTable;
/**
* Get the data source property for the selected column
*/
dataSrc(): number | string | Function;
/**
* Get index information about the selected cell
*
* @param t Specify if you want to get the column data index (default) or the visible index (visible).
*/
index(t?: string): DataTable;
/**
* Obtain the th / td nodes for the selected column
*/
nodes(): DataTable[];
}
interface ColumnsMethodsModel {
/**
* Select all columns
*
* @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
*/
(modifier?: ObjectSelectorModifier): ColumnsMethods;
/**
* Select columns found by a cell selector
*
* @param cellSelector Cell selector.
* @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
*/
(columnSelector: any, modifier?: ObjectSelectorModifier): ColumnsMethods;
/**
* Recalculate the column widths for layout.
*/
adjust(): DataTable;
}
interface ColumnsMethods extends DataTableCore, CommonColumnMethod {
/**
* Obtain the data for the columns from the selector
*/
data(): DataTable;
/**
* Get the data source property for the selected columns.
*/
dataSrc(): DataTable;
/**
* Get the column indexes of the selected columns.
*
* @param t Specify if you want to get the column data index (default) or the visible index (visible).
*/
indexes(t?: string): DataTable;
/**
* Obtain the th / td nodes for the selected columns
*/
nodes(): DataTable[][];
}
//#endregion "column-methods"
//#region "row-methods"
interface CommonRowMethod extends CommonSubMethods {
/**
* Obtain the th / td nodes for the selected column
*
* @param source Data source to read the new data from. Values: 'auto', 'data', 'dom'
*/
invalidate(source?: string): DataTable;
}
interface RowChildMethodModel {
/**
* Get the child row(s) that have been set for a parent row
*/
(): JQuery;
/**
* Get the child row(s) that have been set for a parent row
*
* @param showRemove This parameter can be given as true or false
*/
(showRemove: boolean): RowChildMethods;
/**
* 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.
*
* @param data The data to be shown in the child row can be given in multiple different ways.
* @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).
*/
(data: (string | Node | JQuery) | (string | Node | JQuery)[], className?: string): RowChildMethods;
/**
* Hide the child row(s) of a parent row
*/
hide(): DataTable;
/**
* Check if the child rows of a parent row are visible
*/
isShown(): DataTable;
/**
* Remove child row(s) from display and release any allocated memory
*/
remove(): DataTable;
/**
* Show the child row(s) of a parent row
*/
show(): DataTable;
}
interface RowChildMethods extends DataTableCore {
/**
* Hide the child row(s) of a parent row
*/
hide(): DataTable;
/**
* Remove child row(s) from display and release any allocated memory
*/
remove(): DataTable;
/**
* Make newly defined child rows visible
*/
show(): DataTable;
}
interface RowMethodsModel {
/**
* Select a row found by a row selector
*
* @param rowSelector Row selector.
* @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
*/
(rowSelector: any, modifier?: ObjectSelectorModifier): RowMethods;
/**
* Add a new row to the table using the given data
*
* @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
*/
add(data: any[]| Object): DataTable;
}
interface RowMethods extends DataTableCore, CommonRowMethod {
/**
* Order Methods / Object
*/
child: RowChildMethodModel;
/**
* Get the data for the selected row
*/
data(): any[]| Object;
/**
* Set the data for the selected row
*
* @param d Data to use for the row.
*/
data(d: any[]| Object): DataTable;
/**
* Get the row index of the row column.
*/
index(): number;
/**
* Obtain the tr node for the selected row
*/
node(): Node;
/**
* Delete the selected row from the DataTable.
*/
remove(): Node;
}
interface RowsMethodsModel {
/**
* Select all rows
*
* @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
*/
(modifier?: ObjectSelectorModifier): RowsMethods;
/**
* Select rows found by a row selector
*
* @param cellSelector Row selector.
* @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account.
*/
(rowSelector: any, modifier?: ObjectSelectorModifier): RowsMethods;
/**
* Add new rows to the table using the data given
*
* @param data Array of data elements, with each one describing a new row to be added to the table
*/
add(data: any[]): DataTable;
}
interface RowsMethods extends DataTableCore, CommonRowMethod {
/**
* Get the data for the rows from the selector
*/
data(): DataTable;
/**
* Set the data for the selected row
*
* @param d Data to use for the row.
*/
data(d: any[]| Object): DataTable;
/**
* Get the row indexes of the selected rows.
*/
indexes(): DataTable;
/**
* Obtain the tr nodes for the selected rows
*/
nodes(): DataTable;
/**
* Delete the selected rows from the DataTable.
*/
remove(): DataTable;
}
//#endregion "row-methods"
//#region "table-methods"
interface TableMethods extends DataTableCore {
/**
* Get the tfoot node for the table in the API's context
*/
footer(): Node;
/**
* Get the thead node for the table in the API's context
*/
header(): Node;
/**
* Get the tbody node for the table in the API's context
*/
body(): Node;
/**
* Get the div container node for the table in the API's context
*/
container(): Node;
/**
* Get the table node for the table in the API's context
*/
node(): Node;
}
interface TablesMethods extends DataTableCore {
/**
* Get the tfoot nodes for the tables in the API's context
*/
footer(): DataTable;
/**
* Get the thead nodes for the tables in the API's context
*/
header(): DataTable;
/**
* Get the tbody nodes for the tables in the API's context
*/
body(): DataTable;
/**
* Get the div container nodes for the tables in the API's context
*/
containers(): DataTable;
/**
* Get the table nodes for the tables in the API's context
*/
nodes(): DataTable;
}
//#endregion "table-methods"
//#endregion "Namespaces"
//#region "Static-Methods"