-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
501 lines (495 loc) · 8.7 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
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
// Type definitions for react-owl-carousel 2.2
// Project: https://github.com/seal789ie/react-owl-carousel
// Definitions by: endigo <https://github.com/endigo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import * as React from 'react';
export interface Props {
/**
* The number of items you want to see on the screen.
*
* Default: 3.
*/
items?: number;
/**
* margin-right(px) on item.
*
* Default: 0.
*/
margin?: number;
/**
* Infinity loop. Duplicate last and first items to get loop illusion.
*
* Default: false
*/
loop?: boolean;
/**
* Center item. Works well with even an odd number of items.
*
* Default: false
*/
center?: boolean;
/**
* Mouse drag enabled.
*
* Default: true
*/
mouseDrag?: boolean;
/**
* Touch drag enabled.
*
* Default: true
*/
touchDrag?: boolean;
/**
* Stage pull to edge.
*
* Default: true
*/
pullDrag?: boolean;
/**
* Item pull to edge.
*
* Default: false
*/
freeDrag?: boolean;
/**
* Padding left and right on stage (can see neighbours).
*
* Default: 0
*/
stagePadding?: number;
/**
* Merge items. Looking for data-merge='{number}' inside item.
*
* Default: false
*/
merge?: boolean;
/**
* Fit merged items if screen is smaller than items value.
*
* Default: true
*/
mergeFit?: boolean;
/**
* Set non grid content. Try using width style on divs.
*
* Default: false
*/
autoWidth?: boolean;
/**
* Start position or URL Hash string like '#id'.
*
* Default: 0
*/
startPosition?: number | string;
/**
*
*
* Default: false
*/
URLhashListener?: boolean;
/**
* Show next/prev buttons.
*
* Default: false
*/
nav?: boolean;
/**
* Go backwards when the boundary has reached.
*
* Default: true
*/
rewind?: boolean;
/**
* HTML allowed.
*
* Default: ['next','prev']
*/
navText?: string[] | React.ReactElement<any>[];
/**
* DOM element type for a single directional navigation link.
*
* Default: 'div'
*/
navElement?: string;
/**
* Navigation slide by x. 'page' string can be set to slide by page.
*
* Default: 1
*/
slideBy?: number | string;
/**
* Show dots navigation.
*
* Default: true
*/
dots?: boolean;
/**
* Show dots each x item.
*
* Default: false
*/
dotsEach?: number | boolean;
/**
* Used by data-dot content.
*
* Default: false
*/
dotData?: boolean;
/**
* Lazy load images. data-src and data-src-retina for highres. Also load images into background inline style if element is not \<img\>
*
* Default: false
*/
lazyLoad?: boolean;
/**
* lazyContent was introduced during beta tests but i removed it from the final release due to bad implementation. It is a nice options so i will work on it in the nearest feature.
*
* Default: false
*/
lazyContent?: boolean;
/**
* Autoplay.
*
* Default: false
*/
autoplay?: boolean;
/**
* Autoplay interval timeout..
*
* Default: 5000
*/
autoplayTimeout?: number;
/**
* Pause on mouse hover.
*
* Default: false
*/
autoplayHoverPause?: boolean;
/**
* Speed Calculate. More info to come.
*
* Default: 250
*/
smartSpeed?: number;
/**
* Speed Calculate. More info to come.
*
* Default: 250
*/
fluidSpeed?: boolean;
/**
* autoplay speed.
*
* Default: false
*/
autoplaySpeed?: number | boolean;
/**
* Navigation speed
*
* Default: false
*/
navSpeed?: number | boolean;
/**
* Pagination speed.
*
* Default: false
*/
dotsSpeed?: number | boolean;
/**
* Drag end speed
*
* Default: false
*/
dragEndSpeed?: number | boolean;
/**
* Enable callback events.
*
* Default: true
*/
callbacks?: boolean;
/**
* Object containing responsive options. Can be set to false to remove responsive capabilities.
*
* Default: {}
*/
responsive?: {};
/**
* Responsive refresh rate
*
* Default: 250
*/
responsiveRefreshRate?: number;
/**
* Set on any DOM element. If you care about non responsive browser (like ie8) then use it on main wrapper. This will prevent from crazy resizing.
*
* Default: window
*/
responsiveBaseElement?: React.DOMElement<any, any>;
/**
* Enable fetching YouTube/Vimeo/Vzaar videos.
*
* Default: false
*/
video?: boolean;
/**
* Set height for videos
*
* Default: false
*/
videoHeight?: number | boolean;
/**
* Set widrth for videos
*
* Default: false
*/
videoWidth?: number | boolean;
/**
* Class for CSS3 animation out.
*
* Default: false
*/
animateOut?: string | boolean;
/**
* Class for CSS3 animation in.
*
* Default: false
*/
animateIn?: string | boolean;
/**
* Easing for CSS2 $.animate.
*
* Default: 'swing'
*/
fallbackEasing?: string;
/**
* Callback to retrieve basic information (current item/pages/widths). Info function second parameter is Owl DOM object reference.
*
* Default: false
*/
info?: Function | boolean;
/**
* Use it if owl items are deep nested inside some generated content. E.g 'youritem'. Dont use dot before class name.
*
* Default: false
*/
nestedItemSelector?: string | boolean;
/**
* DOM element type for owl-item.
*
* Default: 'div'
*/
itemElement?: string;
/**
* DOM element type for owl-stage.
*
* Default: 'div'
*/
stageElement?: string;
/**
* Set your own container for nav.
*
* Default: false
*/
navContainer?: string | boolean;
/**
* Set your own container for dots.
*
* Default: false
*/
dotsContainer?: string | boolean;
}
export interface ClassProps {
className?: string;
/**
* Class during refresh.
*
* Default: 'owl-refresh'
*/
refreshClass?: string;
/**
* Class during load.
*
* Default: 'owl-loading'
*/
loadingClass?: string;
/**
* Class after load.
*
* Default: 'owl-loaded'
*/
loadedClass?: string;
/**
* Class for right-to-left mode.
*
* Default: 'owl-rtl'
*/
rtlClass?: string;
/**
* Class for mouse drag.
*
* Default: 'owl-drag'
*/
dragClass?: string;
/**
* Class during mouse drag.
*
* Default: 'owl-grab'
*/
grabClass?: string;
/**
* Stage class.
*
* Default: 'owl-stage'
*/
stageClass?: string;
/**
* Stage outer class.
*
* Default: 'owl-stage-outer'
*/
stageOuterClass?: string;
/**
* Navigation contianer class.
*
* Default: 'owl-nav'
*/
navContainerClass?: string;
/**
* Navigation buttons classes.
*
* Default: ['owl-prev', 'owl-next]
*/
navClass?: string[];
/**
* Controls container class - wrapper dor navs and dots
*
* Default: 'owl-controls'
*/
controlsClass?: string;
/**
* Dot class.
*
* Default: 'owl-dot'
*/
dotClass?: string;
/**
* Dots container class
*
* Default: 'owl-dots'
*/
dotsClass?: string;
/**
* Auto height class.
*
* Default: 'owl-height'
*/
autoHeightClass?: string;
/**
* Optional helper class. Add '<responsiveClass>-<breakpoint>' class to main element. Can be used to stylize content on given breakpoint.
*
* Default: false
*/
responsiveClass?: string | boolean;
}
export interface Events {
/**
* When the plugin initializes. When the plugin initializes.
*
* Default: false
*/
onInitialize?: () => void;
/**
* When the plugin has initialized.
*
* Default: false
*/
onInitialized?: () => void;
/**
* When the plugin gets resized.
*
* Default: false
*/
onResize?: () => void;
/**
* When the plugin has resized.
*
* Default: false
*/
onResized?: () => void;
/**
* When the internal state of the plugin needs update.
*
* Default: false
*/
onRefresh?: () => void;
/**
* When the internal state of the plugin has updated.
*
* Default: false
*/
onRefreshed?: () => void;
/**
* When the dragging of an item is started.
*
* Default: false
*/
onDrag?: () => void;
/**
* When the dragging of an item has finished.
*
* Default: false
*/
onDragged?: () => void;
/**
* When the translation of the stage starts.
*
* Default: false
*/
onTranslate?: () => void;
/**
* When the translation of the stage has finished.
*
* Default: false
*/
onTranslated?: () => void;
/**
* Parameter: property. When a property is going to change its value.
*
* Default: false
*/
onChange?: () => void;
/**
* Parameter: property. When a property has changed its value.
*
* Default: false
*/
onChanged?: () => void;
/**
* When lazy image loads.
*
* Default: false
*/
onLoadLazy?: () => void;
/**
* When lazy image has loaded.
*
* Default: false
*/
onLoadedLazy?: () => void;
/**
* When video has unloaded.
*
* Default: false
*/
onStopVideo?: () => void;
/**
* When video has loaded.
*
* Default: false
*/
onPlayVideo?: () => void;
}
export default class OwlCarousel extends React.PureComponent<Props & ClassProps & Events> {
}