// Ambient types for `gifenc` — the package ships no declarations, so without // this the GIF export lane was `any` end to end (and, before the A2 tsconfig // completion, checked by nothing at all). // // Narrowed to the surface exporters/video-encode-lib.ts actually calls; widen // it here rather than casting at a call site. declare module 'gifenc' { export type Palette = number[][]; export interface WriteFrameOptions { palette?: Palette; /** Frame delay in milliseconds. */ delay?: number; transparent?: boolean; transparentIndex?: number; repeat?: number; dispose?: number; } export interface GifEncoder { writeFrame( index: Uint8Array | number[], width: number, height: number, opts?: WriteFrameOptions ): void; finish(): void; bytes(): Uint8Array; bytesView(): Uint8Array; reset(): void; } export function GIFEncoder(opts?: { auto?: boolean; initialCapacity?: number }): GifEncoder; export function quantize( rgba: Uint8Array | Uint8ClampedArray, maxColors: number, opts?: { format?: 'rgb565' | 'rgb444' | 'rgba4444'; oneBitAlpha?: boolean; clearAlpha?: boolean; } ): Palette; export function applyPalette( rgba: Uint8Array | Uint8ClampedArray, palette: Palette, format?: 'rgb565' | 'rgb444' | 'rgba4444' ): Uint8Array; }