forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
datatables-buttons.d.ts
118 lines (98 loc) · 2.91 KB
/
datatables-buttons.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
// Type definitions for JQuery DataTables Buttons extension 1.1.0
// Project: http://datatables.net/extensions/buttons/
// Definitions by: Sam Germano <https://github.com/SammyG4Free>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="../jquery.dataTables/jquery.dataTables.d.ts"/>
declare namespace DataTables {
export interface Settings {
/**
* Buttons extension options
*/
buttons?: boolean | string[] | ButtonSettings[];
}
//#region "button-settings"
/**
* Buttons extension options
*/
export interface ButtonSettings {
/**
* Action to take when the button is activated
*/
action?: FunctionButtonAction;
/**
* Ensure that any requirements have been satisfied before initialising a button
*/
available?: FunctionButtonAvailable;
/**
* Set the class name for the button
*/
className?: string;
/**
* Function that is called when the button is destroyed
*/
destroy?: FunctionButtonInit;
/**
* Set a button's initial enabled state
*/
enabled?: boolean;
/**
* Define which button type the button should be based on
*/
extend?: string;
/**
* Initialisation function that can be used to add events specific to this button
*/
init?: FunctionButtonInit;
/**
* Define an activation key for a button
*/
key?: string | ButtonKey;
/**
* Set a name for each selection
*/
name?: string;
/**
* Unique namespace for every button
*/
namespace?: string;
/**
* The text to show in the button
*/
text?: string | ButtonText;
/**
* Button 'title' attribute text
*/
titleAttr?: string;
exportOptions?: ButtonExportOptions;
autoPrint?: boolean;
customize?: FunctionButtonCustomize;
}
export interface FunctionButtonAvailable {
(dt: DataTables.DataTable, config: any): boolean
}
export interface ButtonExportOptions {
columns?: string;
}
export interface ButtonKey {
key?: string;
shiftKey?: boolean;
altKey?: boolean;
ctrlKey?: boolean;
metaKey?: boolean;
}
export interface ButtonText {
(dt: DataTables.DataTable, node: JQuery, config: any): string
}
export interface FunctionButtonInit {
(dt: DataTables.DataTable, node: JQuery, config: any): void
}
// api object?
export interface FunctionButtonAction {
(e: any, dt: DataTables.DataTable, node: JQuery, config: any): void
}
export interface FunctionButtonCustomize {
(win: Window): void
}
//#endregion "button-settings
}