UNPKG

react-sled

Version:

react-sled is a carousel made with react-spring.

55 lines (54 loc) 1.62 kB
/// <reference types="react" /> import { SpringConfig } from 'react-spring'; import CSS from 'csstype'; export declare type TRef = React.MutableRefObject<HTMLDivElement>; export declare type TSelect = number | 'next' | 'prev'; export declare type TDirection = 'horizontal' | 'vertical' | null; export declare type TProportion = string | null; export declare type TDimension = string | number | null; export interface IInternalState { currentIndex: number; prevIndex?: number; viewCount: number; slideSteps: number; sliderSize: number; hasFocus: boolean; dimensions: { width: number; height: number; }; dimensionsDOM: { width: TDimension; height: TDimension; }; } interface IStateFromProps { width?: number | string; height?: number | string; direction?: TDirection; select?: TSelect; proportion?: TProportion; showElements?: number; slideBy?: number; keyboard: boolean; dragging: boolean; dragDistance: number | string; autoPlayInterval?: number; pauseOnMouseOver: boolean; rewind: boolean; config: SpringConfig; stopOnInteraction: boolean; pause: boolean; onSledEnd?(): void; onAnimationStart?(): void; onAnimationEnd?(): void; } export interface IState extends IInternalState, IStateFromProps { } export interface IViewsProps extends IStateFromProps { children?: React.ReactNode; style?: CSS.Properties; } export declare const ViewsProps: IViewsProps; export declare const initialState: IState; export {};