forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iscroll-lite.d.ts
48 lines (41 loc) · 1.37 KB
/
iscroll-lite.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Type definitions for iScroll Lite 4.1
// Project: http://cubiq.org/iscroll-4
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Christiaan Rakowski <https://github.com/csrakowski/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface iScrollEvent {
(e: Event): void;
}
interface iScrollOptions {
hScroll?: boolean;
vScroll?: boolean;
x?: number;
y?: number;
bounce?: boolean;
bounceLock?: boolean;
momentum?: boolean;
lockDirection?: boolean;
useTransform?: boolean;
useTransition?: boolean;
// Events
onRefresh?: iScrollEvent;
onBeforeScrollStart?: iScrollEvent;
onScrollStart?: iScrollEvent;
onBeforeScrollMove?: iScrollEvent;
onScrollMove?: iScrollEvent;
onBeforeScrollEnd?: iScrollEvent;
onScrollEnd?: iScrollEvent;
onTouchEnd?: iScrollEvent;
onDestroy?: iScrollEvent;
}
declare class iScroll {
constructor (element: string, options?: iScrollOptions);
constructor (element: HTMLElement, options?: iScrollOptions);
destroy(): void;
refresh(): void;
scrollTo(x: number, y: number, time?: number, relative?: boolean): void;
scrollToElement(element: string, time?: number): void;
scrollToElement(element: HTMLElement, time?: number): void;
disable(): void;
enable(): void;
stop(): void;
}