@rspack/core 0.7.0-beta.1-canary-2fe00c8-20240521070203 → 0.7.0-beta.1-canary-c7db90a-20240521105933

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,510 @@
1
+ import { SyncHook, AsyncSeriesBailHook, AsyncSeriesHook } from 'tapable';
2
+
3
+ /*
4
+ * This file was automatically generated.
5
+ * DO NOT MODIFY BY HAND.
6
+ * Run `yarn special-lint-fix` to update
7
+ */
8
+
9
+
10
+
11
+ declare interface AliasOption {
12
+ alias: string | false | string[];
13
+ name: string;
14
+ onlyModule?: boolean;
15
+ }
16
+ type AliasOptionNewRequest = string | false | string[];
17
+ declare interface AliasOptions {
18
+ [index: string]: AliasOptionNewRequest;
19
+ }
20
+ declare interface BaseResolveRequest {
21
+ path: string | false;
22
+ descriptionFilePath?: string;
23
+ descriptionFileRoot?: string;
24
+ descriptionFileData?: object;
25
+ relativePath?: string;
26
+ ignoreSymlinks?: boolean;
27
+ fullySpecified?: boolean;
28
+ }
29
+ declare class CachedInputFileSystem {
30
+ constructor(fileSystem?: any, duration?: any);
31
+ fileSystem: any;
32
+ lstat?: {
33
+ (arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
34
+ (
35
+ arg0: string,
36
+ arg1: object,
37
+ arg2: FileSystemCallback<string | Buffer>
38
+ ): void;
39
+ };
40
+ lstatSync?: (arg0: string, arg1?: object) => FileSystemStats;
41
+ stat: {
42
+ (arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
43
+ (
44
+ arg0: string,
45
+ arg1: object,
46
+ arg2: FileSystemCallback<string | Buffer>
47
+ ): void;
48
+ };
49
+ statSync: (arg0: string, arg1?: object) => FileSystemStats;
50
+ readdir: {
51
+ (
52
+ arg0: string,
53
+ arg1: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]>
54
+ ): void;
55
+ (
56
+ arg0: string,
57
+ arg1: object,
58
+ arg2: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]>
59
+ ): void;
60
+ };
61
+ readdirSync: (
62
+ arg0: string,
63
+ arg1?: object
64
+ ) => (string | Buffer)[] | FileSystemDirent[];
65
+ readFile: {
66
+ (arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
67
+ (
68
+ arg0: string,
69
+ arg1: object,
70
+ arg2: FileSystemCallback<string | Buffer>
71
+ ): void;
72
+ };
73
+ readFileSync: (arg0: string, arg1?: object) => string | Buffer;
74
+ readJson?: {
75
+ (arg0: string, arg1: FileSystemCallback<object>): void;
76
+ (arg0: string, arg1: object, arg2: FileSystemCallback<object>): void;
77
+ };
78
+ readJsonSync?: (arg0: string, arg1?: object) => object;
79
+ readlink: {
80
+ (arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
81
+ (
82
+ arg0: string,
83
+ arg1: object,
84
+ arg2: FileSystemCallback<string | Buffer>
85
+ ): void;
86
+ };
87
+ readlinkSync: (arg0: string, arg1?: object) => string | Buffer;
88
+ purge(what?: any): void;
89
+ }
90
+ declare class CloneBasenamePlugin {
91
+ constructor(source?: any, target?: any);
92
+ source: any;
93
+ target: any;
94
+ apply(resolver: Resolver): void;
95
+ }
96
+ declare interface ExtensionAliasOption {
97
+ alias: string | string[];
98
+ extension: string;
99
+ }
100
+ declare interface ExtensionAliasOptions {
101
+ [index: string]: string | string[];
102
+ }
103
+ declare interface FileSystem {
104
+ readFile: {
105
+ (arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
106
+ (
107
+ arg0: string,
108
+ arg1: object,
109
+ arg2: FileSystemCallback<string | Buffer>
110
+ ): void;
111
+ };
112
+ readdir: {
113
+ (
114
+ arg0: string,
115
+ arg1: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]>
116
+ ): void;
117
+ (
118
+ arg0: string,
119
+ arg1: object,
120
+ arg2: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]>
121
+ ): void;
122
+ };
123
+ readJson?: {
124
+ (arg0: string, arg1: FileSystemCallback<object>): void;
125
+ (arg0: string, arg1: object, arg2: FileSystemCallback<object>): void;
126
+ };
127
+ readlink: {
128
+ (arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
129
+ (
130
+ arg0: string,
131
+ arg1: object,
132
+ arg2: FileSystemCallback<string | Buffer>
133
+ ): void;
134
+ };
135
+ lstat?: {
136
+ (arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
137
+ (
138
+ arg0: string,
139
+ arg1: object,
140
+ arg2: FileSystemCallback<string | Buffer>
141
+ ): void;
142
+ };
143
+ stat: {
144
+ (arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
145
+ (
146
+ arg0: string,
147
+ arg1: object,
148
+ arg2: FileSystemCallback<string | Buffer>
149
+ ): void;
150
+ };
151
+ }
152
+ declare interface FileSystemCallback<T> {
153
+ (err?: null | (PossibleFileSystemError & Error), result?: T): any;
154
+ }
155
+ declare interface FileSystemDirent {
156
+ name: string | Buffer;
157
+ isDirectory: () => boolean;
158
+ isFile: () => boolean;
159
+ }
160
+ declare interface FileSystemStats {
161
+ isDirectory: () => boolean;
162
+ isFile: () => boolean;
163
+ }
164
+ declare class LogInfoPlugin {
165
+ constructor(source?: any);
166
+ source: any;
167
+ apply(resolver: Resolver): void;
168
+ }
169
+ declare interface ParsedIdentifier {
170
+ request: string;
171
+ query: string;
172
+ fragment: string;
173
+ directory: boolean;
174
+ module: boolean;
175
+ file: boolean;
176
+ internal: boolean;
177
+ }
178
+ type Plugin =
179
+ | { apply: (arg0: Resolver) => void }
180
+ | ((this: Resolver, arg1: Resolver) => void);
181
+ declare interface PnpApiImpl {
182
+ resolveToUnqualified: (arg0: string, arg1: string, arg2: object) => string;
183
+ }
184
+ declare interface PossibleFileSystemError {
185
+ code?: string;
186
+ errno?: number;
187
+ path?: string;
188
+ syscall?: string;
189
+ }
190
+
191
+ /**
192
+ * Resolve context
193
+ */
194
+ declare interface ResolveContext {
195
+ contextDependencies?: WriteOnlySet<string>;
196
+
197
+ /**
198
+ * files that was found on file system
199
+ */
200
+ fileDependencies?: WriteOnlySet<string>;
201
+
202
+ /**
203
+ * dependencies that was not found on file system
204
+ */
205
+ missingDependencies?: WriteOnlySet<string>;
206
+
207
+ /**
208
+ * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
209
+ */
210
+ stack?: Set<string>;
211
+
212
+ /**
213
+ * log function
214
+ */
215
+ log?: (arg0: string) => void;
216
+
217
+ /**
218
+ * yield result, if provided plugins can return several results
219
+ */
220
+ yield?: (arg0: ResolveRequest) => void;
221
+ }
222
+ declare interface ResolveOptions {
223
+ alias: AliasOption[];
224
+ fallback: AliasOption[];
225
+ aliasFields: Set<string | string[]>;
226
+ extensionAlias: ExtensionAliasOption[];
227
+ cachePredicate: (arg0: ResolveRequest) => boolean;
228
+ cacheWithContext: boolean;
229
+
230
+ /**
231
+ * A list of exports field condition names.
232
+ */
233
+ conditionNames: Set<string>;
234
+ descriptionFiles: string[];
235
+ enforceExtension: boolean;
236
+ exportsFields: Set<string | string[]>;
237
+ importsFields: Set<string | string[]>;
238
+ extensions: Set<string>;
239
+ fileSystem: FileSystem;
240
+ unsafeCache: false | object;
241
+ symlinks: boolean;
242
+ resolver?: Resolver;
243
+ modules: (string | string[])[];
244
+ mainFields: { name: string[]; forceRelative: boolean }[];
245
+ mainFiles: Set<string>;
246
+ plugins: Plugin[];
247
+ pnpApi: null | PnpApiImpl;
248
+ roots: Set<string>;
249
+ fullySpecified: boolean;
250
+ resolveToContext: boolean;
251
+ restrictions: Set<string | RegExp>;
252
+ preferRelative: boolean;
253
+ preferAbsolute: boolean;
254
+ }
255
+ export type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
256
+ declare abstract class Resolver {
257
+ fileSystem: FileSystem;
258
+ options: ResolveOptions;
259
+ hooks: {
260
+ resolveStep: SyncHook<
261
+ [
262
+ AsyncSeriesBailHook<
263
+ [ResolveRequest, ResolveContext],
264
+ null | ResolveRequest
265
+ >,
266
+ ResolveRequest
267
+ ]
268
+ >;
269
+ noResolve: SyncHook<[ResolveRequest, Error]>;
270
+ resolve: AsyncSeriesBailHook<
271
+ [ResolveRequest, ResolveContext],
272
+ null | ResolveRequest
273
+ >;
274
+ result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
275
+ };
276
+ ensureHook(
277
+ name:
278
+ | string
279
+ | AsyncSeriesBailHook<
280
+ [ResolveRequest, ResolveContext],
281
+ null | ResolveRequest
282
+ >
283
+ ): AsyncSeriesBailHook<
284
+ [ResolveRequest, ResolveContext],
285
+ null | ResolveRequest
286
+ >;
287
+ getHook(
288
+ name:
289
+ | string
290
+ | AsyncSeriesBailHook<
291
+ [ResolveRequest, ResolveContext],
292
+ null | ResolveRequest
293
+ >
294
+ ): AsyncSeriesBailHook<
295
+ [ResolveRequest, ResolveContext],
296
+ null | ResolveRequest
297
+ >;
298
+ resolveSync(context: object, path: string, request: string): string | false;
299
+ resolve(
300
+ context: object,
301
+ path: string,
302
+ request: string,
303
+ resolveContext: ResolveContext,
304
+ callback: (
305
+ arg0: null | Error,
306
+ arg1?: string | false,
307
+ arg2?: ResolveRequest
308
+ ) => void
309
+ ): void;
310
+ doResolve(
311
+ hook?: any,
312
+ request?: any,
313
+ message?: any,
314
+ resolveContext?: any,
315
+ callback?: any
316
+ ): any;
317
+ parse(identifier: string): ParsedIdentifier;
318
+ isModule(path?: any): boolean;
319
+ isPrivate(path?: any): boolean;
320
+ isDirectory(path: string): boolean;
321
+ join(path?: any, request?: any): string;
322
+ normalize(path?: any): string;
323
+ }
324
+ declare interface UserResolveOptions {
325
+ /**
326
+ * A list of module alias configurations or an object which maps key to value
327
+ */
328
+ alias?: AliasOptions | AliasOption[];
329
+
330
+ /**
331
+ * A list of module alias configurations or an object which maps key to value, applied only after modules option
332
+ */
333
+ fallback?: AliasOptions | AliasOption[];
334
+
335
+ /**
336
+ * An object which maps extension to extension aliases
337
+ */
338
+ extensionAlias?: ExtensionAliasOptions;
339
+
340
+ /**
341
+ * A list of alias fields in description files
342
+ */
343
+ aliasFields?: (string | string[])[];
344
+
345
+ /**
346
+ * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
347
+ */
348
+ cachePredicate?: (arg0: ResolveRequest) => boolean;
349
+
350
+ /**
351
+ * Whether or not the unsafeCache should include request context as part of the cache key.
352
+ */
353
+ cacheWithContext?: boolean;
354
+
355
+ /**
356
+ * A list of description files to read from
357
+ */
358
+ descriptionFiles?: string[];
359
+
360
+ /**
361
+ * A list of exports field condition names.
362
+ */
363
+ conditionNames?: string[];
364
+
365
+ /**
366
+ * Enforce that a extension from extensions must be used
367
+ */
368
+ enforceExtension?: boolean;
369
+
370
+ /**
371
+ * A list of exports fields in description files
372
+ */
373
+ exportsFields?: (string | string[])[];
374
+
375
+ /**
376
+ * A list of imports fields in description files
377
+ */
378
+ importsFields?: (string | string[])[];
379
+
380
+ /**
381
+ * A list of extensions which should be tried for files
382
+ */
383
+ extensions?: string[];
384
+
385
+ /**
386
+ * The file system which should be used
387
+ */
388
+ fileSystem: FileSystem;
389
+
390
+ /**
391
+ * Use this cache object to unsafely cache the successful requests
392
+ */
393
+ unsafeCache?: boolean | object;
394
+
395
+ /**
396
+ * Resolve symlinks to their symlinked location
397
+ */
398
+ symlinks?: boolean;
399
+
400
+ /**
401
+ * A prepared Resolver to which the plugins are attached
402
+ */
403
+ resolver?: Resolver;
404
+
405
+ /**
406
+ * A list of directories to resolve modules from, can be absolute path or folder name
407
+ */
408
+ modules?: string | string[];
409
+
410
+ /**
411
+ * A list of main fields in description files
412
+ */
413
+ mainFields?: (
414
+ | string
415
+ | string[]
416
+ | { name: string | string[]; forceRelative: boolean }
417
+ )[];
418
+
419
+ /**
420
+ * A list of main files in directories
421
+ */
422
+ mainFiles?: string[];
423
+
424
+ /**
425
+ * A list of additional resolve plugins which should be applied
426
+ */
427
+ plugins?: Plugin[];
428
+
429
+ /**
430
+ * A PnP API that should be used - null is "never", undefined is "auto"
431
+ */
432
+ pnpApi?: null | PnpApiImpl;
433
+
434
+ /**
435
+ * A list of root paths
436
+ */
437
+ roots?: string[];
438
+
439
+ /**
440
+ * The request is already fully specified and no extensions or directories are resolved for it
441
+ */
442
+ fullySpecified?: boolean;
443
+
444
+ /**
445
+ * Resolve to a context instead of a file
446
+ */
447
+ resolveToContext?: boolean;
448
+
449
+ /**
450
+ * A list of resolve restrictions
451
+ */
452
+ restrictions?: (string | RegExp)[];
453
+
454
+ /**
455
+ * Use only the sync constraints of the file system calls
456
+ */
457
+ useSyncFileSystemCalls?: boolean;
458
+
459
+ /**
460
+ * Prefer to resolve module requests as relative requests before falling back to modules
461
+ */
462
+ preferRelative?: boolean;
463
+
464
+ /**
465
+ * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
466
+ */
467
+ preferAbsolute?: boolean;
468
+ }
469
+ declare interface WriteOnlySet<T> {
470
+ add: (T?: any) => void;
471
+ }
472
+ declare function exports(
473
+ context?: any,
474
+ path?: any,
475
+ request?: any,
476
+ resolveContext?: any,
477
+ callback?: any
478
+ ): void;
479
+ declare namespace exports {
480
+ export const sync: (
481
+ context?: any,
482
+ path?: any,
483
+ request?: any
484
+ ) => string | false;
485
+ export function create(
486
+ options?: any
487
+ ): (
488
+ context?: any,
489
+ path?: any,
490
+ request?: any,
491
+ resolveContext?: any,
492
+ callback?: any
493
+ ) => void;
494
+ export namespace create {
495
+ export const sync: (
496
+ options?: any
497
+ ) => (context?: any, path?: any, request?: any) => string | false;
498
+ }
499
+ export namespace ResolverFactory {
500
+ export let createResolver: (options: UserResolveOptions) => Resolver;
501
+ }
502
+ export const forEachBail: (
503
+ array?: any,
504
+ iterator?: any,
505
+ callback?: any
506
+ ) => any;
507
+ export { CachedInputFileSystem, CloneBasenamePlugin, LogInfoPlugin, type PnpApiImpl as PnpApi, Resolver, type FileSystem, type ResolveContext, type ResolveRequest, type Plugin, type UserResolveOptions as ResolveOptions };
508
+ }
509
+
510
+ export { exports as default };