import { ITransformed, ITree } from '../../../Bulldog'; import { Processor } from '../../../Processor'; import { Process } from '../../Process'; import { CompressionManifest } from './CompressionManifest'; import { ImagePlugin } from './ImagePlugin'; import { AVIFOptions } from './plugins/AVIFPlugin'; import { MozJpegOptions } from './plugins/MozJPEGPlugin'; import { OptiPNGOptions } from './plugins/OptiPNGPlugin'; import { PngquantOptions } from './plugins/PngquantPlugin'; import { WebPOptions } from './plugins/WebPPlugin'; export declare type Processors = 'pngquant' | 'mozjpeg' | 'optipng' | 'webp' | 'avif'; export interface ImageCompressorOptions { compressionManifest?: string; /** @defaultValue true */ pngquantOptions?: boolean | PngquantOptions; /** @defaultValue true */ mozjpegOptions?: boolean | MozJpegOptions; /** @defaultValue true */ optipngOptions?: boolean | OptiPNGOptions; /** @defaultValue true */ webpOptions?: boolean | WebPOptions; /** @defaultValue true */ avifOptions?: boolean | AVIFOptions; /** @defaultValue true */ basisOptions?: boolean; /** * If true then this plugin will take precedence over PNGQuant * @defaultValue true */ preferOptiPNG?: boolean; customPlugins?: ImagePlugin[]; } export declare class ImageCompressor extends Process { plugins: ImagePlugin[]; compressionManifest: CompressionManifest; /** * @param opts - Options used to modify the jpg and png compression or turn them off. */ constructor(opts?: ImageCompressorOptions); /** * Checks the path file extension for 'png', 'jpg'/'jpeg'. Will return false if 'no-tiny' tag is found * @override */ test(tree: ITree): boolean; /** * Minifies image using the appropriate compression for the format. * @override */ post(transformedFile: ITransformed, processor: Processor): Promise; /** * reads a file and returns the buffer * @param input - file path to be read */ private _getBuffer; /** * Saves a buffer to an output with a specified extension * @param output - file path for the original image * @param data - extension to be added */ private _saveFile; } //# sourceMappingURL=ImageCompressor.d.ts.map