/** * GIF Encoder - Encode captured frames to animated GIF * * Uses gif.js library for encoding. * * @example * ```typescript * const frames = await capture.captureAnimation(...); * const gif = await encodeGIF(frames, { * width: 800, * height: 600, * fps: 30, * quality: 10, * }, (percent) => console.log(`Encoding: ${percent}%`)); * * // Download the GIF * downloadBlob(gif, 'animation.gif'); * ``` */ import type { CapturedFrame } from './frame-capture'; export interface GIFOptions { /** Output width in pixels */ width: number; /** Output height in pixels */ height: number; /** Frames per second */ fps: number; /** Quality (1-30, lower is better quality but slower) */ quality?: number; /** Number of web workers to use (default: 4) */ workers?: number; /** Whether to loop the GIF (default: true) */ loop?: boolean; /** Background color (default: transparent) */ background?: string; /** Transparent color (for transparency support) */ transparent?: string; } /** * Encode frames to animated GIF * * @param frames - Array of captured frames * @param options - GIF encoding options * @param onProgress - Progress callback (0-100) * @returns Blob containing the GIF */ export declare function encodeGIF(frames: CapturedFrame[], options: GIFOptions, onProgress?: (percent: number) => void): Promise; /** * Helper function to download a blob */ export declare function downloadBlob(blob: Blob, filename: string): void; /** * Get estimated file size for GIF * Very rough estimate based on frame count and dimensions */ export declare function estimateGIFSize(frameCount: number, width: number, height: number, quality?: number): number; //# sourceMappingURL=gif-encoder.d.ts.map