UNPKG

react-rebound

Version:

High-performance spring animations in React.

48 lines (47 loc) 1.54 kB
import { CSSProperties } from 'react'; declare function px(n: number): string; declare function alpha(x: number): string; declare function color([r, g, b]: [number, number, number]): string; export declare const numericalProperties: { top: typeof px; left: typeof px; right: typeof px; bottom: typeof px; width: typeof px; height: typeof px; opacity: typeof alpha; color: typeof color; background: typeof color; backgroundColor: typeof color; borderBottomColor: typeof color; borderColor: typeof color; borderLeftColor: typeof color; borderRightColor: typeof color; borderTopColor: typeof color; outlineColor: typeof color; textDecorationColor: typeof color; fontSize: typeof px; lineHeight: typeof px; letterSpacing: typeof px; }; export declare const transformProperties: { translateX: boolean; translateY: boolean; translateZ: boolean; scaleX: boolean; scaleY: boolean; rotateX: boolean; rotateY: boolean; rotateZ: boolean; skewX: boolean; skewY: boolean; }; declare type NumericalProperties = { [key in keyof typeof numericalProperties]: Parameters<typeof numericalProperties[key]>[0]; }; declare type TransformProperties = { [key in keyof typeof transformProperties]: number; }; export declare type AnimatableProps = TransformProperties & NumericalProperties; export declare function toStyle(props: Partial<AnimatableProps>): Partial<CSSProperties>; export {};