mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[swiper] Update swiper typings to v5.4 (#45330)
* [swiper] Update swiper typings to v5.4 * [swiper] Update tests for changed typings
This commit is contained in:
parent
94b5f9c904
commit
1e4b8d4d61
11
types/swiper/index.d.ts
vendored
11
types/swiper/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// Type definitions for Swiper 5.3
|
||||
// Type definitions for Swiper 5.4
|
||||
// Project: https://github.com/nolimits4web/Swiper, http://www.idangero.us/swiper
|
||||
// Definitions by: Sebastián Galiano <https://github.com/sgaliano>
|
||||
// Luca Trazzi <https://github.com/lucax88x>
|
||||
@ -61,10 +61,15 @@ export type AutoplayEvent = 'autoplayStart' | 'autoplayStop' | 'autoplay';
|
||||
*/
|
||||
export type LazyLoadingEvent = 'lazyImageLoad' | 'lazyImageReady';
|
||||
|
||||
/**
|
||||
* Swiper hash-navigation event names.
|
||||
*/
|
||||
export type HashNavigationEvent = 'hashChange' | 'hashSet';
|
||||
|
||||
/**
|
||||
* Swiper event names.
|
||||
*/
|
||||
export type SwiperEvent = CommonEvent | PaginationEvent | AutoplayEvent | LazyLoadingEvent;
|
||||
export type SwiperEvent = CommonEvent | PaginationEvent | AutoplayEvent | LazyLoadingEvent | HashNavigationEvent;
|
||||
|
||||
/**
|
||||
* Swiper module types.
|
||||
@ -1014,6 +1019,8 @@ export interface ThumbsOptions {
|
||||
swiper?: Swiper;
|
||||
slideThumbActiveClass?: string;
|
||||
thumbsContainerClass?: string;
|
||||
multipleActiveThumbs?: boolean;
|
||||
autoScrollOffset?: number;
|
||||
}
|
||||
|
||||
export interface ZoomOptions {
|
||||
|
||||
@ -565,6 +565,10 @@ function hashNavigation() {
|
||||
nextEl: '.swiper-button-next',
|
||||
prevEl: '.swiper-button-prev',
|
||||
},
|
||||
on: {
|
||||
hashChange: () => null,
|
||||
hashSet: () => null
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -811,3 +815,28 @@ function updateOnWindowResize() {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Thumbs
|
||||
*/
|
||||
function thumbs() {
|
||||
const thumbsSwiper = new Swiper('.swiper-container-thumbs', {
|
||||
slidesPerView: 5,
|
||||
});
|
||||
const swiper = new Swiper(containerSelector, {
|
||||
pagination: {
|
||||
el: '.swiper-pagination',
|
||||
},
|
||||
navigation: {
|
||||
nextEl: '.swiper-button-next',
|
||||
prevEl: '.swiper-button-prev',
|
||||
},
|
||||
thumbs: {
|
||||
swiper: thumbsSwiper,
|
||||
slideThumbActiveClass: 'swiper-slide-thumb-active',
|
||||
thumbsContainerClass: 'swiper-container-thumbs',
|
||||
multipleActiveThumbs: true,
|
||||
autoScrollOffset: 0
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user