1 | import { LightGallery } from './lightgallery';
|
2 | import { VideoSource } from './plugins/video/types';
|
3 | /**
|
4 | * List of lightGallery events
|
5 | * All events should be documented here
|
6 | * Below interfaces are used to build the website documentations
|
7 | * */
|
8 | export declare const lGEvents: {
|
9 | [key: string]: string;
|
10 | };
|
11 | /**
|
12 | * Fired only once when lightGallery is initialized
|
13 | * @name lgInit
|
14 | * @method onInit
|
15 | * @example
|
16 | * const lg = document.getElementById('custom-events-demo');
|
17 | * // Perform any action on lightGallery initialization.
|
18 | * // Init event returns the plugin instance that can be used to call any lightGalley public method
|
19 | * let pluginInstance = null;
|
20 | * lg.addEventListener('lgInit', (event) => {
|
21 | * pluginInstance = event.detail.instance;
|
22 | * });
|
23 | * lightGallery(lg);
|
24 | * @see <a href="/docs/methods">Methods<a>
|
25 | */
|
26 | export interface InitDetail {
|
27 | /**
|
28 | * lightGallery plugin instance
|
29 | */
|
30 | instance: LightGallery;
|
31 | }
|
32 | /**
|
33 | * Fired when the slide content has been inserted into it's slide container.
|
34 | * @name lgAfterAppendSlide
|
35 | * @method onAfterAppendSlide
|
36 | */
|
37 | export interface AfterAppendSlideEventDetail {
|
38 | /**
|
39 | * Index of the slide
|
40 | */
|
41 | index: number;
|
42 | }
|
43 | /**
|
44 | * Fired immediately before opening the gallery
|
45 | * @name lgBeforeOpen
|
46 | * @method onBeforeOpen
|
47 | */
|
48 | export interface BeforeOpenDetail {
|
49 | }
|
50 | /**
|
51 | * Fired immediately after opening the gallery
|
52 | * @name lgAfterOpen
|
53 | * @method onAfterOpen
|
54 | */
|
55 | export interface AfterOpenDetail {
|
56 | }
|
57 | /**
|
58 | * Fired once the media inside the slide has been completely loaded .
|
59 | * @name lgSlideItemLoad
|
60 | * @method onSlideItemLoad
|
61 | */
|
62 | export interface SlideItemLoadDetail {
|
63 | /**
|
64 | * Index of the slide
|
65 | */
|
66 | index: number;
|
67 | /**
|
68 | * For the first slide, lightGallery adds some delay for displaying the loaded slide item.
|
69 | * This delay is required for the transition effect when the slide item is displayed
|
70 | * Respect the delay when you use this event
|
71 | */
|
72 | delay: number;
|
73 | isFirstSlide: boolean;
|
74 | }
|
75 | /**
|
76 | * Fired immediately before each slide transition.
|
77 | * @name lgBeforeSlide
|
78 | * @method onBeforeSlide
|
79 | * @example
|
80 | * const lg = document.getElementById('custom-events-demo');
|
81 | * // Perform any action before each slide transition
|
82 | * lg.addEventListener('lgBeforeSlide', (event) => {
|
83 | * const { index, prevIndex } = event.detail;
|
84 | * alert(index, prevIndex);
|
85 | * });
|
86 | * lightGallery(lg);
|
87 | */
|
88 | export interface BeforeSlideDetail {
|
89 | /**
|
90 | * Index of the previous slide
|
91 | */
|
92 | prevIndex: number;
|
93 | /**
|
94 | * Index of the slide
|
95 | */
|
96 | index: number;
|
97 | /**
|
98 | * true if slide function called via touch event or mouse drag
|
99 | */
|
100 | fromTouch: boolean;
|
101 | /**
|
102 | * true if slide function called via thumbnail click
|
103 | */
|
104 | fromThumb: boolean;
|
105 | }
|
106 | /**
|
107 | * Fired immediately after each slide transition.
|
108 | * @name lgAfterSlide
|
109 | * @method onAfterSlide
|
110 | */
|
111 | export interface AfterSlideDetail {
|
112 | /**
|
113 | * Index of the previous slide
|
114 | */
|
115 | prevIndex: number;
|
116 | /**
|
117 | * Index of the slide
|
118 | */
|
119 | index: number;
|
120 | /**
|
121 | * true if slide function called via touch event or mouse drag
|
122 | */
|
123 | fromTouch: boolean;
|
124 | /**
|
125 | * true if slide function called via thumbnail click
|
126 | */
|
127 | fromThumb: boolean;
|
128 | }
|
129 | /**
|
130 | * Fired when the video poster is clicked.
|
131 | * @name lgPosterClick
|
132 | * @method onPosterClick
|
133 | */
|
134 | export interface PosterClickDetail {
|
135 | }
|
136 | /**
|
137 | * Fired when the drag event to move to different slide starts.
|
138 | * @name lgDragStart
|
139 | * @method onDragStart
|
140 | */
|
141 | export interface DragStartDetail {
|
142 | }
|
143 | /**
|
144 | * Fired periodically during the drag operation.
|
145 | * @name lgDragMove
|
146 | * @method onDragMove
|
147 | */
|
148 | export interface DragMoveDetail {
|
149 | }
|
150 | /**
|
151 | * Fired when the user has finished the drag operation
|
152 | * @name lgDragEnd
|
153 | * @method onDragEnd
|
154 | */
|
155 | export interface DragEndDetail {
|
156 | }
|
157 | /**
|
158 | * Fired immediately before the start of the close process.
|
159 | * @name lgBeforeClose
|
160 | * @method onBeforeClose
|
161 | */
|
162 | export interface BeforeCloseDetail {
|
163 | }
|
164 | /**
|
165 | * Fired immediately once lightGallery is closed.
|
166 | * @name lgAfterClose
|
167 | * @method onAfterClose
|
168 | */
|
169 | export interface AfterCloseDetail {
|
170 | /**
|
171 | * lightGallery plugin instance
|
172 | */
|
173 | instance: LightGallery;
|
174 | }
|
175 | /**
|
176 | * Fired immediately before each "next" slide transition
|
177 | * @name lgBeforeNextSlide
|
178 | * @method onBeforeNextSlide
|
179 | */
|
180 | export interface BeforeNextSlideDetail {
|
181 | /**
|
182 | * Index of the slide
|
183 | */
|
184 | index: number;
|
185 | /**
|
186 | * true if slide function called via touch event or mouse drag
|
187 | */
|
188 | fromTouch: boolean;
|
189 | }
|
190 | /**
|
191 | * Fired immediately before each "prev" slide transition
|
192 | * @name lgBeforePrevSlide
|
193 | * @method onBeforePrevSlide
|
194 | */
|
195 | export interface BeforePrevSlideDetail {
|
196 | /**
|
197 | * Index of the slide
|
198 | */
|
199 | index: number;
|
200 | /**
|
201 | * true if slide function called via touch event or mouse drag
|
202 | */
|
203 | fromTouch: boolean;
|
204 | }
|
205 | /**
|
206 | * Fired when the sub-html content (ex : title/ description) has been appended into the slide.
|
207 | * @name lgAfterAppendSubHtml
|
208 | * @method onAfterAppendSubHtml
|
209 | */
|
210 | export interface AfterAppendSubHtmlDetail {
|
211 | /**
|
212 | * Index of the slide
|
213 | */
|
214 | index: number;
|
215 | }
|
216 | /**
|
217 | * Fired when the lightGallery container has been resized.
|
218 | * @name lgContainerResize
|
219 | * @method onContainerResize
|
220 | */
|
221 | export interface ContainerResizeDetail {
|
222 | /**
|
223 | * Index of the slide
|
224 | */
|
225 | index: number;
|
226 | }
|
227 | /**
|
228 | * Fired when lightGallery detects video slide
|
229 | * @name lgHasVideo
|
230 | * @method onHasVideo
|
231 | */
|
232 | export interface HasVideoDetail {
|
233 | /**
|
234 | * Index of the slide,
|
235 | */
|
236 | index: number;
|
237 | /**
|
238 | * Video source
|
239 | */
|
240 | src: string;
|
241 | /**
|
242 | * HTML5 video source if available
|
243 | * <p>
|
244 | HTML5 video source = source: {
|
245 | src: string;
|
246 | type: string;
|
247 | }[];
|
248 | attributes: HTMLVideoElement;
|
249 | * </p>
|
250 | */
|
251 | html5Video: VideoSource;
|
252 | /**
|
253 | * True if video has poster
|
254 | */
|
255 | hasPoster: boolean;
|
256 | }
|
257 | /**
|
258 | * Fired when the image is rotated in anticlockwise direction
|
259 | * @name lgRotateLeft
|
260 | * @method onRotateLeft
|
261 | */
|
262 | export interface RotateLeftDetail {
|
263 | /**
|
264 | * Index of the slide
|
265 | */
|
266 | index: number;
|
267 | }
|
268 | /**
|
269 | * Fired when the image is rotated in clockwise direction
|
270 | * @name lgRotateRight
|
271 | * @method onRotateRight
|
272 | */
|
273 | export interface RotateRightDetail {
|
274 | /**
|
275 | * Index of the slide
|
276 | */
|
277 | index: number;
|
278 | }
|
279 | /**
|
280 | * Fired when the image is flipped horizontally
|
281 | * @name lgFlipHorizontal
|
282 | * @method onFlipHorizontal
|
283 | */
|
284 | export interface FlipHorizontalDetail {
|
285 | /**
|
286 | * Index of the slide
|
287 | */
|
288 | index: number;
|
289 | }
|
290 | /**
|
291 | * Fired when the image is flipped vertically
|
292 | * @name lgFlipVertical
|
293 | * @method onFlipVertical
|
294 | */
|
295 | export interface FlipVerticalDetail {
|
296 | /**
|
297 | * Index of the slide
|
298 | */
|
299 | index: number;
|
300 | }
|