UNPKG

gif-tools

Version:

A robust, zero-dependency TypeScript library for creating GIF files with support for both static and animated GIFs. Built with modern TypeScript features and designed to work in both Node.js and browser environments.

36 lines (35 loc) 1.13 kB
/** * Core types and interfaces for GIF tools */ /** GIF disposal methods */ export var DisposalMethod; (function (DisposalMethod) { /** No disposal specified */ DisposalMethod[DisposalMethod["None"] = 0] = "None"; /** Do not dispose */ DisposalMethod[DisposalMethod["DoNotDispose"] = 1] = "DoNotDispose"; /** Restore to background color */ DisposalMethod[DisposalMethod["RestoreToBackground"] = 2] = "RestoreToBackground"; /** Restore to previous */ DisposalMethod[DisposalMethod["RestoreToPrevious"] = 3] = "RestoreToPrevious"; })(DisposalMethod || (DisposalMethod = {})); /** Error types */ export class GifError extends Error { constructor(message, code) { super(message); this.code = code; this.name = 'GifError'; } } export class GifValidationError extends GifError { constructor(message) { super(message, 'VALIDATION_ERROR'); this.name = 'GifValidationError'; } } export class GifEncodingError extends GifError { constructor(message) { super(message, 'ENCODING_ERROR'); this.name = 'GifEncodingError'; } }