npm.io
2.1.5 • Published 1 year ago

@types/natural-drag-animation-rbdnd

Licence
MIT
Version
2.1.5
Deps
2
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/natural-drag-animation-rbdnd

Summary

This package contains type definitions for natural-drag-animation-rbdnd (https://github.com/rokborf/natural-drag-animation-rbdnd#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/natural-drag-animation-rbdnd.

index.d.ts

import * as React from "react";
import { DraggableStateSnapshot, DraggingStyle, NotDraggingStyle } from "react-beautiful-dnd";

declare namespace NaturalDragAnimation {
    interface NaturalDragAnimationType {
        /**
         * Pass `snapshot` from `Draggable`.
         */
        snapshot: DraggableStateSnapshot;

        /**
         * In most cases just pass `provided.draggableProps.style` from `Draggable`.
         * `NaturalDragAnimation` patches `transform` from it.
         */
        style: DraggingStyle | NotDraggingStyle | undefined;

        /**
         * Use it to define fade speed of end rotation animation.
         * Must be 0 < `animationRotationFade` < 1.
         *
         * @default 0.9
         */
        animationRotationFade?: number;

        /**
         * Use it to define rotation multiplier.
         *
         * @default 1.3
         */
        rotationMultiplier?: number;

        /**
         * @default x => x / (1 + Math.abs(x))
         */
        sigmoidFunction?: (x: number) => number;

        children: (style: React.CSSProperties) => React.ReactNode;
    }
}

declare class NaturalDragAnimation extends React.Component<NaturalDragAnimation.NaturalDragAnimationType> {}

export = NaturalDragAnimation;

Additional Details

Credits

These definitions were written by Prajwal Kulkarni.