Add iScroll and iScroll Lite definitions

This commit is contained in:
Boris Yankov
2013-01-07 09:47:33 +02:00
parent 8de548be56
commit a367a596f9
3 changed files with 123 additions and 0 deletions

View File

@@ -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))

75
iscroll/iscroll-4.2.d.ts vendored Normal file
View File

@@ -0,0 +1,75 @@
// Type definitions for iScroll 4.2
// Project: http://cubiq.org/iscroll-4
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// 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;
}

47
iscroll/iscroll-lite-4.1.d.ts vendored Normal file
View File

@@ -0,0 +1,47 @@
// Type definitions for iScroll Lite 4.1
// Project: http://cubiq.org/iscroll-4
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// 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;
}