// Type definitions for jquery-datatables-checkboxes
// Project: https://www.gyrocode.com/projects/jquery-datatables-checkboxes/
///
import DataTables, {Api} from 'datatables.net';
export default DataTables;
declare module 'datatables.net' {
interface ConfigColumns {
/**
* Checkboxes plugin options
*/
checkboxes?: boolean | ConfigColumnsCheckboxes;
}
interface ConfigColumnsCheckboxes {
/**
* Enable / disable checkbox state loading/saving if state saving is enabled globally.
*/
stateSave?: boolean;
/**
* Enable / disable row selection.
*/
selectRow?: boolean;
/**
* Enable / disable "select all" control in the header.
*/
selectAll?: boolean;
/**
* Enable / disable ability to select checkboxes from all pages.
*/
selectAllPages?: boolean;
/**
* Checkbox select/deselect callback.
*/
selectCallback?: FunctionCheckboxesSelectCallback;
/**
* "Select all" control select/deselect callback.
*/
selectAllCallback?: FunctionCheckboxesSelectCallback;
/**
* "Select all" control markup.
*/
selectAllRender?: string
}
interface ApiCellMethods {
checkboxes?: ApiCellCheckboxes
}
interface ApiCellsMethods {
checkboxes?: ApiCellsCheckboxes
}
interface ApiColumnMethods {
checkboxes?: ApiColumnCheckboxes
}
interface ApiColumnsMethods {
checkboxes?: ApiColumnsCheckboxes
}
interface ApiCellCheckboxes extends Omit, 'render'> {
/**
* Checks a checkbox in a cell.
*/
select(state?: boolean): Api;
/**
* Unchecks a checkbox in a cell.
*/
deselect(state?: boolean): Api;
/**
* Enables a checkbox in a cell.
*/
enable(state?: boolean): Api;
/**
* Disables a checkbox in a cell.
*/
disable(state?: boolean): Api;
}
interface ApiCellsCheckboxes extends Omit, 'render'> {
/**
* Checks a checkbox in multiple cells.
*/
select(state?: boolean): Api;
/**
* Unchecks a checkbox in multiple cells.
*/
deselect(state?: boolean): Api;
/**
* Enables a checkbox in multiple cells.
*/
enable(state?: boolean): Api;
/**
* Disables a checkbox in multiple cells.
*/
disable(state?: boolean): Api;
}
interface ApiColumnCheckboxes {
/**
* Checks checkboxes in a column.
*/
select(state?: boolean): Api;
/**
* Unchecks checkboxes in a column.
*/
deselect(state?: boolean): Api;
/**
* Unchecks all checkboxes in a column.
*/
deselectAll(): Api;
/**
* Retrieves data for selected checkboxes in a column.
*/
selected(): Api;
}
interface ApiColumnsCheckboxes {
/**
* Checks checkboxes in multiple columns.
*/
select(state?: boolean): Api;
/**
* Unchecks checkboxes in multiple columns.
*/
deselect(state?: boolean): Api;
/**
* Unchecks all checkboxes in multiple columns.
*/
deselectAll(): Api;
/**
* Retrieves data for selected checkboxes in multiple columns.
*/
selected(): Api;
}
}
type FunctionCheckboxesSelectCallback = (nodes: Node[], selected: boolean) => void;
type FunctionCheckboxesSelectAllCallback = (nodes: Node[], selected: boolean, indeterminate: boolean) => void;