UNPKG

react-lottie-lightweight

Version:

React/Typescript lightweight wrapper for awesome Airbnb's [lottie-web](https://github.com/airbnb/lottie-web) lib.

32 lines (31 loc) 1.32 kB
/// <reference types="react" /> import { AnimationEventCallback, AnimationEventName, AnimationConfigWithPath, AnimationConfigWithData, AnimationDirection, AnimationSegment, AnimationItem } from 'lottie-web/build/player/lottie_light'; import CSS from 'csstype'; export interface ReactLottieEvent<T = any> { name: AnimationEventName; callback: AnimationEventCallback<T>; } export declare type ReactLottieConfigWithData = Partial<AnimationConfigWithData> & { animationData: any; }; export declare type ReactLottieConfigWithPath = Partial<AnimationConfigWithPath> & { path: string; }; export declare type ReactLottieConfig = ReactLottieConfigWithData | ReactLottieConfigWithPath; export interface ReactLottieState { config?: ReactLottieConfig; lottieEventListeners?: ReactLottieEvent[]; height?: string; width?: string; playingState?: ReactLottiePlayingState; segments?: AnimationSegment | AnimationSegment[]; speed?: number; style?: CSS.Properties; className?: string; direction?: AnimationDirection; } export interface ReactLottieOwnProps extends ReactLottieState { animationRef?: React.MutableRefObject<AnimationItem>; config: ReactLottieConfig; } export declare type ReactLottiePlayingState = 'playing' | 'paused' | 'stopped';