adding type definition for datatables.net rowreorder extension (#18414)

This commit is contained in:
Vincent Biret
2017-07-26 08:39:58 -07:00
committed by Andy
parent 83f69077f4
commit 3587969e97
4 changed files with 90 additions and 0 deletions
@@ -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
View File
@@ -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": {
}
}