type OutputFormat = 'webp' | 'jpeg' | 'original'; interface CropArea { /** Source-pixel coordinates of the crop rectangle. */ x: number; y: number; width: number; height: number; } interface ProcessOptions { /** Skip all processing and return the input file as-is. */ original?: boolean; /** Crop rectangle in source pixels. Omit for no crop. */ crop?: CropArea; /** Clamp the longer edge to this many pixels. Never upscales. */ maxDimension?: number; /** Output container. `'original'` keeps the input mime. */ format?: OutputFormat; /** Lossy quality 0..1. Ignored for lossless WebP and PNG. Defaults to 0.85. */ quality?: number; /** Force lossless WebP encoding. Only meaningful when format === 'webp'. */ lossless?: boolean; } interface ProcessedImage { blob: Blob; mime: string; /** Decoded width in pixels. 0 means the dimensions could not be determined (e.g. SVG, undecodable passthrough). */ width: number; /** Decoded height in pixels. 0 means the dimensions could not be determined (e.g. SVG, undecodable passthrough). */ height: number; /** Filename derived from the input, with the extension matching `mime`. */ suggestedName: string; } declare function shouldSkipProcessing(mime: string): boolean; declare function extensionFor(mime: string): string; declare function replaceExtension(name: string, mime: string): string; declare function resolveOutputMime(inputMime: string, format: OutputFormat | undefined): string; interface TargetDimensions { width: number; height: number; } /** * Resolve target dimensions, honouring caller's maxDimension AND the hard * canvas-budget ceiling. Never upscales the source. */ declare function computeTargetDimensions(sourceWidth: number, sourceHeight: number, maxDimension: number | undefined): TargetDimensions; declare function processImage(file: File, options?: ProcessOptions): Promise; export { type CropArea, type OutputFormat, type ProcessOptions, type ProcessedImage, type TargetDimensions, computeTargetDimensions, extensionFor, processImage, replaceExtension, resolveOutputMime, shouldSkipProcessing };