1
1
import { forwardRef } from "react" ;
2
2
import cn from "clsx" ;
3
- import { Navigation , Pagination , Autoplay , A11y } from "swiper" ;
3
+ import SwiperCore , { Navigation , Pagination , Autoplay , A11y } from "swiper" ;
4
4
// eslint-disable-next-line import/no-unresolved
5
5
import { Swiper , SwiperSlide } from "swiper/react" ;
6
- import type { Swiper as SwiperInstance } from "swiper/types" ;
7
6
8
7
type TOptions = {
9
8
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -38,9 +37,9 @@ type TOptions = {
38
37
[ x : string ] : number | string ;
39
38
} ;
40
39
} ;
41
- onSlideChange ?: ( swiper : SwiperInstance ) => void ;
42
- onSlideChangeTransitionStart ?: ( swiper : SwiperInstance ) => void ;
43
- onSlideChangeTransitionEnd ?: ( swiper : SwiperInstance ) => void ;
40
+ onSlideChange ?: ( swiper : SwiperCore ) => void ;
41
+ onSlideChangeTransitionStart ?: ( swiper : SwiperCore ) => void ;
42
+ onSlideChangeTransitionEnd ?: ( swiper : SwiperCore ) => void ;
44
43
} ;
45
44
46
45
type TProps = {
@@ -55,9 +54,9 @@ type TProps = {
55
54
children : React . ReactNode ;
56
55
className ?: string ;
57
56
navClass ?: string ;
58
- onSlideChange ?: ( swiper : SwiperInstance ) => void ;
59
- onSlideChangeTransitionStart ?: ( swiper : SwiperInstance ) => void ;
60
- onSlideChangeTransitionEnd ?: ( swiper : SwiperInstance ) => void ;
57
+ onSlideChange ?: ( swiper : SwiperCore ) => void ;
58
+ onSlideChangeTransitionStart ?: ( swiper : SwiperCore ) => void ;
59
+ onSlideChangeTransitionEnd ?: ( swiper : SwiperCore ) => void ;
61
60
} ;
62
61
63
62
const SwiperSlider = forwardRef < HTMLDivElement , TProps > (
0 commit comments