Skip to content

Commit

Permalink
Add TypeScript definition
Browse files Browse the repository at this point in the history
Resolve #552.
  • Loading branch information
Hyunje Jun committed Oct 18, 2016
1 parent 0deb4c9 commit fad7f8b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"jquery": "npm:jquery"
}
},
"typings": "perfect-scrollbar.d.ts",
"scripts": {
"test": "gulp",
"before-deploy": "gulp && gulp compress",
Expand Down
29 changes: 29 additions & 0 deletions perfect-scrollbar.d.ts
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit fad7f8b

Please sign in to comment.