1 | import { SvelteComponentTyped } from 'svelte';
|
2 | import { SwiperOptions, Swiper as SwiperClass } from '../types/';
|
3 |
|
4 | // @ts-ignore
|
5 | interface SwiperProps
|
6 | extends SwiperOptions,
|
7 | svelte.JSX.HTMLAttributes<HTMLElementTagNameMap['div']> {}
|
8 |
|
9 | // @ts-ignore
|
10 | interface SwiperSlideProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap['div']> {
|
11 | /**
|
12 | * Enables additional wrapper required for zoom mode
|
13 | *
|
14 | * @default false
|
15 | */
|
16 | zoom?: boolean;
|
17 |
|
18 | /**
|
19 | * Slide's index in slides array/collection
|
20 | *
|
21 | * @default false
|
22 | */
|
23 | virtualIndex?: number;
|
24 | }
|
25 |
|
26 | declare class Swiper extends SvelteComponentTyped<
|
27 | SwiperProps,
|
28 | {
|
29 | swiper: CustomEvent<void>;
|
30 | /**
|
31 | * Event will be fired in when autoplay started
|
32 | */
|
33 | autoplayStart: CustomEvent<[swiper: SwiperClass]>;
|
34 | /**
|
35 | * Event will be fired when autoplay stopped
|
36 | */
|
37 | autoplayStop: CustomEvent<[swiper: SwiperClass]>;
|
38 | /**
|
39 | * Event will be fired on autoplay pause (on mouse/pointer enter), when `pauseOnMouseEnter` enabled
|
40 | */
|
41 | autoplayPause: CustomEvent<[swiper: SwiperClass]>;
|
42 | /**
|
43 | * Event will be fired on autoplay resume (on mouse/pointer leave), when `pauseOnMouseEnter` enabled
|
44 | */
|
45 | autoplayResume: CustomEvent<[swiper: SwiperClass]>;
|
46 | /**
|
47 | * Event will be fired when slide changed with autoplay
|
48 | */
|
49 | autoplay: CustomEvent<[swiper: SwiperClass]>;/**
|
50 | * Event will be fired on window hash change
|
51 | */
|
52 | hashChange: CustomEvent<[swiper: SwiperClass]>;
|
53 | /**
|
54 | * Event will be fired when swiper updates the hash
|
55 | */
|
56 | hashSet: CustomEvent<[swiper: SwiperClass]>;/**
|
57 | * Event will be fired on key press
|
58 | */
|
59 | keyPress: CustomEvent<[swiper: SwiperClass, keyCode: string]>;/**
|
60 | * Event will be fired in the beginning of lazy loading of image
|
61 | */
|
62 | lazyImageLoad: CustomEvent<[swiper: SwiperClass, slideEl: HTMLElement, imageEl: HTMLElement]>;
|
63 | /**
|
64 | * Event will be fired when lazy loading image will be loaded
|
65 | */
|
66 | lazyImageReady: CustomEvent<[swiper: SwiperClass, slideEl: HTMLElement, imageEl: HTMLElement]>;/**
|
67 | * Event will be fired on mousewheel scroll
|
68 | */
|
69 | scroll: CustomEvent<[swiper: SwiperClass, event: WheelEvent]>;/**
|
70 | * Event will be fired on navigation hide
|
71 | */
|
72 | navigationHide: CustomEvent<[swiper: SwiperClass]>;
|
73 | /**
|
74 | * Event will be fired on navigation show
|
75 | */
|
76 | navigationShow: CustomEvent<[swiper: SwiperClass]>;
|
77 | /**
|
78 | * Event will be fired on navigation prev button click
|
79 | */
|
80 | navigationPrev: CustomEvent<[swiper: SwiperClass]>;
|
81 | /**
|
82 | * Event will be fired on navigation next button click
|
83 | */
|
84 | navigationNext: CustomEvent<[swiper: SwiperClass]>;/**
|
85 | * Event will be fired after pagination rendered
|
86 | */
|
87 | paginationRender: CustomEvent<[swiper: SwiperClass, paginationEl: HTMLElement]>;
|
88 |
|
89 | /**
|
90 | * Event will be fired when pagination updated
|
91 | */
|
92 | paginationUpdate: CustomEvent<[swiper: SwiperClass, paginationEl: HTMLElement]>;
|
93 |
|
94 | /**
|
95 | * Event will be fired on pagination hide
|
96 | */
|
97 | paginationHide: CustomEvent<[swiper: SwiperClass]>;
|
98 |
|
99 | /**
|
100 | * Event will be fired on pagination show
|
101 | */
|
102 | paginationShow: CustomEvent<[swiper: SwiperClass]>;/**
|
103 | * Event will be fired on draggable scrollbar drag start
|
104 | */
|
105 | scrollbarDragStart: CustomEvent<[swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent]>;
|
106 |
|
107 | /**
|
108 | * Event will be fired on draggable scrollbar drag move
|
109 | */
|
110 | scrollbarDragMove: CustomEvent<[swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent]>;
|
111 |
|
112 | /**
|
113 | * Event will be fired on draggable scrollbar drag end
|
114 | */
|
115 | scrollbarDragEnd: CustomEvent<[swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent]>;/**
|
116 | * Event will be fired on zoom change
|
117 | */
|
118 | zoomChange: CustomEvent<[swiper: SwiperClass, scale: number, imageEl: HTMLElement, slideEl: HTMLElement]>;
|
119 |
|
120 | /**
|
121 | * Fired right after Swiper initialization.
|
122 | * @note Note that with `swiper.on('init')` syntax it will
|
123 | * work only in case you set `init: false` parameter.
|
124 | *
|
125 | * @example
|
126 | * ```js
|
127 | * const swiper = new Swiper('.swiper', {
|
128 | * init: false,
|
129 | * // other parameters
|
130 | * });
|
131 | * swiper.on('init', function() {
|
132 | * // do something
|
133 | * });
|
134 | * // init Swiper
|
135 | * swiper.init();
|
136 | * ```
|
137 | *
|
138 | * @example
|
139 | * ```js
|
140 | * // Otherwise use it as the parameter:
|
141 | * const swiper = new Swiper('.swiper', {
|
142 | * // other parameters
|
143 | * on: {
|
144 | * init: function () {
|
145 | * // do something
|
146 | * },
|
147 | * }
|
148 | * });
|
149 | * ```
|
150 | */
|
151 | init: CustomEvent<[swiper: SwiperClass]>;
|
152 |
|
153 | /**
|
154 | * Event will be fired right before Swiper destroyed
|
155 | */
|
156 | beforeDestroy: CustomEvent<[swiper: SwiperClass]>;
|
157 |
|
158 | /**
|
159 | * Event will be fired when currently active slide is changed
|
160 | */
|
161 | slideChange: CustomEvent<[swiper: SwiperClass]>;
|
162 |
|
163 | /**
|
164 | * Event will be fired in the beginning of animation to other slide (next or previous).
|
165 | */
|
166 | slideChangeTransitionStart: CustomEvent<[swiper: SwiperClass]>;
|
167 |
|
168 | /**
|
169 | * Event will be fired after animation to other slide (next or previous).
|
170 | */
|
171 | slideChangeTransitionEnd: CustomEvent<[swiper: SwiperClass]>;
|
172 |
|
173 | /**
|
174 | * Same as "slideChangeTransitionStart" but for "forward" direction only
|
175 | */
|
176 | slideNextTransitionStart: CustomEvent<[swiper: SwiperClass]>;
|
177 |
|
178 | /**
|
179 | * Same as "slideChangeTransitionEnd" but for "forward" direction only
|
180 | */
|
181 | slideNextTransitionEnd: CustomEvent<[swiper: SwiperClass]>;
|
182 |
|
183 | /**
|
184 | * Same as "slideChangeTransitionStart" but for "backward" direction only
|
185 | */
|
186 | slidePrevTransitionStart: CustomEvent<[swiper: SwiperClass]>;
|
187 |
|
188 | /**
|
189 | * Same as "slideChangeTransitionEnd" but for "backward" direction only
|
190 | */
|
191 | slidePrevTransitionEnd: CustomEvent<[swiper: SwiperClass]>;
|
192 |
|
193 | /**
|
194 | * Event will be fired in the beginning of transition.
|
195 | */
|
196 | transitionStart: CustomEvent<[swiper: SwiperClass]>;
|
197 |
|
198 | /**
|
199 | * Event will be fired after transition.
|
200 | */
|
201 | transitionEnd: CustomEvent<[swiper: SwiperClass]>;
|
202 |
|
203 | /**
|
204 | * Event will be fired when user touch Swiper. Receives `touchstart` event as an arguments.
|
205 | */
|
206 | touchStart: CustomEvent<[swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent]>;
|
207 |
|
208 | /**
|
209 | * Event will be fired when user touch and move finger over Swiper. Receives `touchmove` event as an arguments.
|
210 | */
|
211 | touchMove: CustomEvent<[swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent]>;
|
212 |
|
213 | /**
|
214 | * Event will be fired when user touch and move finger over Swiper in direction opposite to direction parameter. Receives `touchmove` event as an arguments.
|
215 | */
|
216 | touchMoveOpposite: CustomEvent<[swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent]>;
|
217 |
|
218 | /**
|
219 | * Event will be fired when user touch and move finger over Swiper and move it. Receives `touchmove` event as an arguments.
|
220 | */
|
221 | sliderMove: CustomEvent<[swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent]>;
|
222 |
|
223 | /**
|
224 | * Event will be fired when user release Swiper. Receives `touchend` event as an arguments.
|
225 | */
|
226 | touchEnd: CustomEvent<[swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent]>;
|
227 |
|
228 | /**
|
229 | * Event will be fired when user click/tap on Swiper. Receives `touchend` event as an arguments.
|
230 | */
|
231 | click: CustomEvent<[swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent]>;
|
232 |
|
233 | /**
|
234 | * Event will be fired when user click/tap on Swiper. Receives `touchend` event as an arguments.
|
235 | */
|
236 | tap: CustomEvent<[swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent]>;
|
237 |
|
238 | /**
|
239 | * Event will be fired when user double tap on Swiper's container. Receives `touchend` event as an arguments
|
240 | */
|
241 | doubleTap: CustomEvent<[swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent]>;
|
242 |
|
243 | /**
|
244 | * Event will be fired right after all inner images are loaded. updateOnImagesReady should be also enabled
|
245 | */
|
246 | imagesReady: CustomEvent<[swiper: SwiperClass]>;
|
247 |
|
248 | /**
|
249 | * Event will be fired when Swiper progress is changed, as an arguments it receives progress that is always from 0 to 1
|
250 | */
|
251 | progress: CustomEvent<[swiper: SwiperClass, progress: number]>;
|
252 |
|
253 | /**
|
254 | * Event will be fired when Swiper reach its beginning (initial position)
|
255 | */
|
256 | reachBeginning: CustomEvent<[swiper: SwiperClass]>;
|
257 |
|
258 | /**
|
259 | * Event will be fired when Swiper reach last slide
|
260 | */
|
261 | reachEnd: CustomEvent<[swiper: SwiperClass]>;
|
262 |
|
263 | /**
|
264 | * Event will be fired when Swiper goes to beginning or end position
|
265 | */
|
266 | toEdge: CustomEvent<[swiper: SwiperClass]>;
|
267 |
|
268 | /**
|
269 | * Event will be fired when Swiper goes from beginning or end position
|
270 | */
|
271 | fromEdge: CustomEvent<[swiper: SwiperClass]>;
|
272 |
|
273 | /**
|
274 | * Event will be fired when swiper's wrapper change its position. Receives current translate value as an arguments
|
275 | */
|
276 | setTranslate: CustomEvent<[swiper: SwiperClass, translate: number]>;
|
277 |
|
278 | /**
|
279 | * Event will be fired everytime when swiper starts animation. Receives current transition duration (in ms) as an arguments
|
280 | */
|
281 | setTransition: CustomEvent<[swiper: SwiperClass, transition: number]>;
|
282 |
|
283 | /**
|
284 | * Event will be fired on window resize right before swiper's onresize manipulation
|
285 | */
|
286 | resize: CustomEvent<[swiper: SwiperClass]>;
|
287 |
|
288 | /**
|
289 | * Event will be fired if observer is enabled and it detects DOM mutations
|
290 | */
|
291 | observerUpdate: CustomEvent<[swiper: SwiperClass]>;
|
292 |
|
293 | /**
|
294 | * Event will be fired right before "loop fix"
|
295 | */
|
296 | beforeLoopFix: CustomEvent<[swiper: SwiperClass]>;
|
297 |
|
298 | /**
|
299 | * Event will be fired after "loop fix"
|
300 | */
|
301 | loopFix: CustomEvent<[swiper: SwiperClass]>;
|
302 |
|
303 | /**
|
304 | * Event will be fired on breakpoint change
|
305 | */
|
306 | breakpoint: CustomEvent<[swiper: SwiperClass, breakpointParams: SwiperOptions]>;
|
307 |
|
308 | /**
|
309 | * !INTERNAL: Event will fired right before breakpoint change
|
310 | */
|
311 | _beforeBreakpoint: CustomEvent<[swiper: SwiperClass, breakpointParams: SwiperOptions]>;
|
312 |
|
313 | /**
|
314 | * !INTERNAL: Event will fired after setting CSS classes on swiper container element
|
315 | */
|
316 | _containerClasses: CustomEvent<[swiper: SwiperClass, classNames: string]>;
|
317 |
|
318 | /**
|
319 | * !INTERNAL: Event will fired after setting CSS classes on swiper slide element
|
320 | */
|
321 | _slideClass: CustomEvent<[swiper: SwiperClass, slideEl: HTMLElement, classNames: string]>;
|
322 |
|
323 | /**
|
324 | * !INTERNAL: Event will fired after setting CSS classes on all swiper slides
|
325 | */
|
326 | _slideClasses: CustomEvent<[
|
327 | swiper: SwiperClass,
|
328 | slides: { slideEl: HTMLElement; classNames: string; index: number }[],
|
329 | ]>;
|
330 |
|
331 | /**
|
332 | * !INTERNAL: Event will fired as soon as swiper instance available (before init)
|
333 | */
|
334 | _swiper: CustomEvent<[swiper: SwiperClass]>;
|
335 |
|
336 | /**
|
337 | * !INTERNAL: Event will be fired on free mode touch end (release) and there will no be momentum
|
338 | */
|
339 | _freeModeNoMomentumRelease: CustomEvent<[swiper: SwiperClass]>;
|
340 |
|
341 | /**
|
342 | * Event will fired on active index change
|
343 | */
|
344 | activeIndexChange: CustomEvent<[swiper: SwiperClass]>;
|
345 | /**
|
346 | * Event will fired on snap index change
|
347 | */
|
348 | snapIndexChange: CustomEvent<[swiper: SwiperClass]>;
|
349 | /**
|
350 | * Event will fired on real index change
|
351 | */
|
352 | realIndexChange: CustomEvent<[swiper: SwiperClass]>;
|
353 | /**
|
354 | * Event will fired right after initialization
|
355 | */
|
356 | afterInit: CustomEvent<[swiper: SwiperClass]>;
|
357 | /**
|
358 | * Event will fired right before initialization
|
359 | */
|
360 | beforeInit: CustomEvent<[swiper: SwiperClass]>;
|
361 | /**
|
362 | * Event will fired before resize handler
|
363 | */
|
364 | beforeResize: CustomEvent<[swiper: SwiperClass]>;
|
365 | /**
|
366 | * Event will fired before slide change transition start
|
367 | */
|
368 | beforeSlideChangeStart: CustomEvent<[swiper: SwiperClass]>;
|
369 | /**
|
370 | * Event will fired before transition start
|
371 | */
|
372 | beforeTransitionStart: CustomEvent<[swiper: SwiperClass, speed: number, internal: any]>; // what is internal?
|
373 | /**
|
374 | * Event will fired on direction change
|
375 | */
|
376 | changeDirection: CustomEvent<[swiper: SwiperClass]>;
|
377 | /**
|
378 | * Event will be fired when user double click/tap on Swiper
|
379 | */
|
380 | doubleClick: CustomEvent<[swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent]>;
|
381 | /**
|
382 | * Event will be fired on swiper destroy
|
383 | */
|
384 | destroy: CustomEvent<[swiper: SwiperClass]>;
|
385 | /**
|
386 | * Event will be fired on momentum bounce
|
387 | */
|
388 | momentumBounce: CustomEvent<[swiper: SwiperClass]>;
|
389 | /**
|
390 | * Event will be fired on orientation change (e.g. landscape -> portrait)
|
391 | */
|
392 | orientationchange: CustomEvent<[swiper: SwiperClass]>;
|
393 | /**
|
394 | * Event will be fired in the beginning of animation of resetting slide to current one
|
395 | */
|
396 | slideResetTransitionStart: CustomEvent<[swiper: SwiperClass]>;
|
397 | /**
|
398 | * Event will be fired in the end of animation of resetting slide to current one
|
399 | */
|
400 | slideResetTransitionEnd: CustomEvent<[swiper: SwiperClass]>;
|
401 | /**
|
402 | * Event will be fired with first touch/drag move
|
403 | */
|
404 | sliderFirstMove: CustomEvent<[swiper: SwiperClass, event: TouchEvent]>;
|
405 | /**
|
406 | * Event will be fired when number of slides has changed
|
407 | */
|
408 | slidesLengthChange: CustomEvent<[swiper: SwiperClass]>;
|
409 | /**
|
410 | * Event will be fired when slides grid has changed
|
411 | */
|
412 | slidesGridLengthChange: CustomEvent<[swiper: SwiperClass]>;
|
413 | /**
|
414 | * Event will be fired when snap grid has changed
|
415 | */
|
416 | snapGridLengthChange: CustomEvent<[swiper: SwiperClass]>;
|
417 | /**
|
418 | * Event will be fired after swiper.update() call
|
419 | */
|
420 | update: CustomEvent<[swiper: SwiperClass]>;
|
421 | /**
|
422 | * Event will be fired when swiper is locked (when `watchOverflow` enabled)
|
423 | */
|
424 | lock: CustomEvent<[swiper: SwiperClass]>;
|
425 | /**
|
426 | * Event will be fired when swiper is unlocked (when `watchOverflow` enabled)
|
427 | */
|
428 | unlock: CustomEvent<[swiper: SwiperClass]>;
|
429 |
|
430 | },
|
431 | {
|
432 | default: {
|
433 | virtualData: {
|
434 | slides: any[];
|
435 | offset: number;
|
436 | from: number;
|
437 | to: number;
|
438 | slidesGrid: number[];
|
439 | };
|
440 | };
|
441 | 'container-start': {};
|
442 | 'wrapper-start': {};
|
443 | 'wrapper-end': {};
|
444 | 'container-end': {};
|
445 | }
|
446 | > {}
|
447 |
|
448 | declare class SwiperSlide extends SvelteComponentTyped<
|
449 | SwiperSlideProps,
|
450 | {},
|
451 | {
|
452 | default: {
|
453 | data: {
|
454 | isActive: boolean;
|
455 | isVisible: boolean;
|
456 | isDuplicate: boolean;
|
457 | isPrev: boolean;
|
458 | isNext: boolean;
|
459 | };
|
460 | };
|
461 | }
|
462 | > {}
|
463 |
|
464 | export { Swiper, SwiperSlide };
|