@ohos-ports/rspack-binding 1.7.11-beta.0

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