export type Task = () => Promise; export type WorkerResult = import("./index").WorkerResult; export type SquooshOptions = import("./index").SquooshOptions; export type ImageminOptions = import("imagemin").Options; export type WebpackError = import("webpack").WebpackError; export type Uint8ArrayUtf8ByteString = ( array: number[] | Uint8Array, start: number, end: number ) => string; export type StringToBytes = (string: string) => number[]; export type MetaData = { warnings: Array; errors: Array; }; export type SharpLib = typeof import("sharp"); export type Sharp = import("sharp").Sharp; export type ResizeOptions = import("sharp").ResizeOptions & { enabled?: boolean; }; export type SharpEncodeOptions = { avif?: import("sharp").AvifOptions | undefined; gif?: import("sharp").GifOptions | undefined; heif?: import("sharp").HeifOptions | undefined; jpeg?: import("sharp").JpegOptions | undefined; jpg?: import("sharp").JpegOptions | undefined; png?: import("sharp").PngOptions | undefined; webp?: import("sharp").WebpOptions | undefined; }; export type SharpFormat = keyof SharpEncodeOptions; export type SharpOptions = { resize?: ResizeOptions | undefined; rotate?: number | "auto" | undefined; sizeSuffix?: SizeSuffix | undefined; encodeOptions?: SharpEncodeOptions | undefined; }; export type SizeSuffix = (width: number, height: number) => string; /** * @template T * @typedef {() => Promise} Task */ /** * Run tasks with limited concurency. * @template T * @param {number} limit - Limit of tasks that run at once. * @param {Task[]} tasks - List of tasks to run. * @returns {Promise} A promise that fulfills to an array of the results */ export function throttleAll(limit: number, tasks: Task[]): Promise; /** * @param {string} url * @returns {boolean} */ export function isAbsoluteURL(url: string): boolean; /** * @template T * @param {ImageminOptions} imageminConfig * @returns {Promise} */ export function imageminNormalizeConfig( imageminConfig: ImageminOptions ): Promise; /** * @template T * @param {WorkerResult} original * @param {T} options * @returns {Promise} */ export function imageminMinify( original: WorkerResult, options: T ): Promise; /** * @template T * @param {WorkerResult} original * @param {T} minimizerOptions * @returns {Promise} */ export function imageminGenerate( original: WorkerResult, minimizerOptions: T ): Promise; /** * @template T * @param {WorkerResult} original * @param {T} options * @returns {Promise} */ export function squooshMinify( original: WorkerResult, options: T ): Promise; export namespace squooshMinify { export { squooshImagePoolSetup as setup }; export { squooshImagePoolTeardown as teardown }; } /** * @template T * @param {WorkerResult} original * @param {T} minifyOptions * @returns {Promise} */ export function squooshGenerate( original: WorkerResult, minifyOptions: T ): Promise; export namespace squooshGenerate { export { squooshImagePoolSetup as setup }; export { squooshImagePoolTeardown as teardown }; } /** * @template T * @param {WorkerResult} original * @param {T} options * @returns {Promise} */ export function sharpMinify( original: WorkerResult, options: T ): Promise; /** * @template T * @param {WorkerResult} original * @param {T} minimizerOptions * @returns {Promise} */ export function sharpGenerate( original: WorkerResult, minimizerOptions: T ): Promise; declare function squooshImagePoolSetup(): void; declare function squooshImagePoolTeardown(): Promise; export {};