@rspack/binding 1.4.8 → 1.4.10

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 (3) hide show
  1. package/binding.d.ts +4 -2808
  2. package/napi-binding.d.ts +2806 -0
  3. package/package.json +22 -19
@@ -0,0 +1,2806 @@
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 JsRsdoctorSourcePosition {
1150
+ line?: number
1151
+ column?: number
1152
+ index?: number
1153
+ }
1154
+
1155
+ export interface JsRsdoctorSourceRange {
1156
+ start: JsRsdoctorSourcePosition
1157
+ end?: JsRsdoctorSourcePosition
1158
+ }
1159
+
1160
+ export interface JsRsdoctorStatement {
1161
+ module: number
1162
+ sourcePosition?: JsRsdoctorSourceRange
1163
+ transformedPosition: JsRsdoctorSourceRange
1164
+ }
1165
+
1166
+ export interface JsRsdoctorVariable {
1167
+ ukey: number
1168
+ name: string
1169
+ module: number
1170
+ usedInfo: string
1171
+ identififer: JsRsdoctorStatement
1172
+ exported?: number
1173
+ }
1174
+
1175
+ export interface JsRspackDiagnostic {
1176
+ severity: JsRspackSeverity
1177
+ error: RspackError
1178
+ }
1179
+
1180
+ export declare enum JsRspackSeverity {
1181
+ Error = 'Error',
1182
+ Warn = 'Warn'
1183
+ }
1184
+
1185
+ export interface JsRuntimeGlobals {
1186
+ value: Array<string>
1187
+ }
1188
+
1189
+ export interface JsRuntimeModule {
1190
+ source?: JsCompatSourceOwned
1191
+ moduleIdentifier: string
1192
+ constructorName: string
1193
+ name: string
1194
+ }
1195
+
1196
+ export interface JsRuntimeModuleArg {
1197
+ module: JsRuntimeModule
1198
+ chunk: Chunk
1199
+ }
1200
+
1201
+ export interface JsRuntimeRequirementInTreeArg {
1202
+ chunk: Chunk
1203
+ allRuntimeRequirements: JsRuntimeGlobals
1204
+ runtimeRequirements: JsRuntimeGlobals
1205
+ }
1206
+
1207
+ export interface JsRuntimeRequirementInTreeResult {
1208
+ allRuntimeRequirements: JsRuntimeGlobals
1209
+ }
1210
+
1211
+ export interface JsStatsAsset {
1212
+ type: string
1213
+ name: string
1214
+ info: JsStatsAssetInfo
1215
+ size: number
1216
+ emitted: boolean
1217
+ chunkNames: Array<string>
1218
+ chunkIdHints: Array<string>
1219
+ chunks: Array<string | undefined | null>
1220
+ auxiliaryChunkNames: Array<string>
1221
+ auxiliaryChunkIdHints: Array<string>
1222
+ auxiliaryChunks: Array<string | undefined | null>
1223
+ }
1224
+
1225
+ export interface JsStatsAssetInfo {
1226
+ minimized?: boolean
1227
+ development?: boolean
1228
+ hotModuleReplacement?: boolean
1229
+ sourceFilename?: string
1230
+ copied?: boolean
1231
+ immutable?: boolean
1232
+ javascriptModule?: boolean
1233
+ chunkhash: Array<string>
1234
+ contenthash: Array<string>
1235
+ fullhash: Array<string>
1236
+ related: Array<JsStatsAssetInfoRelated>
1237
+ isOverSizeLimit?: boolean
1238
+ }
1239
+
1240
+ export interface JsStatsAssetInfoRelated {
1241
+ name: string
1242
+ value: Array<string>
1243
+ }
1244
+
1245
+ export interface JsStatsAssetsByChunkName {
1246
+ name: string
1247
+ files: Array<string>
1248
+ }
1249
+
1250
+ export interface JsStatsChildGroupChildAssets {
1251
+ preload?: Array<string>
1252
+ prefetch?: Array<string>
1253
+ }
1254
+
1255
+ export interface JsStatsChunk {
1256
+ type: string
1257
+ files: Array<string>
1258
+ auxiliaryFiles: Array<string>
1259
+ id?: string
1260
+ idHints: Array<string>
1261
+ hash?: string
1262
+ entry: boolean
1263
+ initial: boolean
1264
+ names: Array<string>
1265
+ size: number
1266
+ parents?: Array<string>
1267
+ children?: Array<string>
1268
+ siblings?: Array<string>
1269
+ childrenByOrder: Record<string, Array<string>>
1270
+ runtime: Array<string>
1271
+ reason?: string
1272
+ rendered: boolean
1273
+ sizes: Array<JsStatsSize>
1274
+ origins: Array<JsOriginRecord>
1275
+ modules?: Array<JsStatsModule>
1276
+ }
1277
+
1278
+ export interface JsStatsChunkGroup {
1279
+ name: string
1280
+ chunks: Array<string>
1281
+ assets: Array<JsStatsChunkGroupAsset>
1282
+ assetsSize: number
1283
+ auxiliaryAssets?: Array<JsStatsChunkGroupAsset>
1284
+ auxiliaryAssetsSize?: number
1285
+ isOverSizeLimit?: boolean
1286
+ children?: JsStatsChunkGroupChildren
1287
+ childAssets?: JsStatsChildGroupChildAssets
1288
+ }
1289
+
1290
+ export interface JsStatsChunkGroupAsset {
1291
+ name: string
1292
+ size: number
1293
+ }
1294
+
1295
+ export interface JsStatsChunkGroupChildren {
1296
+ preload?: Array<JsStatsChunkGroup>
1297
+ prefetch?: Array<JsStatsChunkGroup>
1298
+ }
1299
+
1300
+ export interface JsStatsCompilation {
1301
+ assets?: Array<JsStatsAsset>
1302
+ assetsByChunkName?: Array<JsStatsAssetsByChunkName>
1303
+ chunks?: Array<JsStatsChunk>
1304
+ entrypoints?: Array<JsStatsChunkGroup>
1305
+ errors: Array<JsStatsError>
1306
+ hash?: string
1307
+ modules?: Array<JsStatsModule>
1308
+ namedChunkGroups?: Array<JsStatsChunkGroup>
1309
+ warnings: Array<JsStatsError>
1310
+ }
1311
+
1312
+ export interface JsStatsError {
1313
+ name?: string
1314
+ moduleDescriptor?: JsModuleDescriptor
1315
+ message: string
1316
+ chunkName?: string
1317
+ code?: string
1318
+ chunkEntry?: boolean
1319
+ chunkInitial?: boolean
1320
+ loc?: string
1321
+ file?: string
1322
+ chunkId?: string
1323
+ details?: string
1324
+ stack?: string
1325
+ moduleTrace: Array<JsStatsModuleTrace>
1326
+ }
1327
+
1328
+ export interface JsStatsGetAssets {
1329
+ assets: Array<JsStatsAsset>
1330
+ assetsByChunkName: Array<JsStatsAssetsByChunkName>
1331
+ }
1332
+
1333
+ export interface JsStatsLogging {
1334
+ name: string
1335
+ type: string
1336
+ args?: Array<string>
1337
+ trace?: Array<string>
1338
+ }
1339
+
1340
+ export interface JsStatsMillisecond {
1341
+ secs: number
1342
+ subsecMillis: number
1343
+ }
1344
+
1345
+ export interface JsStatsModule {
1346
+ commonAttributes: JsStatsModuleCommonAttributes
1347
+ dependent?: boolean
1348
+ issuerDescriptor?: JsModuleDescriptor
1349
+ issuerPath?: Array<JsStatsModuleIssuer>
1350
+ usedExports?: string | Array<string>
1351
+ modules?: Array<JsStatsModule>
1352
+ }
1353
+
1354
+ export interface JsStatsModuleCommonAttributes {
1355
+ type: string
1356
+ moduleType: string
1357
+ layer?: string
1358
+ size: number
1359
+ sizes: Array<JsStatsSize>
1360
+ built: boolean
1361
+ codeGenerated: boolean
1362
+ buildTimeExecuted: boolean
1363
+ cached: boolean
1364
+ moduleDescriptor?: JsModuleDescriptor
1365
+ nameForCondition?: string
1366
+ preOrderIndex?: number
1367
+ postOrderIndex?: number
1368
+ cacheable?: boolean
1369
+ optional?: boolean
1370
+ orphan?: boolean
1371
+ failed?: boolean
1372
+ errors?: number
1373
+ warnings?: number
1374
+ profile?: JsStatsModuleProfile
1375
+ chunks?: Array<string>
1376
+ assets?: Array<string>
1377
+ reasons?: Array<JsStatsModuleReason>
1378
+ providedExports?: Array<string>
1379
+ optimizationBailout?: Array<string>
1380
+ depth?: number
1381
+ source?: string | Buffer
1382
+ }
1383
+
1384
+ export interface JsStatsModuleIssuer {
1385
+ moduleDescriptor: JsModuleDescriptor
1386
+ }
1387
+
1388
+ export interface JsStatsModuleProfile {
1389
+ factory: JsStatsMillisecond
1390
+ building: JsStatsMillisecond
1391
+ }
1392
+
1393
+ export interface JsStatsModuleReason {
1394
+ moduleDescriptor?: JsModuleDescriptor
1395
+ resolvedModuleDescriptor?: JsModuleDescriptor
1396
+ moduleChunks?: number
1397
+ type?: string
1398
+ userRequest?: string
1399
+ explanation?: string
1400
+ active: boolean
1401
+ loc?: string
1402
+ }
1403
+
1404
+ export interface JsStatsModuleTrace {
1405
+ origin: JsStatsModuleTraceModule
1406
+ module: JsStatsModuleTraceModule
1407
+ dependencies: Array<JsStatsModuleTraceDependency>
1408
+ }
1409
+
1410
+ export interface JsStatsModuleTraceDependency {
1411
+ loc: string
1412
+ }
1413
+
1414
+ export interface JsStatsModuleTraceModule {
1415
+ moduleDescriptor: JsModuleDescriptor
1416
+ }
1417
+
1418
+ export interface JsStatsOptimizationBailout {
1419
+ inner: string
1420
+ }
1421
+
1422
+ export interface JsStatsOptions {
1423
+ assets: boolean
1424
+ cachedModules: boolean
1425
+ chunks: boolean
1426
+ chunkGroupAuxiliary: boolean
1427
+ chunkGroupChildren: boolean
1428
+ chunkGroups: boolean
1429
+ chunkModules: boolean
1430
+ chunkRelations: boolean
1431
+ depth: boolean
1432
+ entrypoints: boolean | string
1433
+ errors: boolean
1434
+ hash: boolean
1435
+ ids: boolean
1436
+ modules: boolean
1437
+ moduleAssets: boolean
1438
+ nestedModules: boolean
1439
+ optimizationBailout: boolean
1440
+ providedExports: boolean
1441
+ reasons: boolean
1442
+ source: boolean
1443
+ usedExports: boolean
1444
+ warnings: boolean
1445
+ }
1446
+
1447
+ export interface JsStatsSize {
1448
+ sourceType: string
1449
+ size: number
1450
+ }
1451
+
1452
+ export interface JsTap {
1453
+ function: (...args: any[]) => any
1454
+ stage: number
1455
+ }
1456
+
1457
+ export interface KnownAssetInfo {
1458
+ /** if the asset can be long term cached forever (contains a hash) */
1459
+ immutable?: boolean
1460
+ /** whether the asset is minimized */
1461
+ minimized?: boolean
1462
+ /** the value(s) of the full hash used for this asset */
1463
+ fullhash?: string | Array<string>
1464
+ /** the value(s) of the chunk hash used for this asset */
1465
+ chunkhash?: string | Array<string>
1466
+ /**
1467
+ * the value(s) of the module hash used for this asset
1468
+ * the value(s) of the content hash used for this asset
1469
+ */
1470
+ contenthash?: string | Array<string>
1471
+ /** when asset was created from a source file (potentially transformed), the original filename relative to compilation context */
1472
+ sourceFilename?: string
1473
+ /** when asset was created from a source file (potentially transformed), it should be flagged as copied */
1474
+ copied?: boolean
1475
+ /**
1476
+ * size in bytes, only set after asset has been emitted
1477
+ * when asset is only used for development and doesn't count towards user-facing assets
1478
+ */
1479
+ development?: boolean
1480
+ /** when asset ships data for updating an existing application (HMR) */
1481
+ hotModuleReplacement?: boolean
1482
+ /** when asset is javascript and an ESM */
1483
+ javascriptModule?: boolean
1484
+ /** related object to other assets, keyed by type of relation (only points from parent to child) */
1485
+ related?: JsAssetInfoRelated
1486
+ /** unused css local ident for the css chunk */
1487
+ cssUnusedIdents?: Array<string>
1488
+ /** whether this asset is over the size limit */
1489
+ isOverSizeLimit?: boolean
1490
+ }
1491
+
1492
+ export declare function loadBrowserslist(input: string | undefined | null, context: string): Array<string> | null
1493
+
1494
+ export declare function minify(source: string, options: string): Promise<TransformOutput>
1495
+
1496
+ export declare function minifySync(source: string, options: string): TransformOutput
1497
+
1498
+ export interface NativeWatcherOptions {
1499
+ followSymlinks?: boolean
1500
+ pollInterval?: number
1501
+ aggregateTimeout?: number
1502
+ /** A function that will be called with the path of a file or directory that is ignored. */
1503
+ ignored?: (path: string) => boolean
1504
+ }
1505
+
1506
+ export interface NodeFsStats {
1507
+ isFile: boolean
1508
+ isDirectory: boolean
1509
+ isSymlink: boolean
1510
+ atimeMs: number
1511
+ mtimeMs: number
1512
+ ctimeMs: number
1513
+ birthtimeMs: number
1514
+ size: number
1515
+ mode: number
1516
+ }
1517
+
1518
+ export interface PathWithInfo {
1519
+ path: string
1520
+ info: AssetInfo
1521
+ }
1522
+
1523
+ export interface RawAliasOptionItem {
1524
+ path: string
1525
+ redirect: Array<string | false>
1526
+ }
1527
+
1528
+ export interface RawAssetGeneratorDataUrlFnCtx {
1529
+ filename: string
1530
+ module: Module
1531
+ }
1532
+
1533
+ export interface RawAssetGeneratorDataUrlOptions {
1534
+ encoding?: "base64" | "false" | undefined
1535
+ mimetype?: string
1536
+ }
1537
+
1538
+ export interface RawAssetGeneratorOptions {
1539
+ emit?: boolean
1540
+ filename?: JsFilename
1541
+ outputPath?: JsFilename
1542
+ publicPath?: "auto" | JsFilename
1543
+ dataUrl?: RawAssetGeneratorDataUrlOptions | ((source: Buffer, context: RawAssetGeneratorDataUrlFnCtx) => string)
1544
+ importMode?: "url" | "preserve"
1545
+ binary?: boolean
1546
+ }
1547
+
1548
+ export interface RawAssetInlineGeneratorOptions {
1549
+ dataUrl?: RawAssetGeneratorDataUrlOptions | ((source: Buffer, context: RawAssetGeneratorDataUrlFnCtx) => string)
1550
+ binary?: boolean
1551
+ }
1552
+
1553
+ export interface RawAssetParserDataUrl {
1554
+ type: "options"
1555
+ options?: RawAssetParserDataUrlOptions
1556
+ }
1557
+
1558
+ export interface RawAssetParserDataUrlOptions {
1559
+ maxSize?: number
1560
+ }
1561
+
1562
+ export interface RawAssetParserOptions {
1563
+ dataUrlCondition?: RawAssetParserDataUrl
1564
+ }
1565
+
1566
+ export interface RawAssetResourceGeneratorOptions {
1567
+ emit?: boolean
1568
+ filename?: JsFilename
1569
+ outputPath?: JsFilename
1570
+ publicPath?: "auto" | JsFilename
1571
+ importMode?: "url" | "preserve"
1572
+ binary?: boolean
1573
+ }
1574
+
1575
+ export interface RawBannerPluginOptions {
1576
+ banner: string | ((args: { hash: string, chunk: Chunk, filename: string }) => string)
1577
+ entryOnly?: boolean
1578
+ footer?: boolean
1579
+ raw?: boolean
1580
+ stage?: number
1581
+ test?: string | RegExp | (string | RegExp)[]
1582
+ include?: string | RegExp | (string | RegExp)[]
1583
+ exclude?: string | RegExp | (string | RegExp)[]
1584
+ }
1585
+
1586
+ export interface RawBundlerInfoPluginOptions {
1587
+ version: string
1588
+ bundler: string
1589
+ force: boolean | string[]
1590
+ }
1591
+
1592
+ export interface RawCacheGroupOptions {
1593
+ key: string
1594
+ priority?: number
1595
+ test?: RegExp | string | Function
1596
+ filename?: JsFilename
1597
+ idHint?: string
1598
+ /** What kind of chunks should be selected. */
1599
+ chunks?: RegExp | 'async' | 'initial' | 'all'
1600
+ type?: RegExp | string
1601
+ layer?: RegExp | string | ((layer?: string) => boolean)
1602
+ automaticNameDelimiter?: string
1603
+ minChunks?: number
1604
+ minSize?: number | RawSplitChunkSizes
1605
+ minSizeReduction?: number | RawSplitChunkSizes
1606
+ maxSize?: number | RawSplitChunkSizes
1607
+ maxAsyncSize?: number | RawSplitChunkSizes
1608
+ maxInitialSize?: number | RawSplitChunkSizes
1609
+ maxAsyncRequests?: number
1610
+ maxInitialRequests?: number
1611
+ name?: string | false | Function
1612
+ reuseExistingChunk?: boolean
1613
+ enforce?: boolean
1614
+ usedExports?: boolean
1615
+ }
1616
+
1617
+ export interface RawCacheOptions {
1618
+ type: string
1619
+ maxGenerations?: number
1620
+ }
1621
+
1622
+ export interface RawCircularDependencyRspackPluginOptions {
1623
+ failOnError?: boolean
1624
+ allowAsyncCycles?: boolean
1625
+ exclude?: RegExp
1626
+ ignoredConnections?: Array<[string | RegExp, string | RegExp]>
1627
+ onDetected?: (entrypoint: Module, modules: string[]) => void
1628
+ onIgnored?: (entrypoint: Module, modules: string[]) => void
1629
+ onStart?: () => void
1630
+ onEnd?: () => void
1631
+ }
1632
+
1633
+ export interface RawConsumeOptions {
1634
+ key: string
1635
+ import?: string
1636
+ importResolved?: string
1637
+ shareKey: string
1638
+ shareScope: string
1639
+ requiredVersion?: string | false | undefined
1640
+ packageName?: string
1641
+ strictVersion: boolean
1642
+ singleton: boolean
1643
+ eager: boolean
1644
+ }
1645
+
1646
+ export interface RawConsumeSharedPluginOptions {
1647
+ consumes: Array<RawConsumeOptions>
1648
+ enhanced: boolean
1649
+ }
1650
+
1651
+ export interface RawContainerPluginOptions {
1652
+ name: string
1653
+ shareScope: string
1654
+ library: JsLibraryOptions
1655
+ runtime?: false | string
1656
+ filename?: string
1657
+ exposes: Array<RawExposeOptions>
1658
+ enhanced: boolean
1659
+ }
1660
+
1661
+ export interface RawContainerReferencePluginOptions {
1662
+ remoteType: string
1663
+ remotes: Array<RawRemoteOptions>
1664
+ shareScope?: string
1665
+ enhanced: boolean
1666
+ }
1667
+
1668
+ export interface RawContextReplacementPluginOptions {
1669
+ resourceRegExp: RegExp
1670
+ newContentResource?: string
1671
+ newContentRecursive?: boolean
1672
+ newContentRegExp?: RegExp
1673
+ newContentCreateContextMap?: Record<string, string>
1674
+ }
1675
+
1676
+ export interface RawCopyGlobOptions {
1677
+ /**
1678
+ * Whether the match is case sensitive
1679
+ * @default true
1680
+ */
1681
+ caseSensitiveMatch?: boolean
1682
+ /**
1683
+ * Whether to match files starting with `.`
1684
+ * @default true
1685
+ */
1686
+ dot?: boolean
1687
+ /**
1688
+ * An array of strings in glob format, which can be used to ignore specific paths
1689
+ * @default undefined
1690
+ */
1691
+ ignore?: Array<string>
1692
+ }
1693
+
1694
+ export interface RawCopyPattern {
1695
+ /**
1696
+ * The source path of the copy operation, which can be an absolute path, a relative
1697
+ * path, or a glob pattern. It can refer to a file or a directory. If a relative path
1698
+ * is passed, it is relative to the `context` option.
1699
+ * @default undefined
1700
+ */
1701
+ from: string
1702
+ /**
1703
+ * The destination path of the copy operation, which can be an absolute path, a
1704
+ * relative path, or a template string. If not specified, it is equal to Rspack's
1705
+ * `output.path`.
1706
+ * @default Rspack's `output.path`
1707
+ */
1708
+ to?: string | ((pathData: { context: string; absoluteFilename?: string }) => string | Promise<string>)
1709
+ /**
1710
+ * `context` is a path to be prepended to `from` and removed from the start of the
1711
+ * result paths. `context` can be an absolute path or a relative path. If it is a
1712
+ * relative path, then it will be converted to an absolute path based on Rspack's
1713
+ * `context`.
1714
+ * `context` should be explicitly set only when `from` contains a glob. Otherwise,
1715
+ * `context` is automatically set based on whether `from` is a file or a directory:
1716
+ * - If `from` is a file, then `context` is its directory. The result path will be
1717
+ * the filename alone.
1718
+ * - If `from` is a directory, then `context` equals `from`. The result paths will
1719
+ * be the paths of the directory's contents (including nested contents), relative
1720
+ * to the directory.
1721
+ * @default Rspack's `context`
1722
+ */
1723
+ context?: string
1724
+ /**
1725
+ * Specify the type of [to](#to), which can be a directory, a file, or a template
1726
+ * name in Rspack. If not specified, it will be automatically inferred.
1727
+ * The automatic inference rules are as follows:
1728
+ * - `dir`: If `to` has no extension, or ends on `/`.
1729
+ * - `file`: If `to` is not a directory and is not a template.
1730
+ * - `template`: If `to` contains a template pattern.
1731
+ * @default undefined
1732
+ */
1733
+ toType?: string
1734
+ /**
1735
+ * Whether to ignore the error if there are missing files or directories.
1736
+ * @default false
1737
+ */
1738
+ noErrorOnMissing: boolean
1739
+ /**
1740
+ * Whether to force the copy operation to overwrite the destination file if it
1741
+ * already exists.
1742
+ * @default false
1743
+ */
1744
+ force: boolean
1745
+ /**
1746
+ * The priority of the copy operation. The higher the priority, the earlier the copy
1747
+ * operation will be executed. When `force` is set to `true`, if a matching file is
1748
+ * found, the one with higher priority will overwrite the one with lower priority.
1749
+ * @default 0
1750
+ */
1751
+ priority: number
1752
+ /**
1753
+ * Set the glob options for the copy operation.
1754
+ * @default undefined
1755
+ */
1756
+ globOptions: RawCopyGlobOptions
1757
+ /**
1758
+ * Allows to add some assets info to the copied files, which may affect some behaviors
1759
+ * in the build process. For example, by default, the copied JS and CSS files will be
1760
+ * minified by Rspack's minimizer, if you want to skip minification for copied files,
1761
+ * you can set `info.minimized` to `true`.
1762
+ * @default undefined
1763
+ */
1764
+ info?: RawInfo
1765
+ /**
1766
+ * Determines whether to copy file permissions from the source to the destination.
1767
+ * When set to true, the plugin will preserve executable permissions and other file modes.
1768
+ * This is particularly useful when copying scripts or executable files.
1769
+ * @default false
1770
+ */
1771
+ copyPermissions?: boolean
1772
+ /**
1773
+ * Allows to modify the file contents.
1774
+ * @default undefined
1775
+ */
1776
+ transform?: { transformer: (input: Buffer, absoluteFilename: string) => string | Buffer | Promise<string> | Promise<Buffer> } | ((input: Buffer, absoluteFilename: string) => string | Buffer | Promise<string> | Promise<Buffer>)
1777
+ }
1778
+
1779
+ export interface RawCopyRspackPluginOptions {
1780
+ /** An array of objects that describe the copy operations to be performed. */
1781
+ patterns: Array<RawCopyPattern>
1782
+ }
1783
+
1784
+ export interface RawCssAutoGeneratorOptions {
1785
+ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only"
1786
+ exportsOnly?: boolean
1787
+ localIdentName?: string
1788
+ esModule?: boolean
1789
+ }
1790
+
1791
+ export interface RawCssAutoParserOptions {
1792
+ namedExports?: boolean
1793
+ url?: boolean
1794
+ }
1795
+
1796
+ export interface RawCssExtractPluginOption {
1797
+ filename: JsFilename
1798
+ chunkFilename: JsFilename
1799
+ ignoreOrder: boolean
1800
+ insert?: string
1801
+ attributes: Record<string, string>
1802
+ linkType?: string
1803
+ runtime: boolean
1804
+ pathinfo: boolean
1805
+ enforceRelative: boolean
1806
+ }
1807
+
1808
+ export interface RawCssGeneratorOptions {
1809
+ exportsOnly?: boolean
1810
+ esModule?: boolean
1811
+ }
1812
+
1813
+ export interface RawCssModuleGeneratorOptions {
1814
+ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only"
1815
+ exportsOnly?: boolean
1816
+ localIdentName?: string
1817
+ esModule?: boolean
1818
+ }
1819
+
1820
+ export interface RawCssModuleParserOptions {
1821
+ namedExports?: boolean
1822
+ url?: boolean
1823
+ }
1824
+
1825
+ export interface RawCssParserOptions {
1826
+ namedExports?: boolean
1827
+ url?: boolean
1828
+ }
1829
+
1830
+ export interface RawDllEntryPluginOptions {
1831
+ context: string
1832
+ entries: Array<string>
1833
+ name: string
1834
+ }
1835
+
1836
+ export interface RawDllManifest {
1837
+ content: Record<string, RawDllManifestContentItem>
1838
+ name?: string
1839
+ type?: string
1840
+ }
1841
+
1842
+ export interface RawDllManifestContentItem {
1843
+ buildMeta?: JsBuildMeta
1844
+ exports?: string[] | true
1845
+ id?: number | string
1846
+ }
1847
+
1848
+ export interface RawDllReferenceAgencyPluginOptions {
1849
+ context?: string
1850
+ name?: string
1851
+ extensions: Array<string>
1852
+ scope?: string
1853
+ sourceType?: string
1854
+ type: string
1855
+ content?: Record<string, RawDllManifestContentItem>
1856
+ manifest?: RawDllManifest
1857
+ }
1858
+
1859
+ export interface RawDraft {
1860
+ customMedia: boolean
1861
+ }
1862
+
1863
+ export interface RawDynamicEntryPluginOptions {
1864
+ context: string
1865
+ entry: () => Promise<RawEntryDynamicResult[]>
1866
+ }
1867
+
1868
+ export interface RawEntryDynamicResult {
1869
+ import: Array<string>
1870
+ options: JsEntryOptions
1871
+ }
1872
+
1873
+ export interface RawEnvironment {
1874
+ const?: boolean
1875
+ arrowFunction?: boolean
1876
+ nodePrefixForCoreModules?: boolean
1877
+ asyncFunction?: boolean
1878
+ bigIntLiteral?: boolean
1879
+ destructuring?: boolean
1880
+ document?: boolean
1881
+ dynamicImport?: boolean
1882
+ forOf?: boolean
1883
+ globalThis?: boolean
1884
+ module?: boolean
1885
+ optionalChaining?: boolean
1886
+ templateLiteral?: boolean
1887
+ dynamicImportInWorker?: boolean
1888
+ }
1889
+
1890
+ export interface RawEvalDevToolModulePluginOptions {
1891
+ namespace?: string
1892
+ moduleFilenameTemplate?: string | ((info: RawModuleFilenameTemplateFnCtx) => string)
1893
+ sourceUrlComment?: string
1894
+ }
1895
+
1896
+ export interface RawExperimentCacheOptionsPersistent {
1897
+ buildDependencies?: Array<string>
1898
+ version?: string
1899
+ snapshot?: RawExperimentSnapshotOptions
1900
+ storage?: RawStorageOptions
1901
+ }
1902
+
1903
+ export interface RawExperiments {
1904
+ layers: boolean
1905
+ topLevelAwait: boolean
1906
+ incremental?: false | { [key: string]: boolean }
1907
+ parallelCodeSplitting: boolean
1908
+ rspackFuture?: RawRspackFuture
1909
+ cache: boolean | { type: "persistent" } & RawExperimentCacheOptionsPersistent | { type: "memory" }
1910
+ useInputFileSystem?: false | Array<RegExp>
1911
+ inlineConst: boolean
1912
+ inlineEnum: boolean
1913
+ typeReexportsPresence: boolean
1914
+ }
1915
+
1916
+ export interface RawExperimentSnapshotOptions {
1917
+ immutablePaths: Array<string|RegExp>
1918
+ unmanagedPaths: Array<string|RegExp>
1919
+ managedPaths: Array<string|RegExp>
1920
+ }
1921
+
1922
+ export interface RawExposeOptions {
1923
+ key: string
1924
+ name?: string
1925
+ import: Array<string>
1926
+ }
1927
+
1928
+ export interface RawExternalItemFnCtxData {
1929
+ request: string
1930
+ context: string
1931
+ dependencyType: string
1932
+ contextInfo: ContextInfo
1933
+ }
1934
+
1935
+ export interface RawExternalItemFnResult {
1936
+ externalType?: string
1937
+ result?: string | boolean | string[] | Record<string, string[]>
1938
+ }
1939
+
1940
+ export interface RawExternalsPluginOptions {
1941
+ type: string
1942
+ externals: (string | RegExp | Record<string, string | boolean | string[] | Record<string, string[]>> | ((...args: any[]) => any))[]
1943
+ }
1944
+
1945
+ export interface RawExternalsPresets {
1946
+ node: boolean
1947
+ web: boolean
1948
+ electron: boolean
1949
+ electronMain: boolean
1950
+ electronPreload: boolean
1951
+ electronRenderer: boolean
1952
+ }
1953
+
1954
+ export interface RawExtractComments {
1955
+ banner?: string | boolean
1956
+ condition?: string
1957
+ }
1958
+
1959
+ export interface RawFallbackCacheGroupOptions {
1960
+ chunks?: RegExp | 'async' | 'initial' | 'all'
1961
+ minSize?: number | RawSplitChunkSizes
1962
+ maxSize?: number | RawSplitChunkSizes
1963
+ maxAsyncSize?: number | RawSplitChunkSizes
1964
+ maxInitialSize?: number | RawSplitChunkSizes
1965
+ automaticNameDelimiter?: string
1966
+ }
1967
+
1968
+ export interface RawFlagAllModulesAsUsedPluginOptions {
1969
+ explanation: string
1970
+ }
1971
+
1972
+ export interface RawFuncUseCtx {
1973
+ resource?: string
1974
+ realResource?: string
1975
+ resourceQuery: string
1976
+ resourceFragment: string
1977
+ issuer: string
1978
+ issuerLayer: string
1979
+ }
1980
+
1981
+ export interface RawGeneratorOptions {
1982
+ type: "asset" | "asset/inline" | "asset/resource" | "css" | "css/auto" | "css/module" | "json"
1983
+ asset?: RawAssetGeneratorOptions
1984
+ assetInline?: RawAssetInlineGeneratorOptions
1985
+ assetResource?: RawAssetResourceGeneratorOptions
1986
+ css?: RawCssGeneratorOptions
1987
+ cssAuto?: RawCssAutoGeneratorOptions
1988
+ cssModule?: RawCssModuleGeneratorOptions
1989
+ json?: RawJsonGeneratorOptions
1990
+ }
1991
+
1992
+ export interface RawHtmlRspackPluginBaseOptions {
1993
+ href?: string
1994
+ target?: "_self" | "_blank" | "_parent" | "_top"
1995
+ }
1996
+
1997
+ export interface RawHtmlRspackPluginOptions {
1998
+ /** emitted file name in output path */
1999
+ filename?: string[]
2000
+ /** template html file */
2001
+ template?: string
2002
+ templateFn?: (data: string) => Promise<string>
2003
+ templateContent?: string
2004
+ templateParameters?: boolean | Record<string, any> | ((params: string) => Promise<string>)
2005
+ /** "head", "body" or "false" */
2006
+ inject: "head" | "body" | "false"
2007
+ /** path or `auto` */
2008
+ publicPath?: string
2009
+ /** `blocking`, `defer`, `module` or `systemjs-module` */
2010
+ scriptLoading: "blocking" | "defer" | "module" | "systemjs-module"
2011
+ /** entry_chunk_name (only entry chunks are supported) */
2012
+ chunks?: Array<string>
2013
+ excludeChunks?: Array<string>
2014
+ chunksSortMode: "auto" | "manual"
2015
+ sri?: "sha256" | "sha384" | "sha512"
2016
+ minify?: boolean
2017
+ title?: string
2018
+ favicon?: string
2019
+ meta?: Record<string, Record<string, string>>
2020
+ hash?: boolean
2021
+ base?: RawHtmlRspackPluginBaseOptions
2022
+ uid?: number
2023
+ }
2024
+
2025
+ export interface RawHttpExternalsRspackPluginOptions {
2026
+ css: boolean
2027
+ webAsync: boolean
2028
+ }
2029
+
2030
+ export interface RawHttpUriPluginOptions {
2031
+ allowedUris: (string | RegExp)[]
2032
+ lockfileLocation?: string
2033
+ cacheLocation?: string
2034
+ upgrade: boolean
2035
+ httpClient: (url: string, headers: Record<string, string>) => Promise<JsHttpResponseRaw>
2036
+ }
2037
+
2038
+ export interface RawIgnorePluginOptions {
2039
+ resourceRegExp?: RegExp
2040
+ contextRegExp?: RegExp
2041
+ checkResource?: (resource: string, context: string) => boolean
2042
+ }
2043
+
2044
+ export interface RawIncremental {
2045
+ silent: boolean
2046
+ make: boolean
2047
+ inferAsyncModules: boolean
2048
+ providedExports: boolean
2049
+ dependenciesDiagnostics: boolean
2050
+ sideEffects: boolean
2051
+ buildChunkGraph: boolean
2052
+ moduleIds: boolean
2053
+ chunkIds: boolean
2054
+ modulesHashes: boolean
2055
+ modulesCodegen: boolean
2056
+ modulesRuntimeRequirements: boolean
2057
+ chunksRuntimeRequirements: boolean
2058
+ chunksHashes: boolean
2059
+ chunksRender: boolean
2060
+ emitAssets: boolean
2061
+ }
2062
+
2063
+ export interface RawInfo {
2064
+ immutable?: boolean
2065
+ /**
2066
+ * Whether to skip minification for the copied files.
2067
+ * @default false
2068
+ */
2069
+ minimized?: boolean
2070
+ chunkHash?: Array<string>
2071
+ contentHash?: Array<string>
2072
+ development?: boolean
2073
+ hotModuleReplacement?: boolean
2074
+ related?: RawRelated
2075
+ version?: string
2076
+ }
2077
+
2078
+ export interface RawIntegrityData {
2079
+ integerities: Array<RawIntegrityItem>
2080
+ }
2081
+
2082
+ export interface RawIntegrityItem {
2083
+ asset: string
2084
+ integrity: string
2085
+ }
2086
+
2087
+ export interface RawJavascriptParserOptions {
2088
+ dynamicImportMode?: string
2089
+ dynamicImportPreload?: string
2090
+ dynamicImportPrefetch?: string
2091
+ dynamicImportFetchPriority?: string
2092
+ url?: string
2093
+ exprContextCritical?: boolean
2094
+ wrappedContextCritical?: boolean
2095
+ wrappedContextRegExp?: RegExp
2096
+ exportsPresence?: string
2097
+ importExportsPresence?: string
2098
+ reexportExportsPresence?: string
2099
+ strictExportPresence?: boolean
2100
+ worker?: Array<string>
2101
+ overrideStrict?: string
2102
+ importMeta?: boolean
2103
+ /**
2104
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2105
+ * @experimental
2106
+ */
2107
+ requireAsExpression?: boolean
2108
+ /**
2109
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2110
+ * @experimental
2111
+ */
2112
+ requireDynamic?: boolean
2113
+ /**
2114
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2115
+ * @experimental
2116
+ */
2117
+ requireResolve?: boolean
2118
+ /**
2119
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2120
+ * @experimental
2121
+ */
2122
+ importDynamic?: boolean
2123
+ /**
2124
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2125
+ * @experimental
2126
+ */
2127
+ inlineConst?: boolean
2128
+ /**
2129
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2130
+ * @experimental
2131
+ */
2132
+ typeReexportsPresence?: string
2133
+ }
2134
+
2135
+ export interface RawJsonGeneratorOptions {
2136
+ JSONParse?: boolean
2137
+ }
2138
+
2139
+ export interface RawJsonParserOptions {
2140
+ exportsDepth?: number
2141
+ parse?: (source: string) => string
2142
+ }
2143
+
2144
+ export interface RawLazyCompilationOption {
2145
+ module: ((err: Error | null, arg: RawModuleArg) => RawModuleInfo)
2146
+ test?: RawLazyCompilationTest
2147
+ entries: boolean
2148
+ imports: boolean
2149
+ cacheable: boolean
2150
+ }
2151
+
2152
+ export interface RawLibManifestPluginOptions {
2153
+ context?: string
2154
+ entryOnly?: boolean
2155
+ name?: JsFilename
2156
+ path: JsFilename
2157
+ format?: boolean
2158
+ type?: string
2159
+ }
2160
+
2161
+ export interface RawLightningCssBrowsers {
2162
+ android?: number
2163
+ chrome?: number
2164
+ edge?: number
2165
+ firefox?: number
2166
+ ie?: number
2167
+ ios_saf?: number
2168
+ opera?: number
2169
+ safari?: number
2170
+ samsung?: number
2171
+ }
2172
+
2173
+ export interface RawLightningCssMinimizerOptions {
2174
+ errorRecovery: boolean
2175
+ targets?: Array<string>
2176
+ include?: number
2177
+ exclude?: number
2178
+ draft?: RawDraft
2179
+ drafts?: RawDraft
2180
+ nonStandard?: RawNonStandard
2181
+ pseudoClasses?: RawLightningCssPseudoClasses
2182
+ unusedSymbols: Array<string>
2183
+ }
2184
+
2185
+ export interface RawLightningCssMinimizerRspackPluginOptions {
2186
+ test?: string | RegExp | (string | RegExp)[]
2187
+ include?: string | RegExp | (string | RegExp)[]
2188
+ exclude?: string | RegExp | (string | RegExp)[]
2189
+ removeUnusedLocalIdents: boolean
2190
+ minimizerOptions: RawLightningCssMinimizerOptions
2191
+ }
2192
+
2193
+ export interface RawLightningCssPseudoClasses {
2194
+ hover?: string
2195
+ active?: string
2196
+ focus?: string
2197
+ focusVisible?: string
2198
+ focusWithin?: string
2199
+ }
2200
+
2201
+ export interface RawLimitChunkCountPluginOptions {
2202
+ chunkOverhead?: number
2203
+ entryChunkMultiplicator?: number
2204
+ maxChunks: number
2205
+ }
2206
+
2207
+ export interface RawModuleArg {
2208
+ module: string
2209
+ path: string
2210
+ }
2211
+
2212
+ export interface RawModuleFederationRuntimePluginOptions {
2213
+ entryRuntime?: string | undefined
2214
+ }
2215
+
2216
+ export interface RawModuleFilenameTemplateFnCtx {
2217
+ identifier: string
2218
+ shortIdentifier: string
2219
+ resource: string
2220
+ resourcePath: string
2221
+ absoluteResourcePath: string
2222
+ loaders: string
2223
+ allLoaders: string
2224
+ query: string
2225
+ moduleId: string
2226
+ hash: string
2227
+ namespace: string
2228
+ }
2229
+
2230
+ export interface RawModuleInfo {
2231
+ active: boolean
2232
+ client: string
2233
+ data: string
2234
+ }
2235
+
2236
+ export interface RawModuleOptions {
2237
+ rules: Array<RawModuleRule>
2238
+ parser?: Record<string, RawParserOptions>
2239
+ generator?: Record<string, RawGeneratorOptions>
2240
+ noParse?: string | RegExp | ((request: string) => boolean) | (string | RegExp | ((request: string) => boolean))[]
2241
+ }
2242
+
2243
+ export interface RawModuleRule {
2244
+ /**
2245
+ * A conditional match matching an absolute path + query + fragment.
2246
+ * Note:
2247
+ * This is a custom matching rule not initially designed by webpack.
2248
+ * Only for single-threaded environment interoperation purpose.
2249
+ */
2250
+ rspackResource?: RawRuleSetCondition
2251
+ /** A condition matcher matching an absolute path. */
2252
+ test?: RawRuleSetCondition
2253
+ include?: RawRuleSetCondition
2254
+ exclude?: RawRuleSetCondition
2255
+ /** A condition matcher matching an absolute path. */
2256
+ resource?: RawRuleSetCondition
2257
+ /** A condition matcher against the resource query. */
2258
+ resourceQuery?: RawRuleSetCondition
2259
+ resourceFragment?: RawRuleSetCondition
2260
+ descriptionData?: Record<string, RawRuleSetCondition>
2261
+ with?: Record<string, RawRuleSetCondition>
2262
+ sideEffects?: boolean
2263
+ use?: RawModuleRuleUse[] | ((arg: RawFuncUseCtx) => RawModuleRuleUse[])
2264
+ type?: string
2265
+ layer?: string
2266
+ parser?: RawParserOptions
2267
+ generator?: RawGeneratorOptions
2268
+ resolve?: RawResolveOptions
2269
+ issuer?: RawRuleSetCondition
2270
+ issuerLayer?: RawRuleSetCondition
2271
+ dependency?: RawRuleSetCondition
2272
+ scheme?: RawRuleSetCondition
2273
+ mimetype?: RawRuleSetCondition
2274
+ oneOf?: Array<RawModuleRule>
2275
+ rules?: Array<RawModuleRule>
2276
+ /** Specifies the category of the loader. No value means normal loader. */
2277
+ enforce?: 'pre' | 'post'
2278
+ }
2279
+
2280
+ /**
2281
+ * `loader` is for both JS and Rust loaders.
2282
+ * `options` is
2283
+ * - a `None` on rust side and handled by js side `getOptions` when
2284
+ * using with `loader`.
2285
+ * - a `Some(string)` on rust side, deserialized by `serde_json::from_str`
2286
+ * and passed to rust side loader in [get_builtin_loader] when using with
2287
+ * `builtin_loader`.
2288
+ */
2289
+ export interface RawModuleRuleUse {
2290
+ loader: string
2291
+ options?: string
2292
+ }
2293
+
2294
+ export interface RawNodeOption {
2295
+ dirname: string
2296
+ filename: string
2297
+ global: string
2298
+ }
2299
+
2300
+ export interface RawNonStandard {
2301
+ deepSelectorCombinator: boolean
2302
+ }
2303
+
2304
+ export interface RawOccurrenceChunkIdsPluginOptions {
2305
+ prioritiseInitial?: boolean
2306
+ }
2307
+
2308
+ export interface RawOptimizationOptions {
2309
+ removeAvailableModules: boolean
2310
+ sideEffects: boolean | string
2311
+ usedExports: boolean | string
2312
+ providedExports: boolean
2313
+ innerGraph: boolean
2314
+ realContentHash: boolean
2315
+ mangleExports: boolean | string
2316
+ concatenateModules: boolean
2317
+ avoidEntryIife: boolean
2318
+ }
2319
+
2320
+ export interface RawOptions {
2321
+ name?: string
2322
+ mode?: undefined | 'production' | 'development' | 'none'
2323
+ context: string
2324
+ output: RawOutputOptions
2325
+ resolve: RawResolveOptions
2326
+ resolveLoader: RawResolveOptions
2327
+ module: RawModuleOptions
2328
+ optimization: RawOptimizationOptions
2329
+ stats: RawStatsOptions
2330
+ cache: RawCacheOptions
2331
+ experiments: RawExperiments
2332
+ node?: RawNodeOption
2333
+ profile: boolean
2334
+ amd?: string
2335
+ bail: boolean
2336
+ __references: Record<string, any>
2337
+ }
2338
+
2339
+ export interface RawOutputOptions {
2340
+ path: string
2341
+ pathinfo: boolean | "verbose"
2342
+ clean: boolean | JsCleanOptions
2343
+ publicPath: "auto" | JsFilename
2344
+ assetModuleFilename: JsFilename
2345
+ wasmLoading: string | false
2346
+ enabledWasmLoadingTypes: Array<string>
2347
+ webassemblyModuleFilename: string
2348
+ filename: JsFilename
2349
+ chunkFilename: JsFilename
2350
+ crossOriginLoading: string | false
2351
+ cssFilename: JsFilename
2352
+ cssChunkFilename: JsFilename
2353
+ hotUpdateMainFilename: string
2354
+ hotUpdateChunkFilename: string
2355
+ hotUpdateGlobal: string
2356
+ uniqueName: string
2357
+ chunkLoadingGlobal: string
2358
+ library?: JsLibraryOptions
2359
+ strictModuleErrorHandling: boolean
2360
+ enabledLibraryTypes?: Array<string>
2361
+ globalObject: string
2362
+ importFunctionName: string
2363
+ importMetaName: string
2364
+ iife: boolean
2365
+ module: boolean
2366
+ chunkLoading: string | false
2367
+ chunkLoadTimeout: number
2368
+ charset: boolean
2369
+ enabledChunkLoadingTypes?: Array<string>
2370
+ trustedTypes?: RawTrustedTypes
2371
+ sourceMapFilename: string
2372
+ hashFunction: string
2373
+ hashDigest: string
2374
+ hashDigestLength: number
2375
+ hashSalt?: string
2376
+ asyncChunks: boolean
2377
+ workerChunkLoading: string | false
2378
+ workerWasmLoading: string | false
2379
+ workerPublicPath: string
2380
+ scriptType: "module" | "text/javascript" | false
2381
+ environment: RawEnvironment
2382
+ compareBeforeEmit: boolean
2383
+ }
2384
+
2385
+ export interface RawParserOptions {
2386
+ type: "asset" | "css" | "css/auto" | "css/module" | "javascript" | "javascript/auto" | "javascript/dynamic" | "javascript/esm" | "json"
2387
+ asset?: RawAssetParserOptions
2388
+ css?: RawCssParserOptions
2389
+ cssAuto?: RawCssAutoParserOptions
2390
+ cssModule?: RawCssModuleParserOptions
2391
+ javascript?: RawJavascriptParserOptions
2392
+ json?: RawJsonParserOptions
2393
+ }
2394
+
2395
+ export interface RawPathData {
2396
+ filename?: string
2397
+ contentHash?: string
2398
+ url?: string
2399
+ }
2400
+
2401
+ export interface RawProgressPluginOptions {
2402
+ prefix?: string
2403
+ profile?: boolean
2404
+ template?: string
2405
+ tick?: string | Array<string>
2406
+ progressChars?: string
2407
+ handler?: (percent: number, msg: string, items: string[]) => void
2408
+ }
2409
+
2410
+ export interface RawProvideOptions {
2411
+ key: string
2412
+ shareKey: string
2413
+ shareScope: string
2414
+ version?: string | false | undefined
2415
+ eager: boolean
2416
+ singleton?: boolean
2417
+ requiredVersion?: string | false | undefined
2418
+ strictVersion?: boolean
2419
+ }
2420
+
2421
+ export interface RawRelated {
2422
+ sourceMap?: string
2423
+ }
2424
+
2425
+ export interface RawRemoteOptions {
2426
+ key: string
2427
+ external: Array<string>
2428
+ shareScope: string
2429
+ }
2430
+
2431
+ export interface RawResolveOptions {
2432
+ preferRelative?: boolean
2433
+ preferAbsolute?: boolean
2434
+ extensions?: Array<string>
2435
+ mainFiles?: Array<string>
2436
+ mainFields?: Array<string>
2437
+ conditionNames?: Array<string>
2438
+ alias?: Array<RawAliasOptionItem> | false
2439
+ fallback?: Array<RawAliasOptionItem> | false
2440
+ symlinks?: boolean
2441
+ tsconfig?: RawResolveTsconfigOptions
2442
+ modules?: Array<string>
2443
+ byDependency?: Record<string, RawResolveOptions>
2444
+ fullySpecified?: boolean
2445
+ exportsFields?: Array<string>
2446
+ descriptionFiles?: Array<string>
2447
+ enforceExtension?: boolean
2448
+ importsFields?: Array<string>
2449
+ extensionAlias?: Record<string, Array<string>>
2450
+ aliasFields?: Array<string>
2451
+ restrictions?: (string | RegExp)[]
2452
+ roots?: Array<string>
2453
+ pnp?: boolean
2454
+ }
2455
+
2456
+ export interface RawResolveOptionsWithDependencyType {
2457
+ preferRelative?: boolean
2458
+ preferAbsolute?: boolean
2459
+ extensions?: Array<string>
2460
+ mainFiles?: Array<string>
2461
+ mainFields?: Array<string>
2462
+ conditionNames?: Array<string>
2463
+ alias?: Array<RawAliasOptionItem> | false
2464
+ fallback?: Array<RawAliasOptionItem> | false
2465
+ symlinks?: boolean
2466
+ tsconfig?: RawResolveTsconfigOptions
2467
+ modules?: Array<string>
2468
+ byDependency?: Record<string, RawResolveOptions>
2469
+ fullySpecified?: boolean
2470
+ exportsFields?: Array<string>
2471
+ descriptionFiles?: Array<string>
2472
+ enforceExtension?: boolean
2473
+ importsFields?: Array<string>
2474
+ extensionAlias?: Record<string, Array<string>>
2475
+ aliasFields?: Array<string>
2476
+ restrictions?: (string | RegExp)[]
2477
+ roots?: Array<string>
2478
+ dependencyCategory?: string
2479
+ resolveToContext?: boolean
2480
+ pnp?: boolean
2481
+ }
2482
+
2483
+ export interface RawResolveTsconfigOptions {
2484
+ configFile: string
2485
+ referencesType: "auto" | "manual" | "disabled"
2486
+ references?: Array<string>
2487
+ }
2488
+
2489
+ export interface RawRsdoctorPluginOptions {
2490
+ moduleGraphFeatures: boolean | Array<'graph' | 'ids' | 'sources'>
2491
+ chunkGraphFeatures: boolean | Array<'graph' | 'assets'>
2492
+ }
2493
+
2494
+ export interface RawRslibPluginOptions {
2495
+ interceptApiPlugin: boolean
2496
+ }
2497
+
2498
+ export interface RawRspackFuture {
2499
+
2500
+ }
2501
+
2502
+ export interface RawRstestPluginOptions {
2503
+ injectModulePathName: boolean
2504
+ importMetaPathName: boolean
2505
+ hoistMockModule: boolean
2506
+ manualMockRoot: string
2507
+ }
2508
+
2509
+ export interface RawRuleSetCondition {
2510
+ type: RawRuleSetConditionType
2511
+ string?: string
2512
+ regexp?: RegExp
2513
+ logical?: Array<RawRuleSetLogicalConditions>
2514
+ array?: Array<RawRuleSetCondition>
2515
+ func?: (value: string) => boolean
2516
+ }
2517
+
2518
+ export declare enum RawRuleSetConditionType {
2519
+ string = 'string',
2520
+ regexp = 'regexp',
2521
+ logical = 'logical',
2522
+ array = 'array',
2523
+ func = 'func'
2524
+ }
2525
+
2526
+ export interface RawRuleSetLogicalConditions {
2527
+ and?: Array<RawRuleSetCondition>
2528
+ or?: Array<RawRuleSetCondition>
2529
+ not?: RawRuleSetCondition
2530
+ }
2531
+
2532
+ export interface RawRuntimeChunkNameFnCtx {
2533
+ name: string
2534
+ }
2535
+
2536
+ export interface RawRuntimeChunkOptions {
2537
+ name: string | ((entrypoint: { name: string }) => string)
2538
+ }
2539
+
2540
+ export interface RawSizeLimitsPluginOptions {
2541
+ assetFilter?: (assetFilename: string) => boolean
2542
+ hints?: "error" | "warning"
2543
+ maxAssetSize?: number
2544
+ maxEntrypointSize?: number
2545
+ }
2546
+
2547
+ export interface RawSplitChunkSizes {
2548
+ sizes: Record<string, number>
2549
+ }
2550
+
2551
+ export interface RawSplitChunksOptions {
2552
+ fallbackCacheGroup?: RawFallbackCacheGroupOptions
2553
+ name?: string | false | Function
2554
+ filename?: JsFilename
2555
+ cacheGroups?: Array<RawCacheGroupOptions>
2556
+ /** What kind of chunks should be selected. */
2557
+ chunks?: RegExp | 'async' | 'initial' | 'all' | Function
2558
+ usedExports?: boolean
2559
+ automaticNameDelimiter?: string
2560
+ maxAsyncRequests?: number
2561
+ maxInitialRequests?: number
2562
+ defaultSizeTypes: Array<string>
2563
+ minChunks?: number
2564
+ hidePathInfo?: boolean
2565
+ minSize?: number | RawSplitChunkSizes
2566
+ minSizeReduction?: number | RawSplitChunkSizes
2567
+ enforceSizeThreshold?: number
2568
+ minRemainingSize?: number | RawSplitChunkSizes
2569
+ maxSize?: number | RawSplitChunkSizes
2570
+ maxAsyncSize?: number | RawSplitChunkSizes
2571
+ maxInitialSize?: number | RawSplitChunkSizes
2572
+ }
2573
+
2574
+ export interface RawStatsOptions {
2575
+ colors: boolean
2576
+ }
2577
+
2578
+ export interface RawStorageOptions {
2579
+ type: "filesystem"
2580
+ directory: string
2581
+ }
2582
+
2583
+ export interface RawSubresourceIntegrityPluginOptions {
2584
+ integrityCallback?: (data: RawIntegrityData) => void
2585
+ hashFuncNames: Array<string>
2586
+ htmlPlugin: "JavaScript" | "Native" | "Disabled"
2587
+ }
2588
+
2589
+ export interface RawSwcJsMinimizerOptions {
2590
+ ecma: any
2591
+ compress: any
2592
+ mangle: any
2593
+ format: any
2594
+ module?: boolean
2595
+ minify?: boolean
2596
+ }
2597
+
2598
+ export interface RawSwcJsMinimizerRspackPluginOptions {
2599
+ test?: string | RegExp | (string | RegExp)[]
2600
+ include?: string | RegExp | (string | RegExp)[]
2601
+ exclude?: string | RegExp | (string | RegExp)[]
2602
+ extractComments?: RawExtractComments
2603
+ minimizerOptions: RawSwcJsMinimizerOptions
2604
+ }
2605
+
2606
+ export interface RawToOptions {
2607
+ context: string
2608
+ absoluteFilename?: string
2609
+ }
2610
+
2611
+ export interface RawTraceEvent {
2612
+ name: string
2613
+ trackName?: string
2614
+ processName?: string
2615
+ args?: Record<string, string>
2616
+ uuid: number
2617
+ ts: bigint
2618
+ ph: string
2619
+ categories?: Array<string>
2620
+ }
2621
+
2622
+ export interface RawTrustedTypes {
2623
+ policyName?: string
2624
+ onPolicyCreationFailure?: string
2625
+ }
2626
+
2627
+ export interface RealDependencyLocation {
2628
+ start: SourcePosition
2629
+ end?: SourcePosition
2630
+ }
2631
+
2632
+ /**
2633
+ * this is a process level tracing, which means it would be shared by all compilers in the same process
2634
+ * only the first call would take effect, the following calls would be ignored
2635
+ * Some code is modified based on
2636
+ * https://github.com/swc-project/swc/blob/d1d0607158ab40463d1b123fed52cc526eba8385/bindings/binding_core_node/src/util.rs#L29-L58
2637
+ * Apache-2.0 licensed
2638
+ * Author Donny/강동윤
2639
+ * Copyright (c)
2640
+ */
2641
+ export declare function registerGlobalTrace(filter: string, layer: "logger" | "perfetto" , output: string): void
2642
+
2643
+ export declare enum RegisterJsTapKind {
2644
+ CompilerThisCompilation = 0,
2645
+ CompilerCompilation = 1,
2646
+ CompilerMake = 2,
2647
+ CompilerFinishMake = 3,
2648
+ CompilerShouldEmit = 4,
2649
+ CompilerEmit = 5,
2650
+ CompilerAfterEmit = 6,
2651
+ CompilerAssetEmitted = 7,
2652
+ CompilationBuildModule = 8,
2653
+ CompilationStillValidModule = 9,
2654
+ CompilationSucceedModule = 10,
2655
+ CompilationExecuteModule = 11,
2656
+ CompilationFinishModules = 12,
2657
+ CompilationOptimizeModules = 13,
2658
+ CompilationAfterOptimizeModules = 14,
2659
+ CompilationOptimizeTree = 15,
2660
+ CompilationOptimizeChunkModules = 16,
2661
+ CompilationAdditionalTreeRuntimeRequirements = 17,
2662
+ CompilationRuntimeRequirementInTree = 18,
2663
+ CompilationRuntimeModule = 19,
2664
+ CompilationChunkHash = 20,
2665
+ CompilationChunkAsset = 21,
2666
+ CompilationProcessAssets = 22,
2667
+ CompilationAfterProcessAssets = 23,
2668
+ CompilationSeal = 24,
2669
+ CompilationAfterSeal = 25,
2670
+ NormalModuleFactoryBeforeResolve = 26,
2671
+ NormalModuleFactoryFactorize = 27,
2672
+ NormalModuleFactoryResolve = 28,
2673
+ NormalModuleFactoryAfterResolve = 29,
2674
+ NormalModuleFactoryCreateModule = 30,
2675
+ NormalModuleFactoryResolveForScheme = 31,
2676
+ ContextModuleFactoryBeforeResolve = 32,
2677
+ ContextModuleFactoryAfterResolve = 33,
2678
+ JavascriptModulesChunkHash = 34,
2679
+ HtmlPluginBeforeAssetTagGeneration = 35,
2680
+ HtmlPluginAlterAssetTags = 36,
2681
+ HtmlPluginAlterAssetTagGroups = 37,
2682
+ HtmlPluginAfterTemplateExecution = 38,
2683
+ HtmlPluginBeforeEmit = 39,
2684
+ HtmlPluginAfterEmit = 40,
2685
+ RuntimePluginCreateScript = 41,
2686
+ RuntimePluginLinkPreload = 42,
2687
+ RuntimePluginLinkPrefetch = 43,
2688
+ RsdoctorPluginModuleGraph = 44,
2689
+ RsdoctorPluginChunkGraph = 45,
2690
+ RsdoctorPluginModuleIds = 46,
2691
+ RsdoctorPluginModuleSources = 47,
2692
+ RsdoctorPluginAssets = 48
2693
+ }
2694
+
2695
+ export interface RegisterJsTaps {
2696
+ registerCompilerThisCompilationTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }>
2697
+ registerCompilerCompilationTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }>
2698
+ registerCompilerMakeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => Promise<void>); stage: number; }>
2699
+ registerCompilerFinishMakeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }>
2700
+ registerCompilerShouldEmitTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => boolean | undefined); stage: number; }>
2701
+ registerCompilerEmitTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
2702
+ registerCompilerAfterEmitTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
2703
+ registerCompilerAssetEmittedTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAssetEmittedArgs) => Promise<void>); stage: number; }>
2704
+ registerCompilationBuildModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: Module) => void); stage: number; }>
2705
+ registerCompilationStillValidModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: Module) => void); stage: number; }>
2706
+ registerCompilationSucceedModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: Module) => void); stage: number; }>
2707
+ registerCompilationExecuteModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: JsExecuteModuleArg) => void); stage: number; }>
2708
+ registerCompilationAdditionalTreeRuntimeRequirementsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAdditionalTreeRuntimeRequirementsArg) => JsAdditionalTreeRuntimeRequirementsResult | undefined); stage: number; }>
2709
+ registerCompilationRuntimeRequirementInTreeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRuntimeRequirementInTreeArg) => JsRuntimeRequirementInTreeResult | undefined); stage: number; }>
2710
+ registerCompilationRuntimeModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRuntimeModuleArg) => JsRuntimeModule | undefined); stage: number; }>
2711
+ registerCompilationFinishModulesTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => Promise<void>); stage: number; }>
2712
+ registerCompilationOptimizeModulesTaps: (stages: Array<number>) => Array<{ function: (() => boolean | undefined); stage: number; }>
2713
+ registerCompilationAfterOptimizeModulesTaps: (stages: Array<number>) => Array<{ function: (() => void); stage: number; }>
2714
+ registerCompilationOptimizeTreeTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
2715
+ registerCompilationOptimizeChunkModulesTaps: (stages: Array<number>) => Array<{ function: (() => Promise<boolean | undefined>); stage: number; }>
2716
+ registerCompilationChunkHashTaps: (stages: Array<number>) => Array<{ function: ((arg: Chunk) => Buffer); stage: number; }>
2717
+ registerCompilationChunkAssetTaps: (stages: Array<number>) => Array<{ function: ((arg: JsChunkAssetArgs) => void); stage: number; }>
2718
+ registerCompilationProcessAssetsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => Promise<void>); stage: number; }>
2719
+ registerCompilationAfterProcessAssetsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }>
2720
+ registerCompilationSealTaps: (stages: Array<number>) => Array<{ function: (() => void); stage: number; }>
2721
+ registerCompilationAfterSealTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
2722
+ registerNormalModuleFactoryBeforeResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: JsBeforeResolveArgs) => Promise<[boolean | undefined, JsBeforeResolveArgs]>); stage: number; }>
2723
+ registerNormalModuleFactoryFactorizeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsFactorizeArgs) => Promise<JsFactorizeArgs>); stage: number; }>
2724
+ registerNormalModuleFactoryResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: JsResolveArgs) => Promise<JsResolveArgs>); stage: number; }>
2725
+ registerNormalModuleFactoryResolveForSchemeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsResolveForSchemeArgs) => Promise<[boolean | undefined, JsResolveForSchemeArgs]>); stage: number; }>
2726
+ registerNormalModuleFactoryAfterResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: string) => Promise<[boolean | undefined, JsCreateData | undefined]>); stage: number; }>
2727
+ registerNormalModuleFactoryCreateModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: JsNormalModuleFactoryCreateModuleArgs) => Promise<void>); stage: number; }>
2728
+ registerContextModuleFactoryBeforeResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: false | JsContextModuleFactoryBeforeResolveData) => Promise<false | JsContextModuleFactoryBeforeResolveData>); stage: number; }>
2729
+ registerContextModuleFactoryAfterResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: false | JsContextModuleFactoryAfterResolveData) => Promise<false | JsContextModuleFactoryAfterResolveData>); stage: number; }>
2730
+ registerJavascriptModulesChunkHashTaps: (stages: Array<number>) => Array<{ function: ((arg: Chunk) => Buffer); stage: number; }>
2731
+ registerHtmlPluginBeforeAssetTagGenerationTaps: (stages: Array<number>) => Array<{ function: ((arg: JsBeforeAssetTagGenerationData) => JsBeforeAssetTagGenerationData); stage: number; }>
2732
+ registerHtmlPluginAlterAssetTagsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAlterAssetTagsData) => JsAlterAssetTagsData); stage: number; }>
2733
+ registerHtmlPluginAlterAssetTagGroupsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAlterAssetTagGroupsData) => JsAlterAssetTagGroupsData); stage: number; }>
2734
+ registerHtmlPluginAfterTemplateExecutionTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAfterTemplateExecutionData) => JsAfterTemplateExecutionData); stage: number; }>
2735
+ registerHtmlPluginBeforeEmitTaps: (stages: Array<number>) => Array<{ function: ((arg: JsBeforeEmitData) => JsBeforeEmitData); stage: number; }>
2736
+ registerHtmlPluginAfterEmitTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAfterEmitData) => JsAfterEmitData); stage: number; }>
2737
+ registerRuntimePluginCreateScriptTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCreateScriptData) => String); stage: number; }>
2738
+ registerRuntimePluginLinkPreloadTaps: (stages: Array<number>) => Array<{ function: ((arg: JsLinkPreloadData) => String); stage: number; }>
2739
+ registerRuntimePluginLinkPrefetchTaps: (stages: Array<number>) => Array<{ function: ((arg: JsLinkPrefetchData) => String); stage: number; }>
2740
+ registerRsdoctorPluginModuleGraphTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorModuleGraph) => Promise<boolean | undefined>); stage: number; }>
2741
+ registerRsdoctorPluginChunkGraphTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorChunkGraph) => Promise<boolean | undefined>); stage: number; }>
2742
+ registerRsdoctorPluginModuleIdsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorModuleIdsPatch) => Promise<boolean | undefined>); stage: number; }>
2743
+ registerRsdoctorPluginModuleSourcesTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorModuleSourcesPatch) => Promise<boolean | undefined>); stage: number; }>
2744
+ registerRsdoctorPluginAssetsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorAssetPatch) => Promise<boolean | undefined>); stage: number; }>
2745
+ }
2746
+
2747
+ export interface SourceMapDevToolPluginOptions {
2748
+ append?: (false | null) | string | Function
2749
+ columns?: boolean
2750
+ fallbackModuleFilenameTemplate?: string | ((info: RawModuleFilenameTemplateFnCtx) => string)
2751
+ fileContext?: string
2752
+ filename?: (false | null) | string
2753
+ module?: boolean
2754
+ moduleFilenameTemplate?: string | ((info: RawModuleFilenameTemplateFnCtx) => string)
2755
+ namespace?: string
2756
+ noSources?: boolean
2757
+ publicPath?: string
2758
+ sourceRoot?: string
2759
+ test?: string | RegExp | (string | RegExp)[]
2760
+ include?: string | RegExp | (string | RegExp)[]
2761
+ exclude?: string | RegExp | (string | RegExp)[]
2762
+ debugIds?: boolean
2763
+ }
2764
+
2765
+ export interface SourcePosition {
2766
+ line: number
2767
+ column?: number
2768
+ }
2769
+
2770
+ export declare function syncTraceEvent(events: Array<RawTraceEvent>): void
2771
+
2772
+ export interface SyntheticDependencyLocation {
2773
+ name: string
2774
+ }
2775
+
2776
+ export interface ThreadsafeNodeFS {
2777
+ writeFile: (name: string, content: Buffer) => Promise<void>
2778
+ removeFile: (name: string) => Promise<void>
2779
+ mkdir: (name: string) => Promise<void>
2780
+ mkdirp: (name: string) => Promise<string | void>
2781
+ removeDirAll: (name: string) => Promise<string | void>
2782
+ readDir: (name: string) => Promise<string[] | void>
2783
+ readFile: (name: string) => Promise<Buffer | string | void>
2784
+ stat: (name: string) => Promise<NodeFsStats | void>
2785
+ lstat: (name: string) => Promise<NodeFsStats | void>
2786
+ realpath: (name: string) => Promise<string | void>
2787
+ open: (name: string, flags: string) => Promise<number | void>
2788
+ rename: (from: string, to: string) => Promise<void>
2789
+ close: (fd: number) => Promise<void>
2790
+ write: (fd: number, content: Buffer, position: number) => Promise<number | void>
2791
+ writeAll: (fd: number, content: Buffer) => Promise<number | void>
2792
+ read: (fd: number, length: number, position: number) => Promise<Buffer | void>
2793
+ readUntil: (fd: number, code: number, position: number) => Promise<Buffer | void>
2794
+ readToEnd: (fd: number, position: number) => Promise<Buffer | void>
2795
+ chmod?: (name: string, mode: number) => Promise<void>
2796
+ }
2797
+
2798
+ export declare function transform(source: string, options: string): Promise<TransformOutput>
2799
+
2800
+ export interface TransformOutput {
2801
+ code: string
2802
+ map?: string
2803
+ diagnostics: Array<string>
2804
+ }
2805
+
2806
+ export declare function transformSync(source: string, options: string): TransformOutput