UNPKG

@faceless-ui/slider

Version:

A React library for building every kind of slider

35 lines (34 loc) 845 B
import type { ISlide } from '../Slide/index.js'; export type SliderState = { currentSlideIndex: number; selectedSlideIndex?: number; slides: ISlide[]; scrollIndex?: number; }; export type UPDATE_SLIDE = { type: 'UPDATE_SLIDE'; payload: { slide?: ISlide; }; }; export type GO_TO_SLIDE_INDEX = { type: 'GO_TO_SLIDE_INDEX'; payload: { index?: number; }; }; export type GO_TO_PREV_SLIDE = { type: 'GO_TO_PREV_SLIDE'; payload: { loop?: boolean; }; }; export type GO_TO_NEXT_SLIDE = { type: 'GO_TO_NEXT_SLIDE'; payload: { loop?: boolean; isFullyScrolled?: boolean; }; }; export type Action = GO_TO_PREV_SLIDE | UPDATE_SLIDE | GO_TO_SLIDE_INDEX | GO_TO_NEXT_SLIDE; export declare const reducer: (state: SliderState, action: Action) => SliderState;