diff --git a/scripts/build-modules.js b/scripts/build-modules.js index f073c6ddc..e1e6a667a 100644 --- a/scripts/build-modules.js +++ b/scripts/build-modules.js @@ -46,6 +46,7 @@ export default async function buildModules() { './src/swiper-vue.mjs', './src/swiper-react.mjs', ...modulesPaths, + './src/swiper-effect-utils.mjs', ], plugins: [ replace({ diff --git a/src/copy/package.json b/src/copy/package.json index b34b13a9c..d38bcfef3 100644 --- a/src/copy/package.json +++ b/src/copy/package.json @@ -11,6 +11,10 @@ "types": "./swiper.d.ts", "default": "./swiper.mjs" }, + "./effect-utils": { + "types": "./swiper-effect-utils.d.ts", + "default": "./swiper-effect-utils.mjs" + }, "./core": { "types": "./swiper.d.ts", "default": "./swiper.mjs" @@ -205,4 +209,4 @@ "node": ">= 4.7.0" }, "releaseDate": "February 5, 2024" -} +} \ No newline at end of file diff --git a/src/swiper-effect-utils.d.ts b/src/swiper-effect-utils.d.ts new file mode 100644 index 000000000..97f31c2ed --- /dev/null +++ b/src/swiper-effect-utils.d.ts @@ -0,0 +1,28 @@ +import { Swiper, SwiperOptions } from './types/index.d.ts'; + +declare const createShadow: (suffix?: string, slideEl: HTMLElement, side?: string) => HTMLElement; + +declare const effectInit: (params: { + effect: string; + swiper: Swiper; + on?: () => void; + setTranslate?: () => void; + setTransition?: () => void; + overwriteParams?: () => SwiperOptions; + perspective?: boolean; + recreateShadows?: () => void; + getEffectParams?: () => any; +}) => void; + +declare const effectTarget: (effectParams: any, slideEl: HTMLElement) => void; + +declare const effectVirtualTransitionEnd: (params: { + swiper: Swiper; + duration: number; + transformElements: HTMLElement[]; + allSlides?: boolean; +}) => void; + +declare const getSlideTransformEl: (slideEl: HTMLElement) => void; + +export { createShadow, effectInit, effectTarget, effectVirtualTransitionEnd, getSlideTransformEl }; diff --git a/src/swiper-effect-utils.mjs b/src/swiper-effect-utils.mjs new file mode 100644 index 000000000..93704767f --- /dev/null +++ b/src/swiper-effect-utils.mjs @@ -0,0 +1,7 @@ +import createShadow from './shared/create-shadow.mjs'; +import effectInit from './shared/effect-init.mjs'; +import effectTarget from './shared/effect-target.mjs'; +import effectVirtualTransitionEnd from './shared/effect-virtual-transition-end.mjs'; +import { getSlideTransformEl } from './shared/utils.mjs'; + +export { effectInit, effectTarget, effectVirtualTransitionEnd, getSlideTransformEl, createShadow };