1 | import { GalleryItem } from './lg-utils';
|
2 | import { LgQuery } from './lgQuery';
|
3 | import { LightGallery } from './lightgallery';
|
4 | import { AutoplaySettings } from './plugins/autoplay/lg-autoplay-settings';
|
5 | import { CommentSettings } from './plugins/comment/lg-comment-settings';
|
6 | import { FullscreenSettings } from './plugins/fullscreen/lg-fullscreen-settings';
|
7 | import { HashSettings } from './plugins/hash/lg-hash-settings';
|
8 | import { PagerSettings } from './plugins/pager/lg-pager-settings';
|
9 | import { RotateSettings } from './plugins/rotate/lg-rotate-settings';
|
10 | import { ShareSettings } from './plugins/share/lg-share-settings';
|
11 | import { ThumbnailsSettings } from './plugins/thumbnail/lg-thumbnail-settings';
|
12 | import { VideoSettings } from './plugins/video/lg-video-settings';
|
13 | import { ZoomSettings } from './plugins/zoom/lg-zoom-settings';
|
14 | declare type LightGalleryCoreMobileSettings = Exclude<LightGalleryCoreSettings, 'mobileSettings'>;
|
15 | export interface MobileSettings extends LightGalleryCoreMobileSettings, Partial<ZoomSettings>, Partial<ThumbnailsSettings>, Partial<VideoSettings>, Partial<AutoplaySettings>, Partial<CommentSettings>, Partial<FullscreenSettings>, Partial<HashSettings>, Partial<PagerSettings>, Partial<RotateSettings>, Partial<ShareSettings> {
|
16 | }
|
17 | export declare type LightGalleryAllSettings = LightGalleryCoreSettings & ZoomSettings & ThumbnailsSettings & VideoSettings & AutoplaySettings & CommentSettings & FullscreenSettings & HashSettings & PagerSettings & RotateSettings & ShareSettings;
|
18 | export declare type LightGallerySettings = Partial<LightGalleryAllSettings>;
|
19 | export interface LightGalleryCoreSettings {
|
20 | /**
|
21 | * Type of transition between images.
|
22 | */
|
23 | mode: 'lg-slide' | 'lg-fade' | 'lg-zoom-in' | 'lg-zoom-in-big' | 'lg-zoom-out' | 'lg-zoom-out-big' | 'lg-zoom-out-in' | 'lg-zoom-in-out' | 'lg-soft-zoom' | 'lg-scale-up' | 'lg-slide-circular' | 'lg-slide-circular-vertical' | 'lg-slide-vertical' | 'lg-slide-vertical-growth' | 'lg-slide-skew-only' | 'lg-slide-skew-only-rev' | 'lg-slide-skew-only-y' | 'lg-slide-skew-only-y-rev' | 'lg-slide-skew' | 'lg-slide-skew-rev' | 'lg-slide-skew-cross' | 'lg-slide-skew-cross-rev' | 'lg-slide-skew-ver' | 'lg-slide-skew-ver-rev' | 'lg-slide-skew-ver-cross' | 'lg-slide-skew-ver-cross-rev' | 'lg-lollipop' | 'lg-lollipop-rev' | 'lg-rotate' | 'lg-rotate-rev' | 'lg-tube';
|
24 | /**
|
25 | * Slide animation CSS easing property
|
26 | */
|
27 | easing: string;
|
28 | /**
|
29 | *Transition duration (in ms).
|
30 | */
|
31 | speed: number;
|
32 | /**
|
33 | * If you are using lightGallery for commercial projects, you need to purchase a commercial license
|
34 | * to get the license key. For projects that are compatible with GPLv3 license,
|
35 | * please contact us for getting a license key at <a href="mailto:contact@lightgalleryjs.com">contact@lightgalleryjs.com</a>.
|
36 | * If you want to test lightGallery before purchasing a commercial license, you can
|
37 | * use `0000-0000-000-0000` as a temporary license key
|
38 | */
|
39 | licenseKey: string;
|
40 | /**
|
41 | * Height of the gallery.
|
42 | * example '100%' , '300px'
|
43 | */
|
44 | height: string;
|
45 | /**
|
46 | * Width of the gallery.
|
47 | * example '100%' , '300px'
|
48 | */
|
49 | width: string;
|
50 | /**
|
51 | * Add custom class for gallery container
|
52 | * This can be used to set different style for different galleries
|
53 | */
|
54 | addClass: string;
|
55 | /**
|
56 | * Start animation class for the gallery.
|
57 | * @description
|
58 | * <ul>
|
59 | * <li>This can be used to change the zoom effect when the image is loaded</li>
|
60 | * <li>This is also applied when navigating to new slides</li>
|
61 | * <li>startClass will be empty zoomFromOrigin is true.</li>
|
62 | * </ul>
|
63 | */
|
64 | startClass: string;
|
65 | /**
|
66 | * Enable zoom from origin effect.
|
67 | * @description You need to know the original image size upfront and provide it via data-lg-size attribute as <code> data-lg-size="1920-1280</code>"
|
68 | *
|
69 | * If you don't know, the size of a few images in the list, you can skip the data-lg-size attribute for the particular slides,
|
70 | * lightGallery will show the default animation if data-lg-size is not available
|
71 | *
|
72 | * If you are using responsive images,
|
73 | * you can pass a comma separated list of sizes combined with a max-width (up to what size the particular image should be used)
|
74 | *
|
75 | * example -
|
76 | * <code> data-lg-size="240-160-375, 400-267-480, 1600-1067"
|
77 | * data-responsive="img-240.jpg 375, img-400.jpg 480"
|
78 | * data-src="img-1600.jpg" </code>
|
79 | *
|
80 | * In the above example, upto 375 width img.240.jpg and lg-size 240-160 will be used.
|
81 | * Similarly, upto 480 pixel width size 400-267 and img-400.jpg will be used
|
82 | * And above 480, lg-size 1600-1067 and img-1600.jpg will be used
|
83 | *
|
84 | * <ul>
|
85 | * <li>At the moment, zoomFromOrigin options is supported only for image slides.</li>
|
86 | * <li>Will be false if dynamic option is enabled or galleryID found in the URL.</li>
|
87 | * <li>startClass will be empty if zoomFromOrigin is true to avoid css conflicts.</li>
|
88 | * </ul>
|
89 | */
|
90 | zoomFromOrigin: boolean;
|
91 | /**
|
92 | * Zoom from image animation duration
|
93 | */
|
94 | startAnimationDuration: number;
|
95 | /**
|
96 | * Backdrop transition duration.
|
97 | * Note - Do not change the value of backdrop via css.
|
98 | */
|
99 | backdropDuration: number;
|
100 | /**
|
101 | * Configure where the gallery should be appended.
|
102 | * Useful to create inline galleries and more
|
103 | */
|
104 | container: HTMLElement;
|
105 | /**
|
106 | * Delay for hiding gallery controls in ms.
|
107 | * Pass <code>0</code> if you don't want to hide the controls
|
108 | */
|
109 | hideBarsDelay: number;
|
110 | /**
|
111 | * Delay in hiding controls for the first time when gallery is opened
|
112 | */
|
113 | showBarsAfter: number;
|
114 | /**
|
115 | * Delay slide transitions.
|
116 | * @description This is useful if you want to do any action in the current slide before moving to next slide.
|
117 | * <section>
|
118 | * For example, fading out the captions before going to next slide.
|
119 | * <code>.lg-slide-progress</code> class name is added to the current slide immediately after calling the slide method.
|
120 | * But transition begins only after the delay
|
121 | * </section>
|
122 | */
|
123 | slideDelay: number;
|
124 | /**
|
125 | * Support legacy browsers
|
126 | * @description Currently this is used only for adding support to srcset attribute via picturefill library
|
127 | * If true lightGallery will show warning message to include picturefill library
|
128 | */
|
129 | supportLegacyBrowser: boolean;
|
130 | /**
|
131 | * If true, toolbar, captions and thumbnails will not overlap with media element
|
132 | * This will not effect thumbnails if animateThumb is false
|
133 | * Also, toggle thumbnails button is not displayed if allowMediaOverlap is false
|
134 | * <section>
|
135 | * Note - Changing the position of the media on every slide transition creates a flickering effect.
|
136 | * Therefore, The height of the caption is calculated dynamically, only once based on the first slide caption.
|
137 | * </section>
|
138 | * <section>
|
139 | * if you have dynamic captions for each media,
|
140 | * you can provide an appropriate height for the captions via allowMediaOverlap option
|
141 | * </section>
|
142 | */
|
143 | allowMediaOverlap: boolean;
|
144 | /**
|
145 | * Video max size.
|
146 | * @description This can be over-written by passing specific size via data-lg-size attribute
|
147 | * Recommended video resolution and & aspect ratios <a href="https://support.google.com/youtube/answer/6375112">https://support.google.com/youtube/answer/6375112</a>
|
148 | */
|
149 | videoMaxSize: string;
|
150 | /**
|
151 | * Height of the caption for calculating allowMediaOverlap positions
|
152 | * Note - this is only used to find the position of media item if allowMediaOverlap is true.
|
153 | * Not for setting height of the captions
|
154 | * Set 0 if you want to calculate the height of captions dynamically
|
155 | */
|
156 | defaultCaptionHeight: number;
|
157 | /**
|
158 | * aria-labelledby attribute fot gallery
|
159 | */
|
160 | ariaLabelledby: string;
|
161 | /**
|
162 | * aria-describedby attribute for gallery
|
163 | */
|
164 | ariaDescribedby: string;
|
165 | /**
|
166 | * If false user won't be abel to close the gallery at all
|
167 | * This is useful for creating inline galleries.
|
168 | */
|
169 | closable: boolean;
|
170 | /**
|
171 | * allows vertical drag/swipe to close gallery
|
172 | * <code>false</code> if option <code>closable</code> is <code>false</code>
|
173 | */
|
174 | swipeToClose: boolean;
|
175 | /**
|
176 | * allows clicks on black area to close gallery.
|
177 | */
|
178 | closeOnTap: boolean;
|
179 | /**
|
180 | * If false, close button won't be displayed.
|
181 | * Useful for creating inline galleries.
|
182 | */
|
183 | showCloseIcon: boolean;
|
184 | /**
|
185 | * Show maximize icon.
|
186 | * Useful for creating inline galleries.
|
187 | */
|
188 | showMaximizeIcon: boolean;
|
189 | /**
|
190 | * If false, will disable the ability to loop back to the beginning of the gallery from the last slide.
|
191 | */
|
192 | loop: boolean;
|
193 | /**
|
194 | * Whether the LightGallery could be closed by pressing the "Esc" key.
|
195 | */
|
196 | escKey: boolean;
|
197 | /**
|
198 | * Enable keyboard navigation
|
199 | */
|
200 | keyPress: boolean;
|
201 | /**
|
202 | * If false, prev/next buttons will not be displayed.
|
203 | */
|
204 | controls: boolean;
|
205 | /**
|
206 | * Enable slideEnd animation
|
207 | */
|
208 | slideEndAnimation: boolean;
|
209 | /**
|
210 | * If true, prev/next button will be hidden on first/last image.
|
211 | */
|
212 | hideControlOnEnd: boolean;
|
213 | /**
|
214 | * ability to navigate to next/prev slides on mousewheel
|
215 | */
|
216 | mousewheel: boolean;
|
217 | /**
|
218 | * Option to get captions from alt or title tags.
|
219 | */
|
220 | getCaptionFromTitleOrAlt: boolean;
|
221 | /**
|
222 | * control where the sub-html should be appended.
|
223 | * If you choose '.lg-outer', you are responsible for placing the div at the right position.
|
224 | * '.lg-outer' is useful if you want show custom HTML outside the normal gallery
|
225 | */
|
226 | appendSubHtmlTo: '.lg-sub-html' | '.lg-item' | '.lg-outer';
|
227 | /**
|
228 | * Set to true if the selector in "data-sub-html" should use the current item as its origin.
|
229 | */
|
230 | subHtmlSelectorRelative: boolean;
|
231 | /**
|
232 | * number of preload slides
|
233 | * @description will exicute only after the current slide is fully loaded.
|
234 | * for example, if you click on 4th image and if preload = 1 then 3rd slide and 5th
|
235 | * slide will be loaded in the background after the 4th slide is fully loaded..
|
236 | * if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.
|
237 | */
|
238 | preload: number;
|
239 | /**
|
240 | * Control how many slide items should be kept in dom at a time
|
241 | * @description To improve performance by reducing number of gallery items in the dom,
|
242 | * lightGallery keeps only the lowest possible number of slides in the dom at a time.
|
243 | * This has a minimum value of 3
|
244 | */
|
245 | numberOfSlideItemsInDom: number;
|
246 | /**
|
247 | * Show Content once it is fully loaded
|
248 | */
|
249 | showAfterLoad: boolean;
|
250 | /**
|
251 | * Custom selector property instead of direct children.
|
252 | * @description Based on your markup structure, you can specify custom selectors to fetch media data for the gallery
|
253 | * Pass "this" to select same element
|
254 | * You can also pass HTMLCollection directly
|
255 | * Example - '.my-selector' | '#my-selector' | this | document.querySelectorAll('.my-selector')
|
256 | */
|
257 | selector: string | HTMLCollection[];
|
258 | /**
|
259 | * By default selector element relative to the current gallery.
|
260 | * Instead of that you can tell lightGallery to select element relative to another element.
|
261 | * Example - '.my-selector-container' | '#my-selector-container'
|
262 | * In the code this become selector = document.querySelector(this.s.selectWithin ).querySelectorAll(this.s.selector);
|
263 | */
|
264 | selectWithin: string;
|
265 | /**
|
266 | * Custom html for next control
|
267 | */
|
268 | nextHtml: string;
|
269 | /**
|
270 | * Custom html for prev control
|
271 | */
|
272 | prevHtml: string;
|
273 | /**
|
274 | * specify which slide should load initially
|
275 | */
|
276 | index: number;
|
277 | /**
|
278 | * Set width for iframe.
|
279 | */
|
280 | iframeWidth: string;
|
281 | /**
|
282 | * Set width for iframe.
|
283 | */
|
284 | iframeHeight: string;
|
285 | /**
|
286 | * Enable download button.
|
287 | * @description By default download url will be taken from data-src/href attribute but it supports only for modern browsers.
|
288 | * If you want you can provide another url for download via data-download-url.
|
289 | * pass false in data-download-url if you want to hide download button for the particular slide.
|
290 | */
|
291 | download: boolean;
|
292 | /**
|
293 | * Whether to show total number of images and index number of currently displayed image.
|
294 | */
|
295 | counter: boolean;
|
296 | /**
|
297 | * Where the counter should be appended
|
298 | */
|
299 | appendCounterTo: string;
|
300 | /**
|
301 | * By setting the swipeThreshold (in px) you can set how far the user must swipe for the next/prev image.
|
302 | */
|
303 | swipeThreshold: number;
|
304 | /**
|
305 | * Enables swipe support for touch devices
|
306 | */
|
307 | enableSwipe: boolean;
|
308 | /**
|
309 | * Enables desktop mouse drag support
|
310 | */
|
311 | enableDrag: boolean;
|
312 | /**
|
313 | * LightGallery can be instantiated and launched programmatically by setting this option to true and populating dynamicEl option (see below) with the definitions of images.
|
314 | */
|
315 | dynamic: boolean;
|
316 | /**
|
317 | * An array of objects (src, iframe, subHtml, thumb, poster, responsive, srcset sizes) representing gallery elements.
|
318 | */
|
319 | dynamicEl: GalleryItem[];
|
320 | /**
|
321 | * Fetch custom properties from the selector
|
322 | * @description this is useful for plugin development
|
323 | * By default lightGallery fetches and store all the props selectors to
|
324 | * reduce frequent dom interaction for fetching props every time.
|
325 | *
|
326 | * If you need any addition data to be fetched and stored in the galleryItems variable,
|
327 | * you can do this just by passing the prop names via extraProps
|
328 | * @example
|
329 | * HTML:
|
330 | * <div id="lightGallery">
|
331 | * <a href="a.jpg" data-custom-prop="abc"><img src="thumb.jpg" /></a>
|
332 | * <a href="a.jpg" data-custom-prop="xyz"><img src="thumb.jpg" /></a>
|
333 | * </div>
|
334 | * JS:
|
335 | * lightGallery(document.getElementById('lightGallery'), {
|
336 | * extraProps: ['customProp']
|
337 | * })
|
338 | * // Note - If you are using dynamic mode, you can pass any custom prop in the galleryItem
|
339 | * lightGallery(document.getElementById('lightGallery'), {
|
340 | * dynamic: true,
|
341 | * dynamicEl: [{
|
342 | * src: 'img/img1.jpg',
|
343 | * customProp:'abc',
|
344 | * }]
|
345 | * })
|
346 | *
|
347 | */
|
348 | extraProps: string[];
|
349 | /**
|
350 | * Option to fetch different thumbnail image other than first image
|
351 | * @description If you want to use external image for thumbnail,
|
352 | * add the path of that image inside "data-" attribute
|
353 | * and set value of this option to the name of your custom attribute.
|
354 | *
|
355 | * @example
|
356 | * <div id="lightGallery">
|
357 | * <a href="a.jpg" data-external-thumb-image="images/externalThumb.jpg" ><img src="thumb.jpg" /></a>
|
358 | * </div>
|
359 | *
|
360 | * lightGallery(document.getElementById('lightGallery'), {
|
361 | * exThumbImage: 'data-external-thumb-image'
|
362 | * })
|
363 | */
|
364 | exThumbImage: string;
|
365 | /**
|
366 | * Function to detect mobile devices
|
367 | */
|
368 | isMobile?: () => boolean;
|
369 | /**
|
370 | * Separate settings for mobile devices
|
371 | * @description Note - this is applied only at the time of loading
|
372 | * by default controls and close buttons are disabled on mobile devices.
|
373 | * use this options if you want to enable them or change any other settings for mobile devices
|
374 | * Note - mobileSettings does not merge default values, You need to provide all mobileSettings including default values
|
375 | */
|
376 | mobileSettings: Partial<MobileSettings>;
|
377 | plugins: (new (instance: LightGallery, $LG: LgQuery) => any)[];
|
378 | }
|
379 | export declare const lightGalleryCoreSettings: LightGalleryCoreSettings;
|
380 | export {};
|
381 |
|
\ | No newline at end of file |