Add TypeScript definition

Resolve #552.
This commit is contained in:
Hyunje Jun 2016-10-18 12:58:42 +09:00
parent 0deb4c9bc7
commit fad7f8b4a6
2 changed files with 30 additions and 0 deletions

View File

@ -54,6 +54,7 @@
"jquery": "npm:jquery"
}
},
"typings": "perfect-scrollbar.d.ts",
"scripts": {
"test": "gulp",
"before-deploy": "gulp && gulp compress",

29
perfect-scrollbar.d.ts vendored Normal file
View File

@ -0,0 +1,29 @@
interface PerfectScrollbarOptions {
wheelSpeed?: number;
wheelPropagation?: boolean;
swipePropagation?: boolean;
minScrollbarLength?: number;
maxScrollbarLength?: number;
useBothWheelAxes?: boolean;
useKeyboard?: boolean;
suppressScrollX?: boolean;
suppressScrollY?: boolean;
scrollXMarginOffset?: number;
scrollYMarginOffset?: number;
}
interface PerfectScrollbar {
initialize(container: HTMLElement, options?: PerfectScrollbarOptions);
update(container: HTMLElement);
destroy(container: HTMLElement);
}
interface JQuery {
perfectScrollbar(options?: PerfectScrollbarOptions): JQuery;
}
declare var ps: PerfectScrollbar;
declare module "perfect-scrollbar" {
export = ps;
}