// Generated by dts-bundle v0.7.3 // Dependencies for this module: // ../../../../../../packages/jest-worker import { Worker } from "jest-worker"; export = TerserPlugin; /** * @template [T=TerserOptions] */ class TerserPlugin { /** * @param {BasePluginOptions & DefinedDefaultMinimizerAndOptions} [options] */ constructor( options?: | (BasePluginOptions & DefinedDefaultMinimizerAndOptions) | undefined ); /** * @param {Compiler} compiler * @returns {void} */ apply(compiler: Compiler): void; } namespace TerserPlugin { export { terserMinify, uglifyJsMinify, swcMinify, esbuildMinify, Schema, Compiler, Compilation, WebpackError, Asset, TerserECMA, TerserOptions, JestWorker, SourceMapInput, Rule, Rules, ExtractCommentsFunction, ExtractCommentsCondition, ExtractCommentsFilename, ExtractCommentsBanner, ExtractCommentsObject, ExtractCommentsOptions, MinimizedResult, Input, CustomOptions, InferDefaultType, PredefinedOptions, MinimizerOptions, BasicMinimizerImplementation, MinimizeFunctionHelpers, MinimizerImplementation, InternalOptions, MinimizerWorker, Parallel, BasePluginOptions, DefinedDefaultMinimizerAndOptions, InternalPluginOptions, }; } type Compiler = import("webpack").Compiler; type BasePluginOptions = { test?: Rules | undefined; include?: Rules | undefined; exclude?: Rules | undefined; extractComments?: ExtractCommentsOptions | undefined; parallel?: Parallel; }; type DefinedDefaultMinimizerAndOptions = T extends TerserOptions ? { minify?: MinimizerImplementation | undefined; terserOptions?: MinimizerOptions | undefined; } : { minify: MinimizerImplementation; terserOptions?: MinimizerOptions | undefined; }; type Schema = import("schema-utils/declarations/validate").Schema; type Compilation = import("webpack").Compilation; type WebpackError = import("webpack").WebpackError; type Asset = import("webpack").Asset; type TerserECMA = import("./utils.js").TerserECMA; type TerserOptions = import("./utils.js").TerserOptions; type JestWorker = import("jest-worker").Worker; type SourceMapInput = import("@jridgewell/trace-mapping").SourceMapInput; type Rule = RegExp | string; type Rules = Rule[] | Rule; type ExtractCommentsFunction = ( astNode: any, comment: { value: string; type: "comment1" | "comment2" | "comment3" | "comment4"; pos: number; line: number; col: number; } ) => boolean; type ExtractCommentsCondition = | boolean | "all" | "some" | RegExp | ExtractCommentsFunction; type ExtractCommentsFilename = string | ((fileData: any) => string); type ExtractCommentsBanner = | string | boolean | ((commentsFile: string) => string); type ExtractCommentsObject = { condition?: ExtractCommentsCondition | undefined; filename?: ExtractCommentsFilename | undefined; banner?: ExtractCommentsBanner | undefined; }; type ExtractCommentsOptions = ExtractCommentsCondition | ExtractCommentsObject; type MinimizedResult = { code: string; map?: import("@jridgewell/trace-mapping").SourceMapInput | undefined; errors?: (string | Error)[] | undefined; warnings?: (string | Error)[] | undefined; extractedComments?: string[] | undefined; }; type Input = { [file: string]: string; }; type CustomOptions = { [key: string]: any; }; type InferDefaultType = T extends infer U ? U : CustomOptions; type PredefinedOptions = { module?: boolean | undefined; ecma?: import("terser").ECMA | undefined; }; type MinimizerOptions = PredefinedOptions & InferDefaultType; type BasicMinimizerImplementation = ( input: Input, sourceMap: SourceMapInput | undefined, minifyOptions: MinimizerOptions, extractComments: ExtractCommentsOptions | undefined ) => Promise; type MinimizeFunctionHelpers = { getMinimizerVersion?: (() => string | undefined) | undefined; }; type MinimizerImplementation = BasicMinimizerImplementation & MinimizeFunctionHelpers; type InternalOptions = { name: string; input: string; inputSourceMap: SourceMapInput | undefined; extractComments: ExtractCommentsOptions | undefined; minimizer: { implementation: MinimizerImplementation; options: MinimizerOptions; }; }; type MinimizerWorker = Worker & { transform: (options: string) => MinimizedResult; minify: (options: InternalOptions) => MinimizedResult; }; type Parallel = undefined | boolean | number; type InternalPluginOptions = BasePluginOptions & { minimizer: { implementation: MinimizerImplementation; options: MinimizerOptions; }; }; export type Task = () => Promise; export type SourceMapInput = import("@jridgewell/trace-mapping").SourceMapInput; export type TerserFormatOptions = import("terser").FormatOptions; export type TerserOptions = import("terser").MinifyOptions; export type TerserCompressOptions = import("terser").CompressOptions; export type TerserECMA = import("terser").ECMA; export type ExtractCommentsOptions = import("./index.js").ExtractCommentsOptions; export type ExtractCommentsFunction = import("./index.js").ExtractCommentsFunction; export type ExtractCommentsCondition = import("./index.js").ExtractCommentsCondition; export type Input = import("./index.js").Input; export type MinimizedResult = import("./index.js").MinimizedResult; export type PredefinedOptions = import("./index.js").PredefinedOptions; export type CustomOptions = import("./index.js").CustomOptions; export type ExtractedComments = Array; /** * 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 {Input} input * @param {SourceMapInput | undefined} sourceMap * @param {PredefinedOptions & CustomOptions} minimizerOptions * @param {ExtractCommentsOptions | undefined} extractComments * @return {Promise} */ export function terserMinify( input: Input, sourceMap: SourceMapInput | undefined, minimizerOptions: PredefinedOptions & CustomOptions, extractComments: ExtractCommentsOptions | undefined ): Promise; export namespace terserMinify { /** * @returns {string | undefined} */ function getMinimizerVersion(): string | undefined; } /** * @param {Input} input * @param {SourceMapInput | undefined} sourceMap * @param {PredefinedOptions & CustomOptions} minimizerOptions * @param {ExtractCommentsOptions | undefined} extractComments * @return {Promise} */ export function uglifyJsMinify( input: Input, sourceMap: SourceMapInput | undefined, minimizerOptions: PredefinedOptions & CustomOptions, extractComments: ExtractCommentsOptions | undefined ): Promise; export namespace uglifyJsMinify { /** * @returns {string | undefined} */ function getMinimizerVersion(): string | undefined; } /** * @param {Input} input * @param {SourceMapInput | undefined} sourceMap * @param {PredefinedOptions & CustomOptions} minimizerOptions * @return {Promise} */ export function swcMinify( input: Input, sourceMap: SourceMapInput | undefined, minimizerOptions: PredefinedOptions & CustomOptions ): Promise; export namespace swcMinify { /** * @returns {string | undefined} */ function getMinimizerVersion(): string | undefined; } /** * @param {Input} input * @param {SourceMapInput | undefined} sourceMap * @param {PredefinedOptions & CustomOptions} minimizerOptions * @return {Promise} */ export function esbuildMinify( input: Input, sourceMap: SourceMapInput | undefined, minimizerOptions: PredefinedOptions & CustomOptions ): Promise; export namespace esbuildMinify { /** * @returns {string | undefined} */ function getMinimizerVersion(): string | undefined; } export type MinimizedResult = import("./index.js").MinimizedResult; export type CustomOptions = import("./index.js").CustomOptions; /** * @template T * @param {import("./index.js").InternalOptions} options * @returns {Promise} */ export function minify( options: import("./index.js").InternalOptions ): Promise; /** * @param {string} options * @returns {Promise} */ export function transform(options: string): Promise;