Skip to content

Commit

Permalink
- Created package.json (for npm)
Browse files Browse the repository at this point in the history
- Added TS typings
- Added missing onResizeStart to readme.md
  • Loading branch information
Daniel Hobi committed Feb 10, 2022
1 parent ad2d1c2 commit ca44a14
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
32 changes: 32 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "datatables.net-colresize-unofficial",
"version": "1.6.1",
"description": "Plugin to resize columns by mouse drag or touch.",
"main": "./jquery.dataTables.colResize.js",
"types": "./types.d.ts",
"files": [
"jquery.dataTables.colResize.js",
"jquery.dataTables.colResize.css",
"types.d.ts"
],
"repository": {
"type": "git",
"url": "git+https://github.com/dhobi/datatables.colResize.git"
},
"keywords": [],
"dependencies": {
"datatables.net": ">=1.10.9",
"jquery": ">=1.7"
},
"moduleType": [
"globals",
"amd",
"node"
],
"author": "Daniel Hobi",
"license": "MIT",
"bugs": {
"url": "https://github.com/dhobi/datatables.colResize/issues"
},
"homepage": "https://github.com/dhobi/datatables.colResize#readme"
}
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ colResize = {
minBoundClass: 'dt-colresizable-bound-min',
maxBoundClass: 'dt-colresizable-bound-max',
isResizable: function(column) { return true; },
onResizeStart: function(column, columns) {},
onResize: function(column) {},
onResizeEnd: function(column, columns) {},
getMinWidthOf: function($thNode) {}
Expand Down
29 changes: 29 additions & 0 deletions types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/// <reference types="jquery" />
/// <reference types="datatables.net"/>

declare namespace DataTables {
interface Settings {
colResize?: ColResizeSettings;
}

interface ColResizeSettings {
isEnabled?: boolean;
hoverClass?: string;
hasBoundCheck?: boolean;
minBoundClass?: string;
maxBoundClass?: string;
isResizable?: (column : ColumnLegacy) => boolean;
onResizeStart?: (column: ColumnLegacy, columns : (ColumnLegacy)[]) => void;
onResize?: (column: ColumnLegacy) => void;
onResizeEnd?: (column: ColumnLegacy, columns : (ColumnLegacy)[]) => void;
getMinWidthOf?: ($thNode : JQuery<HTMLTableCellElement>) => number;
}

interface Api {
colResize: {
enable(): Api;
disable(): Api;
reset(): Api;
};
}
}

0 comments on commit ca44a14

Please sign in to comment.