forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
glidejs.d.ts
189 lines (179 loc) · 5.06 KB
/
glidejs.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
// Type definitions for Glide.js v1.0.6
// Project: http://glide.jedrzejchalubek.com/
// Definitions by: Milan Jaros <https://github.com/milanjaros/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface JQuery {
/**
* Glide is responsive and touch-friendly jQuery slider.
* Based on CSS3 transitions with fallback to older broswers.
* It's simple, lightweight and fast. Designed to slide,
* no less, no more.
*/
glide(options?: JQueryGlide.IGlideOptions): JQuery;
}
declare module JQueryGlide {
interface IGlideOptions {
/**
* Default: 4000
* {Int or Bool} False for turning off autoplay
*/
autoplay?: any;
/**
* Default: true {Bool} Pause autoplay on mouseover slider
*/
hoverpause?: boolean;
/**
* Default: true {Bool} Circular play (Animation continues without starting over once it reaches the last slide)
*/
circular?: boolean;
/**
* Default: 500
* Animation time in ms
* @type {number}
*/
animationDuration?: number;
/**
* Default: cubic-bezier(0.165, 0.840, 0.440, 1.000)
* cubic-bezier(0.165, 0.840, 0.440, 1.000)
*/
animationTimingFunc?: string;
/**
* Default: true
* {Bool or String} Show/hide/appendTo arrows
* True for append arrows to slider wrapper
* False for not appending arrows
* Id or class name (e.g. '.class-name') for appending to specific HTML markup
*/
arrows?: any;
/**
* Default: 'slider-arrows'
* {String} Arrows wrapper class
*/
arrowsWrapperClass?: string;
/**
* Default: 'slider-arrow'
* {String} Main class for both arrows
*/
arrowMainClass?: string;
/**
* Default: 'slider-arrow--right'
* {String} Right arrow
*/
arrowRightClass?: string;
/**
* Default: 'next'
* {String} Right arrow text
*/
arrowRightText?: string;
/**
* Default: 'slider-arrow--left'
* {String} Left arrow
*/
arrowLeftClass?: string;
/**
* Default: 'prev'
* {String} Left arrow text
*/
arrowLeftText?: string;
/**
* Default: true
* {Bool or String} Show/hide/appendTo bullets navigation
* True for append arrows to slider wrapper
* False for not appending arrows
* Id or class name (e.g. '.class-name') for appending to specific HTML markup
*/
navigation?: any;
/**
* Default: true
* {Bool} Center bullet navigation
*/
navigationCenter?: boolean;
/**
* Default: 'slider-nav'
* {String} Navigation class
*/
navigationClass?: string;
/**
* Default: 'slider-nav__item'
* {String} Navigation item class
*/
navigationItemClass?: string;
/**
* Default: 'slider-nav__item--current'
* {String} Current navigation item class
*/
navigationCurrentItemClass?: string;
/**
* Default: true
* {Bool} Slide on left / right keyboard arrows press
*/
keyboard?: boolean;
/**
* Default: 60
* {Int or Bool} Touch settings
*/
touchDistance?: any;
/**
* Default: function () {}
* {Function} Callback before plugin init
*/
beforeInit?: Function;
/**
* Default: function () {}
* {Function} Callback after plugin init
*/
afterInit?: Function;
/**
* Default: function () {}
* {Function} Callback before slide change
*/
beforeTransition?: Function;
/**
* Default: function() {}
* {Function} Callback after slide change
*/
afterTransition?: Function;
}
interface IGlideApi {
/**
* Returning current slide number
*/
current(): number;
/**
* Rebuild and recalculate dimensions of slider elements
*/
reinit(): void;
/**
* Destroy and cleanup slider
*/
destroy(): void;
/**
* Starting autoplay
*/
play(): void;
/**
* Stopping autoplay
*/
pause(): void;
/**
* Slide one forward
*/
next(callback: Function): void;
/**
* Slide one backward
*/
prev(callback: Function): void;
/**
* Jump to current slide
*/
jump(distance: number, callback: Function): void;
/**
* Append navigation to specifed target (eq. 'body', '.class', '#id')
*/
nav(target: string): void;
/**
* Append arrows to specifed target (eq. 'body', '.class', '#id')
*/
arrows(target: string): void;
}
}