import * as React from 'react';
import { AnimationItem } from 'lottie-web';

/** JSON animation data exported from After Effects via the Bodymovin plugin. */
type LottieAnimationData = Record<string, unknown>;
/** Props for the Lottie animation component. */
interface LottieProps {
    /** Lottie JSON animation data object. */
    animationData: LottieAnimationData;
    /** Whether the animation plays immediately on mount. @default true */
    autoplay?: boolean;
    /** `true` to loop forever, a number to loop N times, `false` to play once. @default false */
    loop?: boolean | number;
    /** Playback speed multiplier (e.g., 2 = double speed). @default 1 */
    speed?: number;
    /** Playback direction: `1` = forward, `-1` = reverse. @default 1 */
    direction?: 1 | -1;
    /** Container width. Accepts CSS values (e.g., `"100%"`) or a number in pixels. */
    width?: string | number;
    /** Container height. Accepts CSS values or a number in pixels. */
    height?: string | number;
    /** Additional CSS class name for the container element. */
    className?: string;
    /** Play the animation only while the user hovers over the container. Pauses on mouse leave. */
    playOnHover?: boolean;
    /** Loop the animation while hovering; play once then stop on mouse leave. */
    loopOnHover?: boolean;
    /** Accessible label for the animation. */
    "aria-label"?: string;
    /** Called once the lottie-web AnimationItem has loaded and is ready. */
    onAnimationLoaded?: (animation: AnimationItem) => void;
    /** Fires when a non-looping animation reaches its last frame. */
    onComplete?: () => void;
    /** Fires at the end of each loop iteration. */
    onLoopComplete?: () => void;
    /** Fires on every animation frame with the current and total time. */
    onEnterFrame?: (frame: {
        currentTime: number;
        totalTime: number;
    }) => void;
}
/** Imperative handle exposed via `ref` on the Lottie component. */
interface LottieRef {
    /** Start or resume playback. */
    play(): void;
    /** Pause playback at the current frame. */
    pause(): void;
    /** Stop playback and reset to the first frame. */
    stop(): void;
    /** Jump to a specific point and start playing. @param value — frame number or time (seconds) depending on `isFrame`. */
    goToAndPlay(value: number, isFrame?: boolean): void;
    /** Jump to a specific point and pause. @param value — frame number or time (seconds) depending on `isFrame`. */
    goToAndStop(value: number, isFrame?: boolean): void;
    /** Set playback direction: `1` = forward, `-1` = reverse. */
    setDirection(direction: 1 | -1): void;
    /** Set playback speed multiplier. */
    setSpeed(speed: number): void;
    /** Access the underlying lottie-web AnimationItem, or `null` if not yet loaded. */
    getAnimationItem(): AnimationItem | null;
}

declare const Lottie: React.ForwardRefExoticComponent<LottieProps & React.RefAttributes<LottieRef>>;

export { Lottie, type LottieAnimationData, type LottieProps, type LottieRef };
