forked from DataTables/KeyTable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.d.ts
128 lines (112 loc) · 4.04 KB
/
types.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
// Type definitions for datatables.net-keytable 2.5
// Project: https://datatables.net
// Definitions by: Konstantin Kuznetsov <https://github.com/Arik-neKrol>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
/// <reference types="jquery" />
/// <reference types="datatables.net"/>
declare namespace DataTables {
interface Settings {
/*
* KeyTable extension options
*/
keys?: boolean | KeyTableSettings;
}
interface KeyTableSettings {
/*
* Allow KeyTable's focus to be blurred (removed) from a table
*
* When set to true this option allows the table to lose focus (i.e. to be blurred),
* while false will not allow the table to lose focus.
*/
blurable?: boolean;
/*
* Set the class name used for the focused cell
*
* The class name to be added and removed from cells as they gain and loose focus.
*/
className?: string;
/*
* Enable / disable clipboard interaction with KeyTable
*
* A boolean flag that can optionally be used to disable KeyTables' clipboard interaction.
*/
clipboard?: boolean;
/*
* Set the orthogonal data point for the data to copy to clipboard.
*/
clipboardOrthogonal?: string;
/*
* Select the columns that can gain focus
*
* The columns that can gain focus. This accepts all of the options of column-selector
* such as class name selector, jQuery pseudo selects and column index selectors.
*/
columns?: any;
/*
* Control if editing should be activated immediately upon focus
*
* true to enable editing on focus, false to disable.
*/
editOnFocus?: boolean;
/*
* Attach an Editor instance for Excel like editing
*
* The Editor instance to use for editing of the table
*/
editor?: any;
/*
* Cell to receive initial focus in the table
*
* The cell that will receive focus when the table is initialised. This accepts all of
* the options of cell-selector such as class name selector, jQuery pseudo selects and
* cell index selectors.
*/
focus?: any;
/*
* Limit the keys that KeyTable will listen for and take action on
*
* As null KeyTable will listen for all key presses, regardless of what key is pressed.
* an array you can limit the keys that KeyTable will take action on to just the key
* codes given in the array.
*/
keys?: number[] | null;
/*
* Set the table's tab index for when it will receive focus
*
* The tab index for the table. Like all other tab indexes, this can be -1 to disallow
* tabbing into the table.
*/
tabIndex?: number;
}
interface Api {
keys: {
/**
* Disable KeyTable's interactions (mouse and keyboard)
*
* @returns DataTables API instance
*/
disable(): Api;
/**
* Enable or disable KeyTable's interactions (mouse and keyboard)
*
* @param options This option can be given as the following values: true - Fully enable KeyTable; false - Fully disable KeyTable (keys.disable()); "navigation-only" - Respond to navigation inputs only;
* @returns DataTables API instance
*/
enable(options?: string | boolean): Api;
/**
* Move the focus from the current cell to one adjacent to it.
*
* @param direction String representing the direction that the focus should move in
* @returns DataTables API instance.
*/
move(direction: string): Api;
};
}
interface CellMethods {
/*
* Focus on a cell
*/
focus(): Api;
}
}