1 | export type Task<T> = () => Promise<T>;
|
2 | export type MinimizedResult = import("./index.js").MinimizedResult;
|
3 | export type Input = import("./index.js").Input;
|
4 | export type HtmlMinifierTerserOptions = import("html-minifier-terser").Options;
|
5 | /**
|
6 | * @template T
|
7 | * @typedef {() => Promise<T>} Task
|
8 | */
|
9 | /**
|
10 | * Run tasks with limited concurency.
|
11 | * @template T
|
12 | * @param {number} limit - Limit of tasks that run at once.
|
13 | * @param {Task<T>[]} tasks - List of tasks to run.
|
14 | * @returns {Promise<T[]>} A promise that fulfills to an array of the results
|
15 | */
|
16 | export function throttleAll<T>(limit: number, tasks: Task<T>[]): Promise<T[]>;
|
17 | /**
|
18 | * @param {Input} input
|
19 | * @param {HtmlMinifierTerserOptions | undefined} [minimizerOptions]
|
20 | * @returns {Promise<MinimizedResult>}
|
21 | */
|
22 | export function htmlMinifierTerser(
|
23 | input: Input,
|
24 | minimizerOptions?: HtmlMinifierTerserOptions | undefined
|
25 | ): Promise<MinimizedResult>;
|