Skip to content

Commit a4497b2

Browse files
committed
9272f0a5e26e4a21dab2a5d02a21ee486856a80a
Sync to source repo @9272f0a5e26e4a21dab2a5d02a21ee486856a80a
1 parent 3551f1a commit a4497b2

4 files changed

Lines changed: 150 additions & 6 deletions

File tree

datatables.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
"types/types.d.ts"
1515
],
1616
"src-repo": "http://github.com/DataTables/StateRestore",
17-
"last-tag": "1.1.1"
18-
}
17+
"last-tag": "1.1.1",
18+
"last-sync": "9272f0a5e26e4a21dab2a5d02a21ee486856a80a"
19+
}

js/stateRestore.jqueryui.min.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/stateRestore.jqueryui.min.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
/*! Bootstrap integration for DataTables' StateRestore
2+
* © SpryMedia Ltd - datatables.net/license
3+
*/
14
import DataTable from"";$.extend(!0,DataTable.StateRestoreCollection.classes,{checkBox:"dtsr-check-box form-check-input",checkLabel:"dtsr-check-label form-check-label",checkRow:"dtsr-check-row form",creationButton:"dtsr-creation-button ui-button ui-corner-all ui-widget",creationForm:"dtsr-creation-form modal-body",creationText:"dtsr-creation-text modal-header",creationTitle:"dtsr-creation-title modal-title",nameInput:"dtsr-name-input form-control",nameLabel:"dtsr-name-label form-label",nameRow:"dtsr-name-row medium-6 cell"}),$.extend(!0,DataTable.StateRestore.classes,{confirmationButton:"dtsr-confirmation-button ui-button ui-state-default ui-button-text-only ui-corner-all ui-widget"});export default DataTable;

types/types.d.ts

Lines changed: 141 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,144 @@
1+
// Type definitions for DataTables StateRestore
2+
//
3+
// Project: https://datatables.net/extensions/StateRestore/, https://datatables.net
14

2-
// Dist-DataTables-StateRestore-jQueryUI integration with jQueryUI exports the DataTables API having
3-
// set default values to complete the ingeration.
4-
import Api from "datatables.net";
5+
/// <reference types="jquery" />
56

6-
export default Api;
7+
import DataTables, {Api} from 'datatables.net';
8+
import * as stateRestoreCollectionType from './StateRestoreCollection';
9+
import * as stateRestoreType from './StateRestore';
710

11+
export default DataTables;
12+
13+
type DeepPartial<T> = T extends object ? {
14+
[P in keyof T]?: DeepPartial<T[P]>;
15+
} : T;
16+
17+
18+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
19+
* DataTables' types integration
20+
*/
21+
declare module 'datatables.net' {
22+
interface Config {
23+
/**
24+
* StateRestore extension options
25+
*/
26+
stateRestore?: boolean | string[] | ConfigStateRestore | ConfigStateRestore[];
27+
}
28+
29+
interface ConfigLanguage {
30+
/**
31+
* StateRestore language options
32+
*/
33+
stateRestore?: ConfigStateRestoreLanguage;
34+
}
35+
36+
interface Api<T> {
37+
/**
38+
* StateRestore API Methods
39+
*/
40+
stateRestore: ApiStateRestore<T>;
41+
}
42+
43+
interface ApiStatic {
44+
/**
45+
* StateRestore class
46+
*/
47+
StateRestore: {
48+
/**
49+
* Create a new StateRestore instance for the target DataTable
50+
*/
51+
new (dt: Api<any>, settings: string[] | ConfigStateRestore | ConfigStateRestore[]);
52+
53+
/**
54+
* StateRestore version
55+
*/
56+
version: string;
57+
58+
/**
59+
* Default configuration values
60+
*/
61+
defaults: ConfigStateRestore;
62+
}
63+
}
64+
}
65+
66+
67+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
68+
* Options
69+
*/
70+
interface ConfigStateRestore extends Partial<stateRestoreCollectionType.IDefaults> {}
71+
72+
interface ConfigStateRestoreLanguage extends DeepPartial<stateRestoreCollectionType.II18n> {}
73+
74+
75+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
76+
* API
77+
*/
78+
79+
interface ApiStateRestore<T> {
80+
/**
81+
* Creates a new state, adding it to the collection.
82+
*
83+
* @param identifier The identifier that is to be used for the new state
84+
*
85+
* @returns DatatTables Api for chaining
86+
*/
87+
addState(identifier: string): void | Api<T>;
88+
89+
/**
90+
* Retrieves a state from the collection.
91+
*
92+
* @param identifier The identifier of the state that is to be retrieved.
93+
*
94+
* @returns StateRestore instance, or further api methods.
95+
*/
96+
state(identifier: string): stateRestoreType.default | null | StateRestoreSubApi<T>;
97+
98+
/**
99+
* Retrieves all of the states from the collection.
100+
*
101+
* @returns An array of the StateRestore instances,
102+
* or further api methods that are applicable to multiple states.
103+
*/
104+
states(): stateRestoreType.default[] | StateRestoreMultiSubApi<T>;
105+
}
106+
107+
interface StateRestoreSubApi<T> extends Api<T> {
108+
/**
109+
* Removes the state previously identified in the call to `state()`.
110+
*
111+
* @returns Datatables Api for chaining.
112+
*/
113+
remove(): Api<T>;
114+
115+
/**
116+
* Loads the state previously identified in the call to `state()` into the table.
117+
*
118+
* @returns Datatables Api for chaining.
119+
*/
120+
load(): Api<T>;
121+
122+
/**
123+
* Renames the state previously identified in the call to `state()`.
124+
*
125+
* @returns Datatables Api for chaining.
126+
*/
127+
rename(): Api<T>;
128+
129+
/**
130+
* Saves the state previously identified in the call to `state()`.
131+
*
132+
* @returns Datatables Api for chaining.
133+
*/
134+
save(): Api<T>;
135+
}
136+
137+
interface StateRestoreMultiSubApi<T> extends Api<T> {
138+
/**
139+
* Removes all of the states that were previously identified in the call to `states()`.
140+
*
141+
* @returns Datatables Api for chaining.
142+
*/
143+
remove(): Api<T>;
144+
}

0 commit comments

Comments
 (0)