import * as React from "react"; type Props = { src: string; alt: string; width?: number; height?: number; scale: number; isPlaying: boolean; /** * Called when the GIF finishes one full loop. */ onLoop: () => void; /** * Called once GIF frames are decoded and the first frame is drawn. */ onLoad?: () => void; }; /** * Renders a GIF using canvas-based frame-by-frame playback. * * Uses two canvases: * - A display canvas (visible) composited and scaled to the display size * - A hidden canvas (hidden) used to convert per-frame ImageData into a * drawable source for proper alpha compositing via drawImage * * This is similar to the approach taken by gifuct-js's own demo: * https://github.com/matt-way/gifuct-js/blob/master/demo/demo.js * * Why are we taking this approach? Because browsers don't natively * support pausing/resuming GIF animations, and we need that for our GIF * images. By decoding the GIF into frames and controlling the playback * via requestAnimationFrame, we can: * - "Pause" GIFs (i.e. show a static image). * - "Play" GIFs (i.e. animate). * - Detect when we have looped the animation. */ declare const GifImage: (props: Props) => React.JSX.Element; export default GifImage;