Skip to content

Commit ca44a14

Browse files
author
Daniel Hobi
committed
- Created package.json (for npm)
- Added TS typings - Added missing onResizeStart to readme.md
1 parent ad2d1c2 commit ca44a14

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "datatables.net-colresize-unofficial",
3+
"version": "1.6.1",
4+
"description": "Plugin to resize columns by mouse drag or touch.",
5+
"main": "./jquery.dataTables.colResize.js",
6+
"types": "./types.d.ts",
7+
"files": [
8+
"jquery.dataTables.colResize.js",
9+
"jquery.dataTables.colResize.css",
10+
"types.d.ts"
11+
],
12+
"repository": {
13+
"type": "git",
14+
"url": "git+https://github.com/dhobi/datatables.colResize.git"
15+
},
16+
"keywords": [],
17+
"dependencies": {
18+
"datatables.net": ">=1.10.9",
19+
"jquery": ">=1.7"
20+
},
21+
"moduleType": [
22+
"globals",
23+
"amd",
24+
"node"
25+
],
26+
"author": "Daniel Hobi",
27+
"license": "MIT",
28+
"bugs": {
29+
"url": "https://github.com/dhobi/datatables.colResize/issues"
30+
},
31+
"homepage": "https://github.com/dhobi/datatables.colResize#readme"
32+
}

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ colResize = {
4242
minBoundClass: 'dt-colresizable-bound-min',
4343
maxBoundClass: 'dt-colresizable-bound-max',
4444
isResizable: function(column) { return true; },
45+
onResizeStart: function(column, columns) {},
4546
onResize: function(column) {},
4647
onResizeEnd: function(column, columns) {},
4748
getMinWidthOf: function($thNode) {}

types.d.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/// <reference types="jquery" />
2+
/// <reference types="datatables.net"/>
3+
4+
declare namespace DataTables {
5+
interface Settings {
6+
colResize?: ColResizeSettings;
7+
}
8+
9+
interface ColResizeSettings {
10+
isEnabled?: boolean;
11+
hoverClass?: string;
12+
hasBoundCheck?: boolean;
13+
minBoundClass?: string;
14+
maxBoundClass?: string;
15+
isResizable?: (column : ColumnLegacy) => boolean;
16+
onResizeStart?: (column: ColumnLegacy, columns : (ColumnLegacy)[]) => void;
17+
onResize?: (column: ColumnLegacy) => void;
18+
onResizeEnd?: (column: ColumnLegacy, columns : (ColumnLegacy)[]) => void;
19+
getMinWidthOf?: ($thNode : JQuery<HTMLTableCellElement>) => number;
20+
}
21+
22+
interface Api {
23+
colResize: {
24+
enable(): Api;
25+
disable(): Api;
26+
reset(): Api;
27+
};
28+
}
29+
}

0 commit comments

Comments
 (0)