/** * The following code is modified based on * https://github.com/webpack/webpack/blob/4b4ca3b/lib/MultiCompiler.js * * MIT Licensed * Author Tobias Koppers @sokra * Copyright (c) JS Foundation and other contributors * https://github.com/webpack/webpack/blob/main/LICENSE */ import { Compiler, RspackOptions } from "."; import ResolverFactory from "./ResolverFactory"; import { WatchFileSystem } from "./util/fs"; import { Watching } from "./Watching"; import { AsyncSeriesHook, Callback, MultiHook, SyncHook } from "tapable"; import MultiStats from "./MultiStats"; import MultiWatching from "./MultiWatching"; import { WatchOptions } from "./config"; type Any = any; export interface MultiCompilerOptions { /** * how many Compilers are allows to run at the same time in parallel */ parallelism?: number; } export type MultiRspackOptions = ReadonlyArray & MultiCompilerOptions; export declare class MultiCompiler { #private; context: string; compilers: Compiler[]; dependencies: WeakMap; hooks: { done: SyncHook; invalid: MultiHook>; run: MultiHook>; watchClose: SyncHook; watchRun: MultiHook; infrastructureLog: MultiHook; }; name: string; infrastructureLogger: Any; _options: { parallelism?: number; }; root: Compiler; resolverFactory: ResolverFactory; running: boolean; watching: Watching; watchMode: boolean; constructor(compilers: Compiler[] | Record, options?: MultiCompilerOptions); get options(): import(".").RspackOptionsNormalized[] & { parallelism?: number | undefined; }; get outputPath(): string; get inputFileSystem(): void; get outputFileSystem(): typeof import("fs"); get watchFileSystem(): WatchFileSystem; get intermediateFileSystem(): any; /** * @param {InputFileSystem} value the new input file system */ set inputFileSystem(value: void); /** * @param {OutputFileSystem} value the new output file system */ set outputFileSystem(value: typeof import("fs")); set watchFileSystem(value: WatchFileSystem); /** * @param {IntermediateFileSystem} value the new intermediate file system */ set intermediateFileSystem(value: any); getInfrastructureLogger(name: string): import("./logging/Logger").Logger; /** * @param {Compiler} compiler the child compiler * @param {string[]} dependencies its dependencies * @returns {void} */ setDependencies(compiler: Compiler, dependencies: string[]): void; /** * @param {Callback} callback signals when the validation is complete * @returns {boolean} true if the dependencies are valid */ validateDependencies(callback: Callback): boolean; /** * @param {WatchOptions|WatchOptions[]} watchOptions the watcher's options * @param {Callback} handler signals when the call finishes * @returns {MultiWatching} a compiler watcher */ watch(watchOptions: WatchOptions, handler: Callback): MultiWatching; run(callback: Callback): void; purgeInputFileSystem(): void; close(callback: Callback): void; } export {};