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; }; /** * @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 }; } declare function squooshImagePoolSetup(): void; declare function squooshImagePoolTeardown(): Promise; export {};