mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 12:11:47 +00:00
adding type definition for datatables.net rowreorder extension (#18414)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
$(document).ready(() => {
|
||||
const config: DataTables.Settings = {
|
||||
// reorder extension options
|
||||
rowReorder: {
|
||||
dataSrc: "somesrc",
|
||||
editor: {},
|
||||
enable: true,
|
||||
formOptions: {},
|
||||
selector: "someselector",
|
||||
snapX: true,
|
||||
update: true,
|
||||
},
|
||||
};
|
||||
});
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
// Type definitions for JQuery DataTables RowReorder extension 1.1
|
||||
// Project: http://datatables.net/extensions/rowreorder/
|
||||
// Definitions by: Vincent Biret <https://github.com/baywet>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery" />
|
||||
/// <reference types="datatables.net"/>
|
||||
|
||||
declare namespace DataTables {
|
||||
interface Settings {
|
||||
/**
|
||||
* Enable and configure the RowReorder extension for DataTables
|
||||
*/
|
||||
rowReorder?: RowReorderSettings;
|
||||
}
|
||||
|
||||
interface RowReorderSettings {
|
||||
/**
|
||||
* Configure the data point that will be used for the reordering data
|
||||
*/
|
||||
dataSrc?: string;
|
||||
/**
|
||||
* Attach an Editor instance for database updating
|
||||
*/
|
||||
editor?: any;
|
||||
/**
|
||||
* Enable / disable RowReorder's user interaction
|
||||
*/
|
||||
enable?: boolean;
|
||||
/**
|
||||
* Set the options for the Editor form when submitting data
|
||||
*/
|
||||
formOptions?: any;
|
||||
/**
|
||||
* Define the selector used to pick the elements that will start a drag
|
||||
*/
|
||||
selector?: string;
|
||||
/**
|
||||
* Horizontal position control of the row being dragged
|
||||
*/
|
||||
snapX?: number | boolean;
|
||||
/**
|
||||
* Control automatic of data when a row is dropped
|
||||
*/
|
||||
update?: boolean;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"datatables.net-rowreorder-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user