forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iscroll-5.d.ts
93 lines (79 loc) · 2.35 KB
/
iscroll-5.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// Type definitions for iScroll 5
// Project: http://cubiq.org/iscroll-5-ready-for-beta-test
// Definitions by: Christiaan Rakowski <https://github.com/csrakowski/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface IScrollOptions {
x?: number;
y?: number;
bounce?: boolean;
bounceLock?: boolean;
momentum?: boolean;
lockDirection?: boolean;
useTransform?: boolean;
useTransition?: boolean;
topOffset?: number;
checkDOMChanges?: boolean;
handleClick?: boolean;
// Scrollbar
hScrollbar?: boolean;
vScrollbar?: boolean;
fixedScrollbar?: boolean;
hideScrollbar?: boolean;
fadeScrollbar?: boolean;
scrollbarClass?: string;
// Zoom
zoom?: boolean;
zoomMin?: number;
zoomMax?: number;
doubleTapZoom?: number;
mouseWheel?: boolean;
wheelAction?: string;
snap?: string | boolean;
snapThreshold?: number;
// New in IScroll 5?
resizeIndicator?: boolean;
mouseWheelSpeed?: number;
startX?: number;
startY?: number;
scrollX?: boolean;
scrollY?: boolean;
scrollbars?: boolean | string;
shrinkScrollbars?: string;
interactiveScrollbars?: boolean;
releaseScroll?: boolean;
fadeScrollbars?: boolean;
directionLockThreshold?: number;
bounceTime?: number;
///String or function
bounceEasing?: string|{ style: string, fn: (k: any) => any };
preventDefault?: boolean;
preventDefaultException?: Array<RegExp>|Object;
HWCompositing?: boolean;
freeScroll?: boolean;
resizePolling?: number;
tap?: boolean;
click?: boolean;
invertWheelDirection?: boolean;
eventPassthrough?: string | boolean;
}
declare class IScroll {
constructor (element: string, options?: IScrollOptions);
constructor (element: HTMLElement, options?: IScrollOptions);
x: number;
y: number;
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;
scrollToElement(element: HTMLElement, time?: number, offsetX?: number | boolean, offsetY?: number | boolean, easing?: Function): void;
goToPage(pageX: number, pageY: number, time?: number): void;
disable(): void;
enable(): void;
stop(): void;
zoom(x: number, y: number, scale: number, time?: number): void;
isReady(): boolean;
// Events
on(type: string, fn: (evt?: any) => void): void;
off(type: string, fn?: (evt?: any) => void): void;
}