-
Notifications
You must be signed in to change notification settings - Fork 0
/
lg-events.d.ts
300 lines (300 loc) · 6.93 KB
/
lg-events.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
import { LightGallery } from './lightgallery';
import { VideoSource } from './plugins/video/types';
/**
* List of lightGallery events
* All events should be documented here
* Below interfaces are used to build the website documentations
* */
export declare const lGEvents: {
[key: string]: string;
};
/**
* Fired only once when lightGallery is initialized
* @name lgInit
* @method onInit
* @example
* const lg = document.getElementById('custom-events-demo');
* // Perform any action on lightGallery initialization.
* // Init event returns the plugin instance that can be used to call any lightGalley public method
* let pluginInstance = null;
* lg.addEventListener('lgInit', (event) => {
* pluginInstance = event.detail.instance;
* });
* lightGallery(lg);
* @see <a href="/docs/methods">Methods<a>
*/
export interface InitDetail {
/**
* lightGallery plugin instance
*/
instance: LightGallery;
}
/**
* Fired when the slide content has been inserted into it's slide container.
* @name lgAfterAppendSlide
* @method onAfterAppendSlide
*/
export interface AfterAppendSlideEventDetail {
/**
* Index of the slide
*/
index: number;
}
/**
* Fired immediately before opening the gallery
* @name lgBeforeOpen
* @method onBeforeOpen
*/
export interface BeforeOpenDetail {
}
/**
* Fired immediately after opening the gallery
* @name lgAfterOpen
* @method onAfterOpen
*/
export interface AfterOpenDetail {
}
/**
* Fired once the media inside the slide has been completely loaded .
* @name lgSlideItemLoad
* @method onSlideItemLoad
*/
export interface SlideItemLoadDetail {
/**
* Index of the slide
*/
index: number;
/**
* For the first slide, lightGallery adds some delay for displaying the loaded slide item.
* This delay is required for the transition effect when the slide item is displayed
* Respect the delay when you use this event
*/
delay: number;
isFirstSlide: boolean;
}
/**
* Fired immediately before each slide transition.
* @name lgBeforeSlide
* @method onBeforeSlide
* @example
* const lg = document.getElementById('custom-events-demo');
* // Perform any action before each slide transition
* lg.addEventListener('lgBeforeSlide', (event) => {
* const { index, prevIndex } = event.detail;
* alert(index, prevIndex);
* });
* lightGallery(lg);
*/
export interface BeforeSlideDetail {
/**
* Index of the previous slide
*/
prevIndex: number;
/**
* Index of the slide
*/
index: number;
/**
* true if slide function called via touch event or mouse drag
*/
fromTouch: boolean;
/**
* true if slide function called via thumbnail click
*/
fromThumb: boolean;
}
/**
* Fired immediately after each slide transition.
* @name lgAfterSlide
* @method onAfterSlide
*/
export interface AfterSlideDetail {
/**
* Index of the previous slide
*/
prevIndex: number;
/**
* Index of the slide
*/
index: number;
/**
* true if slide function called via touch event or mouse drag
*/
fromTouch: boolean;
/**
* true if slide function called via thumbnail click
*/
fromThumb: boolean;
}
/**
* Fired when the video poster is clicked.
* @name lgPosterClick
* @method onPosterClick
*/
export interface PosterClickDetail {
}
/**
* Fired when the drag event to move to different slide starts.
* @name lgDragStart
* @method onDragStart
*/
export interface DragStartDetail {
}
/**
* Fired periodically during the drag operation.
* @name lgDragMove
* @method onDragMove
*/
export interface DragMoveDetail {
}
/**
* Fired when the user has finished the drag operation
* @name lgDragEnd
* @method onDragEnd
*/
export interface DragEndDetail {
}
/**
* Fired immediately before the start of the close process.
* @name lgBeforeClose
* @method onBeforeClose
*/
export interface BeforeCloseDetail {
}
/**
* Fired immediately once lightGallery is closed.
* @name lgAfterClose
* @method onAfterClose
*/
export interface AfterCloseDetail {
/**
* lightGallery plugin instance
*/
instance: LightGallery;
}
/**
* Fired immediately before each "next" slide transition
* @name lgBeforeNextSlide
* @method onBeforeNextSlide
*/
export interface BeforeNextSlideDetail {
/**
* Index of the slide
*/
index: number;
/**
* true if slide function called via touch event or mouse drag
*/
fromTouch: boolean;
}
/**
* Fired immediately before each "prev" slide transition
* @name lgBeforePrevSlide
* @method onBeforePrevSlide
*/
export interface BeforePrevSlideDetail {
/**
* Index of the slide
*/
index: number;
/**
* true if slide function called via touch event or mouse drag
*/
fromTouch: boolean;
}
/**
* Fired when the sub-html content (ex : title/ description) has been appended into the slide.
* @name lgAfterAppendSubHtml
* @method onAfterAppendSubHtml
*/
export interface AfterAppendSubHtmlDetail {
/**
* Index of the slide
*/
index: number;
}
/**
* Fired when the lightGallery container has been resized.
* @name lgContainerResize
* @method onContainerResize
*/
export interface ContainerResizeDetail {
/**
* Index of the slide
*/
index: number;
}
/**
* Fired when lightGallery detects video slide
* @name lgHasVideo
* @method onHasVideo
*/
export interface HasVideoDetail {
/**
* Index of the slide,
*/
index: number;
/**
* Video source
*/
src: string;
/**
* HTML5 video source if available
* <p>
HTML5 video source = source: {
src: string;
type: string;
}[];
attributes: HTMLVideoElement;
* </p>
*/
html5Video: VideoSource;
/**
* True if video has poster
*/
hasPoster: boolean;
}
/**
* Fired when the image is rotated in anticlockwise direction
* @name lgRotateLeft
* @method onRotateLeft
*/
export interface RotateLeftDetail {
/**
* Index of the slide
*/
index: number;
}
/**
* Fired when the image is rotated in clockwise direction
* @name lgRotateRight
* @method onRotateRight
*/
export interface RotateRightDetail {
/**
* Index of the slide
*/
index: number;
}
/**
* Fired when the image is flipped horizontally
* @name lgFlipHorizontal
* @method onFlipHorizontal
*/
export interface FlipHorizontalDetail {
/**
* Index of the slide
*/
index: number;
}
/**
* Fired when the image is flipped vertically
* @name lgFlipVertical
* @method onFlipVertical
*/
export interface FlipVerticalDetail {
/**
* Index of the slide
*/
index: number;
}