diff --git a/types/swiper/index.d.ts b/types/swiper/index.d.ts index a680633135..5fec38f1b8 100644 --- a/types/swiper/index.d.ts +++ b/types/swiper/index.d.ts @@ -74,7 +74,8 @@ declare module 'swiper' { */ interface SwiperOptions { /** - * Whether Swiper should be initialised automatically when you create an instance. If disabled, then you need to init it manually by calling mySwiper.init() + * Whether Swiper should be initialised automatically when you create an instance. + * If disabled, then you need to init it manually by calling mySwiper.init() * * @default true */ @@ -102,24 +103,28 @@ declare module 'swiper' { speed?: number; /** - * Enabled this option and plugin will set width/height on swiper wrapper equal to total size of all slides. Mostly should be used as compatibility fallback option for browser that don't support flexbox layout well + * Enabled this option and plugin will set width/height on swiper wrapper equal to total size of all slides. + * Mostly should be used as compatibility fallback option for browser that don't support flexbox layout well */ setWrapperSize?: boolean; /** - * Enabled this option and swiper will be operated as usual except it will not move, real translate values on wrapper will not be set. Useful when you may need to create custom slide transition + * Enabled this option and swiper will be operated as usual except it will not move, real translate values on wrapper will not be set. + * Useful when you may need to create custom slide transition */ virtualTranslate?: boolean; /** - * Swiper width (in px). Parameter allows to force Swiper width. Useful only if you initialize Swiper when it is hidden. + * Swiper width (in px). Parameter allows to force Swiper width. + * Useful only if you initialize Swiper when it is hidden. * * @note Setting this parameter will make Swiper not responsive */ width?: number; /** - * Swiper height (in px). Parameter allows to force Swiper height. Useful only if you initialize Swiper when it is hidden. + * Swiper height (in px). Parameter allows to force Swiper height. + * Useful only if you initialize Swiper when it is hidden. * * @note Setting this parameter will make Swiper not responsive */ @@ -133,21 +138,25 @@ declare module 'swiper' { autoHeight?: boolean; /** - * Set to true to round values of slides width and height to prevent blurry texts on usual resolution screens (if you have such) + * Set to true to round values of slides width and height to prevent blurry texts on usual + * resolution screens (if you have such) * * @default false */ roundLengths?: boolean; /** - * Set to true on Swiper for correct touch events interception. Use only on swipers that use same direction as the parent one + * Set to true on Swiper for correct touch events interception. Use only on + * swipers that use same direction as the parent one * * @default false */ nested?: boolean; /** - * If enabled (by default) and navigation elements' parameters passed as a string (like ".pagination") then Swiper will look for such elements through child elements first. Applies for pagination, prev/next buttons and scrollbar elements + * If enabled (by default) and navigation elements' parameters passed as a string (like ".pagination") + * then Swiper will look for such elements through child elements first. + * Applies for pagination, prev/next buttons and scrollbar elements * * @default true */ @@ -161,14 +170,16 @@ declare module 'swiper' { effect?: 'slide' | 'fade' | 'cube' | 'coverflow' | 'flip'; /** - * Fire [Transition/SlideChange][Start/End] events on swiper initialization. Such events will be fired on initialization in case of your initialSlide is not 0, or you use loop mode + * Fire [Transition/SlideChange][Start/End] events on swiper initialization. + * Such events will be fired on initialization in case of your initialSlide is not 0, or you use loop mode * * @default true */ runCallbacksOnInit?: boolean; /** - * When enabled Swiper will be disabled and hide navigation buttons on case there are not enough slides for sliding. + * When enabled Swiper will be disabled and hide navigation buttons on + * case there are not enough slides for sliding. * * @default false */ @@ -397,7 +408,8 @@ declare module 'swiper' { touchMoveOpposite?: (event: any) => any; /** - * Triggered when user touch and move finger over Swiper and move it. Receives 'touchmove' event as an arguments. + * Triggered when user touch and move finger over Swiper and move it. + * Receives 'touchmove' event as an arguments. */ sliderMove?: (event: any) => any; @@ -427,7 +439,8 @@ declare module 'swiper' { imagesReady?: () => any; /** - * Triggered when Swiper progress is changed, as an arguments it receives progress that is always from 0 to 1 + * Triggered when Swiper progress is changed, as an arguments it receives + * progress that is always from 0 to 1 */ progress?: (progress: any) => any; @@ -453,7 +466,8 @@ declare module 'swiper' { /** - * Triggered everytime when swiper starts animation. Receives current transition duration (in ms) as an arguments, + * Triggered everytime when swiper starts animation. + * Receives current transition duration (in ms) as an arguments, */ setTransition?: (transition: any) => any; @@ -465,14 +479,16 @@ declare module 'swiper' { interface NavigationOptions { /** - * String with CSS selector or HTML element of the element that will work like "next" button after click on it + * String with CSS selector or HTML element of the element that will work + * like "next" button after click on it * * @default null */ nextEl?: SelectableElement; /** - * String with CSS selector or HTML element of the element that will work like "prev" button after click on it + * String with CSS selector or HTML element of the element that will work + * like "prev" button after click on it * * @default null */ @@ -502,24 +518,38 @@ declare module 'swiper' { interface PaginationOptions { el: SelectableElement; + type?: 'bullets' | 'fraction' | 'progressbar' | 'custom'; + bulletElement?: string; + dynamicBullets?: boolean; + hideOnClick?: boolean; + clickable?: boolean; + /** - * format fraction pagination current number. Function receives current number, and you need to return formatted value + * format fraction pagination current number. Function receives current number, + * and you need to return formatted value */ formatFractionCurrent?: (number: number) => number; + /** - * format fraction pagination total number. Function receives total number, and you need to return formatted value + * format fraction pagination total number. Function receives total number, and you + * need to return formatted value */ formatFractionTotal?: (number: number) => number; + renderBullet?: (index: number, className: string) => void; + renderFraction?: (currentClass: string, totalClass: string) => void; + renderProgressbar?: (progressbarFillClass: string) => void; + /** - * This parameter is required for custom pagination type where you have to specify how it should be rendered. + * This parameter is required for custom pagination type where you have to specify + * how it should be rendered. * * @example * var swiper = new Swiper('.swiper-container', { @@ -540,6 +570,17 @@ declare module 'swiper' { clickableClass?: string; } + /** + * Object with scrollbar parameters. + * + * @example + * var mySwiper = new Swiper('.swiper-container', { + * scrollbar: { + * el: '.swiper-scrollbar', + * draggable: true, + * }, + * }); + */ interface ScrollbarOptions { el?: SelectableElement; @@ -563,21 +604,38 @@ declare module 'swiper' { snapOnRelease?: boolean; } + /** + * Object with autoplay parameters or boolean true to enable with default settings. + * + * @example + * var mySwiper = new Swiper('.swiper-container', { + * autoplay: { + * delay: 5000, + * }, + * }); + */ interface AutoplayOptions { /** * Delay between transitions (in ms). If this parameter is not specified, auto play will be disabled * - * If you need to specify different delay for specifi slides you can do it by using data-swiper-autoplay (in ms) attribute on slide. + * If you need to specify different delay for specifi slides you can do it by using + * data-swiper-autoplay (in ms) attribute on slide. * * @example * *