import type { Compiler, MultiCompiler, MultiRspackOptions, MultiStats, RspackOptions, RspackPluginFunction, RspackPluginInstance, Stats } from '@rspack/core'; import { type CAC } from 'cac'; import type { RspackCLIColors, RspackCLILogger } from './types'; import type { CommonOptions, CommonOptionsForBuildAndServe } from './utils/options'; type Command = 'serve' | 'build'; declare global { const RSPACK_CLI_VERSION: string; } export declare class RspackCLI { colors: RspackCLIColors; program: CAC; constructor(); buildCompilerConfig(options: CommonOptionsForBuildAndServe, rspackCommand: Command): Promise; createCompiler(config: RspackOptions | MultiRspackOptions, callback?: (e: Error | null, res?: Stats | MultiStats) => void): Promise; createColors(useColor?: boolean): RspackCLIColors; getLogger(): RspackCLILogger; run(argv: string[]): Promise; registerCommands(): Promise; buildConfig(item: RspackOptions | MultiRspackOptions, pathMap: WeakMap, options: CommonOptionsForBuildAndServe, command: Command): Promise; loadConfig(options: CommonOptions): Promise<{ config: RspackOptions | MultiRspackOptions; pathMap: WeakMap; }>; private filterConfig; isMultipleCompiler(compiler: Compiler | MultiCompiler): compiler is MultiCompiler; isWatch(compiler: Compiler | MultiCompiler): boolean; } export type RspackConfigFn = (env: Record, argv: Record) => RspackOptions | MultiRspackOptions; export type RspackConfigAsyncFn = (env: Record, argv: Record) => Promise; export type RspackConfigExport = RspackOptions | MultiRspackOptions | RspackConfigFn | RspackConfigAsyncFn; /** * This function helps you to autocomplete configuration types. * It accepts a Rspack config object, or a function that returns a config. */ export declare function defineConfig(config: RspackOptions): RspackOptions; export declare function defineConfig(config: MultiRspackOptions): MultiRspackOptions; export declare function defineConfig(config: RspackConfigFn): RspackConfigFn; export declare function defineConfig(config: RspackConfigAsyncFn): RspackConfigAsyncFn; export declare function defineConfig(config: RspackConfigExport): RspackConfigExport; export declare function definePlugin(plugin: RspackPluginFunction): RspackPluginFunction; export declare function definePlugin(plugin: RspackPluginInstance): RspackPluginInstance; export {};