forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
slick-carousel.d.ts
424 lines (353 loc) · 9.7 KB
/
slick-carousel.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
// Type definitions for stick 1.6.0
// Project: http://kenwheeler.github.io/slick/
// Definitions by: John Gouigouix <https://github.com/orchestra-ts/DefinitelyTyped/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
interface JQuerySlickOptions {
/**
* Enables tabbing and arrow key navigation
* Default: true
*/
accessibility?: boolean;
/**
* Enables adaptive height for single slide horizontal carousels.
* Default: false
*/
adaptiveHeight?: boolean;
/**
* Enables Autoplay
* Default: false
*/
autoplay?: boolean;
/**
* Autoplay Speed in milliseconds
* Default: 3000
*/
autoplaySpeed?: number;
/**
* Prev/Next Arrows
* Default: true
*/
arrows?: boolean;
/**
* Set the slider to be the navigation of other slider (Class or ID Name)
* Default: null
*/
asNavFor?: string;
/**
* Change where the navigation arrows are attached (Selector, htmlString, Array, Element, jQuery object)
* Default: $(element)
*/
appendArrows?: any;
/**
* Change where the navigation dots are attached (Selector, htmlString, Array, Element, jQuery object)
* Default: $(element)
*/
appendDots?: any;
/**
* Allows you to select a node or customize the HTML for the "Previous" arrow.
* Default: <button type="button" class="slick-prev">Previous</button>
*/
prevArrow?: string | Object;
/**
* Allows you to select a node or customize the HTML for the "Next" arrow.
* Default: <button type="button" class="slick-next">Next</button>
*/
nextArrow?: string | Object;
/**
* Enables centered view with partial prev/next slides. Use with odd numbered slidesToShow counts.
* Default: false
*/
centerMode?: boolean;
/**
* Side padding when in center mode (px or %)
* Default: '50px'
*/
centerPadding?: string;
/**
* CSS3 Animation Easing
* Default: 'ease'
*/
cssEase?: string;
/**
* Custom paging templates. See source for use example.
* Default: n/a
*/
customPaging?: (slider: any, i: number) => string;
/**
* Show dot indicators
* Default: false
*/
dots?: boolean;
/**
* Class for slide indicator dots container
* Default: 'slick-dots'
*/
dotsClass?: string;
/**
* Enable mouse dragging
* Default: true
*/
draggable?: boolean;
/**
* Enable fade
* Default: false
*/
fade?: boolean;
/**
* Enable focus on selected element (click)
* Default: false
*/
focusOnSelect?: boolean;
/**
* Add easing for jQuery animate. Use with easing libraries or default easing methods
* Default: 'linear'
*/
easing?: string;
/**
* Resistance when swiping edges of non-infinite carousels
* Default: 0.15
*/
edgeFriction?: number;
/**
* Infinite loop sliding
* Default: true
*/
infinite?: boolean;
/**
* Slide to start on
* Default: 0
*/
initialSlide?: number;
/**
* Set lazy loading technique. Accepts 'ondemand' or 'progressive'.
* Default: 'ondemand'
*/
lazyLoad?: string;
/**
* Responsive settings use mobile first calculation
* Default: false
*/
mobileFirst?: boolean;
/**
* Pause Autoplay On Focus
* Default: true
*/
pauseOnFocus?: boolean;
/**
* Pause Autoplay On Hover
* Default: true
*/
pauseOnHover?: boolean;
/**
* Pause Autoplay when a dot is hovered
* Default: false
*/
pauseOnDotsHover?: boolean;
/**
* Width that responsive object responds to. Can be 'window', 'slider' or 'min' (the smaller of the two)
* Default: 'window'
*/
respondTo?: string;
/**
* Object containing breakpoints and settings objects (see demo).
* Enables settings sets at given screen width.
* Set settings to "unslick" instead of an object to disable slick at a given breakpoint.
* Default: none
*/
responsive?: Object;
/**
* Setting this to more than 1 initializes grid mode. Use slidesPerRow to set how many slides should be in each row.
* Default: 1
*/
rows?: number;
/**
* Element query to use as slide
* Default: 'div'
*/
slide?: string;
/**
* With grid mode intialized via the rows option, this sets how many slides are in each grid row.
* Default: 1
*/
slidesPerRow?: number;
/**
* # of slides to show
* Default: 1
*/
slidesToShow?: number;
/**
* # of slides to scroll
* Default: 1
*/
slidesToScroll?: number;
/**
* Slide/Fade animation speed (ms)
* Default: 300
*/
speed?: number;
/**
* Enable swiping
* Default: true
*/
swipe?: boolean;
/**
* Allow users to drag or swipe directly to a slide irrespective of slidesToScroll.
* Default: false
*/
swipeToSlide?: boolean;
/**
* Enable slide motion with touch
* Default: true
*/
touchMove?: boolean;
/**
* To advance slides, the user must swipe a length of (1/touchThreshold) * the width of the slider.
* Default: 5
*/
touchThreshold?: number;
/**
* Enable/Disable CSS Transitions
* Default: true
*/
useCSS?: boolean;
/**
* Enable/Disable CSS Transforms
* Default: true
*/
useTransform?: boolean;
/**
* Variable width slides.
* Default: false
*/
variableWidth?: boolean;
/**
* Vertical slide mode
* Default: false
*/
vertical?: boolean;
/**
* Vertical swipe mode
* Default: false
*/
verticalSwiping?: boolean;
/**
* Change the slider's direction to become right-to-left
* Default: false
*/
rtl?: boolean;
/**
* Change the slider's direction to become right-to-left
* Default: false
*/
waitForAnimate?: boolean;
/**
* Set the zIndex values for slides, useful for IE9 and lower
* Default: 1000
*/
zIndex?: number;
}
interface JQuery {
/**
* Create slick component
*/
slick(): JQuery;
slick(options: JQuerySlickOptions): JQuery;
/**
* Trigger non-specialized signature method
* @param methodName
* @param arg
*/
slick(methodName: string, ...arg: any[]): any;
/**
* Returns the current slide index
* @param methodName The name of the method
*/
slick(methodName: "slickCurrentSlide"): number;
/**
* Navigates to a slide by index
* @param methodName The name of the method
* @param slide
* @param animate
*/
slick(methodName: "slickGoTo", slide: number, animate?: boolean): JQuery;
/**
* Navigates to the next slide
* @param methodName The name of the method
*/
slick(methodName: "slickNext"): JQuery;
/**
* Navigates to the previous slide
* @param methodName The name of the method
*/
slick(methodName: "slickPrev"): JQuery;
/**
* Pauses autoplay
* @param methodName The name of the method
*/
slick(methodName: "slickPause"): JQuery;
/**
* Starts autoplay
* @param methodName The name of the method
*/
slick(methodName: "slickPlay"): JQuery;
/**
* Add a slide. If an index is provided, will add at that index, or before if addBefore is set. If no index is provided,
* add to the end or to the beginning if addBefore is set. Accepts HTML String || Object
* @param methodName The name of the method
* @param html
* @param index/div>
* @param addBefore
*/
slick(methodName: "slickAdd", html: string | Object, index?: number, addBefore?: number): JQuery;
/**
* Remove slide by index. If removeBefore is set true, remove slide preceding index, or the first slide if no index is specified.
* If removeBefore is set to false, remove the slide following index, or the last slide if no index is set.
* @param methodName The name of the method
* @param index
* @param removeBefore
*/
slick(methodName: "slickRemove", index: number, removeBefore?: number): JQuery;
/**
* Filters slides using jQuery .filter()
* @param methodName The name of the method
* @param selector
*/
slick(methodName : "slickFilter", selector: string): JQuery;
/**
* Filters slides using jQuery .filter()
* @param methodName The name of the method
* @param func
*/
slick(methodName : "slickFilter", func: (index: number, element: Element) => any): JQuery;
/**
* Removes applied filtering
* @param methodName The name of the method
* @param index
*/
slick(methodName: "slickUnfilter", index: number): JQuery;
/**
* Sets an individual value live. Set refresh to true if it's a UI update.
* @param methodName The name of the method
* @param option The option name
*/
slick(methodName: "slickGetOption", option: any): JQuerySlickOptions;
/**
* Sets an individual value live. Set refresh to true if it's a UI update.
* @param methodName The name of the method
* @param option The option name
* @param value depends on option
* @param refresh
*/
slick(methodName: "slickSetOption", option: string, value: JQuerySlickOptions, refresh?: boolean): JQuery;
/**
* Deconstructs slick
* @param methodName The name of the method
*/
slick(methodName: "unslick"): JQuery;
/**
* Get Slick Object
* @param methodName The name of the method
*/
slick(methodName: "getSlick"): Object;
}