zenscroll
zenscroll copied to clipboard
Typescript definition
Here a simple typescript definition for the class, it comes handy in a typescript and module/AMD environment.
Thank you very much
To be used with import * as zenscroll from "zenscroll"
I think the typing should be in modules like so:
declare module ZenScroll {
interface ZenScrollBase {
to(element: HTMLElement);
to(element: HTMLElement, duration: number);
to(element: HTMLElement, duration: number, onDone: () => void);
toY(y: number);
toY(y: number, duration: number);
toY(y: number, duration: number, onDone: () => void);
center(element: HTMLElement);
center(element: HTMLElement, duration: number);
center(element: HTMLElement, duration: number, offset: number);
center(element: HTMLElement, duration: number, offset: number, onDone: () => void);
moving(): boolean;
stop();
setup(duration: number);
setup(duration: number, offset: number);
}
interface ZenScroll extends ZenScrollBase {
createScroller(element: HTMLElement, duration: number, offset: number): ZenScrollBase;
intoView(element: HTMLElement);
}
}
declare module "zenscroll" {
var zenscroll: ZenScroll.ZenScroll;
export = zenscroll;
}