@rspack-debug/binding 1.4.8 → 1.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/binding.d.ts +4 -2808
  2. package/binding.js +357 -193
  3. package/napi-binding.d.ts +2815 -0
  4. package/package.json +21 -18
@@ -0,0 +1,2815 @@
1
+ /* auto-generated by NAPI-RS */
2
+ /* eslint-disable */
3
+
4
+ /* -- banner.d.ts -- */
5
+ export type JsFilename =
6
+ | string
7
+ | ((pathData: JsPathData, assetInfo?: AssetInfo) => string);
8
+
9
+ export type RawLazyCompilationTest = RegExp | ((module: Module) => boolean);
10
+
11
+ export type AssetInfo = KnownAssetInfo & Record<string, any>;
12
+
13
+ export type CustomPluginName = string;
14
+
15
+ export const MODULE_IDENTIFIER_SYMBOL: unique symbol;
16
+
17
+ export const COMPILATION_HOOKS_MAP_SYMBOL: unique symbol;
18
+
19
+ export const BUILD_INFO_ASSETS_SYMBOL: unique symbol;
20
+ export const BUILD_INFO_FILE_DEPENDENCIES_SYMBOL: unique symbol;
21
+ export const BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL: unique symbol;
22
+ export const BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL: unique symbol;
23
+ export const BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL: unique symbol;
24
+ export const COMMIT_CUSTOM_FIELDS_SYMBOL: unique symbol;
25
+
26
+ export const RUST_ERROR_SYMBOL: unique symbol;
27
+
28
+ interface KnownBuildInfo {
29
+ [BUILD_INFO_ASSETS_SYMBOL]: Assets,
30
+ [BUILD_INFO_FILE_DEPENDENCIES_SYMBOL]: string[],
31
+ [BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL]: string[],
32
+ [BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL]: string[],
33
+ [BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL]: string[],
34
+ [COMMIT_CUSTOM_FIELDS_SYMBOL](): void;
35
+ }
36
+
37
+ export type BuildInfo = KnownBuildInfo & Record<string, any>;
38
+
39
+ export interface Module {
40
+ [MODULE_IDENTIFIER_SYMBOL]: string;
41
+ readonly type: string;
42
+ get context(): string | undefined;
43
+ get layer(): string | undefined;
44
+ get factoryMeta(): JsFactoryMeta
45
+ set factoryMeta(factoryMeta: JsFactoryMeta);
46
+ get useSourceMap(): boolean;
47
+ get useSimpleSourceMap(): boolean;
48
+ buildInfo: BuildInfo;
49
+ buildMeta: Record<string, any>;
50
+ }
51
+
52
+ interface NormalModuleConstructor {
53
+ new(): NormalModule;
54
+ readonly prototype: NormalModule;
55
+ }
56
+
57
+ export var NormalModule: NormalModuleConstructor;
58
+
59
+ export interface NormalModule extends Module {
60
+ readonly resource: string;
61
+ readonly request: string;
62
+ readonly userRequest: string;
63
+ readonly rawRequest: string;
64
+ readonly resourceResolveData: Readonly<JsResourceData> | undefined;
65
+ readonly loaders: JsLoaderItem[];
66
+ get matchResource(): string | undefined;
67
+ set matchResource(val: string | undefined);
68
+ }
69
+
70
+ export interface ConcatenatedModule extends Module {
71
+ }
72
+
73
+ export interface ContextModule extends Module {
74
+ }
75
+
76
+ export interface ExternalModule extends Module {
77
+ readonly userRequest: string;
78
+ }
79
+
80
+ export interface RspackError extends Error {
81
+ name: string;
82
+ message: string;
83
+ details?: string;
84
+ module?: null | Module;
85
+ loc?: DependencyLocation;
86
+ file?: string;
87
+ stack?: string;
88
+ hideStack?: boolean;
89
+ error?: Error;
90
+ }
91
+
92
+ export type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
93
+ /* -- banner.d.ts end -- */
94
+
95
+ /* -- napi-rs generated below -- */
96
+
97
+ export declare class ExternalObject<T> {
98
+ readonly '': {
99
+ readonly '': unique symbol
100
+ [K: symbol]: T
101
+ }
102
+ }
103
+ export declare class Assets {
104
+ keys(): Array<string>
105
+ }
106
+
107
+ export declare class AsyncDependenciesBlock {
108
+ get dependencies(): Dependency[]
109
+ get blocks(): AsyncDependenciesBlock[]
110
+ }
111
+
112
+ export declare class Chunk {
113
+ get name(): string | undefined
114
+ get id(): string | undefined
115
+ get ids(): Array<string>
116
+ get idNameHints(): Array<string>
117
+ get filenameTemplate(): string | undefined
118
+ get cssFilenameTemplate(): string | undefined
119
+ get _files(): Array<string>
120
+ get _runtime(): Array<string>
121
+ get hash(): string | undefined
122
+ get contentHash(): Record<string, string>
123
+ get renderedHash(): string | undefined
124
+ get chunkReason(): string | undefined
125
+ get _auxiliaryFiles(): Array<string>
126
+ isOnlyInitial(): boolean
127
+ canBeInitial(): boolean
128
+ hasRuntime(): boolean
129
+ getAllAsyncChunks(): Chunk[]
130
+ getAllInitialChunks(): Chunk[]
131
+ getAllReferencedChunks(): Chunk[]
132
+ get _groupsIterable(): ChunkGroup[]
133
+ getEntryOptions(): EntryOptionsDTO | undefined
134
+ }
135
+
136
+ export declare class ChunkGraph {
137
+ hasChunkEntryDependentChunks(chunk: Chunk): boolean
138
+ getChunkModules(chunk: Chunk): Module[]
139
+ getChunkModulesIterable(chunk: Chunk): Iterable<Module>
140
+ getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>
141
+ getNumberOfEntryModules(chunk: Chunk): number
142
+ getChunkEntryDependentChunksIterable(chunk: Chunk): Chunk[]
143
+ getChunkModulesIterableBySourceType(chunk: Chunk, sourceType: string): Module[]
144
+ getModuleChunks(module: Module): Chunk[]
145
+ getModuleId(module: Module): string | number | null
146
+ _getModuleHash(module: Module, runtime: string | string[] | undefined): string | null
147
+ getBlockChunkGroup(jsBlock: AsyncDependenciesBlock): ChunkGroup | null
148
+ }
149
+
150
+ export declare class ChunkGroup {
151
+ get chunks(): Chunk[]
152
+ get index(): number | undefined
153
+ get name(): string | undefined
154
+ get origins(): Array<JsChunkGroupOrigin>
155
+ get childrenIterable(): ChunkGroup[]
156
+ isInitial(): boolean
157
+ getParents(): ChunkGroup[]
158
+ getRuntimeChunk(): Chunk
159
+ getEntrypointChunk(): Chunk
160
+ getFiles(): Array<string>
161
+ getModulePreOrderIndex(module: Module): number | null
162
+ getModulePostOrderIndex(module: Module): number | null
163
+ }
164
+
165
+ export declare class Chunks {
166
+ get size(): number
167
+ _values(): Chunk[]
168
+ _has(chunk: Chunk): boolean
169
+ }
170
+
171
+ export declare class CodeGenerationResult {
172
+ get sources(): Sources
173
+ }
174
+
175
+ export declare class CodeGenerationResults {
176
+ get(module: Module, runtime: string | string[] | undefined): CodeGenerationResult
177
+ }
178
+
179
+ export declare class ConcatenatedModule {
180
+ get rootModule(): Module
181
+ get modules(): Module[]
182
+ readableIdentifier(): string
183
+ _originalSource(): JsCompatSource | undefined
184
+ nameForCondition(): string | undefined
185
+ get blocks(): AsyncDependenciesBlock[]
186
+ get dependencies(): Dependency[]
187
+ size(ty?: string | undefined | null): number
188
+ libIdent(options: JsLibIdentOptions): string | null
189
+ _emitFile(filename: string, source: JsCompatSource, assetInfo?: AssetInfo | undefined | null): void
190
+ }
191
+
192
+ export declare class ContextModule {
193
+ readableIdentifier(): string
194
+ _originalSource(): JsCompatSource | undefined
195
+ nameForCondition(): string | undefined
196
+ get blocks(): AsyncDependenciesBlock[]
197
+ get dependencies(): Dependency[]
198
+ size(ty?: string | undefined | null): number
199
+ libIdent(options: JsLibIdentOptions): string | null
200
+ _emitFile(filename: string, source: JsCompatSource, assetInfo?: AssetInfo | undefined | null): void
201
+ }
202
+
203
+ export declare class Dependency {
204
+ get _parentModule(): Module | undefined
205
+ get type(): string
206
+ get category(): string
207
+ get request(): string | undefined
208
+ get critical(): boolean
209
+ set critical(val: boolean)
210
+ get ids(): Array<string> | undefined
211
+ }
212
+
213
+ export declare class Diagnostics {
214
+ get length(): number
215
+ values(): Array<RspackError>
216
+ get(index: number): RspackError | undefined
217
+ set(index: number, error: RspackError): void
218
+ spliceWithArray(index: number, deleteCount?: number | undefined | null, newItems?: Array<RspackError> | undefined | null): Array<RspackError>
219
+ }
220
+
221
+ export declare class EntryDataDto {
222
+ get dependencies(): Dependency[]
223
+ get includeDependencies(): Dependency[]
224
+ get options(): EntryOptionsDto
225
+ }
226
+ export type EntryDataDTO = EntryDataDto
227
+
228
+ export declare class EntryDependency {
229
+ constructor(request: string)
230
+ get type(): string
231
+ get category(): string
232
+ get request(): string | undefined
233
+ }
234
+
235
+ export declare class EntryOptionsDto {
236
+ get name(): string | undefined
237
+ set name(name: string | undefined)
238
+ get runtime(): false | string | undefined
239
+ set runtime(chunkLoading: boolean | string | undefined)
240
+ get chunkLoading(): string | undefined
241
+ set chunkLoading(chunkLoading: string | false | undefined)
242
+ get asyncChunks(): boolean | undefined
243
+ set asyncChunks(asyncChunks: boolean | undefined)
244
+ get baseUri(): string | undefined
245
+ set baseUri(baseUri: string | undefined)
246
+ get library(): JsLibraryOptions | undefined
247
+ set library(library: JsLibraryOptions | undefined)
248
+ get dependOn(): Array<string> | undefined
249
+ set dependOn(dependOn: Array<string> | undefined)
250
+ get layer(): string | undefined
251
+ set layer(layer: string | undefined)
252
+ }
253
+ export type EntryOptionsDTO = EntryOptionsDto
254
+
255
+ export declare class ExternalModule {
256
+ readableIdentifier(): string
257
+ _originalSource(): JsCompatSource | undefined
258
+ nameForCondition(): string | undefined
259
+ get blocks(): AsyncDependenciesBlock[]
260
+ get dependencies(): Dependency[]
261
+ size(ty?: string | undefined | null): number
262
+ libIdent(options: JsLibIdentOptions): string | null
263
+ _emitFile(filename: string, source: JsCompatSource, assetInfo?: AssetInfo | undefined | null): void
264
+ }
265
+
266
+ export declare class JsCompilation {
267
+ updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSourceOwned) => JsCompatSourceOwned), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo | undefined)): void
268
+ getAssets(): Readonly<JsAsset>[]
269
+ getAsset(name: string): JsAsset | null
270
+ getAssetSource(name: string): JsCompatSource | null
271
+ get modules(): Array<Module>
272
+ get builtModules(): Array<Module>
273
+ getOptimizationBailout(): Array<JsStatsOptimizationBailout>
274
+ get chunks(): Chunks
275
+ getNamedChunkKeys(): Array<string>
276
+ getNamedChunk(name: string): Chunk
277
+ getNamedChunkGroupKeys(): Array<string>
278
+ getNamedChunkGroup(name: string): ChunkGroup
279
+ setAssetSource(name: string, source: JsCompatSource): void
280
+ deleteAssetSource(name: string): void
281
+ getAssetFilenames(): Array<string>
282
+ hasAsset(name: string): boolean
283
+ emitAsset(filename: string, source: JsCompatSource, assetInfo?: AssetInfo | undefined | null): void
284
+ deleteAsset(filename: string): void
285
+ renameAsset(filename: string, newName: string): void
286
+ get entrypoints(): ChunkGroup[]
287
+ get chunkGroups(): ChunkGroup[]
288
+ get hash(): string | null
289
+ dependencies(): JsDependencies
290
+ pushDiagnostic(diagnostic: JsRspackDiagnostic): void
291
+ pushNativeDiagnostic(diagnostic: ExternalObject<'Diagnostic'>): void
292
+ pushNativeDiagnostics(diagnostics: ExternalObject<'Diagnostic[]'>): void
293
+ get errors(): Diagnostics
294
+ get warnings(): Diagnostics
295
+ getErrors(): Array<RspackError>
296
+ getWarnings(): Array<RspackError>
297
+ getStats(): JsStats
298
+ getAssetPath(filename: string, data: JsPathData): string
299
+ getAssetPathWithInfo(filename: string, data: JsPathData): PathWithInfo
300
+ getPath(filename: string, data: JsPathData): string
301
+ getPathWithInfo(filename: string, data: JsPathData): PathWithInfo
302
+ addFileDependencies(deps: Array<string>): void
303
+ addContextDependencies(deps: Array<string>): void
304
+ addMissingDependencies(deps: Array<string>): void
305
+ addBuildDependencies(deps: Array<string>): void
306
+ /**
307
+ * This is a very unsafe function.
308
+ * Please don't use this at the moment.
309
+ * Using async and mutable reference to `Compilation` at the same time would likely to cause data races.
310
+ */
311
+ rebuildModule(module_identifiers: string[], callback: (...args: any[]) => any): void
312
+ 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
313
+ get entries(): JsEntries
314
+ addRuntimeModule(chunk: Chunk, runtimeModule: JsAddingRuntimeModule): void
315
+ get moduleGraph(): JsModuleGraph
316
+ get chunkGraph(): ChunkGraph
317
+ addEntry(args: [string, EntryDependency, JsEntryOptions | undefined][], callback: (errMsg: Error | null, results: [string | null, Module][]) => void): void
318
+ addInclude(args: [string, EntryDependency, JsEntryOptions | undefined][], callback: (errMsg: Error | null, results: [string | null, Module][]) => void): void
319
+ get codeGenerationResults(): CodeGenerationResults
320
+ createStatsWarnings(warnings: Array<RspackError>, colored?: boolean | undefined | null): JsStatsError[]
321
+ }
322
+
323
+ export declare class JsCompiler {
324
+ constructor(compilerPath: string, options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, inputFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory)
325
+ setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
326
+ /** Build with the given option passed to the constructor */
327
+ build(callback: (err: null | Error) => void): void
328
+ /** Rebuild with the given option passed to the constructor */
329
+ rebuild(changed_files: string[], removed_files: string[], callback: (err: null | Error) => void): void
330
+ close(): Promise<void>
331
+ }
332
+
333
+ export declare class JsContextModuleFactoryAfterResolveData {
334
+ get resource(): string
335
+ set resource(resource: string)
336
+ get context(): string
337
+ set context(context: string)
338
+ get request(): string
339
+ set request(request: string)
340
+ get regExp(): RegExp | undefined
341
+ set regExp(rawRegExp: RegExp | undefined)
342
+ get recursive(): boolean
343
+ set recursive(recursive: boolean)
344
+ get dependencies(): Dependency[]
345
+ }
346
+
347
+ export declare class JsContextModuleFactoryBeforeResolveData {
348
+ get context(): string
349
+ set context(context: string)
350
+ get request(): string
351
+ set request(request: string)
352
+ get regExp(): RegExp | undefined
353
+ set regExp(rawRegExp: RegExp | undefined)
354
+ get recursive(): boolean
355
+ set recursive(recursive: boolean)
356
+ }
357
+
358
+ export declare class JsDependencies {
359
+ get fileDependencies(): Array<string>
360
+ get addedFileDependencies(): Array<string>
361
+ get removedFileDependencies(): Array<string>
362
+ get contextDependencies(): Array<string>
363
+ get addedContextDependencies(): Array<string>
364
+ get removedContextDependencies(): Array<string>
365
+ get missingDependencies(): Array<string>
366
+ get addedMissingDependencies(): Array<string>
367
+ get removedMissingDependencies(): Array<string>
368
+ get buildDependencies(): Array<string>
369
+ get addedBuildDependencies(): Array<string>
370
+ get removedBuildDependencies(): Array<string>
371
+ }
372
+
373
+ export declare class JsEntries {
374
+ clear(): void
375
+ get size(): number
376
+ has(key: string): boolean
377
+ set(key: string, value: JsEntryData | EntryDataDto): void
378
+ delete(key: string): boolean
379
+ get(key: string): EntryDataDto | undefined
380
+ keys(): Array<string>
381
+ values(): Array<EntryDataDto>
382
+ }
383
+
384
+ export declare class JsExportsInfo {
385
+ isUsed(runtime: string | string[] | undefined): boolean
386
+ isModuleUsed(runtime: string | string[] | undefined): boolean
387
+ setUsedInUnknownWay(runtime: string | string[] | undefined): boolean
388
+ getUsed(name: string | string[], runtime: string | string[] | undefined): 0 | 1 | 2 | 3 | 4
389
+ }
390
+
391
+ export declare class JsModuleGraph {
392
+ getModule(dependency: Dependency): Module | null
393
+ getResolvedModule(dependency: Dependency): Module | null
394
+ getUsedExports(module: Module, runtime: string | string[]): boolean | Array<string> | null
395
+ getIssuer(module: Module): Module | null
396
+ getExportsInfo(module: Module): JsExportsInfo
397
+ getConnection(dependency: Dependency): ModuleGraphConnection | null
398
+ getOutgoingConnections(module: Module): ModuleGraphConnection[]
399
+ getOutgoingConnectionsInOrder(module: Module): ModuleGraphConnection[]
400
+ getIncomingConnections(module: Module): ModuleGraphConnection[]
401
+ getParentModule(dependency: Dependency): Module | null
402
+ getParentBlockIndex(dependency: Dependency): number
403
+ isAsync(module: Module): boolean
404
+ }
405
+
406
+ export declare class JsResolver {
407
+ resolveSync(path: string, request: string): string | undefined
408
+ resolve(path: string, request: string, callback: (err: null | Error, req?: string) => void): void
409
+ withOptions(raw?: RawResolveOptionsWithDependencyType | undefined | null): JsResolver
410
+ }
411
+
412
+ export declare class JsResolverFactory {
413
+ constructor(pnp: boolean)
414
+ get(type: string, options?: RawResolveOptionsWithDependencyType): JsResolver
415
+ }
416
+
417
+ export declare class JsStats {
418
+ toJson(jsOptions: JsStatsOptions): JsStatsCompilation
419
+ getLogging(acceptedTypes: number): Array<JsStatsLogging>
420
+ }
421
+
422
+ export declare class KnownBuildInfo {
423
+
424
+ }
425
+
426
+ export declare class Module {
427
+ readableIdentifier(): string
428
+ _originalSource(): JsCompatSource | undefined
429
+ nameForCondition(): string | undefined
430
+ get blocks(): AsyncDependenciesBlock[]
431
+ get dependencies(): Dependency[]
432
+ size(ty?: string | undefined | null): number
433
+ libIdent(options: JsLibIdentOptions): string | null
434
+ _emitFile(filename: string, source: JsCompatSource, assetInfo?: AssetInfo | undefined | null): void
435
+ }
436
+
437
+ export declare class ModuleGraphConnection {
438
+ get dependency(): Dependency
439
+ get module(): Module | null
440
+ get resolvedModule(): Module | null
441
+ get originModule(): Module | null
442
+ }
443
+
444
+ export declare class NativeWatcher {
445
+ constructor(options: NativeWatcherOptions)
446
+ watch(files: [Array<string>, Array<string>], directories: [Array<string>, Array<string>], missing: [Array<string>, Array<string>], callback: (err: Error | null, result: NativeWatchResult) => void, callbackUndelayed: (path: string) => void): void
447
+ /**
448
+ * # Safety
449
+ *
450
+ * This function is unsafe because it uses `&mut self` to call the watcher asynchronously.
451
+ * It's important to ensure that the watcher is not used in any other places before this function is finished.
452
+ * You must ensure that the watcher not call watch, close or pause in the same time, otherwise it may lead to undefined behavior.
453
+ */
454
+ close(): Promise<void>
455
+ pause(): void
456
+ }
457
+
458
+ export declare class NativeWatchResult {
459
+ changedFiles: Array<string>
460
+ removedFiles: Array<string>
461
+ }
462
+
463
+
464
+ export declare class RawExternalItemFnCtx {
465
+ data(): RawExternalItemFnCtxData
466
+ getResolve(options?: RawResolveOptionsWithDependencyType | undefined | null): (context: string, path: string, callback: (error?: Error, text?: string) => void) => void
467
+ }
468
+
469
+ export declare class ReadonlyResourceData {
470
+ get descriptionFileData(): any
471
+ get descriptionFilePath(): string
472
+ }
473
+
474
+ export declare class Sources {
475
+ _get(sourceType: string): JsCompatSourceOwned | null
476
+ }
477
+
478
+ export interface BuiltinPlugin {
479
+ name: BuiltinPluginName | CustomPluginName
480
+ options: unknown
481
+ canInherentFromParent?: boolean
482
+ }
483
+
484
+ export declare enum BuiltinPluginName {
485
+ DefinePlugin = 'DefinePlugin',
486
+ ProvidePlugin = 'ProvidePlugin',
487
+ BannerPlugin = 'BannerPlugin',
488
+ IgnorePlugin = 'IgnorePlugin',
489
+ ProgressPlugin = 'ProgressPlugin',
490
+ EntryPlugin = 'EntryPlugin',
491
+ DynamicEntryPlugin = 'DynamicEntryPlugin',
492
+ ExternalsPlugin = 'ExternalsPlugin',
493
+ NodeTargetPlugin = 'NodeTargetPlugin',
494
+ ElectronTargetPlugin = 'ElectronTargetPlugin',
495
+ EnableChunkLoadingPlugin = 'EnableChunkLoadingPlugin',
496
+ EnableLibraryPlugin = 'EnableLibraryPlugin',
497
+ EnableWasmLoadingPlugin = 'EnableWasmLoadingPlugin',
498
+ FetchCompileAsyncWasmPlugin = 'FetchCompileAsyncWasmPlugin',
499
+ ChunkPrefetchPreloadPlugin = 'ChunkPrefetchPreloadPlugin',
500
+ CommonJsChunkFormatPlugin = 'CommonJsChunkFormatPlugin',
501
+ ArrayPushCallbackChunkFormatPlugin = 'ArrayPushCallbackChunkFormatPlugin',
502
+ ModuleChunkFormatPlugin = 'ModuleChunkFormatPlugin',
503
+ HotModuleReplacementPlugin = 'HotModuleReplacementPlugin',
504
+ LimitChunkCountPlugin = 'LimitChunkCountPlugin',
505
+ WorkerPlugin = 'WorkerPlugin',
506
+ WebWorkerTemplatePlugin = 'WebWorkerTemplatePlugin',
507
+ MergeDuplicateChunksPlugin = 'MergeDuplicateChunksPlugin',
508
+ SplitChunksPlugin = 'SplitChunksPlugin',
509
+ RemoveDuplicateModulesPlugin = 'RemoveDuplicateModulesPlugin',
510
+ ShareRuntimePlugin = 'ShareRuntimePlugin',
511
+ ContainerPlugin = 'ContainerPlugin',
512
+ ContainerReferencePlugin = 'ContainerReferencePlugin',
513
+ ProvideSharedPlugin = 'ProvideSharedPlugin',
514
+ ConsumeSharedPlugin = 'ConsumeSharedPlugin',
515
+ ModuleFederationRuntimePlugin = 'ModuleFederationRuntimePlugin',
516
+ NamedModuleIdsPlugin = 'NamedModuleIdsPlugin',
517
+ NaturalModuleIdsPlugin = 'NaturalModuleIdsPlugin',
518
+ DeterministicModuleIdsPlugin = 'DeterministicModuleIdsPlugin',
519
+ NaturalChunkIdsPlugin = 'NaturalChunkIdsPlugin',
520
+ NamedChunkIdsPlugin = 'NamedChunkIdsPlugin',
521
+ DeterministicChunkIdsPlugin = 'DeterministicChunkIdsPlugin',
522
+ OccurrenceChunkIdsPlugin = 'OccurrenceChunkIdsPlugin',
523
+ RealContentHashPlugin = 'RealContentHashPlugin',
524
+ RemoveEmptyChunksPlugin = 'RemoveEmptyChunksPlugin',
525
+ EnsureChunkConditionsPlugin = 'EnsureChunkConditionsPlugin',
526
+ WarnCaseSensitiveModulesPlugin = 'WarnCaseSensitiveModulesPlugin',
527
+ DataUriPlugin = 'DataUriPlugin',
528
+ FileUriPlugin = 'FileUriPlugin',
529
+ RuntimePlugin = 'RuntimePlugin',
530
+ JsonModulesPlugin = 'JsonModulesPlugin',
531
+ InferAsyncModulesPlugin = 'InferAsyncModulesPlugin',
532
+ JavascriptModulesPlugin = 'JavascriptModulesPlugin',
533
+ AsyncWebAssemblyModulesPlugin = 'AsyncWebAssemblyModulesPlugin',
534
+ AssetModulesPlugin = 'AssetModulesPlugin',
535
+ SourceMapDevToolPlugin = 'SourceMapDevToolPlugin',
536
+ EvalSourceMapDevToolPlugin = 'EvalSourceMapDevToolPlugin',
537
+ EvalDevToolModulePlugin = 'EvalDevToolModulePlugin',
538
+ SideEffectsFlagPlugin = 'SideEffectsFlagPlugin',
539
+ FlagDependencyExportsPlugin = 'FlagDependencyExportsPlugin',
540
+ FlagDependencyUsagePlugin = 'FlagDependencyUsagePlugin',
541
+ MangleExportsPlugin = 'MangleExportsPlugin',
542
+ ModuleConcatenationPlugin = 'ModuleConcatenationPlugin',
543
+ CssModulesPlugin = 'CssModulesPlugin',
544
+ APIPlugin = 'APIPlugin',
545
+ RuntimeChunkPlugin = 'RuntimeChunkPlugin',
546
+ SizeLimitsPlugin = 'SizeLimitsPlugin',
547
+ NoEmitOnErrorsPlugin = 'NoEmitOnErrorsPlugin',
548
+ ContextReplacementPlugin = 'ContextReplacementPlugin',
549
+ DllEntryPlugin = 'DllEntryPlugin',
550
+ DllReferenceAgencyPlugin = 'DllReferenceAgencyPlugin',
551
+ LibManifestPlugin = 'LibManifestPlugin',
552
+ FlagAllModulesAsUsedPlugin = 'FlagAllModulesAsUsedPlugin',
553
+ HttpExternalsRspackPlugin = 'HttpExternalsRspackPlugin',
554
+ CopyRspackPlugin = 'CopyRspackPlugin',
555
+ HtmlRspackPlugin = 'HtmlRspackPlugin',
556
+ SwcJsMinimizerRspackPlugin = 'SwcJsMinimizerRspackPlugin',
557
+ LightningCssMinimizerRspackPlugin = 'LightningCssMinimizerRspackPlugin',
558
+ BundlerInfoRspackPlugin = 'BundlerInfoRspackPlugin',
559
+ CssExtractRspackPlugin = 'CssExtractRspackPlugin',
560
+ SubresourceIntegrityPlugin = 'SubresourceIntegrityPlugin',
561
+ RsdoctorPlugin = 'RsdoctorPlugin',
562
+ RstestPlugin = 'RstestPlugin',
563
+ RslibPlugin = 'RslibPlugin',
564
+ CircularDependencyRspackPlugin = 'CircularDependencyRspackPlugin',
565
+ JsLoaderRspackPlugin = 'JsLoaderRspackPlugin',
566
+ LazyCompilationPlugin = 'LazyCompilationPlugin',
567
+ ModuleInfoHeaderPlugin = 'ModuleInfoHeaderPlugin',
568
+ HttpUriPlugin = 'HttpUriPlugin',
569
+ CssChunkingPlugin = 'CssChunkingPlugin'
570
+ }
571
+
572
+ export declare function cleanupGlobalTrace(): void
573
+
574
+ export interface ContextInfo {
575
+ issuer: string
576
+ issuerLayer?: string
577
+ }
578
+
579
+ export interface CssChunkingPluginOptions {
580
+ strict?: boolean
581
+ minSize?: number
582
+ maxSize?: number
583
+ exclude?: RegExp
584
+ }
585
+
586
+ /**
587
+ * Expected version of @rspack/core to the current binding version
588
+ * @internal
589
+ */
590
+ export const EXPECTED_RSPACK_CORE_VERSION: string
591
+
592
+ export declare function formatDiagnostic(diagnostic: JsDiagnostic): ExternalObject<'Diagnostic'>
593
+
594
+ export interface JsAddingRuntimeModule {
595
+ name: string
596
+ generator: () => String
597
+ dependentHash: boolean
598
+ fullHash: boolean
599
+ isolate: boolean
600
+ stage: number
601
+ }
602
+
603
+ export interface JsAdditionalTreeRuntimeRequirementsArg {
604
+ chunk: Chunk
605
+ runtimeRequirements: JsRuntimeGlobals
606
+ }
607
+
608
+ export interface JsAdditionalTreeRuntimeRequirementsResult {
609
+ runtimeRequirements: JsRuntimeGlobals
610
+ }
611
+
612
+ export interface JsAfterEmitData {
613
+ outputName: string
614
+ compilationId: number
615
+ uid?: number
616
+ }
617
+
618
+ export interface JsAfterTemplateExecutionData {
619
+ html: string
620
+ headTags: Array<JsHtmlPluginTag>
621
+ bodyTags: Array<JsHtmlPluginTag>
622
+ outputName: string
623
+ compilationId: number
624
+ uid?: number
625
+ }
626
+
627
+ export interface JsAlterAssetTagGroupsData {
628
+ headTags: Array<JsHtmlPluginTag>
629
+ bodyTags: Array<JsHtmlPluginTag>
630
+ publicPath: string
631
+ outputName: string
632
+ compilationId: number
633
+ uid?: number
634
+ }
635
+
636
+ export interface JsAlterAssetTagsData {
637
+ assetTags: JsHtmlPluginAssetTags
638
+ outputName: string
639
+ publicPath: string
640
+ compilationId: number
641
+ uid?: number
642
+ }
643
+
644
+ export interface JsAsset {
645
+ name: string
646
+ info: AssetInfo
647
+ }
648
+
649
+ export interface JsAssetEmittedArgs {
650
+ filename: string
651
+ outputPath: string
652
+ targetPath: string
653
+ }
654
+
655
+ export interface JsAssetInfoRelated {
656
+ sourceMap?: string
657
+ }
658
+
659
+ export interface JsBannerContentFnCtx {
660
+ hash: string
661
+ chunk: Chunk
662
+ filename: string
663
+ }
664
+
665
+ export interface JsBeforeAssetTagGenerationData {
666
+ assets: JsHtmlPluginAssets
667
+ outputName: string
668
+ compilationId: number
669
+ uid?: number
670
+ }
671
+
672
+ export interface JsBeforeEmitData {
673
+ html: string
674
+ outputName: string
675
+ compilationId: number
676
+ uid?: number
677
+ }
678
+
679
+ export interface JsBeforeResolveArgs {
680
+ request: string
681
+ context: string
682
+ issuer: string
683
+ issuerLayer?: string
684
+ }
685
+
686
+ export interface JsBuildMeta {
687
+ strictEsmModule: boolean
688
+ hasTopLevelAwait: boolean
689
+ esm: boolean
690
+ exportsType: 'unset' | 'default' | 'namespace' | 'flagged' | 'dynamic'
691
+ defaultObject: 'false' | 'redirect' | JsBuildMetaDefaultObjectRedirectWarn
692
+ sideEffectFree?: boolean
693
+ exportsFinalName?: Array<[string, string]> | undefined
694
+ }
695
+
696
+ export interface JsBuildMetaDefaultObjectRedirectWarn {
697
+ redirectWarn: JsDefaultObjectRedirectWarnObject
698
+ }
699
+
700
+ export interface JsBuildTimeExecutionOption {
701
+ publicPath?: string
702
+ baseUri?: string
703
+ }
704
+
705
+ export interface JsCacheGroupTestCtx {
706
+ module: Module
707
+ }
708
+
709
+ export interface JsChunkAssetArgs {
710
+ chunk: Chunk
711
+ filename: string
712
+ }
713
+
714
+ export interface JsChunkGroupOrigin {
715
+ module?: Module | undefined
716
+ request?: string
717
+ loc?: string | RealDependencyLocation
718
+ }
719
+
720
+ export interface JsChunkOptionNameCtx {
721
+ module: Module
722
+ chunks: Chunk[]
723
+ cacheGroupKey: string
724
+ }
725
+
726
+ /**
727
+ * File clean options
728
+ *
729
+ * This matches with:
730
+ * - keep:
731
+ * - If a string, keep the files under this path
732
+ */
733
+ export interface JsCleanOptions {
734
+ keep?: string | RegExp | ((path: string) => boolean)
735
+ }
736
+
737
+ export interface JsCodegenerationResult {
738
+ sources: Record<string, string>
739
+ }
740
+
741
+ export interface JsCodegenerationResults {
742
+ map: Record<string, Record<string, JsCodegenerationResult>>
743
+ }
744
+
745
+ /**
746
+ * Zero copy `JsCompatSource` slice shared between Rust and Node.js if buffer is used.
747
+ *
748
+ * It can only be used in non-async context and the lifetime is bound to the fn closure.
749
+ *
750
+ * If you want to use Node.js Buffer in async context or want to extend the lifetime, use `JsCompatSourceOwned` instead.
751
+ */
752
+ export interface JsCompatSource {
753
+ source: string | Buffer
754
+ map?: string
755
+ }
756
+
757
+ export interface JsCompatSourceOwned {
758
+ source: string | Buffer
759
+ map?: string
760
+ }
761
+
762
+ export interface JsCreateData {
763
+ request: string
764
+ userRequest: string
765
+ resource: string
766
+ }
767
+
768
+ export interface JsCreateScriptData {
769
+ code: string
770
+ chunk: Chunk
771
+ }
772
+
773
+ export interface JsDefaultObjectRedirectWarnObject {
774
+ ignore: boolean
775
+ }
776
+
777
+ export interface JsDiagnostic {
778
+ message: string
779
+ help?: string
780
+ sourceCode?: string
781
+ location?: JsDiagnosticLocation
782
+ file?: string
783
+ severity: "error" | "warning"
784
+ moduleIdentifier?: string
785
+ }
786
+
787
+ export interface JsDiagnosticLocation {
788
+ text?: string
789
+ /** 1-based */
790
+ line: number
791
+ /** 0-based in bytes */
792
+ column: number
793
+ /** Length in bytes */
794
+ length: number
795
+ }
796
+
797
+ export interface JsEntryData {
798
+ dependencies: Array<Dependency>
799
+ includeDependencies: Array<Dependency>
800
+ options: JsEntryOptions
801
+ }
802
+
803
+ export interface JsEntryOptions {
804
+ name?: string
805
+ runtime?: false | string
806
+ chunkLoading?: false | string
807
+ asyncChunks?: boolean
808
+ publicPath?: "auto" | JsFilename
809
+ baseUri?: string
810
+ filename?: JsFilename
811
+ library?: JsLibraryOptions
812
+ dependOn?: Array<string>
813
+ layer?: string
814
+ }
815
+
816
+ export interface JsEntryPluginOptions {
817
+ context: string
818
+ entry: string
819
+ options: JsEntryOptions
820
+ }
821
+
822
+ export interface JsExecuteModuleArg {
823
+ entry: string
824
+ runtimeModules: Array<string>
825
+ codegenResults: JsCodegenerationResults
826
+ id: number
827
+ }
828
+
829
+ export interface JsExecuteModuleResult {
830
+ fileDependencies: Array<string>
831
+ contextDependencies: Array<string>
832
+ buildDependencies: Array<string>
833
+ missingDependencies: Array<string>
834
+ cacheable: boolean
835
+ id: number
836
+ error?: string
837
+ }
838
+
839
+ export interface JsFactorizeArgs {
840
+ request: string
841
+ context: string
842
+ issuer: string
843
+ issuerLayer?: string
844
+ }
845
+
846
+ export interface JsFactoryMeta {
847
+ sideEffectFree?: boolean
848
+ }
849
+
850
+ export interface JsHtmlPluginAssets {
851
+ publicPath: string
852
+ js: Array<string>
853
+ css: Array<string>
854
+ favicon?: string
855
+ jsIntegrity?: Array<string | undefined | null>
856
+ cssIntegrity?: Array<string | undefined | null>
857
+ }
858
+
859
+ export interface JsHtmlPluginAssetTags {
860
+ scripts: Array<JsHtmlPluginTag>
861
+ styles: Array<JsHtmlPluginTag>
862
+ meta: Array<JsHtmlPluginTag>
863
+ }
864
+
865
+ export interface JsHtmlPluginTag {
866
+ tagName: string
867
+ attributes: Record<string, string | boolean | undefined | null>
868
+ voidTag: boolean
869
+ innerHTML?: string
870
+ asset?: string
871
+ }
872
+
873
+ export interface JsHttpResponseRaw {
874
+ status: number
875
+ headers: Record<string, string>
876
+ body: Buffer
877
+ }
878
+
879
+ export interface JsLibIdentOptions {
880
+ context: string
881
+ }
882
+
883
+ export interface JsLibraryAuxiliaryComment {
884
+ root?: string
885
+ commonjs?: string
886
+ commonjs2?: string
887
+ amd?: string
888
+ }
889
+
890
+ export interface JsLibraryCustomUmdObject {
891
+ amd?: string
892
+ commonjs?: string
893
+ root?: Array<string> | string
894
+ }
895
+
896
+ export interface JsLibraryName {
897
+ type: "string" | "array" | "umdObject"
898
+ stringPayload?: string
899
+ arrayPayload?: Array<string>
900
+ umdObjectPayload?: JsLibraryCustomUmdObject
901
+ }
902
+
903
+ export interface JsLibraryOptions {
904
+ name?: string | Array<string> | JsLibraryCustomUmdObject
905
+ export?: Array<string> | string
906
+ type: string
907
+ umdNamedDefine?: boolean
908
+ auxiliaryComment?: string | JsLibraryAuxiliaryComment
909
+ amdContainer?: string
910
+ }
911
+
912
+ export interface JsLinkPrefetchData {
913
+ code: string
914
+ chunk: Chunk
915
+ }
916
+
917
+ export interface JsLinkPreloadData {
918
+ code: string
919
+ chunk: Chunk
920
+ }
921
+
922
+ export interface JsLoaderContext {
923
+ resource: string
924
+ _module: Module
925
+ hot: Readonly<boolean>
926
+ /** Content maybe empty in pitching stage */
927
+ content: null | Buffer
928
+ additionalData?: any
929
+ __internal__parseMeta: Record<string, string>
930
+ sourceMap?: Buffer
931
+ cacheable: boolean
932
+ fileDependencies: Array<string>
933
+ contextDependencies: Array<string>
934
+ missingDependencies: Array<string>
935
+ buildDependencies: Array<string>
936
+ loaderItems: Array<JsLoaderItem>
937
+ loaderIndex: number
938
+ loaderState: Readonly<JsLoaderState>
939
+ __internal__error?: RspackError
940
+ /**
941
+ * UTF-8 hint for `content`
942
+ * - Some(true): `content` is a `UTF-8` encoded sequence
943
+ */
944
+ __internal__utf8Hint?: boolean
945
+ }
946
+
947
+ export interface JsLoaderItem {
948
+ loader: string
949
+ type: string
950
+ data: any
951
+ normalExecuted: boolean
952
+ pitchExecuted: boolean
953
+ noPitch: boolean
954
+ }
955
+
956
+ export declare enum JsLoaderState {
957
+ Pitching = 'Pitching',
958
+ Normal = 'Normal'
959
+ }
960
+
961
+ export interface JsModuleDescriptor {
962
+ identifier: string
963
+ name: string
964
+ id?: string | number | null
965
+ }
966
+
967
+ export interface JsNormalModuleFactoryCreateModuleArgs {
968
+ dependencyType: string
969
+ rawRequest: string
970
+ resourceResolveData: JsResourceData
971
+ context: string
972
+ matchResource?: string
973
+ }
974
+
975
+ export interface JsOriginRecord {
976
+ moduleDescriptor?: JsModuleDescriptor
977
+ loc: string
978
+ request: string
979
+ }
980
+
981
+ export interface JsPathData {
982
+ filename?: string
983
+ hash?: string
984
+ contentHash?: string
985
+ runtime?: string
986
+ url?: string
987
+ id?: string
988
+ chunk?: JsPathDataChunkLike
989
+ }
990
+
991
+ export interface JsPathDataChunkLike {
992
+ name?: string
993
+ hash?: string
994
+ id?: string
995
+ }
996
+
997
+ export interface JsResolveArgs {
998
+ request: string
999
+ context: string
1000
+ issuer: string
1001
+ issuerLayer?: string
1002
+ }
1003
+
1004
+ export interface JsResolveForSchemeArgs {
1005
+ resourceData: JsResourceData
1006
+ scheme: string
1007
+ }
1008
+
1009
+ export interface JsResourceData {
1010
+ /** Resource with absolute path, query and fragment */
1011
+ resource: string
1012
+ /** Absolute resource path only */
1013
+ path?: string
1014
+ /** Resource query with `?` prefix */
1015
+ query?: string
1016
+ /** Resource fragment with `#` prefix */
1017
+ fragment?: string
1018
+ descriptionFileData?: any
1019
+ descriptionFilePath?: string
1020
+ }
1021
+
1022
+ export interface JsRsdoctorAsset {
1023
+ ukey: number
1024
+ path: string
1025
+ chunks: Array<number>
1026
+ size: number
1027
+ }
1028
+
1029
+ export interface JsRsdoctorAssetPatch {
1030
+ assets: Array<JsRsdoctorAsset>
1031
+ chunkAssets: Array<JsRsdoctorChunkAssets>
1032
+ entrypointAssets: Array<JsRsdoctorEntrypointAssets>
1033
+ }
1034
+
1035
+ export interface JsRsdoctorChunk {
1036
+ ukey: number
1037
+ name: string
1038
+ initial: boolean
1039
+ entry: boolean
1040
+ dependencies: Array<number>
1041
+ imported: Array<number>
1042
+ }
1043
+
1044
+ export interface JsRsdoctorChunkAssets {
1045
+ chunk: number
1046
+ assets: Array<number>
1047
+ }
1048
+
1049
+ export interface JsRsdoctorChunkGraph {
1050
+ chunks: Array<JsRsdoctorChunk>
1051
+ entrypoints: Array<JsRsdoctorEntrypoint>
1052
+ }
1053
+
1054
+ export interface JsRsdoctorChunkModules {
1055
+ chunk: number
1056
+ modules: Array<number>
1057
+ }
1058
+
1059
+ export interface JsRsdoctorDependency {
1060
+ ukey: number
1061
+ kind: string
1062
+ request: string
1063
+ module: number
1064
+ dependency: number
1065
+ }
1066
+
1067
+ export interface JsRsdoctorEntrypoint {
1068
+ ukey: number
1069
+ name: string
1070
+ chunks: Array<number>
1071
+ }
1072
+
1073
+ export interface JsRsdoctorEntrypointAssets {
1074
+ entrypoint: number
1075
+ assets: Array<number>
1076
+ }
1077
+
1078
+ export interface JsRsdoctorExportInfo {
1079
+ ukey: number
1080
+ name: string
1081
+ from?: number
1082
+ variable?: number
1083
+ identifier?: JsRsdoctorStatement
1084
+ sideEffects: Array<number>
1085
+ }
1086
+
1087
+ export interface JsRsdoctorModule {
1088
+ ukey: number
1089
+ identifier: string
1090
+ path: string
1091
+ isEntry: boolean
1092
+ kind: 'normal' | 'concatenated'
1093
+ layer?: string
1094
+ dependencies: Array<number>
1095
+ imported: Array<number>
1096
+ modules: Array<number>
1097
+ belongModules: Array<number>
1098
+ chunks: Array<number>
1099
+ issuerPath: Array<number>
1100
+ bailoutReason: Array<string>
1101
+ }
1102
+
1103
+ export interface JsRsdoctorModuleGraph {
1104
+ modules: Array<JsRsdoctorModule>
1105
+ dependencies: Array<JsRsdoctorDependency>
1106
+ chunkModules: Array<JsRsdoctorChunkModules>
1107
+ }
1108
+
1109
+ export interface JsRsdoctorModuleGraphModule {
1110
+ ukey: number
1111
+ module: number
1112
+ exports: Array<number>
1113
+ sideEffects: Array<number>
1114
+ variables: Array<number>
1115
+ dynamic: boolean
1116
+ }
1117
+
1118
+ export interface JsRsdoctorModuleId {
1119
+ module: number
1120
+ renderId: string
1121
+ }
1122
+
1123
+ export interface JsRsdoctorModuleIdsPatch {
1124
+ moduleIds: Array<JsRsdoctorModuleId>
1125
+ }
1126
+
1127
+ export interface JsRsdoctorModuleOriginalSource {
1128
+ module: number
1129
+ source: string
1130
+ size: number
1131
+ }
1132
+
1133
+ export interface JsRsdoctorModuleSourcesPatch {
1134
+ moduleOriginalSources: Array<JsRsdoctorModuleOriginalSource>
1135
+ }
1136
+
1137
+ export interface JsRsdoctorSideEffect {
1138
+ ukey: number
1139
+ name: string
1140
+ originName?: string
1141
+ module: number
1142
+ identifier: JsRsdoctorStatement
1143
+ isNameSpace: boolean
1144
+ fromDependency?: number
1145
+ exports: Array<number>
1146
+ variable?: number
1147
+ }
1148
+
1149
+ export interface JsRsdoctorSourceMapFeatures {
1150
+ cheap?: boolean
1151
+ module?: boolean
1152
+ }
1153
+
1154
+ export interface JsRsdoctorSourcePosition {
1155
+ line?: number
1156
+ column?: number
1157
+ index?: number
1158
+ }
1159
+
1160
+ export interface JsRsdoctorSourceRange {
1161
+ start: JsRsdoctorSourcePosition
1162
+ end?: JsRsdoctorSourcePosition
1163
+ }
1164
+
1165
+ export interface JsRsdoctorStatement {
1166
+ module: number
1167
+ sourcePosition?: JsRsdoctorSourceRange
1168
+ transformedPosition: JsRsdoctorSourceRange
1169
+ }
1170
+
1171
+ export interface JsRsdoctorVariable {
1172
+ ukey: number
1173
+ name: string
1174
+ module: number
1175
+ usedInfo: string
1176
+ identififer: JsRsdoctorStatement
1177
+ exported?: number
1178
+ }
1179
+
1180
+ export interface JsRspackDiagnostic {
1181
+ severity: JsRspackSeverity
1182
+ error: RspackError
1183
+ }
1184
+
1185
+ export declare enum JsRspackSeverity {
1186
+ Error = 'Error',
1187
+ Warn = 'Warn'
1188
+ }
1189
+
1190
+ export interface JsRuntimeGlobals {
1191
+ value: Array<string>
1192
+ }
1193
+
1194
+ export interface JsRuntimeModule {
1195
+ source?: JsCompatSourceOwned
1196
+ moduleIdentifier: string
1197
+ constructorName: string
1198
+ name: string
1199
+ }
1200
+
1201
+ export interface JsRuntimeModuleArg {
1202
+ module: JsRuntimeModule
1203
+ chunk: Chunk
1204
+ }
1205
+
1206
+ export interface JsRuntimeRequirementInTreeArg {
1207
+ chunk: Chunk
1208
+ allRuntimeRequirements: JsRuntimeGlobals
1209
+ runtimeRequirements: JsRuntimeGlobals
1210
+ }
1211
+
1212
+ export interface JsRuntimeRequirementInTreeResult {
1213
+ allRuntimeRequirements: JsRuntimeGlobals
1214
+ }
1215
+
1216
+ export interface JsStatsAsset {
1217
+ type: string
1218
+ name: string
1219
+ info: JsStatsAssetInfo
1220
+ size: number
1221
+ emitted: boolean
1222
+ chunkNames: Array<string>
1223
+ chunkIdHints: Array<string>
1224
+ chunks: Array<string | undefined | null>
1225
+ auxiliaryChunkNames: Array<string>
1226
+ auxiliaryChunkIdHints: Array<string>
1227
+ auxiliaryChunks: Array<string | undefined | null>
1228
+ }
1229
+
1230
+ export interface JsStatsAssetInfo {
1231
+ minimized?: boolean
1232
+ development?: boolean
1233
+ hotModuleReplacement?: boolean
1234
+ sourceFilename?: string
1235
+ copied?: boolean
1236
+ immutable?: boolean
1237
+ javascriptModule?: boolean
1238
+ chunkhash: Array<string>
1239
+ contenthash: Array<string>
1240
+ fullhash: Array<string>
1241
+ related: Array<JsStatsAssetInfoRelated>
1242
+ isOverSizeLimit?: boolean
1243
+ }
1244
+
1245
+ export interface JsStatsAssetInfoRelated {
1246
+ name: string
1247
+ value: Array<string>
1248
+ }
1249
+
1250
+ export interface JsStatsAssetsByChunkName {
1251
+ name: string
1252
+ files: Array<string>
1253
+ }
1254
+
1255
+ export interface JsStatsChildGroupChildAssets {
1256
+ preload?: Array<string>
1257
+ prefetch?: Array<string>
1258
+ }
1259
+
1260
+ export interface JsStatsChunk {
1261
+ type: string
1262
+ files: Array<string>
1263
+ auxiliaryFiles: Array<string>
1264
+ id?: string
1265
+ idHints: Array<string>
1266
+ hash?: string
1267
+ entry: boolean
1268
+ initial: boolean
1269
+ names: Array<string>
1270
+ size: number
1271
+ parents?: Array<string>
1272
+ children?: Array<string>
1273
+ siblings?: Array<string>
1274
+ childrenByOrder: Record<string, Array<string>>
1275
+ runtime: Array<string>
1276
+ reason?: string
1277
+ rendered: boolean
1278
+ sizes: Array<JsStatsSize>
1279
+ origins: Array<JsOriginRecord>
1280
+ modules?: Array<JsStatsModule>
1281
+ }
1282
+
1283
+ export interface JsStatsChunkGroup {
1284
+ name: string
1285
+ chunks: Array<string>
1286
+ assets: Array<JsStatsChunkGroupAsset>
1287
+ assetsSize: number
1288
+ auxiliaryAssets?: Array<JsStatsChunkGroupAsset>
1289
+ auxiliaryAssetsSize?: number
1290
+ isOverSizeLimit?: boolean
1291
+ children?: JsStatsChunkGroupChildren
1292
+ childAssets?: JsStatsChildGroupChildAssets
1293
+ }
1294
+
1295
+ export interface JsStatsChunkGroupAsset {
1296
+ name: string
1297
+ size: number
1298
+ }
1299
+
1300
+ export interface JsStatsChunkGroupChildren {
1301
+ preload?: Array<JsStatsChunkGroup>
1302
+ prefetch?: Array<JsStatsChunkGroup>
1303
+ }
1304
+
1305
+ export interface JsStatsCompilation {
1306
+ assets?: Array<JsStatsAsset>
1307
+ assetsByChunkName?: Array<JsStatsAssetsByChunkName>
1308
+ chunks?: Array<JsStatsChunk>
1309
+ entrypoints?: Array<JsStatsChunkGroup>
1310
+ errors: Array<JsStatsError>
1311
+ hash?: string
1312
+ modules?: Array<JsStatsModule>
1313
+ namedChunkGroups?: Array<JsStatsChunkGroup>
1314
+ warnings: Array<JsStatsError>
1315
+ }
1316
+
1317
+ export interface JsStatsError {
1318
+ name?: string
1319
+ moduleDescriptor?: JsModuleDescriptor
1320
+ message: string
1321
+ chunkName?: string
1322
+ code?: string
1323
+ chunkEntry?: boolean
1324
+ chunkInitial?: boolean
1325
+ loc?: string
1326
+ file?: string
1327
+ chunkId?: string
1328
+ details?: string
1329
+ stack?: string
1330
+ moduleTrace: Array<JsStatsModuleTrace>
1331
+ }
1332
+
1333
+ export interface JsStatsGetAssets {
1334
+ assets: Array<JsStatsAsset>
1335
+ assetsByChunkName: Array<JsStatsAssetsByChunkName>
1336
+ }
1337
+
1338
+ export interface JsStatsLogging {
1339
+ name: string
1340
+ type: string
1341
+ args?: Array<string>
1342
+ trace?: Array<string>
1343
+ }
1344
+
1345
+ export interface JsStatsMillisecond {
1346
+ secs: number
1347
+ subsecMillis: number
1348
+ }
1349
+
1350
+ export interface JsStatsModule {
1351
+ commonAttributes: JsStatsModuleCommonAttributes
1352
+ dependent?: boolean
1353
+ issuerDescriptor?: JsModuleDescriptor
1354
+ issuerPath?: Array<JsStatsModuleIssuer>
1355
+ usedExports?: string | Array<string>
1356
+ modules?: Array<JsStatsModule>
1357
+ }
1358
+
1359
+ export interface JsStatsModuleCommonAttributes {
1360
+ type: string
1361
+ moduleType: string
1362
+ layer?: string
1363
+ size: number
1364
+ sizes: Array<JsStatsSize>
1365
+ built: boolean
1366
+ codeGenerated: boolean
1367
+ buildTimeExecuted: boolean
1368
+ cached: boolean
1369
+ moduleDescriptor?: JsModuleDescriptor
1370
+ nameForCondition?: string
1371
+ preOrderIndex?: number
1372
+ postOrderIndex?: number
1373
+ cacheable?: boolean
1374
+ optional?: boolean
1375
+ orphan?: boolean
1376
+ failed?: boolean
1377
+ errors?: number
1378
+ warnings?: number
1379
+ profile?: JsStatsModuleProfile
1380
+ chunks?: Array<string>
1381
+ assets?: Array<string>
1382
+ reasons?: Array<JsStatsModuleReason>
1383
+ providedExports?: Array<string>
1384
+ optimizationBailout?: Array<string>
1385
+ depth?: number
1386
+ source?: string | Buffer
1387
+ }
1388
+
1389
+ export interface JsStatsModuleIssuer {
1390
+ moduleDescriptor: JsModuleDescriptor
1391
+ }
1392
+
1393
+ export interface JsStatsModuleProfile {
1394
+ factory: JsStatsMillisecond
1395
+ building: JsStatsMillisecond
1396
+ }
1397
+
1398
+ export interface JsStatsModuleReason {
1399
+ moduleDescriptor?: JsModuleDescriptor
1400
+ resolvedModuleDescriptor?: JsModuleDescriptor
1401
+ moduleChunks?: number
1402
+ type?: string
1403
+ userRequest?: string
1404
+ explanation?: string
1405
+ active: boolean
1406
+ loc?: string
1407
+ }
1408
+
1409
+ export interface JsStatsModuleTrace {
1410
+ origin: JsStatsModuleTraceModule
1411
+ module: JsStatsModuleTraceModule
1412
+ dependencies: Array<JsStatsModuleTraceDependency>
1413
+ }
1414
+
1415
+ export interface JsStatsModuleTraceDependency {
1416
+ loc: string
1417
+ }
1418
+
1419
+ export interface JsStatsModuleTraceModule {
1420
+ moduleDescriptor: JsModuleDescriptor
1421
+ }
1422
+
1423
+ export interface JsStatsOptimizationBailout {
1424
+ inner: string
1425
+ }
1426
+
1427
+ export interface JsStatsOptions {
1428
+ assets: boolean
1429
+ cachedModules: boolean
1430
+ chunks: boolean
1431
+ chunkGroupAuxiliary: boolean
1432
+ chunkGroupChildren: boolean
1433
+ chunkGroups: boolean
1434
+ chunkModules: boolean
1435
+ chunkRelations: boolean
1436
+ depth: boolean
1437
+ entrypoints: boolean | string
1438
+ errors: boolean
1439
+ hash: boolean
1440
+ ids: boolean
1441
+ modules: boolean
1442
+ moduleAssets: boolean
1443
+ nestedModules: boolean
1444
+ optimizationBailout: boolean
1445
+ providedExports: boolean
1446
+ reasons: boolean
1447
+ source: boolean
1448
+ usedExports: boolean
1449
+ warnings: boolean
1450
+ }
1451
+
1452
+ export interface JsStatsSize {
1453
+ sourceType: string
1454
+ size: number
1455
+ }
1456
+
1457
+ export interface JsTap {
1458
+ function: (...args: any[]) => any
1459
+ stage: number
1460
+ }
1461
+
1462
+ export interface KnownAssetInfo {
1463
+ /** if the asset can be long term cached forever (contains a hash) */
1464
+ immutable?: boolean
1465
+ /** whether the asset is minimized */
1466
+ minimized?: boolean
1467
+ /** the value(s) of the full hash used for this asset */
1468
+ fullhash?: string | Array<string>
1469
+ /** the value(s) of the chunk hash used for this asset */
1470
+ chunkhash?: string | Array<string>
1471
+ /**
1472
+ * the value(s) of the module hash used for this asset
1473
+ * the value(s) of the content hash used for this asset
1474
+ */
1475
+ contenthash?: string | Array<string>
1476
+ /** when asset was created from a source file (potentially transformed), the original filename relative to compilation context */
1477
+ sourceFilename?: string
1478
+ /** when asset was created from a source file (potentially transformed), it should be flagged as copied */
1479
+ copied?: boolean
1480
+ /**
1481
+ * size in bytes, only set after asset has been emitted
1482
+ * when asset is only used for development and doesn't count towards user-facing assets
1483
+ */
1484
+ development?: boolean
1485
+ /** when asset ships data for updating an existing application (HMR) */
1486
+ hotModuleReplacement?: boolean
1487
+ /** when asset is javascript and an ESM */
1488
+ javascriptModule?: boolean
1489
+ /** related object to other assets, keyed by type of relation (only points from parent to child) */
1490
+ related?: JsAssetInfoRelated
1491
+ /** unused css local ident for the css chunk */
1492
+ cssUnusedIdents?: Array<string>
1493
+ /** whether this asset is over the size limit */
1494
+ isOverSizeLimit?: boolean
1495
+ }
1496
+
1497
+ export declare function loadBrowserslist(input: string | undefined | null, context: string): Array<string> | null
1498
+
1499
+ export declare function minify(source: string, options: string): Promise<TransformOutput>
1500
+
1501
+ export declare function minifySync(source: string, options: string): TransformOutput
1502
+
1503
+ export interface NativeWatcherOptions {
1504
+ followSymlinks?: boolean
1505
+ pollInterval?: number
1506
+ aggregateTimeout?: number
1507
+ /**
1508
+ * The ignored paths for the watcher.
1509
+ * It can be a single path, an array of paths, or a regular expression.
1510
+ */
1511
+ ignored?: string | string[] | RegExp
1512
+ }
1513
+
1514
+ export interface NodeFsStats {
1515
+ isFile: boolean
1516
+ isDirectory: boolean
1517
+ isSymlink: boolean
1518
+ atimeMs: number
1519
+ mtimeMs: number
1520
+ ctimeMs: number
1521
+ birthtimeMs: number
1522
+ size: number
1523
+ mode: number
1524
+ }
1525
+
1526
+ export interface PathWithInfo {
1527
+ path: string
1528
+ info: AssetInfo
1529
+ }
1530
+
1531
+ export interface RawAliasOptionItem {
1532
+ path: string
1533
+ redirect: Array<string | false>
1534
+ }
1535
+
1536
+ export interface RawAssetGeneratorDataUrlFnCtx {
1537
+ filename: string
1538
+ module: Module
1539
+ }
1540
+
1541
+ export interface RawAssetGeneratorDataUrlOptions {
1542
+ encoding?: "base64" | "false" | undefined
1543
+ mimetype?: string
1544
+ }
1545
+
1546
+ export interface RawAssetGeneratorOptions {
1547
+ emit?: boolean
1548
+ filename?: JsFilename
1549
+ outputPath?: JsFilename
1550
+ publicPath?: "auto" | JsFilename
1551
+ dataUrl?: RawAssetGeneratorDataUrlOptions | ((source: Buffer, context: RawAssetGeneratorDataUrlFnCtx) => string)
1552
+ importMode?: "url" | "preserve"
1553
+ binary?: boolean
1554
+ }
1555
+
1556
+ export interface RawAssetInlineGeneratorOptions {
1557
+ dataUrl?: RawAssetGeneratorDataUrlOptions | ((source: Buffer, context: RawAssetGeneratorDataUrlFnCtx) => string)
1558
+ binary?: boolean
1559
+ }
1560
+
1561
+ export interface RawAssetParserDataUrl {
1562
+ type: "options"
1563
+ options?: RawAssetParserDataUrlOptions
1564
+ }
1565
+
1566
+ export interface RawAssetParserDataUrlOptions {
1567
+ maxSize?: number
1568
+ }
1569
+
1570
+ export interface RawAssetParserOptions {
1571
+ dataUrlCondition?: RawAssetParserDataUrl
1572
+ }
1573
+
1574
+ export interface RawAssetResourceGeneratorOptions {
1575
+ emit?: boolean
1576
+ filename?: JsFilename
1577
+ outputPath?: JsFilename
1578
+ publicPath?: "auto" | JsFilename
1579
+ importMode?: "url" | "preserve"
1580
+ binary?: boolean
1581
+ }
1582
+
1583
+ export interface RawBannerPluginOptions {
1584
+ banner: string | ((args: { hash: string, chunk: Chunk, filename: string }) => string)
1585
+ entryOnly?: boolean
1586
+ footer?: boolean
1587
+ raw?: boolean
1588
+ stage?: number
1589
+ test?: string | RegExp | (string | RegExp)[]
1590
+ include?: string | RegExp | (string | RegExp)[]
1591
+ exclude?: string | RegExp | (string | RegExp)[]
1592
+ }
1593
+
1594
+ export interface RawBundlerInfoPluginOptions {
1595
+ version: string
1596
+ bundler: string
1597
+ force: boolean | string[]
1598
+ }
1599
+
1600
+ export interface RawCacheGroupOptions {
1601
+ key: string
1602
+ priority?: number
1603
+ test?: RegExp | string | Function
1604
+ filename?: JsFilename
1605
+ idHint?: string
1606
+ /** What kind of chunks should be selected. */
1607
+ chunks?: RegExp | 'async' | 'initial' | 'all'
1608
+ type?: RegExp | string
1609
+ layer?: RegExp | string | ((layer?: string) => boolean)
1610
+ automaticNameDelimiter?: string
1611
+ minChunks?: number
1612
+ minSize?: number | RawSplitChunkSizes
1613
+ minSizeReduction?: number | RawSplitChunkSizes
1614
+ maxSize?: number | RawSplitChunkSizes
1615
+ maxAsyncSize?: number | RawSplitChunkSizes
1616
+ maxInitialSize?: number | RawSplitChunkSizes
1617
+ maxAsyncRequests?: number
1618
+ maxInitialRequests?: number
1619
+ name?: string | false | Function
1620
+ reuseExistingChunk?: boolean
1621
+ enforce?: boolean
1622
+ usedExports?: boolean
1623
+ }
1624
+
1625
+ export interface RawCacheOptions {
1626
+ type: string
1627
+ maxGenerations?: number
1628
+ }
1629
+
1630
+ export interface RawCircularDependencyRspackPluginOptions {
1631
+ failOnError?: boolean
1632
+ allowAsyncCycles?: boolean
1633
+ exclude?: RegExp
1634
+ ignoredConnections?: Array<[string | RegExp, string | RegExp]>
1635
+ onDetected?: (entrypoint: Module, modules: string[]) => void
1636
+ onIgnored?: (entrypoint: Module, modules: string[]) => void
1637
+ onStart?: () => void
1638
+ onEnd?: () => void
1639
+ }
1640
+
1641
+ export interface RawConsumeOptions {
1642
+ key: string
1643
+ import?: string
1644
+ importResolved?: string
1645
+ shareKey: string
1646
+ shareScope: string
1647
+ requiredVersion?: string | false | undefined
1648
+ packageName?: string
1649
+ strictVersion: boolean
1650
+ singleton: boolean
1651
+ eager: boolean
1652
+ }
1653
+
1654
+ export interface RawConsumeSharedPluginOptions {
1655
+ consumes: Array<RawConsumeOptions>
1656
+ enhanced: boolean
1657
+ }
1658
+
1659
+ export interface RawContainerPluginOptions {
1660
+ name: string
1661
+ shareScope: string
1662
+ library: JsLibraryOptions
1663
+ runtime?: false | string
1664
+ filename?: string
1665
+ exposes: Array<RawExposeOptions>
1666
+ enhanced: boolean
1667
+ }
1668
+
1669
+ export interface RawContainerReferencePluginOptions {
1670
+ remoteType: string
1671
+ remotes: Array<RawRemoteOptions>
1672
+ shareScope?: string
1673
+ enhanced: boolean
1674
+ }
1675
+
1676
+ export interface RawContextReplacementPluginOptions {
1677
+ resourceRegExp: RegExp
1678
+ newContentResource?: string
1679
+ newContentRecursive?: boolean
1680
+ newContentRegExp?: RegExp
1681
+ newContentCreateContextMap?: Record<string, string>
1682
+ }
1683
+
1684
+ export interface RawCopyGlobOptions {
1685
+ /**
1686
+ * Whether the match is case sensitive
1687
+ * @default true
1688
+ */
1689
+ caseSensitiveMatch?: boolean
1690
+ /**
1691
+ * Whether to match files starting with `.`
1692
+ * @default true
1693
+ */
1694
+ dot?: boolean
1695
+ /**
1696
+ * An array of strings in glob format, which can be used to ignore specific paths
1697
+ * @default undefined
1698
+ */
1699
+ ignore?: Array<string>
1700
+ }
1701
+
1702
+ export interface RawCopyPattern {
1703
+ /**
1704
+ * The source path of the copy operation, which can be an absolute path, a relative
1705
+ * path, or a glob pattern. It can refer to a file or a directory. If a relative path
1706
+ * is passed, it is relative to the `context` option.
1707
+ * @default undefined
1708
+ */
1709
+ from: string
1710
+ /**
1711
+ * The destination path of the copy operation, which can be an absolute path, a
1712
+ * relative path, or a template string. If not specified, it is equal to Rspack's
1713
+ * `output.path`.
1714
+ * @default Rspack's `output.path`
1715
+ */
1716
+ to?: string | ((pathData: { context: string; absoluteFilename?: string }) => string | Promise<string>)
1717
+ /**
1718
+ * `context` is a path to be prepended to `from` and removed from the start of the
1719
+ * result paths. `context` can be an absolute path or a relative path. If it is a
1720
+ * relative path, then it will be converted to an absolute path based on Rspack's
1721
+ * `context`.
1722
+ * `context` should be explicitly set only when `from` contains a glob. Otherwise,
1723
+ * `context` is automatically set based on whether `from` is a file or a directory:
1724
+ * - If `from` is a file, then `context` is its directory. The result path will be
1725
+ * the filename alone.
1726
+ * - If `from` is a directory, then `context` equals `from`. The result paths will
1727
+ * be the paths of the directory's contents (including nested contents), relative
1728
+ * to the directory.
1729
+ * @default Rspack's `context`
1730
+ */
1731
+ context?: string
1732
+ /**
1733
+ * Specify the type of [to](#to), which can be a directory, a file, or a template
1734
+ * name in Rspack. If not specified, it will be automatically inferred.
1735
+ * The automatic inference rules are as follows:
1736
+ * - `dir`: If `to` has no extension, or ends on `/`.
1737
+ * - `file`: If `to` is not a directory and is not a template.
1738
+ * - `template`: If `to` contains a template pattern.
1739
+ * @default undefined
1740
+ */
1741
+ toType?: string
1742
+ /**
1743
+ * Whether to ignore the error if there are missing files or directories.
1744
+ * @default false
1745
+ */
1746
+ noErrorOnMissing: boolean
1747
+ /**
1748
+ * Whether to force the copy operation to overwrite the destination file if it
1749
+ * already exists.
1750
+ * @default false
1751
+ */
1752
+ force: boolean
1753
+ /**
1754
+ * The priority of the copy operation. The higher the priority, the earlier the copy
1755
+ * operation will be executed. When `force` is set to `true`, if a matching file is
1756
+ * found, the one with higher priority will overwrite the one with lower priority.
1757
+ * @default 0
1758
+ */
1759
+ priority: number
1760
+ /**
1761
+ * Set the glob options for the copy operation.
1762
+ * @default undefined
1763
+ */
1764
+ globOptions: RawCopyGlobOptions
1765
+ /**
1766
+ * Allows to add some assets info to the copied files, which may affect some behaviors
1767
+ * in the build process. For example, by default, the copied JS and CSS files will be
1768
+ * minified by Rspack's minimizer, if you want to skip minification for copied files,
1769
+ * you can set `info.minimized` to `true`.
1770
+ * @default undefined
1771
+ */
1772
+ info?: RawInfo
1773
+ /**
1774
+ * Determines whether to copy file permissions from the source to the destination.
1775
+ * When set to true, the plugin will preserve executable permissions and other file modes.
1776
+ * This is particularly useful when copying scripts or executable files.
1777
+ * @default false
1778
+ */
1779
+ copyPermissions?: boolean
1780
+ /**
1781
+ * Allows to modify the file contents.
1782
+ * @default undefined
1783
+ */
1784
+ transform?: { transformer: (input: Buffer, absoluteFilename: string) => string | Buffer | Promise<string> | Promise<Buffer> } | ((input: Buffer, absoluteFilename: string) => string | Buffer | Promise<string> | Promise<Buffer>)
1785
+ }
1786
+
1787
+ export interface RawCopyRspackPluginOptions {
1788
+ /** An array of objects that describe the copy operations to be performed. */
1789
+ patterns: Array<RawCopyPattern>
1790
+ }
1791
+
1792
+ export interface RawCssAutoGeneratorOptions {
1793
+ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only"
1794
+ exportsOnly?: boolean
1795
+ localIdentName?: string
1796
+ esModule?: boolean
1797
+ }
1798
+
1799
+ export interface RawCssAutoParserOptions {
1800
+ namedExports?: boolean
1801
+ url?: boolean
1802
+ }
1803
+
1804
+ export interface RawCssExtractPluginOption {
1805
+ filename: JsFilename
1806
+ chunkFilename: JsFilename
1807
+ ignoreOrder: boolean
1808
+ insert?: string
1809
+ attributes: Record<string, string>
1810
+ linkType?: string
1811
+ runtime: boolean
1812
+ pathinfo: boolean
1813
+ enforceRelative: boolean
1814
+ }
1815
+
1816
+ export interface RawCssGeneratorOptions {
1817
+ exportsOnly?: boolean
1818
+ esModule?: boolean
1819
+ }
1820
+
1821
+ export interface RawCssModuleGeneratorOptions {
1822
+ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only"
1823
+ exportsOnly?: boolean
1824
+ localIdentName?: string
1825
+ esModule?: boolean
1826
+ }
1827
+
1828
+ export interface RawCssModuleParserOptions {
1829
+ namedExports?: boolean
1830
+ url?: boolean
1831
+ }
1832
+
1833
+ export interface RawCssParserOptions {
1834
+ namedExports?: boolean
1835
+ url?: boolean
1836
+ }
1837
+
1838
+ export interface RawDllEntryPluginOptions {
1839
+ context: string
1840
+ entries: Array<string>
1841
+ name: string
1842
+ }
1843
+
1844
+ export interface RawDllManifest {
1845
+ content: Record<string, RawDllManifestContentItem>
1846
+ name?: string
1847
+ type?: string
1848
+ }
1849
+
1850
+ export interface RawDllManifestContentItem {
1851
+ buildMeta?: JsBuildMeta
1852
+ exports?: string[] | true
1853
+ id?: number | string
1854
+ }
1855
+
1856
+ export interface RawDllReferenceAgencyPluginOptions {
1857
+ context?: string
1858
+ name?: string
1859
+ extensions: Array<string>
1860
+ scope?: string
1861
+ sourceType?: string
1862
+ type: string
1863
+ content?: Record<string, RawDllManifestContentItem>
1864
+ manifest?: RawDllManifest
1865
+ }
1866
+
1867
+ export interface RawDraft {
1868
+ customMedia: boolean
1869
+ }
1870
+
1871
+ export interface RawDynamicEntryPluginOptions {
1872
+ context: string
1873
+ entry: () => Promise<RawEntryDynamicResult[]>
1874
+ }
1875
+
1876
+ export interface RawEntryDynamicResult {
1877
+ import: Array<string>
1878
+ options: JsEntryOptions
1879
+ }
1880
+
1881
+ export interface RawEnvironment {
1882
+ const?: boolean
1883
+ arrowFunction?: boolean
1884
+ nodePrefixForCoreModules?: boolean
1885
+ asyncFunction?: boolean
1886
+ bigIntLiteral?: boolean
1887
+ destructuring?: boolean
1888
+ document?: boolean
1889
+ dynamicImport?: boolean
1890
+ forOf?: boolean
1891
+ globalThis?: boolean
1892
+ module?: boolean
1893
+ optionalChaining?: boolean
1894
+ templateLiteral?: boolean
1895
+ dynamicImportInWorker?: boolean
1896
+ }
1897
+
1898
+ export interface RawEvalDevToolModulePluginOptions {
1899
+ namespace?: string
1900
+ moduleFilenameTemplate?: string | ((info: RawModuleFilenameTemplateFnCtx) => string)
1901
+ sourceUrlComment?: string
1902
+ }
1903
+
1904
+ export interface RawExperimentCacheOptionsPersistent {
1905
+ buildDependencies?: Array<string>
1906
+ version?: string
1907
+ snapshot?: RawExperimentSnapshotOptions
1908
+ storage?: RawStorageOptions
1909
+ }
1910
+
1911
+ export interface RawExperiments {
1912
+ layers: boolean
1913
+ topLevelAwait: boolean
1914
+ incremental?: false | { [key: string]: boolean }
1915
+ parallelCodeSplitting: boolean
1916
+ rspackFuture?: RawRspackFuture
1917
+ cache: boolean | { type: "persistent" } & RawExperimentCacheOptionsPersistent | { type: "memory" }
1918
+ useInputFileSystem?: false | Array<RegExp>
1919
+ inlineConst: boolean
1920
+ inlineEnum: boolean
1921
+ typeReexportsPresence: boolean
1922
+ }
1923
+
1924
+ export interface RawExperimentSnapshotOptions {
1925
+ immutablePaths: Array<string|RegExp>
1926
+ unmanagedPaths: Array<string|RegExp>
1927
+ managedPaths: Array<string|RegExp>
1928
+ }
1929
+
1930
+ export interface RawExposeOptions {
1931
+ key: string
1932
+ name?: string
1933
+ import: Array<string>
1934
+ }
1935
+
1936
+ export interface RawExternalItemFnCtxData {
1937
+ request: string
1938
+ context: string
1939
+ dependencyType: string
1940
+ contextInfo: ContextInfo
1941
+ }
1942
+
1943
+ export interface RawExternalItemFnResult {
1944
+ externalType?: string
1945
+ result?: string | boolean | string[] | Record<string, string[]>
1946
+ }
1947
+
1948
+ export interface RawExternalsPluginOptions {
1949
+ type: string
1950
+ externals: (string | RegExp | Record<string, string | boolean | string[] | Record<string, string[]>> | ((...args: any[]) => any))[]
1951
+ }
1952
+
1953
+ export interface RawExternalsPresets {
1954
+ node: boolean
1955
+ web: boolean
1956
+ electron: boolean
1957
+ electronMain: boolean
1958
+ electronPreload: boolean
1959
+ electronRenderer: boolean
1960
+ }
1961
+
1962
+ export interface RawExtractComments {
1963
+ banner?: string | boolean
1964
+ condition?: string
1965
+ }
1966
+
1967
+ export interface RawFallbackCacheGroupOptions {
1968
+ chunks?: RegExp | 'async' | 'initial' | 'all'
1969
+ minSize?: number | RawSplitChunkSizes
1970
+ maxSize?: number | RawSplitChunkSizes
1971
+ maxAsyncSize?: number | RawSplitChunkSizes
1972
+ maxInitialSize?: number | RawSplitChunkSizes
1973
+ automaticNameDelimiter?: string
1974
+ }
1975
+
1976
+ export interface RawFlagAllModulesAsUsedPluginOptions {
1977
+ explanation: string
1978
+ }
1979
+
1980
+ export interface RawFuncUseCtx {
1981
+ resource?: string
1982
+ realResource?: string
1983
+ resourceQuery: string
1984
+ resourceFragment: string
1985
+ issuer: string
1986
+ issuerLayer: string
1987
+ }
1988
+
1989
+ export interface RawGeneratorOptions {
1990
+ type: "asset" | "asset/inline" | "asset/resource" | "css" | "css/auto" | "css/module" | "json"
1991
+ asset?: RawAssetGeneratorOptions
1992
+ assetInline?: RawAssetInlineGeneratorOptions
1993
+ assetResource?: RawAssetResourceGeneratorOptions
1994
+ css?: RawCssGeneratorOptions
1995
+ cssAuto?: RawCssAutoGeneratorOptions
1996
+ cssModule?: RawCssModuleGeneratorOptions
1997
+ json?: RawJsonGeneratorOptions
1998
+ }
1999
+
2000
+ export interface RawHtmlRspackPluginBaseOptions {
2001
+ href?: string
2002
+ target?: "_self" | "_blank" | "_parent" | "_top"
2003
+ }
2004
+
2005
+ export interface RawHtmlRspackPluginOptions {
2006
+ /** emitted file name in output path */
2007
+ filename?: string[]
2008
+ /** template html file */
2009
+ template?: string
2010
+ templateFn?: (data: string) => Promise<string>
2011
+ templateContent?: string
2012
+ templateParameters?: boolean | Record<string, any> | ((params: string) => Promise<string>)
2013
+ /** "head", "body" or "false" */
2014
+ inject: "head" | "body" | "false"
2015
+ /** path or `auto` */
2016
+ publicPath?: string
2017
+ /** `blocking`, `defer`, `module` or `systemjs-module` */
2018
+ scriptLoading: "blocking" | "defer" | "module" | "systemjs-module"
2019
+ /** entry_chunk_name (only entry chunks are supported) */
2020
+ chunks?: Array<string>
2021
+ excludeChunks?: Array<string>
2022
+ chunksSortMode: "auto" | "manual"
2023
+ sri?: "sha256" | "sha384" | "sha512"
2024
+ minify?: boolean
2025
+ title?: string
2026
+ favicon?: string
2027
+ meta?: Record<string, Record<string, string>>
2028
+ hash?: boolean
2029
+ base?: RawHtmlRspackPluginBaseOptions
2030
+ uid?: number
2031
+ }
2032
+
2033
+ export interface RawHttpExternalsRspackPluginOptions {
2034
+ css: boolean
2035
+ webAsync: boolean
2036
+ }
2037
+
2038
+ export interface RawHttpUriPluginOptions {
2039
+ allowedUris: (string | RegExp)[]
2040
+ lockfileLocation?: string
2041
+ cacheLocation?: string
2042
+ upgrade: boolean
2043
+ httpClient: (url: string, headers: Record<string, string>) => Promise<JsHttpResponseRaw>
2044
+ }
2045
+
2046
+ export interface RawIgnorePluginOptions {
2047
+ resourceRegExp?: RegExp
2048
+ contextRegExp?: RegExp
2049
+ checkResource?: (resource: string, context: string) => boolean
2050
+ }
2051
+
2052
+ export interface RawIncremental {
2053
+ silent: boolean
2054
+ make: boolean
2055
+ inferAsyncModules: boolean
2056
+ providedExports: boolean
2057
+ dependenciesDiagnostics: boolean
2058
+ sideEffects: boolean
2059
+ buildChunkGraph: boolean
2060
+ moduleIds: boolean
2061
+ chunkIds: boolean
2062
+ modulesHashes: boolean
2063
+ modulesCodegen: boolean
2064
+ modulesRuntimeRequirements: boolean
2065
+ chunksRuntimeRequirements: boolean
2066
+ chunksHashes: boolean
2067
+ chunksRender: boolean
2068
+ emitAssets: boolean
2069
+ }
2070
+
2071
+ export interface RawInfo {
2072
+ immutable?: boolean
2073
+ /**
2074
+ * Whether to skip minification for the copied files.
2075
+ * @default false
2076
+ */
2077
+ minimized?: boolean
2078
+ chunkHash?: Array<string>
2079
+ contentHash?: Array<string>
2080
+ development?: boolean
2081
+ hotModuleReplacement?: boolean
2082
+ related?: RawRelated
2083
+ version?: string
2084
+ }
2085
+
2086
+ export interface RawIntegrityData {
2087
+ integerities: Array<RawIntegrityItem>
2088
+ }
2089
+
2090
+ export interface RawIntegrityItem {
2091
+ asset: string
2092
+ integrity: string
2093
+ }
2094
+
2095
+ export interface RawJavascriptParserOptions {
2096
+ dynamicImportMode?: string
2097
+ dynamicImportPreload?: string
2098
+ dynamicImportPrefetch?: string
2099
+ dynamicImportFetchPriority?: string
2100
+ url?: string
2101
+ exprContextCritical?: boolean
2102
+ wrappedContextCritical?: boolean
2103
+ wrappedContextRegExp?: RegExp
2104
+ exportsPresence?: string
2105
+ importExportsPresence?: string
2106
+ reexportExportsPresence?: string
2107
+ strictExportPresence?: boolean
2108
+ worker?: Array<string>
2109
+ overrideStrict?: string
2110
+ importMeta?: boolean
2111
+ /**
2112
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2113
+ * @experimental
2114
+ */
2115
+ requireAsExpression?: boolean
2116
+ /**
2117
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2118
+ * @experimental
2119
+ */
2120
+ requireDynamic?: boolean
2121
+ /**
2122
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2123
+ * @experimental
2124
+ */
2125
+ requireResolve?: boolean
2126
+ /**
2127
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2128
+ * @experimental
2129
+ */
2130
+ importDynamic?: boolean
2131
+ /**
2132
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2133
+ * @experimental
2134
+ */
2135
+ inlineConst?: boolean
2136
+ /**
2137
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2138
+ * @experimental
2139
+ */
2140
+ typeReexportsPresence?: string
2141
+ }
2142
+
2143
+ export interface RawJsonGeneratorOptions {
2144
+ JSONParse?: boolean
2145
+ }
2146
+
2147
+ export interface RawJsonParserOptions {
2148
+ exportsDepth?: number
2149
+ parse?: (source: string) => string
2150
+ }
2151
+
2152
+ export interface RawLazyCompilationOption {
2153
+ module: ((err: Error | null, arg: RawModuleArg) => RawModuleInfo)
2154
+ test?: RawLazyCompilationTest
2155
+ entries: boolean
2156
+ imports: boolean
2157
+ cacheable: boolean
2158
+ }
2159
+
2160
+ export interface RawLibManifestPluginOptions {
2161
+ context?: string
2162
+ entryOnly?: boolean
2163
+ name?: JsFilename
2164
+ path: JsFilename
2165
+ format?: boolean
2166
+ type?: string
2167
+ }
2168
+
2169
+ export interface RawLightningCssBrowsers {
2170
+ android?: number
2171
+ chrome?: number
2172
+ edge?: number
2173
+ firefox?: number
2174
+ ie?: number
2175
+ ios_saf?: number
2176
+ opera?: number
2177
+ safari?: number
2178
+ samsung?: number
2179
+ }
2180
+
2181
+ export interface RawLightningCssMinimizerOptions {
2182
+ errorRecovery: boolean
2183
+ targets?: Array<string>
2184
+ include?: number
2185
+ exclude?: number
2186
+ draft?: RawDraft
2187
+ drafts?: RawDraft
2188
+ nonStandard?: RawNonStandard
2189
+ pseudoClasses?: RawLightningCssPseudoClasses
2190
+ unusedSymbols: Array<string>
2191
+ }
2192
+
2193
+ export interface RawLightningCssMinimizerRspackPluginOptions {
2194
+ test?: string | RegExp | (string | RegExp)[]
2195
+ include?: string | RegExp | (string | RegExp)[]
2196
+ exclude?: string | RegExp | (string | RegExp)[]
2197
+ removeUnusedLocalIdents: boolean
2198
+ minimizerOptions: RawLightningCssMinimizerOptions
2199
+ }
2200
+
2201
+ export interface RawLightningCssPseudoClasses {
2202
+ hover?: string
2203
+ active?: string
2204
+ focus?: string
2205
+ focusVisible?: string
2206
+ focusWithin?: string
2207
+ }
2208
+
2209
+ export interface RawLimitChunkCountPluginOptions {
2210
+ chunkOverhead?: number
2211
+ entryChunkMultiplicator?: number
2212
+ maxChunks: number
2213
+ }
2214
+
2215
+ export interface RawModuleArg {
2216
+ module: string
2217
+ path: string
2218
+ }
2219
+
2220
+ export interface RawModuleFederationRuntimePluginOptions {
2221
+ entryRuntime?: string | undefined
2222
+ }
2223
+
2224
+ export interface RawModuleFilenameTemplateFnCtx {
2225
+ identifier: string
2226
+ shortIdentifier: string
2227
+ resource: string
2228
+ resourcePath: string
2229
+ absoluteResourcePath: string
2230
+ loaders: string
2231
+ allLoaders: string
2232
+ query: string
2233
+ moduleId: string
2234
+ hash: string
2235
+ namespace: string
2236
+ }
2237
+
2238
+ export interface RawModuleInfo {
2239
+ active: boolean
2240
+ client: string
2241
+ data: string
2242
+ }
2243
+
2244
+ export interface RawModuleOptions {
2245
+ rules: Array<RawModuleRule>
2246
+ parser?: Record<string, RawParserOptions>
2247
+ generator?: Record<string, RawGeneratorOptions>
2248
+ noParse?: string | RegExp | ((request: string) => boolean) | (string | RegExp | ((request: string) => boolean))[]
2249
+ }
2250
+
2251
+ export interface RawModuleRule {
2252
+ /**
2253
+ * A conditional match matching an absolute path + query + fragment.
2254
+ * Note:
2255
+ * This is a custom matching rule not initially designed by webpack.
2256
+ * Only for single-threaded environment interoperation purpose.
2257
+ */
2258
+ rspackResource?: RawRuleSetCondition
2259
+ /** A condition matcher matching an absolute path. */
2260
+ test?: RawRuleSetCondition
2261
+ include?: RawRuleSetCondition
2262
+ exclude?: RawRuleSetCondition
2263
+ /** A condition matcher matching an absolute path. */
2264
+ resource?: RawRuleSetCondition
2265
+ /** A condition matcher against the resource query. */
2266
+ resourceQuery?: RawRuleSetCondition
2267
+ resourceFragment?: RawRuleSetCondition
2268
+ descriptionData?: Record<string, RawRuleSetCondition>
2269
+ with?: Record<string, RawRuleSetCondition>
2270
+ sideEffects?: boolean
2271
+ use?: RawModuleRuleUse[] | ((arg: RawFuncUseCtx) => RawModuleRuleUse[])
2272
+ type?: string
2273
+ layer?: string
2274
+ parser?: RawParserOptions
2275
+ generator?: RawGeneratorOptions
2276
+ resolve?: RawResolveOptions
2277
+ issuer?: RawRuleSetCondition
2278
+ issuerLayer?: RawRuleSetCondition
2279
+ dependency?: RawRuleSetCondition
2280
+ scheme?: RawRuleSetCondition
2281
+ mimetype?: RawRuleSetCondition
2282
+ oneOf?: Array<RawModuleRule>
2283
+ rules?: Array<RawModuleRule>
2284
+ /** Specifies the category of the loader. No value means normal loader. */
2285
+ enforce?: 'pre' | 'post'
2286
+ }
2287
+
2288
+ /**
2289
+ * `loader` is for both JS and Rust loaders.
2290
+ * `options` is
2291
+ * - a `None` on rust side and handled by js side `getOptions` when
2292
+ * using with `loader`.
2293
+ * - a `Some(string)` on rust side, deserialized by `serde_json::from_str`
2294
+ * and passed to rust side loader in [get_builtin_loader] when using with
2295
+ * `builtin_loader`.
2296
+ */
2297
+ export interface RawModuleRuleUse {
2298
+ loader: string
2299
+ options?: string
2300
+ }
2301
+
2302
+ export interface RawNodeOption {
2303
+ dirname: string
2304
+ filename: string
2305
+ global: string
2306
+ }
2307
+
2308
+ export interface RawNonStandard {
2309
+ deepSelectorCombinator: boolean
2310
+ }
2311
+
2312
+ export interface RawOccurrenceChunkIdsPluginOptions {
2313
+ prioritiseInitial?: boolean
2314
+ }
2315
+
2316
+ export interface RawOptimizationOptions {
2317
+ removeAvailableModules: boolean
2318
+ sideEffects: boolean | string
2319
+ usedExports: boolean | string
2320
+ providedExports: boolean
2321
+ innerGraph: boolean
2322
+ realContentHash: boolean
2323
+ mangleExports: boolean | string
2324
+ concatenateModules: boolean
2325
+ avoidEntryIife: boolean
2326
+ }
2327
+
2328
+ export interface RawOptions {
2329
+ name?: string
2330
+ mode?: undefined | 'production' | 'development' | 'none'
2331
+ context: string
2332
+ output: RawOutputOptions
2333
+ resolve: RawResolveOptions
2334
+ resolveLoader: RawResolveOptions
2335
+ module: RawModuleOptions
2336
+ optimization: RawOptimizationOptions
2337
+ stats: RawStatsOptions
2338
+ cache: RawCacheOptions
2339
+ experiments: RawExperiments
2340
+ node?: RawNodeOption
2341
+ profile: boolean
2342
+ amd?: string
2343
+ bail: boolean
2344
+ __references: Record<string, any>
2345
+ }
2346
+
2347
+ export interface RawOutputOptions {
2348
+ path: string
2349
+ pathinfo: boolean | "verbose"
2350
+ clean: boolean | JsCleanOptions
2351
+ publicPath: "auto" | JsFilename
2352
+ assetModuleFilename: JsFilename
2353
+ wasmLoading: string | false
2354
+ enabledWasmLoadingTypes: Array<string>
2355
+ webassemblyModuleFilename: string
2356
+ filename: JsFilename
2357
+ chunkFilename: JsFilename
2358
+ crossOriginLoading: string | false
2359
+ cssFilename: JsFilename
2360
+ cssChunkFilename: JsFilename
2361
+ hotUpdateMainFilename: string
2362
+ hotUpdateChunkFilename: string
2363
+ hotUpdateGlobal: string
2364
+ uniqueName: string
2365
+ chunkLoadingGlobal: string
2366
+ library?: JsLibraryOptions
2367
+ strictModuleErrorHandling: boolean
2368
+ enabledLibraryTypes?: Array<string>
2369
+ globalObject: string
2370
+ importFunctionName: string
2371
+ importMetaName: string
2372
+ iife: boolean
2373
+ module: boolean
2374
+ chunkLoading: string | false
2375
+ chunkLoadTimeout: number
2376
+ charset: boolean
2377
+ enabledChunkLoadingTypes?: Array<string>
2378
+ trustedTypes?: RawTrustedTypes
2379
+ sourceMapFilename: string
2380
+ hashFunction: string
2381
+ hashDigest: string
2382
+ hashDigestLength: number
2383
+ hashSalt?: string
2384
+ asyncChunks: boolean
2385
+ workerChunkLoading: string | false
2386
+ workerWasmLoading: string | false
2387
+ workerPublicPath: string
2388
+ scriptType: "module" | "text/javascript" | false
2389
+ environment: RawEnvironment
2390
+ compareBeforeEmit: boolean
2391
+ }
2392
+
2393
+ export interface RawParserOptions {
2394
+ type: "asset" | "css" | "css/auto" | "css/module" | "javascript" | "javascript/auto" | "javascript/dynamic" | "javascript/esm" | "json"
2395
+ asset?: RawAssetParserOptions
2396
+ css?: RawCssParserOptions
2397
+ cssAuto?: RawCssAutoParserOptions
2398
+ cssModule?: RawCssModuleParserOptions
2399
+ javascript?: RawJavascriptParserOptions
2400
+ json?: RawJsonParserOptions
2401
+ }
2402
+
2403
+ export interface RawPathData {
2404
+ filename?: string
2405
+ contentHash?: string
2406
+ url?: string
2407
+ }
2408
+
2409
+ export interface RawProgressPluginOptions {
2410
+ prefix?: string
2411
+ profile?: boolean
2412
+ template?: string
2413
+ tick?: string | Array<string>
2414
+ progressChars?: string
2415
+ handler?: (percent: number, msg: string, items: string[]) => void
2416
+ }
2417
+
2418
+ export interface RawProvideOptions {
2419
+ key: string
2420
+ shareKey: string
2421
+ shareScope: string
2422
+ version?: string | false | undefined
2423
+ eager: boolean
2424
+ singleton?: boolean
2425
+ requiredVersion?: string | false | undefined
2426
+ strictVersion?: boolean
2427
+ }
2428
+
2429
+ export interface RawRelated {
2430
+ sourceMap?: string
2431
+ }
2432
+
2433
+ export interface RawRemoteOptions {
2434
+ key: string
2435
+ external: Array<string>
2436
+ shareScope: string
2437
+ }
2438
+
2439
+ export interface RawResolveOptions {
2440
+ preferRelative?: boolean
2441
+ preferAbsolute?: boolean
2442
+ extensions?: Array<string>
2443
+ mainFiles?: Array<string>
2444
+ mainFields?: Array<string>
2445
+ conditionNames?: Array<string>
2446
+ alias?: Array<RawAliasOptionItem> | false
2447
+ fallback?: Array<RawAliasOptionItem> | false
2448
+ symlinks?: boolean
2449
+ tsconfig?: RawResolveTsconfigOptions
2450
+ modules?: Array<string>
2451
+ byDependency?: Record<string, RawResolveOptions>
2452
+ fullySpecified?: boolean
2453
+ exportsFields?: Array<string>
2454
+ descriptionFiles?: Array<string>
2455
+ enforceExtension?: boolean
2456
+ importsFields?: Array<string>
2457
+ extensionAlias?: Record<string, Array<string>>
2458
+ aliasFields?: Array<string>
2459
+ restrictions?: (string | RegExp)[]
2460
+ roots?: Array<string>
2461
+ pnp?: boolean
2462
+ }
2463
+
2464
+ export interface RawResolveOptionsWithDependencyType {
2465
+ preferRelative?: boolean
2466
+ preferAbsolute?: boolean
2467
+ extensions?: Array<string>
2468
+ mainFiles?: Array<string>
2469
+ mainFields?: Array<string>
2470
+ conditionNames?: Array<string>
2471
+ alias?: Array<RawAliasOptionItem> | false
2472
+ fallback?: Array<RawAliasOptionItem> | false
2473
+ symlinks?: boolean
2474
+ tsconfig?: RawResolveTsconfigOptions
2475
+ modules?: Array<string>
2476
+ byDependency?: Record<string, RawResolveOptions>
2477
+ fullySpecified?: boolean
2478
+ exportsFields?: Array<string>
2479
+ descriptionFiles?: Array<string>
2480
+ enforceExtension?: boolean
2481
+ importsFields?: Array<string>
2482
+ extensionAlias?: Record<string, Array<string>>
2483
+ aliasFields?: Array<string>
2484
+ restrictions?: (string | RegExp)[]
2485
+ roots?: Array<string>
2486
+ dependencyCategory?: string
2487
+ resolveToContext?: boolean
2488
+ pnp?: boolean
2489
+ }
2490
+
2491
+ export interface RawResolveTsconfigOptions {
2492
+ configFile: string
2493
+ referencesType: "auto" | "manual" | "disabled"
2494
+ references?: Array<string>
2495
+ }
2496
+
2497
+ export interface RawRsdoctorPluginOptions {
2498
+ moduleGraphFeatures: boolean | Array<'graph' | 'ids' | 'sources'>
2499
+ chunkGraphFeatures: boolean | Array<'graph' | 'assets'>
2500
+ sourceMapFeatures?: { module?: boolean; cheap?: boolean } | undefined
2501
+ }
2502
+
2503
+ export interface RawRslibPluginOptions {
2504
+ interceptApiPlugin: boolean
2505
+ }
2506
+
2507
+ export interface RawRspackFuture {
2508
+
2509
+ }
2510
+
2511
+ export interface RawRstestPluginOptions {
2512
+ injectModulePathName: boolean
2513
+ importMetaPathName: boolean
2514
+ hoistMockModule: boolean
2515
+ manualMockRoot: string
2516
+ }
2517
+
2518
+ export interface RawRuleSetCondition {
2519
+ type: RawRuleSetConditionType
2520
+ string?: string
2521
+ regexp?: RegExp
2522
+ logical?: Array<RawRuleSetLogicalConditions>
2523
+ array?: Array<RawRuleSetCondition>
2524
+ func?: (value: string) => boolean
2525
+ }
2526
+
2527
+ export declare enum RawRuleSetConditionType {
2528
+ string = 'string',
2529
+ regexp = 'regexp',
2530
+ logical = 'logical',
2531
+ array = 'array',
2532
+ func = 'func'
2533
+ }
2534
+
2535
+ export interface RawRuleSetLogicalConditions {
2536
+ and?: Array<RawRuleSetCondition>
2537
+ or?: Array<RawRuleSetCondition>
2538
+ not?: RawRuleSetCondition
2539
+ }
2540
+
2541
+ export interface RawRuntimeChunkNameFnCtx {
2542
+ name: string
2543
+ }
2544
+
2545
+ export interface RawRuntimeChunkOptions {
2546
+ name: string | ((entrypoint: { name: string }) => string)
2547
+ }
2548
+
2549
+ export interface RawSizeLimitsPluginOptions {
2550
+ assetFilter?: (assetFilename: string) => boolean
2551
+ hints?: "error" | "warning"
2552
+ maxAssetSize?: number
2553
+ maxEntrypointSize?: number
2554
+ }
2555
+
2556
+ export interface RawSplitChunkSizes {
2557
+ sizes: Record<string, number>
2558
+ }
2559
+
2560
+ export interface RawSplitChunksOptions {
2561
+ fallbackCacheGroup?: RawFallbackCacheGroupOptions
2562
+ name?: string | false | Function
2563
+ filename?: JsFilename
2564
+ cacheGroups?: Array<RawCacheGroupOptions>
2565
+ /** What kind of chunks should be selected. */
2566
+ chunks?: RegExp | 'async' | 'initial' | 'all' | Function
2567
+ usedExports?: boolean
2568
+ automaticNameDelimiter?: string
2569
+ maxAsyncRequests?: number
2570
+ maxInitialRequests?: number
2571
+ defaultSizeTypes: Array<string>
2572
+ minChunks?: number
2573
+ hidePathInfo?: boolean
2574
+ minSize?: number | RawSplitChunkSizes
2575
+ minSizeReduction?: number | RawSplitChunkSizes
2576
+ enforceSizeThreshold?: number
2577
+ minRemainingSize?: number | RawSplitChunkSizes
2578
+ maxSize?: number | RawSplitChunkSizes
2579
+ maxAsyncSize?: number | RawSplitChunkSizes
2580
+ maxInitialSize?: number | RawSplitChunkSizes
2581
+ }
2582
+
2583
+ export interface RawStatsOptions {
2584
+ colors: boolean
2585
+ }
2586
+
2587
+ export interface RawStorageOptions {
2588
+ type: "filesystem"
2589
+ directory: string
2590
+ }
2591
+
2592
+ export interface RawSubresourceIntegrityPluginOptions {
2593
+ integrityCallback?: (data: RawIntegrityData) => void
2594
+ hashFuncNames: Array<string>
2595
+ htmlPlugin: "JavaScript" | "Native" | "Disabled"
2596
+ }
2597
+
2598
+ export interface RawSwcJsMinimizerOptions {
2599
+ ecma: any
2600
+ compress: any
2601
+ mangle: any
2602
+ format: any
2603
+ module?: boolean
2604
+ minify?: boolean
2605
+ }
2606
+
2607
+ export interface RawSwcJsMinimizerRspackPluginOptions {
2608
+ test?: string | RegExp | (string | RegExp)[]
2609
+ include?: string | RegExp | (string | RegExp)[]
2610
+ exclude?: string | RegExp | (string | RegExp)[]
2611
+ extractComments?: RawExtractComments
2612
+ minimizerOptions: RawSwcJsMinimizerOptions
2613
+ }
2614
+
2615
+ export interface RawToOptions {
2616
+ context: string
2617
+ absoluteFilename?: string
2618
+ }
2619
+
2620
+ export interface RawTraceEvent {
2621
+ name: string
2622
+ trackName?: string
2623
+ processName?: string
2624
+ args?: Record<string, string>
2625
+ uuid: number
2626
+ ts: bigint
2627
+ ph: string
2628
+ categories?: Array<string>
2629
+ }
2630
+
2631
+ export interface RawTrustedTypes {
2632
+ policyName?: string
2633
+ onPolicyCreationFailure?: string
2634
+ }
2635
+
2636
+ export interface RealDependencyLocation {
2637
+ start: SourcePosition
2638
+ end?: SourcePosition
2639
+ }
2640
+
2641
+ /**
2642
+ * this is a process level tracing, which means it would be shared by all compilers in the same process
2643
+ * only the first call would take effect, the following calls would be ignored
2644
+ * Some code is modified based on
2645
+ * https://github.com/swc-project/swc/blob/d1d0607158ab40463d1b123fed52cc526eba8385/bindings/binding_core_node/src/util.rs#L29-L58
2646
+ * Apache-2.0 licensed
2647
+ * Author Donny/강동윤
2648
+ * Copyright (c)
2649
+ */
2650
+ export declare function registerGlobalTrace(filter: string, layer: "logger" | "perfetto" , output: string): void
2651
+
2652
+ export declare enum RegisterJsTapKind {
2653
+ CompilerThisCompilation = 0,
2654
+ CompilerCompilation = 1,
2655
+ CompilerMake = 2,
2656
+ CompilerFinishMake = 3,
2657
+ CompilerShouldEmit = 4,
2658
+ CompilerEmit = 5,
2659
+ CompilerAfterEmit = 6,
2660
+ CompilerAssetEmitted = 7,
2661
+ CompilationBuildModule = 8,
2662
+ CompilationStillValidModule = 9,
2663
+ CompilationSucceedModule = 10,
2664
+ CompilationExecuteModule = 11,
2665
+ CompilationFinishModules = 12,
2666
+ CompilationOptimizeModules = 13,
2667
+ CompilationAfterOptimizeModules = 14,
2668
+ CompilationOptimizeTree = 15,
2669
+ CompilationOptimizeChunkModules = 16,
2670
+ CompilationAdditionalTreeRuntimeRequirements = 17,
2671
+ CompilationRuntimeRequirementInTree = 18,
2672
+ CompilationRuntimeModule = 19,
2673
+ CompilationChunkHash = 20,
2674
+ CompilationChunkAsset = 21,
2675
+ CompilationProcessAssets = 22,
2676
+ CompilationAfterProcessAssets = 23,
2677
+ CompilationSeal = 24,
2678
+ CompilationAfterSeal = 25,
2679
+ NormalModuleFactoryBeforeResolve = 26,
2680
+ NormalModuleFactoryFactorize = 27,
2681
+ NormalModuleFactoryResolve = 28,
2682
+ NormalModuleFactoryAfterResolve = 29,
2683
+ NormalModuleFactoryCreateModule = 30,
2684
+ NormalModuleFactoryResolveForScheme = 31,
2685
+ ContextModuleFactoryBeforeResolve = 32,
2686
+ ContextModuleFactoryAfterResolve = 33,
2687
+ JavascriptModulesChunkHash = 34,
2688
+ HtmlPluginBeforeAssetTagGeneration = 35,
2689
+ HtmlPluginAlterAssetTags = 36,
2690
+ HtmlPluginAlterAssetTagGroups = 37,
2691
+ HtmlPluginAfterTemplateExecution = 38,
2692
+ HtmlPluginBeforeEmit = 39,
2693
+ HtmlPluginAfterEmit = 40,
2694
+ RuntimePluginCreateScript = 41,
2695
+ RuntimePluginLinkPreload = 42,
2696
+ RuntimePluginLinkPrefetch = 43,
2697
+ RsdoctorPluginModuleGraph = 44,
2698
+ RsdoctorPluginChunkGraph = 45,
2699
+ RsdoctorPluginModuleIds = 46,
2700
+ RsdoctorPluginModuleSources = 47,
2701
+ RsdoctorPluginAssets = 48
2702
+ }
2703
+
2704
+ export interface RegisterJsTaps {
2705
+ registerCompilerThisCompilationTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }>
2706
+ registerCompilerCompilationTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }>
2707
+ registerCompilerMakeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => Promise<void>); stage: number; }>
2708
+ registerCompilerFinishMakeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }>
2709
+ registerCompilerShouldEmitTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => boolean | undefined); stage: number; }>
2710
+ registerCompilerEmitTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
2711
+ registerCompilerAfterEmitTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
2712
+ registerCompilerAssetEmittedTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAssetEmittedArgs) => Promise<void>); stage: number; }>
2713
+ registerCompilationBuildModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: Module) => void); stage: number; }>
2714
+ registerCompilationStillValidModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: Module) => void); stage: number; }>
2715
+ registerCompilationSucceedModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: Module) => void); stage: number; }>
2716
+ registerCompilationExecuteModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: JsExecuteModuleArg) => void); stage: number; }>
2717
+ registerCompilationAdditionalTreeRuntimeRequirementsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAdditionalTreeRuntimeRequirementsArg) => JsAdditionalTreeRuntimeRequirementsResult | undefined); stage: number; }>
2718
+ registerCompilationRuntimeRequirementInTreeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRuntimeRequirementInTreeArg) => JsRuntimeRequirementInTreeResult | undefined); stage: number; }>
2719
+ registerCompilationRuntimeModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRuntimeModuleArg) => JsRuntimeModule | undefined); stage: number; }>
2720
+ registerCompilationFinishModulesTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => Promise<void>); stage: number; }>
2721
+ registerCompilationOptimizeModulesTaps: (stages: Array<number>) => Array<{ function: (() => boolean | undefined); stage: number; }>
2722
+ registerCompilationAfterOptimizeModulesTaps: (stages: Array<number>) => Array<{ function: (() => void); stage: number; }>
2723
+ registerCompilationOptimizeTreeTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
2724
+ registerCompilationOptimizeChunkModulesTaps: (stages: Array<number>) => Array<{ function: (() => Promise<boolean | undefined>); stage: number; }>
2725
+ registerCompilationChunkHashTaps: (stages: Array<number>) => Array<{ function: ((arg: Chunk) => Buffer); stage: number; }>
2726
+ registerCompilationChunkAssetTaps: (stages: Array<number>) => Array<{ function: ((arg: JsChunkAssetArgs) => void); stage: number; }>
2727
+ registerCompilationProcessAssetsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => Promise<void>); stage: number; }>
2728
+ registerCompilationAfterProcessAssetsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }>
2729
+ registerCompilationSealTaps: (stages: Array<number>) => Array<{ function: (() => void); stage: number; }>
2730
+ registerCompilationAfterSealTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
2731
+ registerNormalModuleFactoryBeforeResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: JsBeforeResolveArgs) => Promise<[boolean | undefined, JsBeforeResolveArgs]>); stage: number; }>
2732
+ registerNormalModuleFactoryFactorizeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsFactorizeArgs) => Promise<JsFactorizeArgs>); stage: number; }>
2733
+ registerNormalModuleFactoryResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: JsResolveArgs) => Promise<JsResolveArgs>); stage: number; }>
2734
+ registerNormalModuleFactoryResolveForSchemeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsResolveForSchemeArgs) => Promise<[boolean | undefined, JsResolveForSchemeArgs]>); stage: number; }>
2735
+ registerNormalModuleFactoryAfterResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: string) => Promise<[boolean | undefined, JsCreateData | undefined]>); stage: number; }>
2736
+ registerNormalModuleFactoryCreateModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: JsNormalModuleFactoryCreateModuleArgs) => Promise<void>); stage: number; }>
2737
+ registerContextModuleFactoryBeforeResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: false | JsContextModuleFactoryBeforeResolveData) => Promise<false | JsContextModuleFactoryBeforeResolveData>); stage: number; }>
2738
+ registerContextModuleFactoryAfterResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: false | JsContextModuleFactoryAfterResolveData) => Promise<false | JsContextModuleFactoryAfterResolveData>); stage: number; }>
2739
+ registerJavascriptModulesChunkHashTaps: (stages: Array<number>) => Array<{ function: ((arg: Chunk) => Buffer); stage: number; }>
2740
+ registerHtmlPluginBeforeAssetTagGenerationTaps: (stages: Array<number>) => Array<{ function: ((arg: JsBeforeAssetTagGenerationData) => JsBeforeAssetTagGenerationData); stage: number; }>
2741
+ registerHtmlPluginAlterAssetTagsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAlterAssetTagsData) => JsAlterAssetTagsData); stage: number; }>
2742
+ registerHtmlPluginAlterAssetTagGroupsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAlterAssetTagGroupsData) => JsAlterAssetTagGroupsData); stage: number; }>
2743
+ registerHtmlPluginAfterTemplateExecutionTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAfterTemplateExecutionData) => JsAfterTemplateExecutionData); stage: number; }>
2744
+ registerHtmlPluginBeforeEmitTaps: (stages: Array<number>) => Array<{ function: ((arg: JsBeforeEmitData) => JsBeforeEmitData); stage: number; }>
2745
+ registerHtmlPluginAfterEmitTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAfterEmitData) => JsAfterEmitData); stage: number; }>
2746
+ registerRuntimePluginCreateScriptTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCreateScriptData) => String); stage: number; }>
2747
+ registerRuntimePluginLinkPreloadTaps: (stages: Array<number>) => Array<{ function: ((arg: JsLinkPreloadData) => String); stage: number; }>
2748
+ registerRuntimePluginLinkPrefetchTaps: (stages: Array<number>) => Array<{ function: ((arg: JsLinkPrefetchData) => String); stage: number; }>
2749
+ registerRsdoctorPluginModuleGraphTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorModuleGraph) => Promise<boolean | undefined>); stage: number; }>
2750
+ registerRsdoctorPluginChunkGraphTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorChunkGraph) => Promise<boolean | undefined>); stage: number; }>
2751
+ registerRsdoctorPluginModuleIdsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorModuleIdsPatch) => Promise<boolean | undefined>); stage: number; }>
2752
+ registerRsdoctorPluginModuleSourcesTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorModuleSourcesPatch) => Promise<boolean | undefined>); stage: number; }>
2753
+ registerRsdoctorPluginAssetsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorAssetPatch) => Promise<boolean | undefined>); stage: number; }>
2754
+ }
2755
+
2756
+ export interface SourceMapDevToolPluginOptions {
2757
+ append?: (false | null) | string | Function
2758
+ columns?: boolean
2759
+ fallbackModuleFilenameTemplate?: string | ((info: RawModuleFilenameTemplateFnCtx) => string)
2760
+ fileContext?: string
2761
+ filename?: (false | null) | string
2762
+ module?: boolean
2763
+ moduleFilenameTemplate?: string | ((info: RawModuleFilenameTemplateFnCtx) => string)
2764
+ namespace?: string
2765
+ noSources?: boolean
2766
+ publicPath?: string
2767
+ sourceRoot?: string
2768
+ test?: string | RegExp | (string | RegExp)[]
2769
+ include?: string | RegExp | (string | RegExp)[]
2770
+ exclude?: string | RegExp | (string | RegExp)[]
2771
+ debugIds?: boolean
2772
+ }
2773
+
2774
+ export interface SourcePosition {
2775
+ line: number
2776
+ column?: number
2777
+ }
2778
+
2779
+ export declare function syncTraceEvent(events: Array<RawTraceEvent>): void
2780
+
2781
+ export interface SyntheticDependencyLocation {
2782
+ name: string
2783
+ }
2784
+
2785
+ export interface ThreadsafeNodeFS {
2786
+ writeFile: (name: string, content: Buffer) => Promise<void>
2787
+ removeFile: (name: string) => Promise<void>
2788
+ mkdir: (name: string) => Promise<void>
2789
+ mkdirp: (name: string) => Promise<string | void>
2790
+ removeDirAll: (name: string) => Promise<string | void>
2791
+ readDir: (name: string) => Promise<string[] | void>
2792
+ readFile: (name: string) => Promise<Buffer | string | void>
2793
+ stat: (name: string) => Promise<NodeFsStats | void>
2794
+ lstat: (name: string) => Promise<NodeFsStats | void>
2795
+ realpath: (name: string) => Promise<string | void>
2796
+ open: (name: string, flags: string) => Promise<number | void>
2797
+ rename: (from: string, to: string) => Promise<void>
2798
+ close: (fd: number) => Promise<void>
2799
+ write: (fd: number, content: Buffer, position: number) => Promise<number | void>
2800
+ writeAll: (fd: number, content: Buffer) => Promise<number | void>
2801
+ read: (fd: number, length: number, position: number) => Promise<Buffer | void>
2802
+ readUntil: (fd: number, code: number, position: number) => Promise<Buffer | void>
2803
+ readToEnd: (fd: number, position: number) => Promise<Buffer | void>
2804
+ chmod?: (name: string, mode: number) => Promise<void>
2805
+ }
2806
+
2807
+ export declare function transform(source: string, options: string): Promise<TransformOutput>
2808
+
2809
+ export interface TransformOutput {
2810
+ code: string
2811
+ map?: string
2812
+ diagnostics: Array<string>
2813
+ }
2814
+
2815
+ export declare function transformSync(source: string, options: string): TransformOutput