Skip to content

Commit

Permalink
feat: add swiper-effect-utils
Browse files Browse the repository at this point in the history
fixes #7336
  • Loading branch information
nolimits4web committed Feb 27, 2024
1 parent 645f266 commit df5f873
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions scripts/build-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
6 changes: 5 additions & 1 deletion src/copy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -205,4 +209,4 @@
"node": ">= 4.7.0"
},
"releaseDate": "February 5, 2024"
}
}
28 changes: 28 additions & 0 deletions src/swiper-effect-utils.d.ts
Original file line number Diff line number Diff line change
@@ -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 };
7 changes: 7 additions & 0 deletions src/swiper-effect-utils.mjs
Original file line number Diff line number Diff line change
@@ -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 };

0 comments on commit df5f873

Please sign in to comment.