@rspack-debug/binding 1.3.14

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