From fad7f8b4a67cc5e97f952d7629258941838b23e5 Mon Sep 17 00:00:00 2001 From: Hyunje Jun Date: Tue, 18 Oct 2016 12:58:42 +0900 Subject: [PATCH] Add TypeScript definition Resolve #552. --- package.json | 1 + perfect-scrollbar.d.ts | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 perfect-scrollbar.d.ts diff --git a/package.json b/package.json index c8d4f2a..9545644 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "jquery": "npm:jquery" } }, + "typings": "perfect-scrollbar.d.ts", "scripts": { "test": "gulp", "before-deploy": "gulp && gulp compress", diff --git a/perfect-scrollbar.d.ts b/perfect-scrollbar.d.ts new file mode 100644 index 0000000..93e47f0 --- /dev/null +++ b/perfect-scrollbar.d.ts @@ -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; +}