@alfonmga/react-lottie-light-ts
Version:
React/Typescript wrapper for awesome Airbnb's [lottie-web](https://github.com/airbnb/lottie-web) lib.
30 lines (29 loc) • 1.19 kB
TypeScript
import { AnimationEventCallback, AnimationEventName, AnimationConfigWithPath, AnimationConfigWithData, AnimationDirection, AnimationSegment } from 'lottie-web';
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 {
config: ReactLottieConfig;
}
export declare type ReactLottiePlayingState = 'playing' | 'paused' | 'stopped';