mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
Add iScroll and iScroll Lite definitions
This commit is contained in:
@@ -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
75
iscroll/iscroll-4.2.d.ts
vendored
Normal 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
47
iscroll/iscroll-lite-4.1.d.ts
vendored
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user