@types/react-motion-slider
TypeScript icon, indicating that this package has built-in type declarations

0.4.13 • Public • Published

Installation

npm install --save @types/react-motion-slider

Summary

This package contains type definitions for react-motion-slider (https://github.com/souporserious/react-motion-slider).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-motion-slider.

index.d.ts

declare module "react-motion-slider" {
    import * as React from "react";
    import { OpaqueConfig } from "react-motion";

    export interface SliderProps {
        children?: React.ReactNode;
        /**
         * Move to a slide by its key.
         */
        currentKey?: string | number | undefined;
        /**
         * Move to a slide by its index.
         */
        currentIndex?: number | undefined;
        /**
         * The amount of slides shown in view
         * @default 1
         */
        slidesToShow?: number | undefined;
        /**
         * The amount of slides to move upon using prev and next methods.
         * @default 1
         */
        slidesToMove?: number | undefined;
        /**
         * Animates the wrapper height to fit the current slide.
         * @default false
         */
        autoHeight?: boolean | undefined;
        /**
         * Offsets the slide to align either left, center, or right.
         * @default "left"
         */
        align?: "left" | "center" | "right" | undefined;
        /**
         * Enable touch and/or mouse dragging
         * @default true
         */
        swipe?: boolean | "touch" | "mouse" | undefined;
        /**
         * The amount the user must swipe to advance slides. (sliderWidth * swipeThreshold)
         * @default 0.5
         */
        swipeThreshold?: number | undefined;
        /**
         * The amount of time in milliseconds that determines if a swipe was a flick or not.
         */
        flickTimeout?: number | undefined;
        /**
         * Accepts a React Motion spring config.
         */
        springConfig?: OpaqueConfig | undefined;
        /**
         * Prop callback fired before slide change.
         * @param currentIndex
         * @param nextIndex
         */
        beforeSlide?: ((currentIndex: number, nextIndex: number) => void) | undefined;
        /**
         * Prop callback fired after slide change.
         * @param currentIndex
         */
        afterSlide?: ((currentIndex: number) => void) | undefined;
    }

    export default class Slider extends React.Component<SliderProps> {
        /**
         * Moves to next slide
         */
        public next(): void;

        /**
         * Move to previous slide
         */
        public prev(): void;
    }
}

Additional Details

Credits

These definitions were written by Alexey Svetliakov.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/react-motion-slider

Weekly Downloads

0

Version

0.4.13

License

MIT

Unpacked Size

7.48 kB

Total Files

5

Last publish

Collaborators

  • types