-
Notifications
You must be signed in to change notification settings - Fork 74
/
index.d.ts
66 lines (55 loc) · 1.98 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
55
56
57
58
59
60
61
62
63
64
65
66
// Type definitions for touchslider>=2.1.0
// Project: TouchSlider
// Definitions by: qiqiboy
declare const TouchSlider: TouchSlider.TouchSliderConstructor;
export = TouchSlider;
export as namespace TouchSlider;
declare namespace TouchSlider {
interface TouchSliderConfig {
duration?: number;
direction?: 0 | 1;
start?: number;
loop?: boolean;
mouse?: boolean;
mousewheel?: boolean;
interval?: number;
autoplay?: number;
arrowkey?: boolean;
freeze?: boolean;
fullsize?: boolean;
align?: 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
}
interface TouchSlider {
pages: HTMLElement[];
length: number;
arrowkey: boolean;
playing: boolean;
interval: number;
mousewheel: boolean;
mouse: boolean;
loop: boolean;
current: number;
direction: 0 | 1;
duration: number;
prev(): TouchSlider;
next(): TouchSlider;
slide(index: number): TouchSlider;
play(): TouchSlider;
pause(): TouchSlider;
resize(): TouchSlider;
isStatic(): boolean;
prepend(page: HTMLElement): TouchSlider;
append(page: HTMLElement): TouchSlider;
insertBefore(page: HTMLElement, index: number): TouchSlider;
insertAfter(page: HTMLElement, index: number): TouchSlider;
remove(index: number): TouchSlider;
on(action: 'before', callback: (current: number, next: number) => void): TouchSlider;
on(action: 'after', callback: (current: number, prev: number) => void): TouchSlider;
on(action: 'dragStart' | 'drageMove' | 'dragEnd', callback: (event: any) => void): TouchSlider;
destroy(): TouchSlider;
}
interface TouchSliderConstructor {
new (idOrElement: string | HTMLElement, config?: TouchSliderConfig): TouchSlider;
(idOrElement: string | HTMLElement, config?: TouchSliderConfig): TouchSlider;
}
}