/* auto-generated by NAPI-RS */ /* eslint-disable */ /* -- banner.d.ts -- */ export type JsFilename = | string | ((pathData: JsPathData, assetInfo?: AssetInfo) => string); export type RawLazyCompilationTest = RegExp | ((module: Module) => boolean); export type AssetInfo = KnownAssetInfo & Record; export type CustomPluginName = string; export const MODULE_IDENTIFIER_SYMBOL: unique symbol; export const COMPILATION_HOOKS_MAP_SYMBOL: unique symbol; export const BUILD_INFO_ASSETS_SYMBOL: unique symbol; export const BUILD_INFO_FILE_DEPENDENCIES_SYMBOL: unique symbol; export const BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL: unique symbol; export const BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL: unique symbol; export const BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL: unique symbol; export const COMMIT_CUSTOM_FIELDS_SYMBOL: unique symbol; export const RUST_ERROR_SYMBOL: unique symbol; interface KnownBuildInfo { [BUILD_INFO_ASSETS_SYMBOL]: Assets, [BUILD_INFO_FILE_DEPENDENCIES_SYMBOL]: string[], [BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL]: string[], [BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL]: string[], [BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL]: string[], [COMMIT_CUSTOM_FIELDS_SYMBOL](): void; } export type BuildInfo = KnownBuildInfo & Record; export interface Module { [MODULE_IDENTIFIER_SYMBOL]: string; readonly type: string; get context(): string | undefined; get layer(): string | undefined; get factoryMeta(): JsFactoryMeta set factoryMeta(factoryMeta: JsFactoryMeta); get useSourceMap(): boolean; get useSimpleSourceMap(): boolean; buildInfo: BuildInfo; buildMeta: Record; } interface NormalModuleConstructor { new(): NormalModule; readonly prototype: NormalModule; } export var NormalModule: NormalModuleConstructor; export interface NormalModule extends Module { readonly resource: string; readonly request: string; readonly userRequest: string; readonly rawRequest: string; readonly resourceResolveData: Readonly | undefined; readonly loaders: JsLoaderItem[]; get matchResource(): string | undefined; set matchResource(val: string | undefined); } export interface ConcatenatedModule extends Module { } export interface ContextModule extends Module { } export interface ExternalModule extends Module { readonly userRequest: string; } export interface RspackError extends Error { name: string; message: string; details?: string; module?: null | Module; loc?: DependencyLocation; file?: string; stack?: string; hideStack?: boolean; error?: Error; } export type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation; export interface JsSource { source: string | Buffer map?: string } /* -- banner.d.ts end -- */ /* -- napi-rs generated below -- */ export declare class ExternalObject { readonly '': { readonly '': unique symbol [K: symbol]: T } } export declare class Assets { keys(): Array } export declare class AsyncDependenciesBlock { get dependencies(): Dependency[] get blocks(): AsyncDependenciesBlock[] } export declare class Chunk { get name(): string | undefined get id(): string | undefined get ids(): Array get idNameHints(): Array get filenameTemplate(): string | undefined get cssFilenameTemplate(): string | undefined get _files(): Array get _runtime(): Array get hash(): string | undefined get contentHash(): Record get renderedHash(): string | undefined get chunkReason(): string | undefined get _auxiliaryFiles(): Array isOnlyInitial(): boolean canBeInitial(): boolean hasRuntime(): boolean getAllAsyncChunks(): Chunk[] getAllInitialChunks(): Chunk[] getAllReferencedChunks(): Chunk[] get _groupsIterable(): ChunkGroup[] getEntryOptions(): EntryOptionsDTO | undefined } export declare class ChunkGraph { hasChunkEntryDependentChunks(chunk: Chunk): boolean getChunkModules(chunk: Chunk): Module[] getChunkModulesIterable(chunk: Chunk): Iterable getChunkEntryModulesIterable(chunk: Chunk): Iterable getNumberOfEntryModules(chunk: Chunk): number getChunkEntryDependentChunksIterable(chunk: Chunk): Chunk[] getChunkModulesIterableBySourceType(chunk: Chunk, sourceType: string): Module[] getModuleChunks(module: Module): Chunk[] getModuleId(module: Module): string | number | null _getModuleHash(module: Module, runtime: string | string[] | undefined): string | null getBlockChunkGroup(jsBlock: AsyncDependenciesBlock): ChunkGroup | null } export declare class ChunkGroup { get chunks(): Chunk[] get index(): number | undefined get name(): string | undefined get origins(): Array get childrenIterable(): ChunkGroup[] isInitial(): boolean getParents(): ChunkGroup[] getRuntimeChunk(): Chunk getEntrypointChunk(): Chunk getFiles(): Array getModulePreOrderIndex(module: Module): number | null getModulePostOrderIndex(module: Module): number | null } export declare class Chunks { get size(): number _values(): Chunk[] _has(chunk: Chunk): boolean } export declare class CodeGenerationResult { get sources(): Sources } export declare class CodeGenerationResults { get(module: Module, runtime: string | string[] | undefined): CodeGenerationResult } export declare class ConcatenatedModule { get rootModule(): Module get modules(): Module[] readableIdentifier(): string _originalSource(): JsSource nameForCondition(): string | undefined get blocks(): AsyncDependenciesBlock[] get dependencies(): Dependency[] size(ty?: string | undefined | null): number libIdent(options: JsLibIdentOptions): string | null _emitFile(filename: string, source: JsSource, assetInfo?: AssetInfo | undefined | null): void } export declare class ContextModule { readableIdentifier(): string _originalSource(): JsSource nameForCondition(): string | undefined get blocks(): AsyncDependenciesBlock[] get dependencies(): Dependency[] size(ty?: string | undefined | null): number libIdent(options: JsLibIdentOptions): string | null _emitFile(filename: string, source: JsSource, assetInfo?: AssetInfo | undefined | null): void } export declare class Dependency { get _parentModule(): Module | undefined get type(): string get category(): string get request(): string | undefined get critical(): boolean set critical(val: boolean) get ids(): Array | undefined } export declare class Diagnostics { get length(): number values(): Array get(index: number): RspackError | undefined set(index: number, error: RspackError): void spliceWithArray(index: number, deleteCount?: number | undefined | null, newItems?: Array | undefined | null): Array } export declare class EntryDataDto { get dependencies(): Dependency[] get includeDependencies(): Dependency[] get options(): EntryOptionsDto } export type EntryDataDTO = EntryDataDto export declare class EntryDependency { constructor(request: string) get type(): string get category(): string get request(): string | undefined } export declare class EntryOptionsDto { get name(): string | undefined set name(name: string | undefined) get runtime(): false | string | undefined set runtime(chunkLoading: boolean | string | undefined) get chunkLoading(): string | undefined set chunkLoading(chunkLoading: string | false | undefined) get asyncChunks(): boolean | undefined set asyncChunks(asyncChunks: boolean | undefined) get baseUri(): string | undefined set baseUri(baseUri: string | undefined) get library(): JsLibraryOptions | undefined set library(library: JsLibraryOptions | undefined) get dependOn(): Array | undefined set dependOn(dependOn: Array | undefined) get layer(): string | undefined set layer(layer: string | undefined) } export type EntryOptionsDTO = EntryOptionsDto export declare class ExternalModule { readableIdentifier(): string _originalSource(): JsSource nameForCondition(): string | undefined get blocks(): AsyncDependenciesBlock[] get dependencies(): Dependency[] size(ty?: string | undefined | null): number libIdent(options: JsLibIdentOptions): string | null _emitFile(filename: string, source: JsSource, assetInfo?: AssetInfo | undefined | null): void } export declare class JsCompilation { updateAsset(filename: string, newSourceOrFunction: JsSource | ((source: JsSource) => JsSource), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo | undefined)): void getAssets(): Readonly[] getAsset(name: string): JsAsset | null getAssetSource(name: string): JsSource | null get modules(): Array get builtModules(): Array getOptimizationBailout(): Array get chunks(): Chunks getNamedChunkKeys(): Array getNamedChunk(name: string): Chunk getNamedChunkGroupKeys(): Array getNamedChunkGroup(name: string): ChunkGroup setAssetSource(name: string, source: JsSource): void deleteAssetSource(name: string): void getAssetFilenames(): Array hasAsset(name: string): boolean emitAsset(filename: string, source: JsSource, assetInfo?: AssetInfo | undefined | null): void deleteAsset(filename: string): void renameAsset(filename: string, newName: string): void get entrypoints(): ChunkGroup[] get chunkGroups(): ChunkGroup[] get hash(): string | null dependencies(): JsDependencies pushDiagnostic(diagnostic: JsRspackDiagnostic): void pushNativeDiagnostic(diagnostic: ExternalObject<'Diagnostic'>): void pushNativeDiagnostics(diagnostics: ExternalObject<'Diagnostic[]'>): void get errors(): Diagnostics get warnings(): Diagnostics getErrors(): Array getWarnings(): Array getStats(): JsStats getAssetPath(filename: string, data: JsPathData): string getAssetPathWithInfo(filename: string, data: JsPathData): PathWithInfo getPath(filename: string, data: JsPathData): string getPathWithInfo(filename: string, data: JsPathData): PathWithInfo addFileDependencies(deps: Array): void addContextDependencies(deps: Array): void addMissingDependencies(deps: Array): void addBuildDependencies(deps: Array): void /** * This is a very unsafe function. * Please don't use this at the moment. * Using async and mutable reference to `Compilation` at the same time would likely to cause data races. */ rebuildModule(module_identifiers: string[], callback: (...args: any[]) => any): void importModule(request: string, layer: string | undefined, public_path: JsFilename | undefined, base_uri: string | undefined, original_module: string, original_module_context: string | undefined | null, callback: (...args: any[]) => any): void get entries(): JsEntries addRuntimeModule(chunk: Chunk, runtimeModule: JsAddingRuntimeModule): void get moduleGraph(): JsModuleGraph get chunkGraph(): ChunkGraph addEntry(args: [string, EntryDependency, JsEntryOptions | undefined][], callback: (errMsg: Error | null, results: [string | null, Module][]) => void): void addInclude(args: [string, EntryDependency, JsEntryOptions | undefined][], callback: (errMsg: Error | null, results: [string | null, Module][]) => void): void get codeGenerationResults(): CodeGenerationResults createStatsWarnings(warnings: Array, colored?: boolean | undefined | null): JsStatsError[] } export declare class JsCompiler { constructor(compilerPath: string, options: RawOptions, builtinPlugins: Array, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, inputFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory, unsafeFastDrop: boolean, platform: RawCompilerPlatform) setNonSkippableRegisters(kinds: Array): void /** Build with the given option passed to the constructor */ build(callback: (err: null | Error) => void): void /** Rebuild with the given option passed to the constructor */ rebuild(changed_files: string[], removed_files: string[], callback: (err: null | Error) => void): void close(): Promise getVirtualFileStore(): VirtualFileStore | null } export declare class JsContextModuleFactoryAfterResolveData { get resource(): string set resource(resource: string) get context(): string set context(context: string) get request(): string set request(request: string) get regExp(): RegExp | undefined set regExp(rawRegExp: RegExp | undefined) get recursive(): boolean set recursive(recursive: boolean) get dependencies(): Dependency[] } export declare class JsContextModuleFactoryBeforeResolveData { get context(): string set context(context: string) get request(): string set request(request: string) get regExp(): RegExp | undefined set regExp(rawRegExp: RegExp | undefined) get recursive(): boolean set recursive(recursive: boolean) } export declare class JsDependencies { get fileDependencies(): Array get addedFileDependencies(): Array get removedFileDependencies(): Array get contextDependencies(): Array get addedContextDependencies(): Array get removedContextDependencies(): Array get missingDependencies(): Array get addedMissingDependencies(): Array get removedMissingDependencies(): Array get buildDependencies(): Array get addedBuildDependencies(): Array get removedBuildDependencies(): Array } export declare class JsEntries { clear(): void get size(): number has(key: string): boolean set(key: string, value: JsEntryData | EntryDataDto): void delete(key: string): boolean get(key: string): EntryDataDto | undefined keys(): Array values(): Array } export declare class JsExportsInfo { isUsed(runtime: string | string[] | undefined): boolean isModuleUsed(runtime: string | string[] | undefined): boolean setUsedInUnknownWay(runtime: string | string[] | undefined): boolean getUsed(name: string | string[], runtime: string | string[] | undefined): 0 | 1 | 2 | 3 | 4 } export declare class JsModuleGraph { getModule(dependency: Dependency): Module | null getResolvedModule(dependency: Dependency): Module | null getUsedExports(module: Module, runtime: string | string[]): boolean | Array | null getIssuer(module: Module): Module | null getExportsInfo(module: Module): JsExportsInfo getConnection(dependency: Dependency): ModuleGraphConnection | null getOutgoingConnections(module: Module): ModuleGraphConnection[] getOutgoingConnectionsInOrder(module: Module): ModuleGraphConnection[] getIncomingConnections(module: Module): ModuleGraphConnection[] getParentModule(dependency: Dependency): Module | null getParentBlockIndex(dependency: Dependency): number isAsync(module: Module): boolean } export declare class JsResolver { resolveSync(path: string, request: string): string | undefined resolve(path: string, request: string, callback: (err: null | Error, req?: string) => void): void } export declare class JsResolverFactory { constructor(pnp: boolean, jsResolveOptions: RawResolveOptions, jsLoaderResolveOptions: RawResolveOptions) get(type: string, options?: RawResolveOptionsWithDependencyType): JsResolver } export declare class JsStats { toJson(jsOptions: JsStatsOptions): JsStatsCompilation getLogging(acceptedTypes: number): Array } export declare class KnownBuildInfo { } export declare class Module { readableIdentifier(): string _originalSource(): JsSource nameForCondition(): string | undefined get blocks(): AsyncDependenciesBlock[] get dependencies(): Dependency[] size(ty?: string | undefined | null): number libIdent(options: JsLibIdentOptions): string | null _emitFile(filename: string, source: JsSource, assetInfo?: AssetInfo | undefined | null): void } export declare class ModuleGraphConnection { get dependency(): Dependency get module(): Module | null get resolvedModule(): Module | null get originModule(): Module | null } export declare class NativeWatcher { constructor(options: NativeWatcherOptions) watch(files: [Array, Array], directories: [Array, Array], missing: [Array, Array], startTime: bigint, callback: (err: Error | null, result: NativeWatchResult) => void, callbackUndelayed: (path: string) => void): void triggerEvent(kind: 'change' | 'remove' | 'create', path: string): void /** * # Safety * * This function is unsafe because it uses `&mut self` to call the watcher asynchronously. * It's important to ensure that the watcher is not used in any other places before this function is finished. * You must ensure that the watcher not call watch, close or pause in the same time, otherwise it may lead to undefined behavior. */ close(): Promise pause(): void } export declare class NativeWatchResult { changedFiles: Array removedFiles: Array } export declare class RawExternalItemFnCtx { data(): RawExternalItemFnCtxData getResolve(options?: RawResolveOptionsWithDependencyType | undefined | null): (context: string, path: string, callback: (error?: Error, text?: string) => void) => void } export declare class ReadonlyResourceData { get descriptionFileData(): any get descriptionFilePath(): string } export declare class ResolverFactory { constructor(options?: NapiResolveOptions | undefined | null) static default(): ResolverFactory /** Clone the resolver using the same underlying cache. */ cloneWithOptions(options: NapiResolveOptions): ResolverFactory /** Clear the underlying cache. */ clearCache(): void /** Synchronously resolve `specifier` at an absolute path to a `directory`. */ sync(directory: string, request: string): ResolveResult /** Asynchronously resolve `specifier` at an absolute path to a `directory`. */ async(directory: string, request: string): Promise } export declare class Sources { _get(sourceType: string): JsSource | null } export declare class VirtualFileStore { writeVirtualFileSync(path: string, content: string): void batchWriteVirtualFilesSync(files: Array): void } export type JsVirtualFileStore = VirtualFileStore export interface AssetInfoRelated { sourceMap?: string | null } export declare function async(path: string, request: string): Promise export interface BuiltinPlugin { name: BuiltinPluginName | CustomPluginName options: unknown canInherentFromParent?: boolean } export declare enum BuiltinPluginName { DefinePlugin = 'DefinePlugin', ProvidePlugin = 'ProvidePlugin', BannerPlugin = 'BannerPlugin', IgnorePlugin = 'IgnorePlugin', ProgressPlugin = 'ProgressPlugin', EntryPlugin = 'EntryPlugin', DynamicEntryPlugin = 'DynamicEntryPlugin', ExternalsPlugin = 'ExternalsPlugin', NodeTargetPlugin = 'NodeTargetPlugin', ElectronTargetPlugin = 'ElectronTargetPlugin', EnableChunkLoadingPlugin = 'EnableChunkLoadingPlugin', EnableLibraryPlugin = 'EnableLibraryPlugin', EnableWasmLoadingPlugin = 'EnableWasmLoadingPlugin', FetchCompileAsyncWasmPlugin = 'FetchCompileAsyncWasmPlugin', ChunkPrefetchPreloadPlugin = 'ChunkPrefetchPreloadPlugin', CommonJsChunkFormatPlugin = 'CommonJsChunkFormatPlugin', ArrayPushCallbackChunkFormatPlugin = 'ArrayPushCallbackChunkFormatPlugin', ModuleChunkFormatPlugin = 'ModuleChunkFormatPlugin', EsmLibraryPlugin = 'EsmLibraryPlugin', HotModuleReplacementPlugin = 'HotModuleReplacementPlugin', LimitChunkCountPlugin = 'LimitChunkCountPlugin', WorkerPlugin = 'WorkerPlugin', WebWorkerTemplatePlugin = 'WebWorkerTemplatePlugin', MergeDuplicateChunksPlugin = 'MergeDuplicateChunksPlugin', SplitChunksPlugin = 'SplitChunksPlugin', RemoveDuplicateModulesPlugin = 'RemoveDuplicateModulesPlugin', ShareRuntimePlugin = 'ShareRuntimePlugin', ContainerPlugin = 'ContainerPlugin', ContainerReferencePlugin = 'ContainerReferencePlugin', ProvideSharedPlugin = 'ProvideSharedPlugin', ConsumeSharedPlugin = 'ConsumeSharedPlugin', ModuleFederationRuntimePlugin = 'ModuleFederationRuntimePlugin', ModuleFederationManifestPlugin = 'ModuleFederationManifestPlugin', NamedModuleIdsPlugin = 'NamedModuleIdsPlugin', NaturalModuleIdsPlugin = 'NaturalModuleIdsPlugin', DeterministicModuleIdsPlugin = 'DeterministicModuleIdsPlugin', NaturalChunkIdsPlugin = 'NaturalChunkIdsPlugin', NamedChunkIdsPlugin = 'NamedChunkIdsPlugin', DeterministicChunkIdsPlugin = 'DeterministicChunkIdsPlugin', OccurrenceChunkIdsPlugin = 'OccurrenceChunkIdsPlugin', RealContentHashPlugin = 'RealContentHashPlugin', RemoveEmptyChunksPlugin = 'RemoveEmptyChunksPlugin', EnsureChunkConditionsPlugin = 'EnsureChunkConditionsPlugin', CaseSensitivePlugin = 'CaseSensitivePlugin', DataUriPlugin = 'DataUriPlugin', FileUriPlugin = 'FileUriPlugin', RuntimePlugin = 'RuntimePlugin', JsonModulesPlugin = 'JsonModulesPlugin', InferAsyncModulesPlugin = 'InferAsyncModulesPlugin', JavascriptModulesPlugin = 'JavascriptModulesPlugin', AsyncWebAssemblyModulesPlugin = 'AsyncWebAssemblyModulesPlugin', AssetModulesPlugin = 'AssetModulesPlugin', SourceMapDevToolPlugin = 'SourceMapDevToolPlugin', EvalSourceMapDevToolPlugin = 'EvalSourceMapDevToolPlugin', EvalDevToolModulePlugin = 'EvalDevToolModulePlugin', SideEffectsFlagPlugin = 'SideEffectsFlagPlugin', FlagDependencyExportsPlugin = 'FlagDependencyExportsPlugin', FlagDependencyUsagePlugin = 'FlagDependencyUsagePlugin', InlineExportsPlugin = 'InlineExportsPlugin', MangleExportsPlugin = 'MangleExportsPlugin', ModuleConcatenationPlugin = 'ModuleConcatenationPlugin', CssModulesPlugin = 'CssModulesPlugin', APIPlugin = 'APIPlugin', RuntimeChunkPlugin = 'RuntimeChunkPlugin', SizeLimitsPlugin = 'SizeLimitsPlugin', NoEmitOnErrorsPlugin = 'NoEmitOnErrorsPlugin', NormalModuleReplacementPlugin = 'NormalModuleReplacementPlugin', ContextReplacementPlugin = 'ContextReplacementPlugin', DllEntryPlugin = 'DllEntryPlugin', DllReferenceAgencyPlugin = 'DllReferenceAgencyPlugin', LibManifestPlugin = 'LibManifestPlugin', FlagAllModulesAsUsedPlugin = 'FlagAllModulesAsUsedPlugin', HttpExternalsRspackPlugin = 'HttpExternalsRspackPlugin', CopyRspackPlugin = 'CopyRspackPlugin', HtmlRspackPlugin = 'HtmlRspackPlugin', SwcJsMinimizerRspackPlugin = 'SwcJsMinimizerRspackPlugin', LightningCssMinimizerRspackPlugin = 'LightningCssMinimizerRspackPlugin', BundlerInfoRspackPlugin = 'BundlerInfoRspackPlugin', CssExtractRspackPlugin = 'CssExtractRspackPlugin', SubresourceIntegrityPlugin = 'SubresourceIntegrityPlugin', RsdoctorPlugin = 'RsdoctorPlugin', RstestPlugin = 'RstestPlugin', RslibPlugin = 'RslibPlugin', CircularDependencyRspackPlugin = 'CircularDependencyRspackPlugin', URLPlugin = 'URLPlugin', JsLoaderRspackPlugin = 'JsLoaderRspackPlugin', LazyCompilationPlugin = 'LazyCompilationPlugin', ModuleInfoHeaderPlugin = 'ModuleInfoHeaderPlugin', HttpUriPlugin = 'HttpUriPlugin', CssChunkingPlugin = 'CssChunkingPlugin' } export declare function cleanupGlobalTrace(): void export interface ContextInfo { issuer: string issuerLayer?: string } export declare enum EnforceExtension { Auto = 0, Enabled = 1, Disabled = 2 } /** * Expected version of @rspack/core to the current binding version * @internal */ export const EXPECTED_RSPACK_CORE_VERSION: string export declare function formatDiagnostic(diagnostic: JsDiagnostic): ExternalObject<'Diagnostic'> export interface JsAddingRuntimeModule { name: string generator: () => String dependentHash: boolean fullHash: boolean isolate: boolean stage: number } export interface JsAdditionalTreeRuntimeRequirementsArg { chunk: Chunk runtimeRequirements: JsRuntimeGlobals } export interface JsAdditionalTreeRuntimeRequirementsResult { runtimeRequirements: JsRuntimeGlobals } export interface JsAfterEmitData { outputName: string compilationId: number uid?: number } export interface JsAfterTemplateExecutionData { html: string headTags: Array bodyTags: Array outputName: string compilationId: number uid?: number } export interface JsAlterAssetTagGroupsData { headTags: Array bodyTags: Array publicPath: string outputName: string compilationId: number uid?: number } export interface JsAlterAssetTagsData { assetTags: JsHtmlPluginAssetTags outputName: string publicPath: string compilationId: number uid?: number } export interface JsAsset { name: string info: AssetInfo } export interface JsAssetEmittedArgs { filename: string outputPath: string targetPath: string } export interface JsBannerContentFnCtx { hash: string chunk: Chunk filename: string } export interface JsBeforeAssetTagGenerationData { assets: JsHtmlPluginAssets outputName: string compilationId: number uid?: number } export interface JsBeforeEmitData { html: string outputName: string compilationId: number uid?: number } export interface JsBuildMeta { strictEsmModule?: boolean hasTopLevelAwait?: boolean esm?: boolean exportsType?: undefined | 'unset' | 'default' | 'namespace' | 'flagged' | 'dynamic' defaultObject?: undefined | 'false' | 'redirect' | JsBuildMetaDefaultObjectRedirectWarn sideEffectFree?: boolean exportsFinalName?: Array<[string, string]> | undefined } export interface JsBuildMetaDefaultObjectRedirectWarn { redirectWarn: JsDefaultObjectRedirectWarnObject } export interface JsBuildTimeExecutionOption { publicPath?: string baseUri?: string } export interface JsCacheGroupTestCtx { module: Module } export interface JsChunkAssetArgs { chunk: Chunk filename: string } export interface JsChunkGroupOrigin { module?: Module | undefined request?: string loc?: string | RealDependencyLocation } export interface JsChunkOptionNameCtx { module: Module chunks: Chunk[] cacheGroupKey: string } /** * File clean options * * This matches with: * - keep: * - If a string, keep the files under this path */ export interface JsCleanOptions { keep?: string | RegExp | ((path: string) => boolean) } export interface JsCodegenerationResult { sources: Record } export interface JsCodegenerationResults { map: Record> } export interface JsCreateData { request: string userRequest: string resource: string } export interface JsCreateLinkData { code: string chunk: Chunk } export interface JsCreateScriptData { code: string chunk: Chunk } export interface JsDefaultObjectRedirectWarnObject { ignore: boolean } export interface JsDiagnostic { message: string help?: string sourceCode?: string location?: JsDiagnosticLocation file?: string severity: "error" | "warning" moduleIdentifier?: string } export interface JsDiagnosticLocation { text?: string /** 1-based */ line: number /** 0-based in bytes */ column: number /** Length in bytes */ length: number } export interface JsEntryData { dependencies: Array includeDependencies: Array options: JsEntryOptions } export interface JsEntryOptions { name?: string runtime?: false | string chunkLoading?: false | string wasmLoading?: false | string asyncChunks?: boolean publicPath?: "auto" | JsFilename baseUri?: string filename?: JsFilename library?: JsLibraryOptions dependOn?: Array layer?: string } export interface JsEntryPluginOptions { context: string entry: string options: JsEntryOptions } export interface JsExecuteModuleArg { entry: string runtimeModules: Array codegenResults: JsCodegenerationResults id: number } export interface JsExecuteModuleResult { fileDependencies: Array contextDependencies: Array buildDependencies: Array missingDependencies: Array cacheable: boolean id: number error?: string } export interface JsFactoryMeta { sideEffectFree?: boolean } export interface JsHtmlPluginAssets { publicPath: string js: Array css: Array favicon?: string jsIntegrity?: Array cssIntegrity?: Array } export interface JsHtmlPluginAssetTags { scripts: Array styles: Array meta: Array } export interface JsHtmlPluginTag { tagName: string attributes: Record voidTag: boolean innerHTML?: string asset?: string } export interface JsHttpResponseRaw { status: number headers: Record body: Buffer } export interface JsLibIdentOptions { context: string } export interface JsLibraryAuxiliaryComment { root?: string commonjs?: string commonjs2?: string amd?: string } export interface JsLibraryCustomUmdObject { amd?: string commonjs?: string root?: Array | string } export interface JsLibraryName { type: "string" | "array" | "umdObject" stringPayload?: string arrayPayload?: Array umdObjectPayload?: JsLibraryCustomUmdObject } export interface JsLibraryOptions { name?: string | Array | JsLibraryCustomUmdObject export?: Array | string type: string umdNamedDefine?: boolean auxiliaryComment?: string | JsLibraryAuxiliaryComment amdContainer?: string } export interface JsLinkPrefetchData { code: string chunk: Chunk } export interface JsLinkPreloadData { code: string chunk: Chunk } export interface JsLoaderContext { resource: string _module: Module hot: Readonly /** Content maybe empty in pitching stage */ content: null | Buffer additionalData?: any __internal__parseMeta: Record sourceMap?: Buffer cacheable: boolean fileDependencies: Array contextDependencies: Array missingDependencies: Array buildDependencies: Array loaderItems: Array loaderIndex: number loaderState: Readonly __internal__error?: RspackError /** * UTF-8 hint for `content` * - Some(true): `content` is a `UTF-8` encoded sequence */ __internal__utf8Hint?: boolean } export interface JsLoaderItem { loader: string type: string data: any normalExecuted: boolean pitchExecuted: boolean noPitch: boolean } export declare enum JsLoaderState { Pitching = 'Pitching', Normal = 'Normal' } export interface JsModuleDescriptor { identifier: string name: string id?: string | number | null } export interface JsNormalModuleFactoryCreateModuleArgs { dependencyType: string rawRequest: string resourceResolveData: JsResourceData context: string matchResource?: string } export interface JsOriginRecord { moduleDescriptor?: JsModuleDescriptor loc: string request: string } export interface JsPathData { filename?: string hash?: string contentHash?: string runtime?: string url?: string id?: string chunk?: JsPathDataChunkLike } export interface JsPathDataChunkLike { name?: string hash?: string id?: string } export interface JsResolveData { request: string context: string contextInfo: ContextInfo fileDependencies: Array contextDependencies: Array missingDependencies: Array createData?: JsCreateData } export interface JsResolveForSchemeArgs { resourceData: JsResourceData scheme: string } export interface JsResourceData { /** Resource with absolute path, query and fragment */ resource: string /** Absolute resource path only */ path?: string /** Resource query with `?` prefix */ query?: string /** Resource fragment with `#` prefix */ fragment?: string descriptionFileData?: any descriptionFilePath?: string } export interface JsRsdoctorAsset { ukey: number path: string chunks: Array size: number } export interface JsRsdoctorAssetPatch { assets: Array chunkAssets: Array entrypointAssets: Array } export interface JsRsdoctorChunk { ukey: number name: string initial: boolean entry: boolean dependencies: Array imported: Array } export interface JsRsdoctorChunkAssets { chunk: number assets: Array } export interface JsRsdoctorChunkGraph { chunks: Array entrypoints: Array } export interface JsRsdoctorChunkModules { chunk: number modules: Array } export interface JsRsdoctorDependency { ukey: number kind: string request: string module: number dependency: number } export interface JsRsdoctorEntrypoint { ukey: number name: string chunks: Array } export interface JsRsdoctorEntrypointAssets { entrypoint: number assets: Array } export interface JsRsdoctorExportInfo { ukey: number name: string from?: number variable?: number identifier?: JsRsdoctorStatement sideEffects: Array } export interface JsRsdoctorModule { ukey: number identifier: string path: string isEntry: boolean kind: 'normal' | 'concatenated' layer?: string dependencies: Array imported: Array modules: Array belongModules: Array chunks: Array issuerPath: Array bailoutReason: Array } export interface JsRsdoctorModuleGraph { modules: Array dependencies: Array chunkModules: Array } export interface JsRsdoctorModuleGraphModule { ukey: number module: number exports: Array sideEffects: Array variables: Array dynamic: boolean } export interface JsRsdoctorModuleId { module: number renderId: string } export interface JsRsdoctorModuleIdsPatch { moduleIds: Array } export interface JsRsdoctorModuleOriginalSource { module: number source: string size: number } export interface JsRsdoctorModuleSourcesPatch { moduleOriginalSources: Array } export interface JsRsdoctorSideEffect { ukey: number name: string originName?: string module: number identifier: JsRsdoctorStatement isNameSpace: boolean fromDependency?: number exports: Array variable?: number } export interface JsRsdoctorSourceMapFeatures { cheap?: boolean module?: boolean } export interface JsRsdoctorSourcePosition { line?: number column?: number index?: number } export interface JsRsdoctorSourceRange { start: JsRsdoctorSourcePosition end?: JsRsdoctorSourcePosition } export interface JsRsdoctorStatement { module: number sourcePosition?: JsRsdoctorSourceRange transformedPosition: JsRsdoctorSourceRange } export interface JsRsdoctorVariable { ukey: number name: string module: number usedInfo: string identififer: JsRsdoctorStatement exported?: number } export interface JsRspackDiagnostic { severity: JsRspackSeverity error: RspackError } export declare enum JsRspackSeverity { Error = 'Error', Warn = 'Warn' } export interface JsRuntimeGlobals { value: Array } export interface JsRuntimeModule { source?: JsSource moduleIdentifier: string constructorName: string name: string stage: number isolate: boolean } export interface JsRuntimeModuleArg { module: JsRuntimeModule chunk: Chunk } export interface JsRuntimeRequirementInTreeArg { chunk: Chunk allRuntimeRequirements: JsRuntimeGlobals runtimeRequirements: JsRuntimeGlobals } export interface JsRuntimeRequirementInTreeResult { allRuntimeRequirements: JsRuntimeGlobals } /** * Zero copy `JsSourceFromJs` slice shared between Rust and Node.js if buffer is used. * * It can only be used in non-async context and the lifetime is bound to the fn closure. * * If you want to use Node.js Buffer in async context or want to extend the lifetime, use `JsSourceToJs` instead. */ export interface JsSourceFromJs { source: string | Buffer map?: string } export interface JsSourceToJs { source: string | Buffer map?: string } export interface JsStatsAsset { type: string name: string info: JsStatsAssetInfo size: number emitted: boolean chunkNames: Array chunkIdHints: Array chunks: Array auxiliaryChunkNames: Array auxiliaryChunkIdHints: Array auxiliaryChunks: Array } export interface JsStatsAssetInfo { minimized?: boolean development?: boolean hotModuleReplacement?: boolean sourceFilename?: string copied?: boolean immutable?: boolean javascriptModule?: boolean chunkhash: Array contenthash: Array fullhash: Array related: Array isOverSizeLimit?: boolean } export interface JsStatsAssetInfoRelated { name: string value: Array } export interface JsStatsAssetsByChunkName { name: string files: Array } export interface JsStatsChildGroupChildAssets { preload?: Array prefetch?: Array } export interface JsStatsChunk { type: string files: Array auxiliaryFiles: Array id?: string idHints: Array hash?: string entry: boolean initial: boolean names: Array size: number parents?: Array children?: Array siblings?: Array childrenByOrder: Record> runtime: Array reason?: string rendered: boolean sizes: Array origins: Array modules?: Array } export interface JsStatsChunkGroup { name: string chunks: Array assets: Array assetsSize: number auxiliaryAssets?: Array auxiliaryAssetsSize?: number isOverSizeLimit?: boolean children?: JsStatsChunkGroupChildren childAssets?: JsStatsChildGroupChildAssets } export interface JsStatsChunkGroupAsset { name: string size: number } export interface JsStatsChunkGroupChildren { preload?: Array prefetch?: Array } export interface JsStatsCompilation { assets?: Array assetsByChunkName?: Array chunks?: Array entrypoints?: Array errors: Array hash?: string modules?: Array namedChunkGroups?: Array warnings: Array } export interface JsStatsError { name?: string moduleDescriptor?: JsModuleDescriptor message: string chunkName?: string code?: string chunkEntry?: boolean chunkInitial?: boolean loc?: string file?: string chunkId?: string details?: string stack?: string moduleTrace: Array } export interface JsStatsGetAssets { assets: Array assetsByChunkName: Array } export interface JsStatsLogging { name: string type: string args?: Array trace?: Array } export interface JsStatsModule { commonAttributes: JsStatsModuleCommonAttributes dependent?: boolean issuerDescriptor?: JsModuleDescriptor issuerPath?: Array usedExports?: string | Array modules?: Array } export interface JsStatsModuleCommonAttributes { type: string moduleType: string layer?: string size: number sizes: Array built: boolean codeGenerated: boolean buildTimeExecuted: boolean cached: boolean moduleDescriptor?: JsModuleDescriptor nameForCondition?: string preOrderIndex?: number postOrderIndex?: number cacheable?: boolean optional?: boolean orphan?: boolean failed?: boolean errors?: number warnings?: number profile?: JsStatsModuleProfile chunks?: Array assets?: Array reasons?: Array providedExports?: Array optimizationBailout?: Array depth?: number source?: string | Buffer } export interface JsStatsModuleIssuer { moduleDescriptor: JsModuleDescriptor } export interface JsStatsModuleProfile { factory: number building: number } export interface JsStatsModuleReason { moduleDescriptor?: JsModuleDescriptor resolvedModuleDescriptor?: JsModuleDescriptor moduleChunks?: number type?: string userRequest?: string explanation?: string active: boolean loc?: string } export interface JsStatsModuleTrace { origin: JsStatsModuleTraceModule module: JsStatsModuleTraceModule dependencies: Array } export interface JsStatsModuleTraceDependency { loc: string } export interface JsStatsModuleTraceModule { moduleDescriptor: JsModuleDescriptor } export interface JsStatsOptimizationBailout { inner: string } export interface JsStatsOptions { assets: boolean cachedModules: boolean chunks: boolean chunkGroupAuxiliary: boolean chunkGroupChildren: boolean chunkGroups: boolean chunkModules: boolean chunkRelations: boolean depth: boolean entrypoints: boolean | string errors: boolean hash: boolean ids: boolean modules: boolean moduleAssets: boolean nestedModules: boolean optimizationBailout: boolean providedExports: boolean reasons: boolean source: boolean usedExports: boolean warnings: boolean } export interface JsStatsSize { sourceType: string size: number } export interface JsTap { function: (...args: any[]) => any stage: number } export interface JsVirtualFile { path: string content: string } export interface KnownAssetInfo { /** if the asset can be long term cached forever (contains a hash) */ immutable?: boolean /** whether the asset is minimized */ minimized?: boolean /** the value(s) of the full hash used for this asset */ fullhash?: string | Array /** the value(s) of the chunk hash used for this asset */ chunkhash?: string | Array /** * the value(s) of the module hash used for this asset * the value(s) of the content hash used for this asset */ contenthash?: string | Array /** when asset was created from a source file (potentially transformed), the original filename relative to compilation context */ sourceFilename?: string /** when asset was created from a source file (potentially transformed), it should be flagged as copied */ copied?: boolean /** * size in bytes, only set after asset has been emitted * when asset is only used for development and doesn't count towards user-facing assets */ development?: boolean /** when asset ships data for updating an existing application (HMR) */ hotModuleReplacement?: boolean /** when asset is javascript and an ESM */ javascriptModule?: boolean /** related object to other assets, keyed by type of relation (only points from parent to child) */ related?: AssetInfoRelated /** unused css local ident for the css chunk */ cssUnusedIdents?: Array /** whether this asset is over the size limit */ isOverSizeLimit?: boolean /** the asset type */ assetType?: string } export declare function loadBrowserslist(input: string | undefined | null, context: string): Array | null export declare function minify(source: string, options: string): Promise export declare function minifySync(source: string, options: string): TransformOutput /** * Module Resolution Options * * Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). * * See [rspack resolve](https://rspack.rs/config/resolve) for information and examples */ export interface NapiResolveOptions { /** * Path to TypeScript configuration file. * * Default `None` */ tsconfig?: TsconfigOptions /** * Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. * * For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> * AliasValue::Path(String)` * Create aliases to import or require certain modules more easily. * A trailing $ can also be added to the given object's keys to signify an exact match. */ alias?: Record /** * A list of alias fields in description files. * Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). * Can be a path to json object such as `["path", "to", "exports"]`. * * Default `[]` */ aliasFields?: (string | string[])[] /** * Condition names for exports field which defines entry points of a package. * The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. * * Default `[]` */ conditionNames?: Array /** * The JSON files to use for descriptions. (There was once a `bower.json`.) * * Default `["package.json"]` */ descriptionFiles?: Array /** * If true, it will not allow extension-less files. * So by default `require('./foo')` works if `./foo` has a `.js` extension, * but with this enabled only `require('./foo.js')` will work. * * Default to `true` when [ResolveOptions::extensions] contains an empty string. * Use `Some(false)` to disable the behavior. * See * * Default None, which is the same as `Some(false)` when the above empty rule is not applied. */ enforceExtension?: EnforceExtension /** * A list of exports fields in description files. * Can be a path to json object such as `["path", "to", "exports"]`. * * Default `[["exports"]]`. */ exportsFields?: (string | string[])[] /** * Fields from `package.json` which are used to provide the internal requests of a package * (requests starting with # are considered internal). * * Can be a path to a JSON object such as `["path", "to", "imports"]`. * * Default `[["imports"]]`. */ importsFields?: (string | string[])[] /** * An object which maps extension to extension aliases. * * Default `{}` */ extensionAlias?: Record> /** * Attempt to resolve these extensions in order. * If multiple files share the same name but have different extensions, * will resolve the one with the extension listed first in the array and skip the rest. * * Default `[".js", ".json", ".node"]` */ extensions?: Array /** * Redirect module requests when normal resolving fails. * * Default `[]` */ fallback?: Record> /** * Request passed to resolve is already fully specified and extensions or main files are not resolved for it (they are still resolved for internal requests). * * See also rspack configuration [resolve.fullySpecified](https://rspack.rs/config/resolve#resolvefullyspecified) * * Default `false` */ fullySpecified?: boolean /** * A list of main fields in description files * * Default `["main"]`. */ mainFields?: string | string[] /** * The filename to be used while resolving directories. * * Default `["index"]` */ mainFiles?: Array /** * A list of directories to resolve modules from, can be absolute path or folder name. * * Default `["node_modules"]` */ modules?: string | string[] /** * Resolve to a context instead of a file. * * Default `false` */ resolveToContext?: boolean /** * Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. * * Default `false` */ preferRelative?: boolean /** * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. * * Default `false` */ preferAbsolute?: boolean /** * A list of resolve restrictions to restrict the paths that a request can be resolved on. * * Default `[]` */ restrictions?: Array /** * A list of directories where requests of server-relative URLs (starting with '/') are resolved. * On non-Windows systems these requests are resolved as an absolute path first. * * Default `[]` */ roots?: Array /** * Whether to resolve symlinks to their symlinked location. * When enabled, symlinked resources are resolved to their real path, not their symlinked location. * Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). * * Default `true` */ symlinks?: boolean /** * Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. * For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. * * Default `false` */ builtinModules?: boolean /** * Whether to enable yarn Plug'n'Play * * Default `false` */ enablePnp?: boolean } export interface NativeWatcherOptions { followSymlinks?: boolean pollInterval?: number aggregateTimeout?: number /** * The ignored paths for the watcher. * It can be a single path, an array of paths, or a regular expression. */ ignored?: string | string[] | RegExp } export interface NodeFsStats { isFile: boolean isDirectory: boolean isSymlink: boolean atimeMs: number mtimeMs: number ctimeMs: number birthtimeMs: number size: number mode: number } export interface PathWithInfo { path: string info: AssetInfo } export interface RawAliasOptionItem { path: string redirect: Array } export interface RawAssetGeneratorDataUrlFnCtx { filename: string module: Module } export interface RawAssetGeneratorDataUrlOptions { encoding?: "base64" | "false" | undefined mimetype?: string } export interface RawAssetGeneratorOptions { emit?: boolean filename?: JsFilename outputPath?: JsFilename publicPath?: "auto" | JsFilename dataUrl?: RawAssetGeneratorDataUrlOptions | ((source: Buffer, context: RawAssetGeneratorDataUrlFnCtx) => string) importMode?: "url" | "preserve" binary?: boolean } export interface RawAssetInlineGeneratorOptions { dataUrl?: RawAssetGeneratorDataUrlOptions | ((source: Buffer, context: RawAssetGeneratorDataUrlFnCtx) => string) binary?: boolean } export interface RawAssetParserDataUrl { type: "options" options?: RawAssetParserDataUrlOptions } export interface RawAssetParserDataUrlOptions { maxSize?: number } export interface RawAssetParserOptions { dataUrlCondition?: RawAssetParserDataUrl } export interface RawAssetResourceGeneratorOptions { emit?: boolean filename?: JsFilename outputPath?: JsFilename publicPath?: "auto" | JsFilename importMode?: "url" | "preserve" binary?: boolean } export interface RawBannerPluginOptions { banner: string | ((args: { hash: string, chunk: Chunk, filename: string }) => string) entryOnly?: boolean footer?: boolean raw?: boolean stage?: number test?: string | RegExp | (string | RegExp)[] include?: string | RegExp | (string | RegExp)[] exclude?: string | RegExp | (string | RegExp)[] } export interface RawBundlerInfoPluginOptions { version: string bundler: string force: boolean | string[] } export interface RawCacheGroupOptions { key: string priority?: number test?: RegExp | string | Function filename?: JsFilename idHint?: string /** What kind of chunks should be selected. */ chunks?: RegExp | 'async' | 'initial' | 'all' type?: RegExp | string layer?: RegExp | string | ((layer?: string) => boolean) automaticNameDelimiter?: string minChunks?: number minSize?: number | RawSplitChunkSizes minSizeReduction?: number | RawSplitChunkSizes maxSize?: number | RawSplitChunkSizes maxAsyncSize?: number | RawSplitChunkSizes maxInitialSize?: number | RawSplitChunkSizes maxAsyncRequests?: number maxInitialRequests?: number name?: string | false | Function reuseExistingChunk?: boolean enforce?: boolean usedExports?: boolean } export interface RawCacheOptions { type: string maxGenerations?: number } export interface RawCircularDependencyRspackPluginOptions { failOnError?: boolean exclude?: RegExp ignoredConnections?: Array<[string | RegExp, string | RegExp]> onDetected?: (entrypoint: Module, modules: string[]) => void onIgnored?: (entrypoint: Module, modules: string[]) => void onStart?: () => void onEnd?: () => void } export interface RawCompilerPlatform { web?: boolean | null browser?: boolean | null webworker?: boolean | null node?: boolean | null nwjs?: boolean | null electron?: boolean | null } export interface RawConsumeOptions { key: string import?: string importResolved?: string shareKey: string shareScope: string requiredVersion?: string | false | undefined packageName?: string strictVersion: boolean singleton: boolean eager: boolean } export interface RawConsumeSharedPluginOptions { consumes: Array enhanced: boolean } export interface RawContainerPluginOptions { name: string shareScope: string library: JsLibraryOptions runtime?: false | string filename?: string exposes: Array enhanced: boolean } export interface RawContainerReferencePluginOptions { remoteType: string remotes: Array shareScope?: string enhanced: boolean } export interface RawContextReplacementPluginOptions { resourceRegExp: RegExp newContentResource?: string newContentRecursive?: boolean newContentRegExp?: RegExp newContentCreateContextMap?: Record } export interface RawCopyGlobOptions { /** * Whether the match is case sensitive * @default true */ caseSensitiveMatch?: boolean /** * Whether to match files starting with `.` * @default true */ dot?: boolean /** * An array of strings in glob format, which can be used to ignore specific paths * @default undefined */ ignore?: Array } export interface RawCopyPattern { /** * The source path of the copy operation, which can be an absolute path, a relative * path, or a glob pattern. It can refer to a file or a directory. If a relative path * is passed, it is relative to the `context` option. * @default undefined */ from: string /** * The destination path of the copy operation, which can be an absolute path, a * relative path, or a template string. If not specified, it is equal to Rspack's * `output.path`. * @default Rspack's `output.path` */ to?: string | ((pathData: { context: string; absoluteFilename?: string }) => string | Promise) /** * `context` is a path to be prepended to `from` and removed from the start of the * result paths. `context` can be an absolute path or a relative path. If it is a * relative path, then it will be converted to an absolute path based on Rspack's * `context`. * `context` should be explicitly set only when `from` contains a glob. Otherwise, * `context` is automatically set based on whether `from` is a file or a directory: * - If `from` is a file, then `context` is its directory. The result path will be * the filename alone. * - If `from` is a directory, then `context` equals `from`. The result paths will * be the paths of the directory's contents (including nested contents), relative * to the directory. * @default Rspack's `context` */ context?: string /** * Specify the type of [to](#to), which can be a directory, a file, or a template * name in Rspack. If not specified, it will be automatically inferred. * The automatic inference rules are as follows: * - `dir`: If `to` has no extension, or ends on `/`. * - `file`: If `to` is not a directory and is not a template. * - `template`: If `to` contains a template pattern. * @default undefined */ toType?: string /** * Whether to ignore the error if there are missing files or directories. * @default false */ noErrorOnMissing: boolean /** * Whether to force the copy operation to overwrite the destination file if it * already exists. * @default false */ force: boolean /** * The priority of the copy operation. The higher the priority, the earlier the copy * operation will be executed. When `force` is set to `true`, if a matching file is * found, the one with higher priority will overwrite the one with lower priority. * @default 0 */ priority: number /** * Set the glob options for the copy operation. * @default undefined */ globOptions: RawCopyGlobOptions /** * Allows to add some assets info to the copied files, which may affect some behaviors * in the build process. For example, by default, the copied JS and CSS files will be * minified by Rspack's minimizer, if you want to skip minification for copied files, * you can set `info.minimized` to `true`. * @default undefined */ info?: RawInfo /** * Determines whether to copy file permissions from the source to the destination. * When set to true, the plugin will preserve executable permissions and other file modes. * This is particularly useful when copying scripts or executable files. * @default false */ copyPermissions?: boolean /** * Allows to modify the file contents. * @default undefined */ transform?: { transformer: (input: Buffer, absoluteFilename: string) => string | Buffer | Promise | Promise } | ((input: Buffer, absoluteFilename: string) => string | Buffer | Promise | Promise) } export interface RawCopyRspackPluginOptions { /** An array of objects that describe the copy operations to be performed. */ patterns: Array } export interface RawCssAutoGeneratorOptions { exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" exportsOnly?: boolean localIdentName?: string esModule?: boolean } export interface RawCssAutoParserOptions { namedExports?: boolean url?: boolean } export interface RawCssChunkingPluginOptions { strict?: boolean minSize?: number maxSize?: number exclude?: RegExp } export interface RawCssExtractPluginOption { filename: JsFilename chunkFilename: JsFilename ignoreOrder: boolean insert?: string attributes: Record linkType?: string runtime: boolean pathinfo: boolean enforceRelative: boolean } export interface RawCssGeneratorOptions { exportsOnly?: boolean esModule?: boolean } export interface RawCssModuleGeneratorOptions { exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" exportsOnly?: boolean localIdentName?: string esModule?: boolean } export interface RawCssModuleParserOptions { namedExports?: boolean url?: boolean } export interface RawCssParserOptions { namedExports?: boolean url?: boolean } export interface RawDllEntryPluginOptions { context: string entries: Array name: string } export interface RawDllManifest { content: Record name?: string type?: string } export interface RawDllManifestContentItem { buildMeta?: JsBuildMeta exports?: string[] | true id?: number | string } export interface RawDllReferenceAgencyPluginOptions { context?: string name?: string extensions: Array scope?: string sourceType?: string type: string content?: Record manifest?: RawDllManifest } export interface RawDraft { customMedia: boolean } export interface RawDynamicEntryPluginOptions { context: string entry: () => Promise } export interface RawEntryDynamicResult { import: Array options: JsEntryOptions } export interface RawEnvironment { const?: boolean methodShorthand?: boolean arrowFunction?: boolean nodePrefixForCoreModules?: boolean asyncFunction?: boolean bigIntLiteral?: boolean destructuring?: boolean document?: boolean dynamicImport?: boolean forOf?: boolean globalThis?: boolean module?: boolean optionalChaining?: boolean templateLiteral?: boolean dynamicImportInWorker?: boolean importMetaDirnameAndFilename?: boolean } export interface RawEsmLibraryPlugin { preserveModules?: string } export interface RawEvalDevToolModulePluginOptions { namespace?: string moduleFilenameTemplate?: string | ((info: RawModuleFilenameTemplateFnCtx) => string) sourceUrlComment?: string } export interface RawExperimentCacheOptionsPersistent { buildDependencies?: Array version?: string snapshot?: RawExperimentSnapshotOptions storage?: RawStorageOptions } export interface RawExperiments { topLevelAwait: boolean incremental?: false | { [key: string]: boolean } rspackFuture?: RawRspackFuture cache: boolean | { type: "persistent" } & RawExperimentCacheOptionsPersistent | { type: "memory" } useInputFileSystem?: false | Array css?: boolean lazyBarrel: boolean deferImport: boolean } export interface RawExperimentSnapshotOptions { immutablePaths: Array unmanagedPaths: Array managedPaths: Array } export interface RawExposeOptions { key: string name?: string import: Array } export interface RawExternalItemFnCtxData { request: string context: string dependencyType: string contextInfo: ContextInfo } export interface RawExternalItemFnResult { externalType?: string result?: string | boolean | string[] | Record } export interface RawExternalsPluginOptions { type: string externals: (string | RegExp | Record> | ((...args: any[]) => any))[] placeInInitial: boolean } export interface RawExternalsPresets { node: boolean web: boolean electron: boolean electronMain: boolean electronPreload: boolean electronRenderer: boolean } export interface RawExtractComments { banner?: string | boolean condition?: string } export interface RawFallbackCacheGroupOptions { chunks?: RegExp | 'async' | 'initial' | 'all' minSize?: number | RawSplitChunkSizes maxSize?: number | RawSplitChunkSizes maxAsyncSize?: number | RawSplitChunkSizes maxInitialSize?: number | RawSplitChunkSizes automaticNameDelimiter?: string } export interface RawFlagAllModulesAsUsedPluginOptions { explanation: string } export interface RawFuncUseCtx { resource?: string realResource?: string resourceQuery: string resourceFragment: string issuer: string issuerLayer: string } export interface RawGeneratorOptions { type: "asset" | "asset/inline" | "asset/resource" | "css" | "css/auto" | "css/module" | "json" asset?: RawAssetGeneratorOptions assetInline?: RawAssetInlineGeneratorOptions assetResource?: RawAssetResourceGeneratorOptions css?: RawCssGeneratorOptions cssAuto?: RawCssAutoGeneratorOptions cssModule?: RawCssModuleGeneratorOptions json?: RawJsonGeneratorOptions } export interface RawHtmlRspackPluginBaseOptions { href?: string target?: "_self" | "_blank" | "_parent" | "_top" } export interface RawHtmlRspackPluginOptions { /** emitted file name in output path */ filename?: string[] /** template html file */ template?: string templateFn?: (data: string) => Promise templateContent?: string templateParameters?: boolean | Record | ((params: string) => Promise) /** "head", "body" or "false" */ inject: "head" | "body" | "false" /** path or `auto` */ publicPath?: string /** `blocking`, `defer`, `module` or `systemjs-module` */ scriptLoading: "blocking" | "defer" | "module" | "systemjs-module" /** entry_chunk_name (only entry chunks are supported) */ chunks?: Array excludeChunks?: Array chunksSortMode: "auto" | "manual" sri?: "sha256" | "sha384" | "sha512" minify?: boolean title?: string favicon?: string meta?: Record> hash?: boolean base?: RawHtmlRspackPluginBaseOptions uid?: number } export interface RawHttpExternalsRspackPluginOptions { css: boolean webAsync: boolean } export interface RawHttpUriPluginOptions { allowedUris: (string | RegExp)[] lockfileLocation?: string cacheLocation?: string upgrade: boolean httpClient: (url: string, headers: Record) => Promise } export interface RawIgnorePluginOptions { resourceRegExp?: RegExp contextRegExp?: RegExp checkResource?: (resource: string, context: string) => boolean } export interface RawIncremental { silent: boolean make: boolean inferAsyncModules: boolean providedExports: boolean dependenciesDiagnostics: boolean sideEffects: boolean buildChunkGraph: boolean moduleIds: boolean chunkIds: boolean modulesHashes: boolean modulesCodegen: boolean modulesRuntimeRequirements: boolean chunksRuntimeRequirements: boolean chunksHashes: boolean chunksRender: boolean emitAssets: boolean } export interface RawInfo { immutable?: boolean /** * Whether to skip minification for the copied files. * @default false */ minimized?: boolean chunkHash?: Array contentHash?: Array development?: boolean hotModuleReplacement?: boolean related?: RawRelated version?: string } export interface RawIntegrityData { integerities: Array } export interface RawIntegrityItem { asset: string integrity: string } export declare enum RawJavascriptParserCommonjsExports { SkipInEsm = 'skipInEsm' } export interface RawJavascriptParserCommonjsOptions { exports?: boolean | 'skipInEsm' } export interface RawJavascriptParserOptions { dynamicImportMode?: string dynamicImportPreload?: string dynamicImportPrefetch?: string dynamicImportFetchPriority?: string url?: string exprContextCritical?: boolean unknownContextCritical?: boolean wrappedContextCritical?: boolean wrappedContextRegExp?: RegExp exportsPresence?: string importExportsPresence?: string reexportExportsPresence?: string strictExportPresence?: boolean worker?: Array overrideStrict?: string importMeta?: boolean /** * This option is experimental in Rspack only and subject to change or be removed anytime. * @experimental */ requireAlias?: boolean /** * This option is experimental in Rspack only and subject to change or be removed anytime. * @experimental */ requireAsExpression?: boolean /** * This option is experimental in Rspack only and subject to change or be removed anytime. * @experimental */ requireDynamic?: boolean /** * This option is experimental in Rspack only and subject to change or be removed anytime. * @experimental */ requireResolve?: boolean commonjs?: boolean | { exports?: boolean | 'skipInEsm' } /** * This option is experimental in Rspack only and subject to change or be removed anytime. * @experimental */ importDynamic?: boolean commonjsMagicComments?: boolean /** * This option is experimental in Rspack only and subject to change or be removed anytime. * @experimental */ typeReexportsPresence?: string /** * This option is experimental in Rspack only and subject to change or be removed anytime. * @experimental */ jsx?: boolean deferImport?: boolean } export interface RawJsonGeneratorOptions { JSONParse?: boolean } export interface RawJsonParserOptions { exportsDepth?: number parse?: (source: string) => string } export interface RawLazyCompilationOption { currentActiveModules: ((err: Error | null, ) => Set) test?: RawLazyCompilationTest entries: boolean imports: boolean client: string } export interface RawLibManifestPluginOptions { context?: string entryOnly?: boolean name?: JsFilename path: JsFilename format?: boolean type?: string } export interface RawLightningCssBrowsers { android?: number chrome?: number edge?: number firefox?: number ie?: number ios_saf?: number opera?: number safari?: number samsung?: number } export interface RawLightningCssMinimizerOptions { errorRecovery: boolean targets?: Array include?: number exclude?: number draft?: RawDraft drafts?: RawDraft nonStandard?: RawNonStandard pseudoClasses?: RawLightningCssPseudoClasses unusedSymbols: Array } export interface RawLightningCssMinimizerRspackPluginOptions { test?: string | RegExp | (string | RegExp)[] include?: string | RegExp | (string | RegExp)[] exclude?: string | RegExp | (string | RegExp)[] removeUnusedLocalIdents: boolean minimizerOptions: RawLightningCssMinimizerOptions } export interface RawLightningCssPseudoClasses { hover?: string active?: string focus?: string focusVisible?: string focusWithin?: string } export interface RawLimitChunkCountPluginOptions { chunkOverhead?: number entryChunkMultiplicator?: number maxChunks: number } export interface RawManifestExposeOption { path: string name: string } export interface RawManifestSharedOption { name: string version?: string requiredVersion?: string singleton?: boolean } export interface RawModuleFederationManifestPluginOptions { name?: string globalName?: string fileName?: string filePath?: string statsFileName?: string manifestFileName?: string disableAssetsAnalyze?: boolean remoteAliasMap?: Record exposes?: Array shared?: Array buildInfo?: RawStatsBuildInfo } export interface RawModuleFederationRuntimeExperimentsOptions { asyncStartup?: boolean } export interface RawModuleFederationRuntimePluginOptions { entryRuntime?: string | undefined experiments?: RawModuleFederationRuntimeExperimentsOptions } export interface RawModuleFilenameTemplateFnCtx { identifier: string shortIdentifier: string resource: string resourcePath: string absoluteResourcePath: string loaders: string allLoaders: string query: string moduleId: string hash: string namespace: string } export interface RawModuleInfo { active: boolean client: string data: string } export interface RawModuleOptions { rules: Array parser?: Record generator?: Record noParse?: string | RegExp | ((request: string) => boolean) | (string | RegExp | ((request: string) => boolean))[] unsafeCache?: boolean | RegExp } export interface RawModuleRule { /** * A conditional match matching an absolute path + query + fragment. * Note: * This is a custom matching rule not initially designed by webpack. * Only for single-threaded environment interoperation purpose. */ rspackResource?: RawRuleSetCondition /** A condition matcher matching an absolute path. */ test?: RawRuleSetCondition include?: RawRuleSetCondition exclude?: RawRuleSetCondition /** A condition matcher matching an absolute path. */ resource?: RawRuleSetCondition /** A condition matcher against the resource query. */ resourceQuery?: RawRuleSetCondition resourceFragment?: RawRuleSetCondition descriptionData?: Record with?: Record sideEffects?: boolean use?: RawModuleRuleUse[] | ((arg: RawFuncUseCtx) => RawModuleRuleUse[]) type?: string layer?: string parser?: RawParserOptions generator?: RawGeneratorOptions resolve?: RawResolveOptions issuer?: RawRuleSetCondition issuerLayer?: RawRuleSetCondition dependency?: RawRuleSetCondition scheme?: RawRuleSetCondition mimetype?: RawRuleSetCondition oneOf?: Array rules?: Array /** Specifies the category of the loader. No value means normal loader. */ enforce?: 'pre' | 'post' /** Whether to extract source maps from the module. */ extractSourceMap?: boolean } /** * `loader` is for both JS and Rust loaders. * `options` is * - a `None` on rust side and handled by js side `getOptions` when * using with `loader`. * - a `Some(string)` on rust side, deserialized by `serde_json::from_str` * and passed to rust side loader in [get_builtin_loader] when using with * `builtin_loader`. */ export interface RawModuleRuleUse { loader: string options?: string } export interface RawNodeOption { dirname: string filename: string global: string } export interface RawNonStandard { deepSelectorCombinator: boolean } export interface RawNormalModuleReplacementPluginOptions { resourceRegExp: RegExp newResource: string | ((data: JsResolveData) => JsResolveData) } export interface RawOccurrenceChunkIdsPluginOptions { prioritiseInitial?: boolean } export interface RawOptimizationOptions { removeAvailableModules: boolean sideEffects: boolean | string usedExports: boolean | string providedExports: boolean innerGraph: boolean realContentHash: boolean mangleExports: boolean | string inlineExports: boolean concatenateModules: boolean avoidEntryIife: boolean } export interface RawOptions { name?: string mode?: undefined | 'production' | 'development' | 'none' context: string output: RawOutputOptions resolve: RawResolveOptions resolveLoader: RawResolveOptions module: RawModuleOptions optimization: RawOptimizationOptions stats: RawStatsOptions cache: RawCacheOptions experiments: RawExperiments node?: RawNodeOption profile: boolean amd?: string bail: boolean __references: Record __virtual_files?: Array } export interface RawOutputOptions { path: string pathinfo: boolean | "verbose" clean: boolean | JsCleanOptions publicPath: "auto" | JsFilename assetModuleFilename: JsFilename wasmLoading: string | false enabledWasmLoadingTypes: Array webassemblyModuleFilename: string filename: JsFilename chunkFilename: JsFilename crossOriginLoading: string | false cssFilename: JsFilename cssChunkFilename: JsFilename hotUpdateMainFilename: string hotUpdateChunkFilename: string hotUpdateGlobal: string uniqueName: string chunkLoadingGlobal: string library?: JsLibraryOptions strictModuleErrorHandling: boolean enabledLibraryTypes?: Array globalObject: string importFunctionName: string importMetaName: string iife: boolean module: boolean chunkLoading: string | false chunkLoadTimeout: number charset: boolean enabledChunkLoadingTypes?: Array trustedTypes?: RawTrustedTypes sourceMapFilename: string hashFunction: string hashDigest: string hashDigestLength: number hashSalt?: string asyncChunks: boolean workerChunkLoading: string | false workerWasmLoading: string | false workerPublicPath: string scriptType: "module" | "text/javascript" | false environment: RawEnvironment compareBeforeEmit: boolean } export interface RawParserOptions { type: "asset" | "css" | "css/auto" | "css/module" | "javascript" | "javascript/auto" | "javascript/dynamic" | "javascript/esm" | "json" asset?: RawAssetParserOptions css?: RawCssParserOptions cssAuto?: RawCssAutoParserOptions cssModule?: RawCssModuleParserOptions javascript?: RawJavascriptParserOptions json?: RawJsonParserOptions } export interface RawPathData { filename?: string contentHash?: string url?: string } export interface RawProgressPluginOptions { prefix?: string profile?: boolean template?: string tick?: string | Array progressChars?: string handler?: (percent: number, msg: string, items: string[]) => void } export interface RawProvideOptions { key: string shareKey: string shareScope: string version?: string | false | undefined eager: boolean singleton?: boolean requiredVersion?: string | false | undefined strictVersion?: boolean } export interface RawRelated { sourceMap?: string } export interface RawRemoteAliasTarget { name: string entry?: string } export interface RawRemoteOptions { key: string external: Array shareScope: string } export interface RawResolveOptions { preferRelative?: boolean preferAbsolute?: boolean extensions?: Array mainFiles?: Array mainFields?: Array conditionNames?: Array alias?: Array | false fallback?: Array | false symlinks?: boolean tsconfig?: RawResolveTsconfigOptions modules?: Array byDependency?: Record fullySpecified?: boolean exportsFields?: Array descriptionFiles?: Array enforceExtension?: boolean importsFields?: Array extensionAlias?: Record> aliasFields?: Array restrictions?: (string | RegExp)[] roots?: Array pnp?: boolean } export interface RawResolveOptionsWithDependencyType { preferRelative?: boolean preferAbsolute?: boolean extensions?: Array mainFiles?: Array mainFields?: Array conditionNames?: Array alias?: Array | false fallback?: Array | false symlinks?: boolean tsconfig?: RawResolveTsconfigOptions modules?: Array byDependency?: Record fullySpecified?: boolean exportsFields?: Array descriptionFiles?: Array enforceExtension?: boolean importsFields?: Array extensionAlias?: Record> aliasFields?: Array restrictions?: (string | RegExp)[] roots?: Array dependencyType?: string resolveToContext?: boolean pnp?: boolean } export interface RawResolveTsconfigOptions { configFile: string referencesType: "auto" | "manual" | "disabled" references?: Array } export interface RawRsdoctorPluginOptions { moduleGraphFeatures: boolean | Array<'graph' | 'ids' | 'sources'> chunkGraphFeatures: boolean | Array<'graph' | 'assets'> sourceMapFeatures?: { module?: boolean; cheap?: boolean } | undefined } export interface RawRslibPluginOptions { /** * Intercept partial parse hooks of APIPlugin, expect some statements not to be parsed as API. * @default `false` */ interceptApiPlugin?: boolean /** * Add shims for javascript/esm modules * @default `false` */ forceNodeShims?: boolean } export interface RawRspackFuture { } export interface RawRstestPluginOptions { injectModulePathName: boolean importMetaPathName: boolean hoistMockModule: boolean manualMockRoot: string preserveNewUrl?: Array } export interface RawRuleSetCondition { type: RawRuleSetConditionType string?: string regexp?: RegExp logical?: Array array?: Array func?: (value: string) => boolean } export declare enum RawRuleSetConditionType { string = 'string', regexp = 'regexp', logical = 'logical', array = 'array', func = 'func' } export interface RawRuleSetLogicalConditions { and?: Array or?: Array not?: RawRuleSetCondition } export interface RawRuntimeChunkNameFnCtx { name: string } export interface RawRuntimeChunkOptions { name: string | ((entrypoint: { name: string }) => string) } export interface RawSizeLimitsPluginOptions { assetFilter?: (assetFilename: string) => boolean hints?: "error" | "warning" maxAssetSize?: number maxEntrypointSize?: number } export interface RawSplitChunkSizes { sizes: Record } export interface RawSplitChunksOptions { fallbackCacheGroup?: RawFallbackCacheGroupOptions name?: string | false | Function filename?: JsFilename cacheGroups?: Array /** What kind of chunks should be selected. */ chunks?: RegExp | 'async' | 'initial' | 'all' | Function usedExports?: boolean automaticNameDelimiter?: string maxAsyncRequests?: number maxInitialRequests?: number defaultSizeTypes: Array minChunks?: number hidePathInfo?: boolean minSize?: number | RawSplitChunkSizes minSizeReduction?: number | RawSplitChunkSizes enforceSizeThreshold?: number minRemainingSize?: number | RawSplitChunkSizes maxSize?: number | RawSplitChunkSizes maxAsyncSize?: number | RawSplitChunkSizes maxInitialSize?: number | RawSplitChunkSizes } export interface RawStatsBuildInfo { buildVersion: string buildName?: string } export interface RawStatsOptions { colors: boolean } export interface RawStorageOptions { type: "filesystem" directory: string } export interface RawSubresourceIntegrityPluginOptions { integrityCallback?: (data: RawIntegrityData) => void hashFuncNames: Array htmlPlugin: "JavaScript" | "Native" | "Disabled" } export interface RawSwcJsMinimizerOptions { ecma: any compress: any mangle: any format: any module?: boolean minify?: boolean } export interface RawSwcJsMinimizerRspackPluginOptions { test?: string | RegExp | (string | RegExp)[] include?: string | RegExp | (string | RegExp)[] exclude?: string | RegExp | (string | RegExp)[] extractComments?: RawExtractComments minimizerOptions: RawSwcJsMinimizerOptions } export interface RawToOptions { context: string absoluteFilename?: string } export interface RawTraceEvent { name: string trackName?: string processName?: string args?: Record uuid: number ts: bigint ph: string categories?: Array } export interface RawTrustedTypes { policyName?: string onPolicyCreationFailure?: string } export interface RealDependencyLocation { start: SourcePosition end?: SourcePosition } /** * this is a process level tracing, which means it would be shared by all compilers in the same process * only the first call would take effect, the following calls would be ignored * Some code is modified based on * https://github.com/swc-project/swc/blob/d1d0607158ab40463d1b123fed52cc526eba8385/bindings/binding_core_node/src/util.rs#L29-L58 * Apache-2.0 licensed * Author Donny/강동윤 * Copyright (c) */ export declare function registerGlobalTrace(filter: string, layer: "logger" | "perfetto" , output: string): void export declare enum RegisterJsTapKind { CompilerThisCompilation = 0, CompilerCompilation = 1, CompilerMake = 2, CompilerFinishMake = 3, CompilerShouldEmit = 4, CompilerEmit = 5, CompilerAfterEmit = 6, CompilerAssetEmitted = 7, CompilationBuildModule = 8, CompilationStillValidModule = 9, CompilationSucceedModule = 10, CompilationExecuteModule = 11, CompilationFinishModules = 12, CompilationOptimizeModules = 13, CompilationAfterOptimizeModules = 14, CompilationOptimizeTree = 15, CompilationOptimizeChunkModules = 16, CompilationAdditionalTreeRuntimeRequirements = 17, CompilationRuntimeRequirementInTree = 18, CompilationRuntimeModule = 19, CompilationChunkHash = 20, CompilationChunkAsset = 21, CompilationProcessAssets = 22, CompilationAfterProcessAssets = 23, CompilationSeal = 24, CompilationAfterSeal = 25, NormalModuleFactoryBeforeResolve = 26, NormalModuleFactoryFactorize = 27, NormalModuleFactoryResolve = 28, NormalModuleFactoryAfterResolve = 29, NormalModuleFactoryCreateModule = 30, NormalModuleFactoryResolveForScheme = 31, ContextModuleFactoryBeforeResolve = 32, ContextModuleFactoryAfterResolve = 33, JavascriptModulesChunkHash = 34, HtmlPluginBeforeAssetTagGeneration = 35, HtmlPluginAlterAssetTags = 36, HtmlPluginAlterAssetTagGroups = 37, HtmlPluginAfterTemplateExecution = 38, HtmlPluginBeforeEmit = 39, HtmlPluginAfterEmit = 40, RuntimePluginCreateScript = 41, RuntimePluginCreateLink = 42, RuntimePluginLinkPreload = 43, RuntimePluginLinkPrefetch = 44, RsdoctorPluginModuleGraph = 45, RsdoctorPluginChunkGraph = 46, RsdoctorPluginModuleIds = 47, RsdoctorPluginModuleSources = 48, RsdoctorPluginAssets = 49 } export interface RegisterJsTaps { registerCompilerThisCompilationTaps: (stages: Array) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }> registerCompilerCompilationTaps: (stages: Array) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }> registerCompilerMakeTaps: (stages: Array) => Array<{ function: ((arg: JsCompilation) => Promise); stage: number; }> registerCompilerFinishMakeTaps: (stages: Array) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }> registerCompilerShouldEmitTaps: (stages: Array) => Array<{ function: ((arg: JsCompilation) => boolean | undefined); stage: number; }> registerCompilerEmitTaps: (stages: Array) => Array<{ function: (() => Promise); stage: number; }> registerCompilerAfterEmitTaps: (stages: Array) => Array<{ function: (() => Promise); stage: number; }> registerCompilerAssetEmittedTaps: (stages: Array) => Array<{ function: ((arg: JsAssetEmittedArgs) => Promise); stage: number; }> registerCompilationBuildModuleTaps: (stages: Array) => Array<{ function: ((arg: Module) => void); stage: number; }> registerCompilationStillValidModuleTaps: (stages: Array) => Array<{ function: ((arg: Module) => void); stage: number; }> registerCompilationSucceedModuleTaps: (stages: Array) => Array<{ function: ((arg: Module) => void); stage: number; }> registerCompilationExecuteModuleTaps: (stages: Array) => Array<{ function: ((arg: JsExecuteModuleArg) => void); stage: number; }> registerCompilationAdditionalTreeRuntimeRequirementsTaps: (stages: Array) => Array<{ function: ((arg: JsAdditionalTreeRuntimeRequirementsArg) => JsAdditionalTreeRuntimeRequirementsResult | undefined); stage: number; }> registerCompilationRuntimeRequirementInTreeTaps: (stages: Array) => Array<{ function: ((arg: JsRuntimeRequirementInTreeArg) => JsRuntimeRequirementInTreeResult | undefined); stage: number; }> registerCompilationRuntimeModuleTaps: (stages: Array) => Array<{ function: ((arg: JsRuntimeModuleArg) => JsRuntimeModule | undefined); stage: number; }> registerCompilationFinishModulesTaps: (stages: Array) => Array<{ function: ((arg: JsCompilation) => Promise); stage: number; }> registerCompilationOptimizeModulesTaps: (stages: Array) => Array<{ function: (() => boolean | undefined); stage: number; }> registerCompilationAfterOptimizeModulesTaps: (stages: Array) => Array<{ function: (() => void); stage: number; }> registerCompilationOptimizeTreeTaps: (stages: Array) => Array<{ function: (() => Promise); stage: number; }> registerCompilationOptimizeChunkModulesTaps: (stages: Array) => Array<{ function: (() => Promise); stage: number; }> registerCompilationChunkHashTaps: (stages: Array) => Array<{ function: ((arg: Chunk) => Buffer); stage: number; }> registerCompilationChunkAssetTaps: (stages: Array) => Array<{ function: ((arg: JsChunkAssetArgs) => void); stage: number; }> registerCompilationProcessAssetsTaps: (stages: Array) => Array<{ function: ((arg: JsCompilation) => Promise); stage: number; }> registerCompilationAfterProcessAssetsTaps: (stages: Array) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }> registerCompilationSealTaps: (stages: Array) => Array<{ function: (() => void); stage: number; }> registerCompilationAfterSealTaps: (stages: Array) => Array<{ function: (() => Promise); stage: number; }> registerNormalModuleFactoryBeforeResolveTaps: (stages: Array) => Array<{ function: ((arg: JsResolveData) => Promise<[boolean | undefined, JsResolveData]>); stage: number; }> registerNormalModuleFactoryFactorizeTaps: (stages: Array) => Array<{ function: ((arg: JsResolveData) => Promise); stage: number; }> registerNormalModuleFactoryResolveTaps: (stages: Array) => Array<{ function: ((arg: JsResolveData) => Promise); stage: number; }> registerNormalModuleFactoryResolveForSchemeTaps: (stages: Array) => Array<{ function: ((arg: JsResolveForSchemeArgs) => Promise<[boolean | undefined, JsResolveForSchemeArgs]>); stage: number; }> registerNormalModuleFactoryAfterResolveTaps: (stages: Array) => Array<{ function: ((arg: JsResolveData) => Promise<[boolean | undefined, JsResolveData]>); stage: number; }> registerNormalModuleFactoryCreateModuleTaps: (stages: Array) => Array<{ function: ((arg: JsNormalModuleFactoryCreateModuleArgs) => Promise); stage: number; }> registerContextModuleFactoryBeforeResolveTaps: (stages: Array) => Array<{ function: ((arg: false | JsContextModuleFactoryBeforeResolveData) => Promise); stage: number; }> registerContextModuleFactoryAfterResolveTaps: (stages: Array) => Array<{ function: ((arg: false | JsContextModuleFactoryAfterResolveData) => Promise); stage: number; }> registerJavascriptModulesChunkHashTaps: (stages: Array) => Array<{ function: ((arg: Chunk) => Buffer); stage: number; }> registerHtmlPluginBeforeAssetTagGenerationTaps: (stages: Array) => Array<{ function: ((arg: JsBeforeAssetTagGenerationData) => JsBeforeAssetTagGenerationData); stage: number; }> registerHtmlPluginAlterAssetTagsTaps: (stages: Array) => Array<{ function: ((arg: JsAlterAssetTagsData) => JsAlterAssetTagsData); stage: number; }> registerHtmlPluginAlterAssetTagGroupsTaps: (stages: Array) => Array<{ function: ((arg: JsAlterAssetTagGroupsData) => JsAlterAssetTagGroupsData); stage: number; }> registerHtmlPluginAfterTemplateExecutionTaps: (stages: Array) => Array<{ function: ((arg: JsAfterTemplateExecutionData) => JsAfterTemplateExecutionData); stage: number; }> registerHtmlPluginBeforeEmitTaps: (stages: Array) => Array<{ function: ((arg: JsBeforeEmitData) => JsBeforeEmitData); stage: number; }> registerHtmlPluginAfterEmitTaps: (stages: Array) => Array<{ function: ((arg: JsAfterEmitData) => JsAfterEmitData); stage: number; }> registerRuntimePluginCreateScriptTaps: (stages: Array) => Array<{ function: ((arg: JsCreateScriptData) => String); stage: number; }> registerRuntimePluginCreateLinkTaps: (stages: Array) => Array<{ function: ((arg: JsLinkPreloadData) => String); stage: number; }> registerRuntimePluginLinkPreloadTaps: (stages: Array) => Array<{ function: ((arg: JsCreateLinkData) => String); stage: number; }> registerRuntimePluginLinkPrefetchTaps: (stages: Array) => Array<{ function: ((arg: JsLinkPrefetchData) => String); stage: number; }> registerRsdoctorPluginModuleGraphTaps: (stages: Array) => Array<{ function: ((arg: JsRsdoctorModuleGraph) => Promise); stage: number; }> registerRsdoctorPluginChunkGraphTaps: (stages: Array) => Array<{ function: ((arg: JsRsdoctorChunkGraph) => Promise); stage: number; }> registerRsdoctorPluginModuleIdsTaps: (stages: Array) => Array<{ function: ((arg: JsRsdoctorModuleIdsPatch) => Promise); stage: number; }> registerRsdoctorPluginModuleSourcesTaps: (stages: Array) => Array<{ function: ((arg: JsRsdoctorModuleSourcesPatch) => Promise); stage: number; }> registerRsdoctorPluginAssetsTaps: (stages: Array) => Array<{ function: ((arg: JsRsdoctorAssetPatch) => Promise); stage: number; }> } export interface ResolveResult { path?: string error?: string /** "type" field in the package.json file */ moduleType?: string } /** * Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. * Use struct because napi don't support structured union now */ export interface Restriction { path?: string regex?: string } export interface SourceMapDevToolPluginOptions { append?: (false | null) | string | Function columns?: boolean fallbackModuleFilenameTemplate?: string | ((info: RawModuleFilenameTemplateFnCtx) => string) fileContext?: string filename?: (false | null) | string ignoreList?: string | RegExp | (string | RegExp)[] module?: boolean moduleFilenameTemplate?: string | ((info: RawModuleFilenameTemplateFnCtx) => string) namespace?: string noSources?: boolean publicPath?: string sourceRoot?: string test?: string | RegExp | (string | RegExp)[] include?: string | RegExp | (string | RegExp)[] exclude?: string | RegExp | (string | RegExp)[] debugIds?: boolean } export interface SourcePosition { line: number column?: number } export declare function sync(path: string, request: string): ResolveResult export declare function syncTraceEvent(events: Array): void export interface SyntheticDependencyLocation { name: string } export interface ThreadsafeNodeFS { writeFile: (name: string, content: Buffer) => Promise removeFile: (name: string) => Promise mkdir: (name: string) => Promise mkdirp: (name: string) => Promise removeDirAll: (name: string) => Promise readDir: (name: string) => Promise readFile: (name: string) => Promise stat: (name: string) => Promise lstat: (name: string) => Promise realpath: (name: string) => Promise open: (name: string, flags: string) => Promise rename: (from: string, to: string) => Promise close: (fd: number) => Promise write: (fd: number, content: Buffer, position: number) => Promise writeAll: (fd: number, content: Buffer) => Promise read: (fd: number, length: number, position: number) => Promise readUntil: (fd: number, code: number, position: number) => Promise readToEnd: (fd: number, position: number) => Promise chmod?: (name: string, mode: number) => Promise } export declare function transform(source: string, options: string): Promise export interface TransformOutput { code: string map?: string diagnostics: Array } export declare function transformSync(source: string, options: string): TransformOutput /** * Tsconfig Options * * Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) */ export interface TsconfigOptions { /** * Allows you to specify where to find the TypeScript configuration file. * You may provide * * a relative path to the configuration file. It will be resolved relative to cwd. * * an absolute path to the configuration file. */ configFile: string /** * Support for Typescript Project References. * * * `'auto'`: use the `references` field from tsconfig of `config_file`. * * `string[]`: manually provided relative or absolute path. */ references?: 'auto' | string[] }