forked from webpack/webpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.d.ts
10102 lines (9269 loc) · 252 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn special-lint-fix` to update
*/
import {
ArrayExpression,
ArrayPattern,
ArrowFunctionExpression,
AssignmentExpression,
AssignmentPattern,
AssignmentProperty,
AwaitExpression,
BinaryExpression,
BlockStatement,
BreakStatement,
CatchClause,
ChainExpression,
ClassBody,
ClassDeclaration,
ClassExpression,
Comment,
ConditionalExpression,
ContinueStatement,
DebuggerStatement,
DoWhileStatement,
EmptyStatement,
ExportAllDeclaration,
ExportDefaultDeclaration,
ExportNamedDeclaration,
ExportSpecifier,
ExpressionStatement,
ForInStatement,
ForOfStatement,
ForStatement,
FunctionDeclaration,
FunctionExpression,
Identifier,
IfStatement,
ImportDeclaration,
ImportDefaultSpecifier,
ImportExpression,
ImportNamespaceSpecifier,
ImportSpecifier,
LabeledStatement,
LogicalExpression,
MemberExpression,
MetaProperty,
MethodDefinition,
NewExpression,
ObjectExpression,
ObjectPattern,
Program,
Property,
RegExpLiteral,
RestElement,
ReturnStatement,
SequenceExpression,
SimpleCallExpression,
SimpleLiteral,
SpreadElement,
Super,
SwitchCase,
SwitchStatement,
TaggedTemplateExpression,
TemplateElement,
TemplateLiteral,
ThisExpression,
ThrowStatement,
TryStatement,
UnaryExpression,
UpdateExpression,
VariableDeclaration,
VariableDeclarator,
WhileStatement,
WithStatement,
YieldExpression
} from "estree";
import { Stats as FsStats, WriteStream } from "fs";
import { default as ValidationError } from "schema-utils/declarations/ValidationError";
import {
AsArray,
AsyncParallelHook,
AsyncSeriesBailHook,
AsyncSeriesHook,
AsyncSeriesWaterfallHook,
HookMap,
MultiHook,
SyncBailHook,
SyncHook,
SyncWaterfallHook
} from "tapable";
declare class AbstractLibraryPlugin<T> {
constructor(__0: {
/**
* name of the plugin
*/
pluginName: string;
/**
* used library type
*/
type: string;
});
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
parseOptions(library: LibraryOptions): false | T;
finishEntryModule(
module: Module,
entryName: string,
libraryContext: LibraryContext<T>
): void;
runtimeRequirements(
chunk: Chunk,
set: Set<string>,
libraryContext: LibraryContext<T>
): void;
render(
source: Source,
renderContext: RenderContextObject,
libraryContext: LibraryContext<T>
): Source;
chunkHash(
chunk: Chunk,
hash: Hash,
chunkHashContext: ChunkHashContext,
libraryContext: LibraryContext<T>
): void;
}
declare class AggressiveMergingPlugin {
constructor(options?: any);
options: any;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
declare class AggressiveSplittingPlugin {
constructor(options?: AggressiveSplittingPluginOptions);
options: AggressiveSplittingPluginOptions;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
static wasChunkRecorded(chunk: Chunk): boolean;
}
declare interface AggressiveSplittingPluginOptions {
/**
* Extra cost for each chunk (Default: 9.8kiB).
*/
chunkOverhead?: number;
/**
* Extra cost multiplicator for entry chunks (Default: 10).
*/
entryChunkMultiplicator?: number;
/**
* Byte, max size of per file (Default: 50kiB).
*/
maxSize?: number;
/**
* Byte, split point. (Default: 30kiB).
*/
minSize?: number;
}
type Amd = false | { [index: string]: any };
declare interface Argument {
description: string;
simpleType: "string" | "number" | "boolean";
multiple: boolean;
configs: ArgumentConfig[];
}
declare interface ArgumentConfig {
description: string;
path: string;
multiple: boolean;
type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset";
values?: any[];
}
declare interface Asset {
/**
* the filename of the asset
*/
name: string;
/**
* source of the asset
*/
source: Source;
/**
* info about the asset
*/
info: AssetInfo;
}
declare interface AssetEmittedInfo {
content: Buffer;
source: Source;
compilation: Compilation;
outputPath: string;
targetPath: string;
}
declare interface AssetInfo {
/**
* true, if the asset can be long term cached forever (contains a hash)
*/
immutable?: boolean;
/**
* whether the asset is minimized
*/
minimized?: boolean;
/**
* the value(s) of the full hash used for this asset
*/
fullhash?: EntryItem;
/**
* the value(s) of the chunk hash used for this asset
*/
chunkhash?: EntryItem;
/**
* the value(s) of the module hash used for this asset
*/
modulehash?: EntryItem;
/**
* the value(s) of the content hash used for this asset
*/
contenthash?: EntryItem;
/**
* when asset was created from a source file (potentially transformed), the original filename relative to compilation context
*/
sourceFilename?: string;
/**
* size in bytes, only set after asset has been emitted
*/
size?: number;
/**
* true, when asset is only used for development and doesn't count towards user-facing assets
*/
development?: boolean;
/**
* true, when asset ships data for updating an existing application (HMR)
*/
hotModuleReplacement?: boolean;
/**
* true, when asset is javascript and an ESM
*/
javascriptModule?: boolean;
/**
* object of pointers to other assets, keyed by type of relation (only points from parent to child)
*/
related?: Record<string, EntryItem>;
}
type AssetModuleFilename =
| string
| ((pathData: PathData, assetInfo?: AssetInfo) => string);
declare abstract class AsyncDependenciesBlock extends DependenciesBlock {
groupOptions: {
preloadOrder?: number;
prefetchOrder?: number;
name?: string;
entryOptions?: EntryOptions;
};
loc: DependencyLocation;
request: string;
parent: DependenciesBlock;
chunkName: string;
module: any;
}
declare abstract class AsyncQueue<T, K, R> {
hooks: {
beforeAdd: AsyncSeriesHook<[T]>;
added: SyncHook<[T]>;
beforeStart: AsyncSeriesHook<[T]>;
started: SyncHook<[T]>;
result: SyncHook<[T, Error, R]>;
};
add(item: T, callback: CallbackFunction<R>): void;
invalidate(item: T): void;
stop(): void;
increaseParallelism(): void;
decreaseParallelism(): void;
isProcessing(item: T): boolean;
isQueued(item: T): boolean;
isDone(item: T): boolean;
}
declare class AsyncWebAssemblyModulesPlugin {
constructor(options?: any);
options: any;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
renderModule(module?: any, renderContext?: any, hooks?: any): any;
static getCompilationHooks(
compilation: Compilation
): CompilationHooksAsyncWebAssemblyModulesPlugin;
}
declare class AutomaticPrefetchPlugin {
constructor();
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
declare class BannerPlugin {
constructor(options: BannerPluginArgument);
options: BannerPluginOptions;
banner: (data: { hash: string; chunk: Chunk; filename: string }) => string;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
type BannerPluginArgument =
| string
| BannerPluginOptions
| ((data: { hash: string; chunk: Chunk; filename: string }) => string);
declare interface BannerPluginOptions {
/**
* Specifies the banner.
*/
banner:
| string
| ((data: { hash: string; chunk: Chunk; filename: string }) => string);
/**
* If true, the banner will only be added to the entry chunks.
*/
entryOnly?: boolean;
/**
* Exclude all modules matching any of these conditions.
*/
exclude?: Rules;
/**
* Include all modules matching any of these conditions.
*/
include?: Rules;
/**
* If true, banner will not be wrapped in a comment.
*/
raw?: boolean;
/**
* Include all modules that pass test assertion.
*/
test?: Rules;
}
declare interface BaseResolveRequest {
path: DevTool;
descriptionFilePath?: string;
descriptionFileRoot?: string;
descriptionFileData?: any;
relativePath?: string;
ignoreSymlinks?: boolean;
fullySpecified?: boolean;
}
declare abstract class BasicEvaluatedExpression {
type: number;
range: [number, number];
falsy: boolean;
truthy: boolean;
nullish: boolean;
sideEffects: boolean;
bool: boolean;
number: number;
bigint: bigint;
regExp: RegExp;
string: string;
quasis: BasicEvaluatedExpression[];
parts: BasicEvaluatedExpression[];
array: any[];
items: BasicEvaluatedExpression[];
options: BasicEvaluatedExpression[];
prefix: BasicEvaluatedExpression;
postfix: BasicEvaluatedExpression;
wrappedInnerExpressions: any;
identifier: string;
rootInfo: VariableInfoInterface;
getMembers: () => string[];
expression: NodeEstreeIndex;
isUnknown(): boolean;
isNull(): boolean;
isUndefined(): boolean;
isString(): boolean;
isNumber(): boolean;
isBigInt(): boolean;
isBoolean(): boolean;
isRegExp(): boolean;
isConditional(): boolean;
isArray(): boolean;
isConstArray(): boolean;
isIdentifier(): boolean;
isWrapped(): boolean;
isTemplateString(): boolean;
/**
* Is expression a primitive or an object type value?
*/
isPrimitiveType(): boolean;
/**
* Is expression a runtime or compile-time value?
*/
isCompileTimeValue(): boolean;
/**
* Gets the compile-time value of the expression
*/
asCompileTimeValue(): any;
isTruthy(): boolean;
isFalsy(): boolean;
isNullish(): boolean;
/**
* Can this expression have side effects?
*/
couldHaveSideEffects(): boolean;
asBool(): any;
asNullish(): boolean;
asString(): any;
setString(string?: any): BasicEvaluatedExpression;
setUndefined(): BasicEvaluatedExpression;
setNull(): BasicEvaluatedExpression;
setNumber(number?: any): BasicEvaluatedExpression;
setBigInt(bigint?: any): BasicEvaluatedExpression;
setBoolean(bool?: any): BasicEvaluatedExpression;
setRegExp(regExp?: any): BasicEvaluatedExpression;
setIdentifier(
identifier?: any,
rootInfo?: any,
getMembers?: any
): BasicEvaluatedExpression;
setWrapped(
prefix?: any,
postfix?: any,
innerExpressions?: any
): BasicEvaluatedExpression;
setOptions(options?: any): BasicEvaluatedExpression;
addOptions(options?: any): BasicEvaluatedExpression;
setItems(items?: any): BasicEvaluatedExpression;
setArray(array?: any): BasicEvaluatedExpression;
setTemplateString(
quasis?: any,
parts?: any,
kind?: any
): BasicEvaluatedExpression;
templateStringKind: any;
setTruthy(): BasicEvaluatedExpression;
setFalsy(): BasicEvaluatedExpression;
setNullish(value?: any): BasicEvaluatedExpression;
setRange(range?: any): BasicEvaluatedExpression;
setSideEffects(sideEffects?: boolean): BasicEvaluatedExpression;
setExpression(expression?: any): BasicEvaluatedExpression;
}
type BuildMeta = KnownBuildMeta & Record<string, any>;
declare abstract class ByTypeGenerator extends Generator {
map: any;
}
declare const CIRCULAR_CONNECTION: unique symbol;
declare class Cache {
constructor();
hooks: {
get: AsyncSeriesBailHook<
[
string,
Etag,
((result: any, callback: (arg0: Error) => void) => void)[]
],
any
>;
store: AsyncParallelHook<[string, Etag, any]>;
storeBuildDependencies: AsyncParallelHook<[Iterable<string>]>;
beginIdle: SyncHook<[]>;
endIdle: AsyncParallelHook<[]>;
shutdown: AsyncParallelHook<[]>;
};
get<T>(identifier: string, etag: Etag, callback: CallbackCache<T>): void;
store<T>(
identifier: string,
etag: Etag,
data: T,
callback: CallbackCache<void>
): void;
/**
* After this method has succeeded the cache can only be restored when build dependencies are
*/
storeBuildDependencies(
dependencies: Iterable<string>,
callback: CallbackCache<void>
): void;
beginIdle(): void;
endIdle(callback: CallbackCache<void>): void;
shutdown(callback: CallbackCache<void>): void;
static STAGE_MEMORY: number;
static STAGE_DEFAULT: number;
static STAGE_DISK: number;
static STAGE_NETWORK: number;
}
declare abstract class CacheFacade {
getChildCache(name: string): CacheFacade;
getItemCache(identifier: string, etag: Etag): ItemCacheFacade;
getLazyHashedEtag(obj: HashableObject): Etag;
mergeEtags(a: Etag, b: Etag): Etag;
get<T>(identifier: string, etag: Etag, callback: CallbackCache<T>): void;
getPromise<T>(identifier: string, etag: Etag): Promise<T>;
store<T>(
identifier: string,
etag: Etag,
data: T,
callback: CallbackCache<void>
): void;
storePromise<T>(identifier: string, etag: Etag, data: T): Promise<void>;
provide<T>(
identifier: string,
etag: Etag,
computer: (arg0: CallbackNormalErrorCache<T>) => void,
callback: CallbackNormalErrorCache<T>
): void;
providePromise<T>(
identifier: string,
etag: Etag,
computer: () => T | Promise<T>
): Promise<T>;
}
declare interface CacheGroupSource {
key?: string;
priority?: number;
getName?: (module?: Module, chunks?: Chunk[], key?: string) => string;
chunksFilter?: (chunk: Chunk) => boolean;
enforce?: boolean;
minSize: Record<string, number>;
minRemainingSize: Record<string, number>;
enforceSizeThreshold: Record<string, number>;
maxAsyncSize: Record<string, number>;
maxInitialSize: Record<string, number>;
minChunks?: number;
maxAsyncRequests?: number;
maxInitialRequests?: number;
filename?: string | ((arg0: PathData, arg1: AssetInfo) => string);
idHint?: string;
automaticNameDelimiter: string;
reuseExistingChunk?: boolean;
usedExports?: boolean;
}
declare interface CacheGroupsContext {
moduleGraph: ModuleGraph;
chunkGraph: ChunkGraph;
}
type CacheOptions = boolean | MemoryCacheOptions | FileCacheOptions;
type CacheOptionsNormalized = false | MemoryCacheOptions | FileCacheOptions;
declare class CachedSource extends Source {
constructor(source: Source);
constructor(source: Source | (() => Source), cachedData?: any);
original(): Source;
originalLazy(): Source | (() => Source);
getCachedData(): any;
}
type CallExpression = SimpleCallExpression | NewExpression;
declare interface CallExpressionInfo {
type: "call";
call: CallExpression;
calleeName: string;
rootInfo: string | VariableInfo;
getCalleeMembers: () => string[];
name: string;
getMembers: () => string[];
}
declare interface CallbackCache<T> {
(err?: WebpackError, result?: T): void;
}
declare interface CallbackFunction<T> {
(err?: Error, result?: T): any;
}
declare interface CallbackNormalErrorCache<T> {
(err?: Error, result?: T): void;
}
declare interface CallbackWebpack<T> {
(err?: Error, stats?: T): void;
}
declare class Chunk {
constructor(name?: string);
id: string | number;
ids: (string | number)[];
debugId: number;
name: string;
idNameHints: SortableSet<string>;
preventIntegration: boolean;
filenameTemplate: string | ((arg0: PathData, arg1: AssetInfo) => string);
runtime: RuntimeSpec;
files: Set<string>;
auxiliaryFiles: Set<string>;
rendered: boolean;
hash: string;
contentHash: Record<string, string>;
renderedHash: string;
chunkReason: string;
extraAsync: boolean;
readonly entryModule: Module;
hasEntryModule(): boolean;
addModule(module: Module): boolean;
removeModule(module: Module): void;
getNumberOfModules(): number;
readonly modulesIterable: Iterable<Module>;
compareTo(otherChunk: Chunk): 0 | 1 | -1;
containsModule(module: Module): boolean;
getModules(): Module[];
remove(): void;
moveModule(module: Module, otherChunk: Chunk): void;
integrate(otherChunk: Chunk): boolean;
canBeIntegrated(otherChunk: Chunk): boolean;
isEmpty(): boolean;
modulesSize(): number;
size(options?: ChunkSizeOptions): number;
integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number;
getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps;
hasModuleInGraph(
filterFn: (m: Module) => boolean,
filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
): boolean;
getChunkMaps(realHash: boolean): ChunkMaps;
hasRuntime(): boolean;
canBeInitial(): boolean;
isOnlyInitial(): boolean;
getEntryOptions(): EntryOptions;
addGroup(chunkGroup: ChunkGroup): void;
removeGroup(chunkGroup: ChunkGroup): void;
isInGroup(chunkGroup: ChunkGroup): boolean;
getNumberOfGroups(): number;
readonly groupsIterable: Iterable<ChunkGroup>;
disconnectFromGroups(): void;
split(newChunk: Chunk): void;
updateHash(hash: Hash, chunkGraph: ChunkGraph): void;
getAllAsyncChunks(): Set<Chunk>;
getAllInitialChunks(): Set<Chunk>;
getAllReferencedChunks(): Set<Chunk>;
getAllReferencedAsyncEntrypoints(): Set<Entrypoint>;
hasAsyncChunks(): boolean;
getChildIdsByOrders(
chunkGraph: ChunkGraph,
filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
): Record<string, (string | number)[]>;
getChildIdsByOrdersMap(
chunkGraph: ChunkGraph,
includeDirectChildren?: boolean,
filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
): Record<string | number, Record<string, (string | number)[]>>;
}
type ChunkFilename =
| string
| ((pathData: PathData, assetInfo?: AssetInfo) => string);
declare class ChunkGraph {
constructor(moduleGraph: ModuleGraph);
moduleGraph: ModuleGraph;
connectChunkAndModule(chunk: Chunk, module: Module): void;
disconnectChunkAndModule(chunk: Chunk, module: Module): void;
disconnectChunk(chunk: Chunk): void;
attachModules(chunk: Chunk, modules: Iterable<Module>): void;
attachRuntimeModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
attachFullHashModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
replaceModule(oldModule: Module, newModule: Module): void;
isModuleInChunk(module: Module, chunk: Chunk): boolean;
isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean;
isEntryModule(module: Module): boolean;
getModuleChunksIterable(module: Module): Iterable<Chunk>;
getOrderedModuleChunksIterable(
module: Module,
sortFn: (arg0: Chunk, arg1: Chunk) => 0 | 1 | -1
): Iterable<Chunk>;
getModuleChunks(module: Module): Chunk[];
getNumberOfModuleChunks(module: Module): number;
getModuleRuntimes(module: Module): RuntimeSpecSet;
getNumberOfChunkModules(chunk: Chunk): number;
getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
getChunkModulesIterableBySourceType(
chunk: Chunk,
sourceType: string
): Iterable<Module>;
getOrderedChunkModulesIterable(
chunk: Chunk,
comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
): Iterable<Module>;
getOrderedChunkModulesIterableBySourceType(
chunk: Chunk,
sourceType: string,
comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
): Iterable<Module>;
getChunkModules(chunk: Chunk): Module[];
getOrderedChunkModules(
chunk: Chunk,
comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
): Module[];
getChunkModuleIdMap(
chunk: Chunk,
filterFn: (m: Module) => boolean,
includeAllChunks?: boolean
): Record<string | number, (string | number)[]>;
getChunkModuleRenderedHashMap(
chunk: Chunk,
filterFn: (m: Module) => boolean,
hashLength?: number,
includeAllChunks?: boolean
): Record<string | number, Record<string | number, string>>;
getChunkConditionMap(
chunk: Chunk,
filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean
): Record<string | number, boolean>;
hasModuleInGraph(
chunk: Chunk,
filterFn: (m: Module) => boolean,
filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
): boolean;
compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1;
getChunkModulesSize(chunk: Chunk): number;
getChunkModulesSizes(chunk: Chunk): Record<string, number>;
getChunkRootModules(chunk: Chunk): Module[];
getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number;
getIntegratedChunksSize(
chunkA: Chunk,
chunkB: Chunk,
options?: ChunkSizeOptions
): number;
canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean;
integrateChunks(chunkA: Chunk, chunkB: Chunk): void;
isEntryModuleInChunk(module: Module, chunk: Chunk): boolean;
connectChunkAndEntryModule(
chunk: Chunk,
module: Module,
entrypoint?: Entrypoint
): void;
connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void;
disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
disconnectEntryModule(module: Module): void;
disconnectEntries(chunk: Chunk): void;
getNumberOfEntryModules(chunk: Chunk): number;
getNumberOfRuntimeModules(chunk: Chunk): number;
getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>;
getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
hasChunkEntryDependentChunks(chunk: Chunk): boolean;
getChunkRuntimeModulesIterable(chunk: Chunk): Iterable<RuntimeModule>;
getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[];
getChunkFullHashModulesIterable(chunk: Chunk): Iterable<RuntimeModule>;
getChunkEntryModulesWithChunkGroupIterable(
chunk: Chunk
): Iterable<[Module, Entrypoint]>;
getBlockChunkGroup(depBlock: AsyncDependenciesBlock): ChunkGroup;
connectBlockAndChunkGroup(
depBlock: AsyncDependenciesBlock,
chunkGroup: ChunkGroup
): void;
disconnectChunkGroup(chunkGroup: ChunkGroup): void;
getModuleId(module: Module): string | number;
setModuleId(module: Module, id: string | number): void;
getRuntimeId(runtime: string): string | number;
setRuntimeId(runtime: string, id: string | number): void;
hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean;
getModuleHash(module: Module, runtime: RuntimeSpec): string;
getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string;
setModuleHashes(
module: Module,
runtime: RuntimeSpec,
hash: string,
renderedHash: string
): void;
addModuleRuntimeRequirements(
module: Module,
runtime: RuntimeSpec,
items: Set<string>
): void;
addChunkRuntimeRequirements(chunk: Chunk, items: Set<string>): void;
addTreeRuntimeRequirements(chunk: Chunk, items: Iterable<string>): void;
getModuleRuntimeRequirements(
module: Module,
runtime: RuntimeSpec
): ReadonlySet<string>;
getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
static getChunkGraphForModule(
module: Module,
deprecateMessage: string,
deprecationCode: string
): ChunkGraph;
static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void;
static getChunkGraphForChunk(
chunk: Chunk,
deprecateMessage: string,
deprecationCode: string
): ChunkGraph;
static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void;
}
declare abstract class ChunkGroup {
groupDebugId: number;
options: ChunkGroupOptions;
chunks: Chunk[];
origins: OriginRecord[];
index: number;
/**
* when a new chunk is added to a chunkGroup, addingOptions will occur.
*/
addOptions(options: ChunkGroupOptions): void;
/**
* returns the name of current ChunkGroup
* sets a new name for current ChunkGroup
*/
name: string;
/**
* get a uniqueId for ChunkGroup, made up of its member Chunk debugId's
*/
readonly debugId: string;
/**
* get a unique id for ChunkGroup, made up of its member Chunk id's
*/
readonly id: string;
/**
* Performs an unshift of a specific chunk
*/
unshiftChunk(chunk: Chunk): boolean;
/**
* inserts a chunk before another existing chunk in group
*/
insertChunk(chunk: Chunk, before: Chunk): boolean;
/**
* add a chunk into ChunkGroup. Is pushed on or prepended
*/
pushChunk(chunk: Chunk): boolean;
replaceChunk(oldChunk: Chunk, newChunk: Chunk): boolean;
removeChunk(chunk: Chunk): boolean;
isInitial(): boolean;
addChild(group: ChunkGroup): boolean;
getChildren(): ChunkGroup[];
getNumberOfChildren(): number;
readonly childrenIterable: SortableSet<ChunkGroup>;
removeChild(group: ChunkGroup): boolean;
addParent(parentChunk: ChunkGroup): boolean;
getParents(): ChunkGroup[];
getNumberOfParents(): number;
hasParent(parent: ChunkGroup): boolean;
readonly parentsIterable: SortableSet<ChunkGroup>;
removeParent(chunkGroup: ChunkGroup): boolean;
addAsyncEntrypoint(entrypoint: Entrypoint): boolean;
readonly asyncEntrypointsIterable: SortableSet<ChunkGroup>;
getBlocks(): any[];
getNumberOfBlocks(): number;
hasBlock(block?: any): boolean;
readonly blocksIterable: Iterable<AsyncDependenciesBlock>;
addBlock(block: AsyncDependenciesBlock): boolean;
addOrigin(module: Module, loc: DependencyLocation, request: string): void;
getFiles(): string[];
remove(): void;
sortItems(): void;
/**
* Sorting predicate which allows current ChunkGroup to be compared against another.
* Sorting values are based off of number of chunks in ChunkGroup.
*/
compareTo(chunkGraph: ChunkGraph, otherGroup: ChunkGroup): 0 | 1 | -1;
getChildrenByOrders(
moduleGraph: ModuleGraph,
chunkGraph: ChunkGraph
): Record<string, ChunkGroup[]>;
/**
* Sets the top-down index of a module in this ChunkGroup
*/
setModulePreOrderIndex(module: Module, index: number): void;
/**
* Gets the top-down index of a module in this ChunkGroup
*/
getModulePreOrderIndex(module: Module): number;
/**
* Sets the bottom-up index of a module in this ChunkGroup
*/
setModulePostOrderIndex(module: Module, index: number): void;
/**
* Gets the bottom-up index of a module in this ChunkGroup
*/
getModulePostOrderIndex(module: Module): number;
checkConstraints(): void;
getModuleIndex: (module: Module) => number;
getModuleIndex2: (module: Module) => number;
}
declare interface ChunkGroupOptions {
preloadOrder?: number;
prefetchOrder?: number;
name?: string;
}
declare interface ChunkHashContext {
/**
* the runtime template
*/
runtimeTemplate: RuntimeTemplate;
/**
* the module graph
*/
moduleGraph: ModuleGraph;
/**
* the chunk graph
*/
chunkGraph: ChunkGraph;
}
declare interface ChunkMaps {
hash: Record<string | number, string>;
contentHash: Record<string | number, Record<string, string>>;
name: Record<string | number, string>;
}
declare class ChunkModuleIdRangePlugin {
constructor(options?: any);
options: any;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
declare interface ChunkModuleMaps {
id: Record<string | number, (string | number)[]>;
hash: Record<string | number, string>;
}
declare interface ChunkPathData {
id: string | number;
name?: string;
hash: string;
hashWithLength?: (arg0: number) => string;
contentHash?: Record<string, string>;
contentHashWithLength?: Record<string, (length: number) => string>;
}
declare class ChunkPrefetchPreloadPlugin {
constructor();
apply(compiler: Compiler): void;
}
declare interface ChunkSizeOptions {
/**
* constant overhead for a chunk
*/
chunkOverhead?: number;
/**
* multiplicator for initial chunks
*/
entryChunkMultiplicator?: number;
}
declare abstract class ChunkTemplate {
hooks: Readonly<{
renderManifest: { tap: (options?: any, fn?: any) => void };
modules: { tap: (options?: any, fn?: any) => void };
render: { tap: (options?: any, fn?: any) => void };
renderWithEntry: { tap: (options?: any, fn?: any) => void };
hash: { tap: (options?: any, fn?: any) => void };
hashForChunk: { tap: (options?: any, fn?: any) => void };
}>;
readonly outputOptions: Output;
}
declare interface CodeGenerationContext {
/**
* the dependency templates
*/
dependencyTemplates: DependencyTemplates;
/**