diff --git a/types/jquery.nicescroll/index.d.ts b/types/jquery.nicescroll/index.d.ts index 1b5b714cb8..8228ae5209 100644 --- a/types/jquery.nicescroll/index.d.ts +++ b/types/jquery.nicescroll/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jquery.nicescroll 3.7.6 +// Type definitions for jquery.nicescroll 3.7 // Project: https://nicescroll.areaaperta.com // Definitions by: Bohdan Stupak // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,98 +8,98 @@ declare namespace JQueryNiceScroll { interface NiceScrollPage { - maxw: number - maxh: number - width: number - height: number - w: number - h: number + maxw: number; + maxh: number; + width: number; + height: number; + w: number; + h: number; } - + interface NiceScroll { - show(): NiceScroll - hide(): NiceScroll - toggle(): NiceScroll - onResize(e?: Event, page?: NiceScrollPage): NiceScroll - resize(e?: Event, page?: NiceScrollPage): NiceScroll - remove(): void - stop(): NiceScroll - doScrollPos(x: number, y: number, spd: number): void - doScrollLeft(x: number, duration: number): void - doScrollTop(x: number, duration: number): void + show(): NiceScroll; + hide(): NiceScroll; + toggle(): NiceScroll; + onResize(e?: Event, page?: NiceScrollPage): NiceScroll; + resize(e?: Event, page?: NiceScrollPage): NiceScroll; + remove(): void; + stop(): NiceScroll; + doScrollPos(x: number, y: number, spd: number): void; + doScrollLeft(x: number, duration: number): void; + doScrollTop(x: number, duration: number): void; } - + interface NiceScrollOptions { - zindex?: "auto" | number - cursoropacitymin?: number - cursoropacitymax?: number - cursorcolor?: string - cursorwidth?: string - cursorborder?: string - cursorborderradius?: string - scrollspeed?: number - mousescrollstep?: number - touchbehavior?: boolean - emulatetouch?: boolean - hwacceleration?: boolean - usetransition?: boolean - boxzoom?: boolean - dblclickzoom?: boolean - gesturezoom?: boolean - grabcursorenabled?: boolean - autohidemode?: "leave" | "scroll" | "cursor" | "hidden" | boolean - background?: string - iframeautoresize?: boolean - cursorminheight?: number - preservenativescrolling?: boolean + zindex?: "auto" | number; + cursoropacitymin?: number; + cursoropacitymax?: number; + cursorcolor?: string; + cursorwidth?: string; + cursorborder?: string; + cursorborderradius?: string; + scrollspeed?: number; + mousescrollstep?: number; + touchbehavior?: boolean; + emulatetouch?: boolean; + hwacceleration?: boolean; + usetransition?: boolean; + boxzoom?: boolean; + dblclickzoom?: boolean; + gesturezoom?: boolean; + grabcursorenabled?: boolean; + autohidemode?: "leave" | "scroll" | "cursor" | "hidden" | boolean; + background?: string; + iframeautoresize?: boolean; + cursorminheight?: number; + preservenativescrolling?: boolean; railoffset?: boolean | { - top?: number - left?: number - } + top?: number; + left?: number; + }; railhoffset?: boolean | { - top?: number - left?: number - } - bouncescroll?: boolean - spacebarenabled?: boolean + top?: number; + left?: number; + }; + bouncescroll?: boolean; + spacebarenabled?: boolean; railpadding?: { - top: number - right: number - left: number - bottom: number - } - disableoutline?: boolean - horizrailenabled?: boolean - railalign?: "right" | "left" | "top" | "bottom" - railvalign?: "right" | "left" | "top" | "bottom" - enabletranslate3d?: boolean - enablemousewheel?: boolean - enablekeyboard?: boolean - smoothscroll?: boolean - sensitiverail?: boolean - enablemouselockapi?: boolean - cursorfixedheight?: number - directionlockdeadzone?: number - hidecursordelay?: number - nativeparentscrolling?: boolean - enablescrollonselection?: boolean - overflowx?: "auto" | "hidden" | "inherit" | "initial" | "overlay" | "scroll" | "unset" | "visible" - overflowy?: "auto" | "hidden" | "inherit" | "initial" | "overlay" | "scroll" | "unset" | "visible" - cursordragspeed?: number - rtlmode?: "auto" | boolean - cursordragontouch?: boolean - oneaxismousemode?: "auto" | boolean - scriptpath?: string - preventmultitouchscrolling?: boolean - disablemutationobserver?: boolean - enableobserver?: boolean - scrollbarid?: string - scrollCLass?: string - } + top: number; + right: number; + left: number; + bottom: number; + }; + disableoutline?: boolean; + horizrailenabled?: boolean; + railalign?: "right" | "left" | "top" | "bottom"; + railvalign?: "right" | "left" | "top" | "bottom"; + enabletranslate3d?: boolean; + enablemousewheel?: boolean; + enablekeyboard?: boolean; + smoothscroll?: boolean; + sensitiverail?: boolean; + enablemouselockapi?: boolean; + cursorfixedheight?: number; + directionlockdeadzone?: number; + hidecursordelay?: number; + nativeparentscrolling?: boolean; + enablescrollonselection?: boolean; + overflowx?: "auto" | "hidden" | "inherit" | "initial" | "overlay" | "scroll" | "unset" | "visible"; + overflowy?: "auto" | "hidden" | "inherit" | "initial" | "overlay" | "scroll" | "unset" | "visible"; + cursordragspeed?: number; + rtlmode?: "auto" | boolean; + cursordragontouch?: boolean; + oneaxismousemode?: "auto" | boolean; + scriptpath?: string; + preventmultitouchscrolling?: boolean; + disablemutationobserver?: boolean; + enableobserver?: boolean; + scrollbarid?: string; + scrollCLass?: string; + } } interface JQuery { - niceScroll(options?: JQueryNiceScroll.NiceScrollOptions) : JQueryNiceScroll.NiceScroll; - niceScroll(wrapper: string, options: JQueryNiceScroll.NiceScrollOptions) : JQueryNiceScroll.NiceScroll; - getNiceScroll(index?: number) : JQueryNiceScroll.NiceScroll; -} \ No newline at end of file + niceScroll(options?: JQueryNiceScroll.NiceScrollOptions): JQueryNiceScroll.NiceScroll; + niceScroll(wrapper: string, options: JQueryNiceScroll.NiceScrollOptions): JQueryNiceScroll.NiceScroll; + getNiceScroll(index?: number): JQueryNiceScroll.NiceScroll; +} diff --git a/types/jquery.nicescroll/jquery.nicescroll-tests.ts b/types/jquery.nicescroll/jquery.nicescroll-tests.ts index 2d4599d8d6..f4362530f9 100644 --- a/types/jquery.nicescroll/jquery.nicescroll-tests.ts +++ b/types/jquery.nicescroll/jquery.nicescroll-tests.ts @@ -1,23 +1,23 @@ -//cases from documentation +// cases from documentation // 1. Simple mode, it styles document scrollbar: -$(function() { +$(() => { $("body").niceScroll(); }); // 2. Instance with object returned: let nice; -$(function() { +$(() => { nice = $("body").niceScroll(); }); // 3. Style a DIV and change cursor color: -$(function() { - $("#thisdiv").niceScroll({cursorcolor:"#00F"}); +$(() => { + $("#thisdiv").niceScroll({cursorcolor: "#00F"}); }); // 4. DIV with "wrapper", formed by two divs, the first is the vieport, the latter is the content: -$(function() { - $("#viewportdiv").niceScroll("#wrapperdiv",{cursorcolor:"#00F"}); +$(() => { + $("#viewportdiv").niceScroll("#wrapperdiv", {cursorcolor: "#00F"}); }); // 5. Get nicescroll object: @@ -33,9 +33,9 @@ $("#mydiv").getNiceScroll().resize(); $("#mydiv").getNiceScroll(0).doScrollLeft(1, 2); // Scroll X Axis $("#mydiv").getNiceScroll(0).doScrollTop(1, 14); // Scroll Y Axis -//other cases +// other cases $(".ui-grid-viewport").niceScroll({ cursorcolor: "#fff", cursorwidth: "8px", autohidemode: "leave" -}); \ No newline at end of file +}); diff --git a/types/jquery.nicescroll/tsconfig.json b/types/jquery.nicescroll/tsconfig.json index a5d8cb44a3..9d94444fc2 100644 --- a/types/jquery.nicescroll/tsconfig.json +++ b/types/jquery.nicescroll/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/jquery.nicescroll/tslint.json b/types/jquery.nicescroll/tslint.json index 8bc7a53d89..e60c15844f 100644 --- a/types/jquery.nicescroll/tslint.json +++ b/types/jquery.nicescroll/tslint.json @@ -1,3 +1,3 @@ { - "extends": "dtslint/dt.json", -} + "extends": "dtslint/dt.json" +} \ No newline at end of file