-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
54 lines (54 loc) · 1.37 KB
/
index.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
export default class ViteScroll {
private _unbindXTouch;
readonly LOG_PREFIX: string;
readonly VERSION: string;
readonly SPEED_DETECT_INTERVAL: number;
readonly MAX_OVERFLOW: number;
readonly MIN_SPEED: number;
readonly TOUCH_RESISTANCE: number;
readonly WINDAGE_RESISTANCE: number;
readonly ELASTIC_RESISTANCE: number;
private tranformStyleName;
private container;
private content;
private scrollTouches;
private touchStarted;
private scrolling;
private containerHeight;
private contentHeight;
private minTranslate;
private originCurrent;
private current;
constructor(el: HTMLElement, options: IOptions);
destroy(): void;
onStart(e: TouchEvent): void;
onMove(e: TouchEvent): void;
private _handleMove;
onEnd(e: TouchEvent): void;
scrollTo(y: number): void;
scrollAt(speed: number): void;
resetPosition(): void;
setTranslate(y: number): void;
getTranslate(element: HTMLElement): number;
getOccupiedHeight(element: HTMLElement): number;
}
export declare enum Direction {
X = 0,
Y = 1,
Both = 2
}
interface IOptions {
/**
* 设置之后按照此数值的整数倍滚动
*/
scrollUnit?: number;
/**
* 滚动方向
*/
direction?: Direction;
/**
* 滚动内容元素选择器
*/
selector?: string;
}
export {};