diff --git a/README.md b/README.md index 999a45dd6..efa5c42e1 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ Complete * [History.js](https://github.com/balupton/History.js/) (by [Boris Yankov](https://github.com/borisyankov)) * [Humane.js](http://wavded.github.com/humane-js/) (by [John Vrbanac](https://github.com/jmvrbanac)) * [Impress.js](https://github.com/bartaz/impress.js) (by [Boris Yankov](https://github.com/borisyankov)) +* [iScroll](http://cubiq.org/iscroll-4) (by [Boris Yankov](https://github.com/borisyankov)) * [Jasmine](http://pivotal.github.com/jasmine/) (by [Boris Yankov](https://github.com/borisyankov)) * [jQuery](http://jquery.com/) (from TypeScript samples) * [jQuery Mobile](http://jquerymobile.com) (by [Boris Yankov](https://github.com/borisyankov)) diff --git a/iscroll/iscroll-4.2.d.ts b/iscroll/iscroll-4.2.d.ts new file mode 100644 index 000000000..938da44ac --- /dev/null +++ b/iscroll/iscroll-4.2.d.ts @@ -0,0 +1,75 @@ +// Type definitions for iScroll 4.2 +// Project: http://cubiq.org/iscroll-4 +// Definitions by: Boris Yankov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +interface iScrollEvent { + (e: Event): void; +} + +interface iScrollOptions { + hScroll?: bool; + vScroll?: bool; + x?: number; + y?: number; + bounce?: bool; + bounceLock?: bool; + momentum?: bool; + lockDirection?: bool; + useTransform?: bool; + useTransition?: bool; + topOffset?: number; + checkDOMChanges?: bool; + handleClick?: bool; + + // Scrollbar + hScrollbar?: bool; + vScrollbar?: bool; + fixedScrollbar?: bool; + hideScrollbar?: bool; + fadeScrollbar?: bool; + scrollbarClass?: string; + + // Zoom + zoom?: bool; + zoomMin?: number; + zoomMax?: number; + doubleTapZoom?: number; + wheelAction?: string; + + // Snap + snap?: bool; + snapThreshold?: number; + + // Events + onRefresh?: iScrollEvent; + onBeforeScrollStart?: iScrollEvent; + onScrollStart?: iScrollEvent; + onBeforeScrollMove?: iScrollEvent; + onScrollMove?: iScrollEvent; + onBeforeScrollEnd?: iScrollEvent; + onScrollEnd?: iScrollEvent; + onTouchEnd?: iScrollEvent; + onDestroy?: iScrollEvent; + onZoomStart?: iScrollEvent; + onZoom?: iScrollEvent; + onZoomEnd?: iScrollEvent; +} + +class iScroll { + + constructor (element: string); + constructor (element: string, options: iScrollOptions); + + destroy(): void; + refresh(): void; + scrollTo(x: number, y: number, time: number, relative: bool): void; + scrollToElement(element: string, time: number): void; + scrollToPage(pageX: number, pageY: number, time: number): void; + disable(): void; + enalbe(): void; + stop(): void; + zoom(x: number, y: number, scale: number, time: number): void; + isReady(): bool; +} \ No newline at end of file diff --git a/iscroll/iscroll-lite-4.1.d.ts b/iscroll/iscroll-lite-4.1.d.ts new file mode 100644 index 000000000..8964b8b74 --- /dev/null +++ b/iscroll/iscroll-lite-4.1.d.ts @@ -0,0 +1,47 @@ +// Type definitions for iScroll Lite 4.1 +// Project: http://cubiq.org/iscroll-4 +// Definitions by: Boris Yankov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +interface iScrollEvent { + (e: Event): void; +} + +interface iScrollOptions { + hScroll?: bool; + vScroll?: bool; + x?: number; + y?: number; + bounce?: bool; + bounceLock?: bool; + momentum?: bool; + lockDirection?: bool; + useTransform?: bool; + useTransition?: bool; + + // Events + onRefresh?: iScrollEvent; + onBeforeScrollStart?: iScrollEvent; + onScrollStart?: iScrollEvent; + onBeforeScrollMove?: iScrollEvent; + onScrollMove?: iScrollEvent; + onBeforeScrollEnd?: iScrollEvent; + onScrollEnd?: iScrollEvent; + onTouchEnd?: iScrollEvent; + onDestroy?: iScrollEvent; +} + +class iScroll { + + constructor (element: string); + constructor (element: string, options: iScrollOptions); + + destroy(): void; + refresh(): void; + scrollTo(x: number, y: number, time: number, relative: bool): void; + scrollToElement(element: string, time: number): void; + disable(): void; + enalbe(): void; + stop(): void; +} \ No newline at end of file