forked from DataTables/RowGroup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.d.ts
More file actions
105 lines (89 loc) · 2.83 KB
/
types.d.ts
File metadata and controls
105 lines (89 loc) · 2.83 KB
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
// Type definitions for datatables.net-rowgroup 1.0
// Project: https://datatables.net/extensions/rowgroup/, https://datatables.net
// Definitions by: Matthieu Tabuteau <https://github.com/maixiu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
/// <reference types="jquery" />
/// <reference types="datatables.net"/>
declare namespace DataTables {
interface Settings {
/**
* RowGroup extension options
*/
rowGroup?: boolean | RowGroupSettings;
}
interface StaticFunctions {
RowGroup: RowGroupStaticFunctions;
}
interface RowGroupStaticFunctions {
new (dt: Api<any>, settings: boolean | RowGroupSettings): undefined;
version: string;
defaults: RowGroupSettings;
}
interface Api<T> {
rowGroup(): RowGroupApi;
}
interface RowGroupApi {
/**
* Get the data source for the row grouping
*
* @returns Data source property
*/
dataSrc(): number | string;
/**
* Set the data source for the row grouping
*
* @param prop Data source property
* @returns DataTables Api instance
*/
dataSrc(prop: number|string): Api<any>;
/**
* Disable RowGroup's interaction with the table
*
* @returns DataTables API instance
*/
disable(): Api<any>;
/**
* Enable or disable RowGroup's interaction with the table
*
* @param enable Either enables or disables RowGroup depending on the value of the flag
* @returns DataTables Api instance
*/
enable(enable?: boolean): Api<any>;
/**
* Get the enabled state for RowGroup.
*
* @returns true if enabled, false otherwise
*/
enabled(): boolean;
}
/**
* RowGroup extension options
*/
interface RowGroupSettings {
/**
* Set the class name to be used for the grouping rows
*/
className?: string;
/**
* Set the data point to use as the grouping data source
*/
dataSrc?: number|string;
/**
* Provides the ability to disable row grouping at initialisation
*/
enable?: boolean;
/**
* Set the class name to be used for the grouping end rows
*/
endClassName?: string;
/**
* Provide a function that can be used to control the data shown in the end grouping row
*/
endRender?: (rows: Api<any>, group: string) => string|HTMLElement|JQuery;
/**
* Provide a function that can be used to control the data shown in the start grouping row
*/
startRender?: (rows: Api<any>, group: string) => string|HTMLElement|JQuery;
}
}