import { ExportProgress, RasterizeSlide } from './export-controller.svelte'; /** * Animated-GIF export capture/encode pipeline. All the pure logic is shared: * `planGifFrames` derives the per-slide frame delays (default duration + * per-slide overrides), `clampGifDimensions` bounds the output size, and * `encodeGif` (median-cut quantisation + LZW GIF89a) produces the bytes with * each frame carrying its own plan delay. This module only owns the * DOM-adjacent glue: rasterising each slide via the injected capture callback * and normalising every frame onto a uniform-size canvas before pixel * extraction. Blob download is left to the caller (`ExportController`). */ /** Options for the animated-GIF export. */ export interface ExportGifOptions { /** Duration each slide is shown, in milliseconds. Default 2000. */ slideDurationMs?: number; /** Per-slide duration overrides in milliseconds (index maps to slide index). */ slideTimingsMs?: number[]; /** * Longest allowed output side in pixels; frames are scaled down * proportionally. Default 960 (GIF encoding cost grows with pixel count: * every pixel is matched against a 256-colour palette per frame). */ maxDimension?: number; /** Capture-phase progress callback: `(currentSlide, totalSlides)`. */ onProgress?: ExportProgress; /** Abort the export early; checked before each slide capture. */ signal?: AbortSignal; } /** Injected capture dependencies (kept DOM-free for unit tests). */ export interface GifCaptureDeps { /** Live slide count; read fresh on every call. */ getSlideCount(): number; rasterizeSlide: RasterizeSlide; /** Canvas factory override (test seam). Defaults to `document.createElement`. */ createCanvas?: (width: number, height: number) => HTMLCanvasElement; } /** * Capture every slide and encode the sequence as an animated GIF Blob. * Rejects with the shared `AbortError` when `signal` aborts between slides. */ export declare function exportSlidesToGifBlob(deps: GifCaptureDeps, options?: ExportGifOptions): Promise; //# sourceMappingURL=export-gif.d.ts.map