var $;
var dataTable;
export function setJQuery(jq) {
$ = jq;
dataTable = jq.fn.dataTable;
}
var StateRestore = /** @class */ (function () {
function StateRestore(settings, opts, identifier, state, isPreDefined, successCallback) {
if (state === void 0) { state = undefined; }
if (isPreDefined === void 0) { isPreDefined = false; }
if (successCallback === void 0) { successCallback = function () { return null; }; }
// Check that the required version of DataTables is included
if (!dataTable || !dataTable.versionCheck || !dataTable.versionCheck('1.10.0')) {
throw new Error('StateRestore requires DataTables 1.10 or newer');
}
// Check that Select is included
// eslint-disable-next-line no-extra-parens
if (!dataTable.Buttons) {
throw new Error('StateRestore requires Buttons');
}
var table = new dataTable.Api(settings);
this.classes = $.extend(true, {}, StateRestore.classes);
// Get options from user
this.c = $.extend(true, {}, StateRestore.defaults, opts);
this.s = {
dt: table,
identifier: identifier,
isPreDefined: isPreDefined,
savedState: null,
tableId: state && state.stateRestore ? state.stateRestore.tableId : undefined
};
this.dom = {
background: $('
'),
closeButton: $('×
'),
confirmation: $(''),
confirmationButton: $('