react-spring-carousel 3.0.0-beta082 → 3.0.0-beta084

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ export * from './useSpringCarousel';
2
+ export * from './useTransitionCarousel';
3
+ export * from './types';
@@ -0,0 +1 @@
1
+ export * from './useThumbsModule';
@@ -0,0 +1,5 @@
1
+ import { EventHandler, Events } from '../types/useEventsModule.types';
2
+ export declare function useEventsModule<T extends 'use-spring' | 'use-transition'>(): {
3
+ useListenToCustomEvent: (eventHandler: EventHandler<T>) => void;
4
+ emitEvent: (event: Events<T>) => void;
5
+ };
@@ -0,0 +1,6 @@
1
+ import { FullscreenModule } from '../types/useFullscreenModule.types';
2
+ export declare function useFullscreenModule({ mainCarouselWrapperRef, onFullScreenChange, handleResize, }: FullscreenModule): {
3
+ enterFullscreen: (elementRef?: HTMLElement) => void;
4
+ exitFullscreen: () => void;
5
+ getIsFullscreen: () => boolean;
6
+ };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { UseThumbsModule } from '../types/useThumbsModule.types';
3
+ export declare function useThumbsModule<T extends 'use-spring' | 'use-transition'>({ thumbsSlideAxis, withThumbs, prepareThumbsData, items, renderThumbFnProps, }: UseThumbsModule<T>): {
4
+ thumbsFragment: JSX.Element | null;
5
+ handleScroll: (activeItem: number) => void;
6
+ };
@@ -0,0 +1,6 @@
1
+ import { MutableRefObject } from 'react';
2
+ export type FullscreenModule = {
3
+ mainCarouselWrapperRef: MutableRefObject<HTMLDivElement | null>;
4
+ handleResize?(): void;
5
+ onFullScreenChange(isFullscreen: boolean): void;
6
+ };
@@ -0,0 +1,8 @@
1
+ import { ItemWithThumb, PrepareThumbsData, RenderItemProps, SpringCarouselWithThumbs } from '../types';
2
+ export type UseThumbsModule<T extends 'use-spring' | 'use-transition'> = {
3
+ withThumbs?: boolean;
4
+ thumbsSlideAxis: SpringCarouselWithThumbs['thumbsSlideAxis'];
5
+ prepareThumbsData?: PrepareThumbsData<T>;
6
+ items: ItemWithThumb<T>[];
7
+ renderThumbFnProps: RenderItemProps<T>;
8
+ };
@@ -0,0 +1,18 @@
1
+ import { UseSpringCarouselWithFreeScroll, UseSpringCarouselWithThumbs, UseSpringCarouselWithNoThumbs, UseSpringCarouselWithNoFixedItems, UseSpringCarouselWithFixedItems, UseSpringFreeScrollReturnType, UseSpringReturnType } from './types';
2
+ type ReturnType<T> = T extends true ? UseSpringFreeScrollReturnType : UseSpringReturnType;
3
+ /**
4
+ * With free scroll
5
+ */
6
+ declare function useSpringCarousel(props: UseSpringCarouselWithFreeScroll): ReturnType<true>;
7
+ declare function useSpringCarousel(props: UseSpringCarouselWithThumbs<true>): ReturnType<true>;
8
+ declare function useSpringCarousel(props: UseSpringCarouselWithNoThumbs<true>): ReturnType<true>;
9
+ /**
10
+ * No free scroll
11
+ */
12
+ declare function useSpringCarousel(props: UseSpringCarouselWithThumbs<false>): ReturnType<false>;
13
+ declare function useSpringCarousel(props: UseSpringCarouselWithNoThumbs<false>): ReturnType<false>;
14
+ declare function useSpringCarousel(props: UseSpringCarouselWithFixedItems<false>): ReturnType<false>;
15
+ declare function useSpringCarousel(props: UseSpringCarouselWithNoFixedItems<false>): ReturnType<false>;
16
+ type ContextProps<T = undefined> = Omit<ReturnType<T extends 'free-scroll' ? true : false>, 'carouselFragment' | 'thumbsFragment'>;
17
+ declare function useSpringCarouselContext<T>(): ContextProps<T>;
18
+ export { useSpringCarousel, useSpringCarouselContext };
@@ -0,0 +1,5 @@
1
+ import { UseTransitionCarouselProps, UseTransitionCarouselReturnProps } from './types';
2
+ declare function useTransitionCarousel({ init, disableGestures, items, springConfig, exitBeforeEnter, trail, withLoop, activeItem: externalActiveItem, toPrevItemSpringProps, toNextItemSpringProps, draggingSlideTreshold, thumbsSlideAxis, }: UseTransitionCarouselProps): UseTransitionCarouselReturnProps;
3
+ type ContextProps = Omit<UseTransitionCarouselReturnProps, 'carouselFragment' | 'thumbsFragment'>;
4
+ declare function useTransitionCarouselContext(): ContextProps;
5
+ export { useTransitionCarousel, useTransitionCarouselContext };
package/package.json CHANGED
@@ -1,24 +1,18 @@
1
1
  {
2
2
  "name": "react-spring-carousel",
3
- "version": "3.0.0-beta082",
4
- "type": "module",
3
+ "version": "3.0.0-beta084",
5
4
  "description": "A new <Carousel /> experience for the web",
6
5
  "homepage": "https://react-spring-carousel.emilianobucci.com",
7
6
  "repository": "https://github.com/Emiliano-Bucci/react-spring-carousel",
8
7
  "author": "Emiliano Bucci",
9
8
  "license": "MIT",
10
- "main": "dist/index.cjs.js",
11
- "module": "dist/index.es.js",
12
- "types": "dist/index.d.ts",
9
+ "type": "module",
10
+ "main": "./dist/index.cjs.js",
11
+ "module": "./dist/index.es.js",
12
+ "types": "./dist/types/index.d.ts",
13
13
  "files": [
14
- "dist"
14
+ "dist/*"
15
15
  ],
16
- "exports": {
17
- ".": {
18
- "require": "./dist/index.js",
19
- "default": "./dist/index.js"
20
- }
21
- },
22
16
  "scripts": {
23
17
  "dev": "vite",
24
18
  "build": "tsc && vite build",
File without changes
File without changes