forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dw-bxslider-4.d.ts
623 lines (548 loc) · 17.1 KB
/
dw-bxslider-4.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
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
// Type definitions for bxSlider v4.2.5
// Project: https://github.com/stevenwanderski/bxslider-4
// Definitions by: Piotr Sałkowski <https://github.com/namerci>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="../jquery/jquery.d.ts"/>
interface bxSliderOptions {
/**
* mode Type of transition between slides
*
* default: 'horizontal'
* options: 'horizontal', 'vertical', 'fade'
*/
mode?: string
/**
* speed Slide transition duration (in ms)
*
* default: 500
* options: integer
*/
speed?: number
/**
* slideMargin Margin between each slide
*
* default: 0
* options: integer
*/
slideMargin?: number
/**
* startSlide Starting slide index (zero-based)
*
* default: 0
* options: integer
*/
startSlide?: number
/**
* randomStart Start slider on a random slide
*
* default: false
* options: boolean (true / false)
*/
randomStart?: boolean
/**
* slideSelector Element to use as slides (ex. 'div.slide').
* Note: by default, bxSlider will use all immediate children of the slider element
*
* default: ''
* options: jQuery selector
*/
slideSelector?: string
/**
* infiniteLoop If true, clicking "Next" while on the last slide will transition to the first slide and vice-versa
*
* default: true
* options: boolean (true / false)
*/
infiniteLoop?: boolean
/**
* hideControlOnEnd If true, "Prev" and "Next" controls will receive a class disabled when slide is the first or the last
* Note: Only used when infiniteLoop: false
*
* default: false
* options: boolean (true / false)
*/
hideControlOnEnd?: boolean
/**
* easing The type of "easing" to use during transitions. If using CSS transitions, include a value for the transition-timing-function property. If not using CSS transitions, you may include plugins/jquery.easing.1.3.js for many options.
* See http://gsgd.co.uk/sandbox/jquery/easing/ for more info.
*
* default: null
* options: if using CSS: 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'cubic-bezier(n,n,n,n)'. If not using CSS: 'swing', 'linear' (see the above file for more options)
*/
easing?: string
/**
* captions Include image captions. Captions are derived from the image's title attribute
*
* default: false
* options: boolean (true / false)
*/
captions?: boolean
/**
* ticker Use slider in ticker mode (similar to a news ticker)
*
* default: false
* options: boolean (true / false)
*/
ticker?: boolean
/**
* tickerHover Ticker will pause when mouse hovers over slider. Note: this functionality does NOT work if using CSS transitions!
*
* default: false
* options: boolean (true / false)
*/
tickerHover?: boolean
/**
* adaptiveHeight Dynamically adjust slider height based on each slide's height
*
* default: false
* options: boolean (true / false)
*/
adaptiveHeight?: boolean
/**
* adaptiveHeightSpeed Slide height transition duration (in ms). Note: only used if adaptiveHeight: true
*
* default: 500
* options: integer
*/
adaptiveHeightSpeed?: number
/**
* video If any slides contain video, set this to true. Also, include plugins/jquery.fitvids.js
* See http://fitvidsjs.com/ for more info
*
* default: false
* options: boolean (true / false)
*/
video?: boolean
/**
* responsive Enable or disable auto resize of the slider. Useful if you need to use fixed width sliders.
*
* default: true
* options: boolean (true / false)
*/
responsive?: boolean
/**
* useCSS If true, CSS transitions will be used for horizontal and vertical slide animations (this uses native hardware acceleration). If false, jQuery animate() will be used.
*
* default: true
* options: boolean (true / false)
*/
useCSS?: boolean
/**
* preloadImages If 'all', preloads all images before starting the slider. If 'visible', preloads only images in the initially visible slides before starting the slider (tip: use 'visible' if all slides are identical dimensions)
*
* default: 'visible'
* options: 'all', 'visible'
*/
preloadImages?: string
/**
* touchEnabled If true, slider will allow touch swipe transitions
*
* default: true
* options: boolean (true / false)
*/
touchEnabled?: boolean
/**
* swipeThreshold Amount of pixels a touch swipe needs to exceed in order to execute a slide transition. Note: only used if touchEnabled: true
*
* default: 50
* options: integer
*/
swipeThreshold?: number
/**
* oneToOneTouch If true, non-fade slides follow the finger as it swipes
*
* default: true
* options: boolean (true / false)
*/
oneToOneTouch?: boolean
/**
* preventDefaultSwipeX If true, touch screen will not move along the x-axis as the finger swipes
*
* default: true
* options: boolean (true / false)
*/
preventDefaultSwipeX?: boolean
/**
* preventDefaultSwipeY If true, touch screen will not move along the y-axis as the finger swipes
*
* default: false
* options: boolean (true / false)
*/
preventDefaultSwipeY?: boolean
/**
* wrapperClass Class to wrap the slider in. Change to prevent from using default bxSlider styles.
*
* default: 'bx-wrapper'
* options: string
*/
wrapperClass?: string
/**
* pager If true, a pager will be added
*
* default: true
* options: boolean (true / false)
*/
pager?: boolean
/**
* pagerType If 'full', a pager link will be generated for each slide. If 'short', a x / y pager will be used (ex. 1 / 5)
*
* default: 'full'
* options: 'full', 'short'
*/
pagerType?: string
/**
* pagerShortSeparator If pagerType: 'short', pager will use this value as the separating character
*
* default: ' / '
* options: string
*/
pagerShortSeparator?: string
/**
* pagerSelector Element used to populate the populate the pager. By default, the pager is appended to the bx-viewport
*
* default: ''
* options: jQuery selector
*/
pagerSelector?: string
/**
* pagerCustom Parent element to be used as the pager. Parent element must contain a <a data-slide-index="x"> element for each slide. See example here. Not for use with dynamic carousels.
*
* default: null
* options: jQuery selector
*/
pagerCustom?: string
/**
* buildPager If supplied, function is called on every slide element, and the returned value is used as the pager item markup.
* See examples for detailed implementation
*
* default: null
* options: functoin(slideIndex)
*/
buildPager?: (slideIndex: number) => void;
/**
* controls If true, "Next" / "Prev" controls will be added
*
* default: true
* options: boolean (true / false)
*/
controls?: boolean
/**
* nextText Text to be used for the "Next" control
*
* default: 'Next'
* options: string
*/
nextText?: string
/**
* prevText Text to be used for the "Prev" control
*
* default: 'Prev'
* options: string
*/
prevText?: string
/**
* nextSelector Element used to populate the "Next" control
*
* default: null
* options: jQuery selector
*/
nextSelector?: string
/**
* prevSelector Element used to populate the "Prev" control
*
* default: null
* options: jQuery selector
*/
prevSelector?: string
/**
* autoControls If true, "Start" / "Stop" controls will be added
*
* default: false
* options: boolean (true / false)
*/
autoControls?: boolean
/**
* startText Text to be used for the "Start" control
*
* default: 'Start'
* options: string
*/
startText?: string
/**
* stopText Text to be used for the "Stop" control
*
* default: 'Stop'
* options: string
*/
stopText?: string
/**
* autoControlsCombine When slideshow is playing only "Stop" control is displayed and vice-versa
*
* default: false
* options: boolean (true / false)
*/
autoControlsCombine?: boolean
/**
* autoControlsSelector Element used to populate the auto controls
*
* default: null
* options: jQuery selector
*/
autoControlsSelector?: string
/**
* keyboardEnabled Allows for keyboard control of visible slider. Keypress ignored if slider not visible.
*
* default: false
* options: boolean (true / false)
*/
keyboardEnabled?: boolean
/**
* auto Slides will automatically transition
*
* default: false
* options: boolean (true / false)
*/
auto?: boolean
/**
* stopAutoOnClick Auto will stop on interaction with controls
*
* default: false
* options: boolean (true / false)
*/
stopAutoOnClick?: boolean
/**
* pause The amount of time (in ms) between each auto transition
*
* default: 4000
* options: integer
*/
pause?: number
/**
* autoStart Auto show starts playing on load. If false, slideshow will start when the "Start" control is clicked
*
* default: true
* options: boolean (true / false)
*/
autoStart?: boolean
/**
* autoDirection The direction of auto show slide transitions
*
* default: 'next'
* options: 'next', 'prev'
*/
autoDirection?: string
/**
* autoHover Auto show will pause when mouse hovers over slider
*
* default: false
* options: boolean (true / false)
*/
autoHover?: boolean
/**
* autoDelay Time (in ms) auto show should wait before starting
*
* default: 0
* options: integer
*/
autoDelay?: number
/**
* minSlides The minimum number of slides to be shown. Slides will be sized down if carousel becomes smaller than the original size.
*
* default: 1
* options: integer
*/
minSlides?: number
/**
* maxSlides The maximum number of slides to be shown. Slides will be sized up if carousel becomes larger than the original size.
*
* default: 1
* options: integer
*/
maxSlides?: number
/**
* moveSlides The number of slides to move on transition. This value must be >= minSlides, and <= maxSlides. If zero (default), the number of fully-visible slides will be used.
*
* default: 0
* options: integer
*/
moveSlides?: number
/**
* slideWidth The width of each slide. This setting is required for all horizontal carousels!
*
* default: 0
* options: integer
*/
slideWidth?: number
/**
* shrinkItems The Carousel will only show whole items and shrink the images to fit the viewport based on maxSlides/MinSlides.
*
* default: false
* options: boolean (true / false)
*/
shrinkItems?: boolean
/**
* ariaLive Adds Aria Live attribute to slider.
*
* default: true
* options: boolean (true / false)
*/
ariaLive?: boolean
/**
* ariaHidden Adds Aria Hidden attribute to any nonvisible slides.
*
* default: true
* options: boolean (true / false)
*/
ariaHidden?: boolean
/**
* onSliderLoad Executes immediately after the slider is fully loaded
*
* default: function(){}
* options: function(currentIndex){ // your code here }
* arguments:
* currentIndex: element index of the current slide
*/
onSliderLoad?: (currentIndex?: number) => void;
/**
* onSliderResize Executes immediately after the slider is resized
*
* default: function(){}
* options: function(currentIndex){ // your code here }
* arguments:
* currentIndex: element index of the current slide
*/
onSliderResize?: (currentIndex?: number) => void;
/**
* onSlideBefore Executes immediately before each slide transition.
*
* default: function(){}
* options: function($slideElement, oldIndex, newIndex){ // your code here }
* arguments:
* $slideElement: jQuery element of the destination element
* oldIndex: element index of the previous slide (before the transition)
* newIndex: element index of the destination slide (after the transition)
*/
onSlideBefore?: ($slideElement?: JQuery, oldIndex?: number, newIndex?: number) => void;
/**
* onSlideAfter Executes immediately after each slide transition. Function argument is the current slide element (when transition completes).
*
* default: function(){}
* options: function($slideElement, oldIndex, newIndex){ // your code here }
* arguments:
* $slideElement: jQuery element of the destination element
* oldIndex: element index of the previous slide (before the transition)
* newIndex: element index of the destination slide (after the transition)
*/
onSlideAfter?: ($slideElement?: JQuery, oldIndex?: number, newIndex?: number) => void;
/**
* onSlideNext Executes immediately before each "Next" slide transition. Function argument is the target (next) slide element.
*
* default: function(){}
* options: function($slideElement, oldIndex, newIndex){ // your code here }
* arguments:
* $slideElement: jQuery element of the destination element
* oldIndex: element index of the previous slide (before the transition)
* newIndex: element index of the destination slide (after the transition)
*/
onSlideNext?: ($slideElement?: JQuery, oldIndex?: number, newIndex?: number) => void;
/**
* onSlidePrev Executes immediately before each "Prev" slide transition. Function argument is the target (prev) slide element.
*
* default: function(){}
* options: function($slideElement, oldIndex, newIndex){ // your code here }
* arguments:
* $slideElement: jQuery element of the destination element
* oldIndex: element index of the previous slide (before the transition)
* newIndex: element index of the destination slide (after the transition)
*/
onSlidePrev?: ($slideElement?: JQuery, oldIndex?: number, newIndex?: number) => void;
}
interface bxSlider {
/**
* goToSlide Performs a slide transition to the supplied slide index (zero-based)
*
* example:
* slider = $('.bxslider').bxSlider();
* slider.goToSlide(3);
*/
goToSlide: (index: number) => void;
/**
* goToNextSlide Performs a "Next" slide transition
*
* example:
* slider = $('.bxslider').bxSlider();
* slider.goToNextSlide();
*/
goToNextSlide: () => void;
/**
* goToPrevSlide Performs a "Prev" slide transition
*
* example:
* slider = $('.bxslider').bxSlider();
* slider.goToPrevSlide();
*/
goToPrevSlide: () => void;
/**
* startAuto Starts the auto show. Provide an argument false to prevent the auto controls from being updated.
*
* example:
* slider = $('.bxslider').bxSlider();
* slider.startAuto();
*/
startAuto: (preventControlUpdate?: boolean) => void;
/**
* stopAuto Stops the auto show. Provide an argument false to prevent the auto controls from being updated.
*
* example:
* slider = $('.bxslider').bxSlider();
* slider.stopAuto();
*/
stopAuto: (preventControlUpdate?: boolean) => void;
/**
* getCurrentSlide Returns the current active slide
*
* example:
* slider = $('.bxslider').bxSlider();
* var current = slider.getCurrentSlide();
*/
getCurrentSlide: () => number;
/**
* getSlideCount Returns the total number of slides in the slider
*
* example:
* slider = $('.bxslider').bxSlider();
* var slideQty = slider.getSlideCount();
*/
getSlideCount: () => number;
/**
* redrawSlider Redraw the slider. Useful when needing to redraw a hidden slider after it is unhidden.
*
* example:
* slider = $('.bxslider').bxSlider();
* slider.redrawSlider();
*/
redrawSlider: () => void;
/**
* reloadSlider Reload the slider. Useful when adding slides on the fly. Accepts an optional settings object. See here for an example.
*
* example:
* slider = $('.bxslider').bxSlider();
* slider.reloadSlider();
*/
reloadSlider: (settings?: bxSliderOptions) => void;
/**
* destroySlider Destroy the slider. This reverts all slider elements back to their original state (before calling the slider).
*
* example:
* slider = $('.bxslider').bxSlider();
* slider.destroySlider();
*/
destroySlider: () => void;
}
interface JQuery {
/**
* Creates a bxSlider from the current element.
* @param options
*/
bxSlider(options?:bxSliderOptions): bxSlider;
}