UNPKG

7.7 kBTypeScriptView Raw
1import { SwiperOptions } from './swiper-options';
2import Swiper from './swiper-class';
3
4import { A11yEvents } from './components/a11y';
5import { AutoplayEvents } from './components/autoplay';
6import { ControllerEvents } from './components/controller';
7import { CoverflowEffectEvents } from './components/effect-coverflow';
8import { CubeEffectEvents } from './components/effect-cube';
9import { FadeEffectEvents } from './components/effect-fade';
10import { FlipEffectEvents } from './components/effect-flip';
11import { HashNavigationEvents } from './components/hash-navigation';
12import { HistoryEvents } from './components/history';
13import { KeyboardEvents } from './components/keyboard';
14import { LazyEvents } from './components/lazy';
15import { MousewheelEvents } from './components/mousewheel';
16import { NavigationEvents } from './components/navigation';
17import { PaginationEvents } from './components/pagination';
18import { ParallaxEvents } from './components/parallax';
19import { ScrollbarEvents } from './components/scrollbar';
20import { ThumbsEvents } from './components/thumbs';
21import { VirtualEvents } from './components/virtual';
22import { ZoomEvents } from './components/zoom';
23
24export interface SwiperEvents {
25 // CORE_EVENTS_START
26 /**
27 * Fired right after Swiper initialization.
28 * @note Note that with swiper.on('init') syntax it will
29 * work only in case you set init: false parameter.
30 *
31 * @example
32 * var swiper = new Swiper('.swiper-container', {
33 * init: false,
34 * // other parameters
35 * });
36 * swiper.on('init', function() {
37 * // do something
38 * });
39 * // init Swiper
40 * swiper.init();
41 *
42 * @example
43 * // Otherwise use it as the parameter:
44 * var swiper = new Swiper('.swiper-container', {
45 * // other parameters
46 * on: {
47 * init: function () {
48 * // do something
49 * },
50 * }
51 * });
52 */
53 init: (swiper: Swiper) => any;
54
55 /**
56 * Event will be fired right before Swiper destroyed
57 */
58 beforeDestroy: (swiper: Swiper) => void;
59
60 /**
61 * Event will be fired when currently active slide is changed
62 */
63 slideChange: (swiper: Swiper) => void;
64
65 /**
66 * Event will be fired in the beginning of animation to other slide (next or previous).
67 */
68 slideChangeTransitionStart: (swiper: Swiper) => void;
69
70 /**
71 * Event will be fired after animation to other slide (next or previous).
72 */
73 slideChangeTransitionEnd: (swiper: Swiper) => void;
74
75 /**
76 * Same as "slideChangeTransitionStart" but for "forward" direction only
77 */
78 slideNextTransitionStart: (swiper: Swiper) => void;
79
80 /**
81 * Same as "slideChangeTransitionEnd" but for "forward" direction only
82 */
83 slideNextTransitionEnd: (swiper: Swiper) => void;
84
85 /**
86 * Same as "slideChangeTransitionStart" but for "backward" direction only
87 */
88 slidePrevTransitionStart: (swiper: Swiper) => void;
89
90 /**
91 * Same as "slideChangeTransitionEnd" but for "backward" direction only
92 */
93 slidePrevTransitionEnd: (swiper: Swiper) => void;
94
95 /**
96 * Event will be fired in the beginning of transition.
97 */
98 transitionStart: (swiper: Swiper) => void;
99
100 /**
101 * Event will be fired after transition.
102 */
103 transitionEnd: (swiper: Swiper) => void;
104
105 /**
106 * Event will be fired when user touch Swiper. Receives 'touchstart' event as an arguments.
107 */
108 touchStart: (swiper: Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
109
110 /**
111 * Event will be fired when user touch and move finger over Swiper. Receives 'touchmove' event as an arguments.
112 */
113 touchMove: (swiper: Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
114
115 /**
116 * Event will be fired when user touch and move finger over Swiper in direction opposite to direction parameter. Receives 'touchmove' event as an arguments.
117 */
118 touchMoveOpposite: (swiper: Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
119
120 /**
121 * Event will be fired when user touch and move finger over Swiper and move it. Receives 'touchmove' event as an arguments.
122 */
123 sliderMove: (swiper: Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
124
125 /**
126 * Event will be fired when user release Swiper. Receives 'touchend' event as an arguments.
127 */
128 touchEnd: (swiper: Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
129
130 /**
131 * Event will be fired when user click/tap on Swiper. Receives 'touchend' event as an arguments.
132 */
133 click: (swiper: Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
134
135 /**
136 * Event will be fired when user click/tap on Swiper. Receives 'touchend' event as an arguments.
137 */
138 tap: (swiper: Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
139
140 /**
141 * Event will be fired when user double tap on Swiper's container. Receives 'touchend' event as an arguments
142 */
143 doubleTap: (swiper: Swiper, event: MouseEvent | TouchEvent | PointerEvent) => void;
144
145 /**
146 * Event will be fired right after all inner images are loaded. updateOnImagesReady should be also enabled
147 */
148 imagesReady: (swiper: Swiper) => void;
149
150 /**
151 * Event will be fired when Swiper progress is changed, as an arguments it receives progress that is always from 0 to 1
152 */
153 progress: (swiper: Swiper, progress: number) => void;
154
155 /**
156 * Event will be fired when Swiper reach its beginning (initial position)
157 */
158 reachBeginning: (swiper: Swiper) => void;
159
160 /**
161 * Event will be fired when Swiper reach last slide
162 */
163 reachEnd: (swiper: Swiper) => void;
164
165 /**
166 * Event will be fired when Swiper goes to beginning or end position
167 */
168 toEdge: (swiper: Swiper) => void;
169
170 /**
171 * Event will be fired when Swiper goes from beginning or end position
172 */
173 fromEdge: (swiper: Swiper) => void;
174
175 /**
176 * Event will be fired when swiper's wrapper change its position. Receives current translate value as an arguments
177 */
178 setTranslate: (swiper: Swiper, translate: number) => void;
179
180 /**
181 * Event will be fired everytime when swiper starts animation. Receives current transition duration (in ms) as an arguments
182 */
183 setTransition: (swiper: Swiper, transition: number) => void;
184
185 /**
186 * Event will be fired on window resize right before swiper's onresize manipulation
187 */
188 resize: (swiper: Swiper) => void;
189
190 /**
191 * Event will be fired if observer is enabled and it detects DOM mutations
192 */
193 observerUpdate: (swiper: Swiper) => void;
194
195 /**
196 * Event will be fired right before "loop fix"
197 */
198 beforeLoopFix: (swiper: Swiper) => void;
199
200 /**
201 * Event will be fired after "loop fix"
202 */
203 loopFix: (swiper: Swiper) => void;
204
205 /**
206 * Event will be fired on breakpoint change
207 */
208 breakpoint: (swiper: Swiper, breakpointParams: SwiperOptions) => void;
209 // CORE_EVENTS_END
210}
211
212interface SwiperEvents extends A11yEvents {}
213interface SwiperEvents extends AutoplayEvents {}
214interface SwiperEvents extends ControllerEvents {}
215interface SwiperEvents extends CoverflowEffectEvents {}
216interface SwiperEvents extends CubeEffectEvents {}
217interface SwiperEvents extends FadeEffectEvents {}
218interface SwiperEvents extends FlipEffectEvents {}
219interface SwiperEvents extends HashNavigationEvents {}
220interface SwiperEvents extends HistoryEvents {}
221interface SwiperEvents extends KeyboardEvents {}
222interface SwiperEvents extends LazyEvents {}
223interface SwiperEvents extends MousewheelEvents {}
224interface SwiperEvents extends NavigationEvents {}
225interface SwiperEvents extends PaginationEvents {}
226interface SwiperEvents extends ParallaxEvents {}
227interface SwiperEvents extends ScrollbarEvents {}
228interface SwiperEvents extends ThumbsEvents {}
229interface SwiperEvents extends VirtualEvents {}
230interface SwiperEvents extends ZoomEvents {}