Skip to content

Commit f867add

Browse files
committed
Revert import resolution change
1 parent 05f7bf1 commit f867add

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed
File renamed without changes.

src/components/ui/swiper/index.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { forwardRef } from "react";
22
import cn from "clsx";
3-
import { Navigation, Pagination, Autoplay, A11y } from "swiper";
3+
import SwiperCore, { Navigation, Pagination, Autoplay, A11y } from "swiper";
44
// eslint-disable-next-line import/no-unresolved
55
import { Swiper, SwiperSlide } from "swiper/react";
6-
import type { Swiper as SwiperInstance } from "swiper/types";
76

87
type TOptions = {
98
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -38,9 +37,9 @@ type TOptions = {
3837
[x: string]: number | string;
3938
};
4039
};
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;
4443
};
4544

4645
type TProps = {
@@ -55,9 +54,9 @@ type TProps = {
5554
children: React.ReactNode;
5655
className?: string;
5756
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;
6160
};
6261

6362
const SwiperSlider = forwardRef<HTMLDivElement, TProps>(

src/containers/hero/layout-07/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useMemo, useState } from "react";
2-
import { EffectFade } from "swiper";
3-
import type { Swiper as SwiperInstance } from "swiper/types";
2+
import SwiperCore, { EffectFade } from "swiper";
43
import { motion } from "motion/react";
54
import SwiperSlider, { SwiperSlide } from "@components/ui/swiper";
65
import { ItemType } from "@utils/types";
@@ -14,7 +13,7 @@ type TProps = {
1413

1514
const HeroArea = ({ data: { items } }: TProps) => {
1615
const [activeIdx, setActiveId] = useState(0);
17-
const onSlideChange = (swiper: SwiperInstance) => {
16+
const onSlideChange = (swiper: SwiperCore) => {
1817
const { activeIndex } = swiper;
1918
setActiveId(activeIndex);
2019
};
@@ -23,7 +22,7 @@ const HeroArea = ({ data: { items } }: TProps) => {
2322
setActiveId(-1);
2423
};
2524

26-
const onSlideChangeTransitionEnd = (swiper: SwiperInstance) => {
25+
const onSlideChangeTransitionEnd = (swiper: SwiperCore) => {
2726
const { activeIndex } = swiper;
2827
setActiveId(activeIndex);
2928
};

src/types/swiper.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"noEmit": true,
1515
"esModuleInterop": true,
1616
"module": "esnext",
17-
"moduleResolution": "bundler",
17+
"moduleResolution": "node",
1818
"resolveJsonModule": true,
1919
"isolatedModules": true,
2020
"jsx": "preserve",

0 commit comments

Comments
 (0)