@rspack/binding-wasm32-wasi 2.3.1 → 2.3.2

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