webpack 5.112.0 → 5.112.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.
Files changed (263) hide show
  1. package/bin/webpack.js +13 -7
  2. package/lib/Compilation.js +198 -61
  3. package/lib/Compiler.js +12 -25
  4. package/lib/asset/AssetBytesGenerator.js +14 -6
  5. package/lib/asset/AssetBytesParser.js +10 -8
  6. package/lib/asset/AssetGenerator.js +36 -48
  7. package/lib/asset/AssetModule.js +11 -0
  8. package/lib/asset/AssetModulesPlugin.js +5 -4
  9. package/lib/asset/AssetParser.js +8 -8
  10. package/lib/asset/AssetSourceGenerator.js +16 -8
  11. package/lib/asset/AssetSourceParser.js +10 -8
  12. package/lib/asset/WebManifestGenerator.js +11 -6
  13. package/lib/asset/WebManifestParser.js +3 -3
  14. package/lib/async-modules/AsyncModuleHelpers.js +8 -2
  15. package/lib/async-modules/InferAsyncModulesPlugin.js +7 -2
  16. package/lib/cache/CacheFacade.js +1 -1
  17. package/lib/cache/PackFileCacheStrategy.js +6 -10
  18. package/lib/cache/ResolverCachePlugin.js +58 -8
  19. package/lib/config/WebpackOptionsApply.js +8 -28
  20. package/lib/config/cli.js +9 -6
  21. package/lib/config/defaults.js +24 -13
  22. package/lib/config/getClaimedAssetTypes.js +2 -2
  23. package/lib/config/target.js +1 -1
  24. package/lib/context/ContextModule.js +1 -1
  25. package/lib/context/ContextModuleFactory.js +1 -1
  26. package/lib/context/ContextReplacementPlugin.js +3 -9
  27. package/lib/css/CssGenerator.js +40 -47
  28. package/lib/css/CssModule.js +10 -0
  29. package/lib/css/CssModulesPlugin.js +13 -6
  30. package/lib/css/CssParser.js +33 -32
  31. package/lib/css/conventions.js +1 -1
  32. package/lib/css/data.js +224 -219
  33. package/lib/css/syntax-parser.js +1312 -312
  34. package/lib/css/syntax-printer.js +1142 -1025
  35. package/lib/debug/ProfilingPlugin.js +65 -43
  36. package/lib/define/DefinePlugin.js +10 -15
  37. package/lib/define/DotenvPlugin.js +10 -6
  38. package/lib/define/EnvironmentPlugin.js +4 -2
  39. package/lib/dependencies/amd/AMDDefineDependencyParserPlugin.js +1 -2
  40. package/lib/dependencies/amd/AMDRequireDependenciesBlockParserPlugin.js +4 -1
  41. package/lib/dependencies/commonjs/CommonJsExportRequireDependency.js +1 -4
  42. package/lib/dependencies/commonjs/CommonJsExportsParserPlugin.js +18 -33
  43. package/lib/dependencies/commonjs/CommonJsImportsParserPlugin.js +1 -3
  44. package/lib/dependencies/commonjs/CommonJsObjectExportDependency.js +4 -4
  45. package/lib/dependencies/commonjs/CommonJsPlugin.js +2 -5
  46. package/lib/dependencies/commonjs/RequireEnsureDependenciesBlockParserPlugin.js +4 -1
  47. package/lib/dependencies/context/ImportMetaContextDependencyParserPlugin.js +1 -2
  48. package/lib/dependencies/context/ImportMetaGlobDependencyParserPlugin.js +4 -7
  49. package/lib/dependencies/context/ImportMetaGlobHelpers.js +8 -10
  50. package/lib/dependencies/core/CachedConstDependency.js +9 -6
  51. package/lib/dependencies/css/CssIcssExportDependency.js +6 -7
  52. package/lib/dependencies/css/CssIcssImportDependency.js +1 -3
  53. package/lib/dependencies/css/CssUrlDependency.js +2 -6
  54. package/lib/dependencies/esm/ESMDetectionParserPlugin.js +2 -4
  55. package/lib/dependencies/esm/ESMExportExpressionDependency.js +2 -2
  56. package/lib/dependencies/esm/ESMExportImportedSpecifierDependency.js +16 -18
  57. package/lib/dependencies/esm/ESMExportSpecifierDependency.js +20 -3
  58. package/lib/dependencies/esm/ESMExports.js +2 -10
  59. package/lib/dependencies/esm/ESMImportDependency.js +17 -2
  60. package/lib/dependencies/esm/ESMImportDependencyParserPlugin.js +6 -17
  61. package/lib/dependencies/esm/ESMImportGuard.js +11 -23
  62. package/lib/dependencies/esm/ESMImportSideEffectDependency.js +1 -1
  63. package/lib/dependencies/esm/ESMImportSpecifierDependency.js +4 -1
  64. package/lib/dependencies/esm/ESMLiveExportDependency.js +311 -0
  65. package/lib/dependencies/esm/ESMLiveExportParserPlugin.js +862 -0
  66. package/lib/dependencies/esm/ESMModulesPlugin.js +1 -3
  67. package/lib/dependencies/esm/TopLevelAwaitDependency.js +1 -8
  68. package/lib/dependencies/helpers/DynamicExports.js +4 -6
  69. package/lib/dependencies/html/HtmlEntryDependency.js +5 -14
  70. package/lib/dependencies/html/HtmlInlineHtmlDependency.js +1 -4
  71. package/lib/dependencies/html/HtmlInlineScriptDependency.js +2 -6
  72. package/lib/dependencies/html/HtmlInlineStyleDependency.js +1 -4
  73. package/lib/dependencies/import/ImportParserPlugin.js +3 -6
  74. package/lib/dependencies/import-meta/ImportMetaPlugin.js +4 -6
  75. package/lib/dependencies/url/URLParserPlugin.js +1 -1
  76. package/lib/dependencies/worker/WorkerAndWorkletPlugin.js +51 -20
  77. package/lib/devtool/ModuleFilenameHelpers.js +1 -1
  78. package/lib/devtool/SourceMapDevToolPlugin.js +1 -1
  79. package/lib/dll/DelegatedModule.js +3 -3
  80. package/lib/dll/DllModule.js +3 -1
  81. package/lib/dll/DllReferencePlugin.js +1 -4
  82. package/lib/errors/AbstractMethodError.js +1 -1
  83. package/lib/errors/ErrorHelpers.js +2 -1
  84. package/lib/errors/HookWebpackError.js +2 -1
  85. package/lib/errors/JSONParseError.js +4 -4
  86. package/lib/errors/WebpackError.js +3 -2
  87. package/lib/esm/ModuleChunkFormatPlugin.js +36 -1
  88. package/lib/externals/ExternalModule.js +12 -9
  89. package/lib/externals/ExternalModuleFactoryPlugin.js +1 -2
  90. package/lib/externals/ExternalsPlugin.js +1 -1
  91. package/lib/fs/FileSystemInfo.js +4 -4
  92. package/lib/graph/AsyncDependenciesBlock.js +1 -1
  93. package/lib/graph/ChunkGraph.js +5 -0
  94. package/lib/graph/Dependency.js +8 -2
  95. package/lib/graph/ExportsInfo.js +1 -1
  96. package/lib/graph/ModuleGraph.js +14 -3
  97. package/lib/graph/buildChunkGraph.js +17 -19
  98. package/lib/graph/findGraphRoots.js +1 -1
  99. package/lib/hmr/HotModuleReplacement.runtime.js +10 -9
  100. package/lib/hmr/HotModuleReplacementPlugin.js +5 -11
  101. package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +16 -19
  102. package/lib/hmr/LazyCompilationPlugin.js +1 -7
  103. package/lib/html/HtmlGenerator.js +25 -17
  104. package/lib/html/HtmlModule.js +11 -1
  105. package/lib/html/HtmlModulesPlugin.js +12 -11
  106. package/lib/html/HtmlParser.js +10 -9
  107. package/lib/html/builtinEmbeddedRenderer.js +31 -33
  108. package/lib/html/data.js +42 -21
  109. package/lib/html/htmlMinify.js +4 -1
  110. package/lib/html/syntax-parser.js +34 -35
  111. package/lib/html/syntax-printer.js +2 -3
  112. package/lib/html/xmlMinify.js +4 -1
  113. package/lib/ids/HashedModuleIdsPlugin.js +1 -1
  114. package/lib/index.js +13 -12
  115. package/lib/javascript/APIPlugin.js +7 -13
  116. package/lib/javascript/BasicEvaluatedExpression.js +5 -5
  117. package/lib/javascript/CommonJsChunkFormatPlugin.js +2 -7
  118. package/lib/javascript/ConstPlugin.js +1 -1
  119. package/lib/javascript/JavascriptGenerator.js +16 -11
  120. package/lib/javascript/JavascriptMetaInfoPlugin.js +3 -15
  121. package/lib/javascript/JavascriptModule.js +10 -0
  122. package/lib/javascript/JavascriptModulesPlugin.js +2 -4
  123. package/lib/javascript/JavascriptParser.js +99 -11
  124. package/lib/javascript/ScopeAnalyzer.js +183 -107
  125. package/lib/javascript/UseStrictPlugin.js +2 -5
  126. package/lib/javascript/jsMinify.js +1 -1
  127. package/lib/javascript/regexp.js +2 -2
  128. package/lib/javascript/syntax-parser.js +2114 -1506
  129. package/lib/javascript/syntax-printer-data.js +167 -1
  130. package/lib/javascript/syntax-printer.js +9554 -2782
  131. package/lib/json/JsonGenerator.js +15 -7
  132. package/lib/json/JsonModule.js +11 -0
  133. package/lib/json/JsonParser.js +7 -6
  134. package/lib/library/AssignLibraryPlugin.js +1 -1
  135. package/lib/library/JsonpLibraryPlugin.js +1 -1
  136. package/lib/library/ModuleLibraryPlugin.js +399 -23
  137. package/lib/loaders/LoaderRunner.js +76 -38
  138. package/lib/loaders/loadLoader.js +16 -10
  139. package/lib/module/Generator.js +17 -9
  140. package/lib/module/Module.js +2 -2
  141. package/lib/module/NormalModule.js +7 -5
  142. package/lib/module/NormalModuleFactory.js +11 -17
  143. package/lib/module/Parser.js +9 -2
  144. package/lib/module/extractSourceMap.js +69 -18
  145. package/lib/module/findCaseMismatch.js +2 -2
  146. package/lib/node/ExternalModuleInitFragment.js +2 -2
  147. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +4 -12
  148. package/lib/node/ReadFileCompileWasmPlugin.js +2 -6
  149. package/lib/node/nodeConsole.js +4 -3
  150. package/lib/optimize/CircularModulesPlugin.js +1 -1
  151. package/lib/optimize/ConcatenatedModule.js +4 -8
  152. package/lib/optimize/FlagDependencyExportsPlugin.js +6 -11
  153. package/lib/optimize/FlagDependencyUsagePlugin.js +28 -3
  154. package/lib/optimize/InlineExports.js +4 -7
  155. package/lib/optimize/LazyBarrels.js +41 -5
  156. package/lib/optimize/ModuleConcatenationPlugin.js +8 -10
  157. package/lib/optimize/RealContentHashPlugin.js +2 -6
  158. package/lib/optimize/SideEffectsFlagPlugin.js +7 -21
  159. package/lib/optimize/SplitChunksPlugin.js +11 -24
  160. package/lib/optimize/TupleQueue.js +1 -1
  161. package/lib/output/CleanPlugin.js +3 -1
  162. package/lib/output/CopyPlugin.js +3 -4
  163. package/lib/performance/EvalUsagePlugin.js +1 -3
  164. package/lib/performance/HotspotsPlugin.js +33 -9
  165. package/lib/performance/PureAnnotationsPlugin.js +16 -10
  166. package/lib/performance/TopLevelThisPlugin.js +17 -9
  167. package/lib/prefetch/ResourceHintPlugin.js +1 -1
  168. package/lib/provide/ProvidedDependency.js +36 -4
  169. package/lib/rules/BasicEffectRulePlugin.js +1 -1
  170. package/lib/rules/RuleSetCompiler.js +15 -5
  171. package/lib/rules/UseEffectRulePlugin.js +1 -3
  172. package/lib/runtime/AsyncModuleRuntimeModule.js +7 -1
  173. package/lib/runtime/GetChunkFilenameRuntimeModule.js +1 -5
  174. package/lib/runtime/RuntimeGlobals.js +6 -0
  175. package/lib/runtime/RuntimePlugin.js +2 -0
  176. package/lib/schemes/HttpUriPlugin.js +1 -2
  177. package/lib/schemes/VirtualUrlPlugin.js +3 -1
  178. package/lib/serialization/AggregateErrorSerializer.js +3 -3
  179. package/lib/serialization/BinaryMiddleware.js +4 -1
  180. package/lib/serialization/ErrorObjectSerializer.js +2 -5
  181. package/lib/serialization/ObjectMiddleware.js +17 -15
  182. package/lib/serialization/PlainObjectSerializer.js +3 -7
  183. package/lib/serialization/Serializer.js +21 -11
  184. package/lib/serialization/SerializerMiddleware.js +8 -6
  185. package/lib/stats/DefaultStatsFactoryPlugin.js +35 -35
  186. package/lib/stats/DefaultStatsPresetPlugin.js +2 -6
  187. package/lib/stats/DefaultStatsPrinterPlugin.js +12 -11
  188. package/lib/stats/StatsFactory.js +194 -24
  189. package/lib/stats/StatsPrinter.js +126 -13
  190. package/lib/template/DependencyTemplate.js +1 -1
  191. package/lib/template/RuntimeTemplate.js +13 -32
  192. package/lib/template/Template.js +1 -1
  193. package/lib/util/SourceProcessor.js +146 -29
  194. package/lib/util/WeakTupleMap.js +10 -4
  195. package/lib/util/cleverMerge.js +61 -33
  196. package/lib/util/comparators.js +9 -5
  197. package/lib/util/dataURL.js +2 -0
  198. package/lib/util/deprecation.js +4 -3
  199. package/lib/util/globUtils.js +1 -4
  200. package/lib/util/internalSerializables.js +2 -0
  201. package/lib/util/makeSerializable.js +6 -4
  202. package/lib/util/memoize.js +1 -1
  203. package/lib/util/parseJson.js +2 -2
  204. package/lib/util/serialization.js +31 -27
  205. package/lib/wasm/AsyncWasmModule.js +12 -2
  206. package/lib/wasm/AsyncWebAssemblyGenerator.js +12 -4
  207. package/lib/wasm/AsyncWebAssemblyJavascriptGenerator.js +13 -5
  208. package/lib/wasm/AsyncWebAssemblyParser.js +7 -5
  209. package/lib/wasm/UniversalCompileAsyncWasmPlugin.js +2 -6
  210. package/lib/wasm-sync/SyncWasmModule.js +16 -1
  211. package/lib/wasm-sync/WebAssemblyGenerator.js +15 -10
  212. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +13 -5
  213. package/lib/wasm-sync/WebAssemblyParser.js +10 -12
  214. package/lib/web/FetchCompileAsyncWasmPlugin.js +4 -12
  215. package/lib/web/FetchCompileWasmPlugin.js +2 -6
  216. package/package.json +18 -19
  217. package/schemas/WebpackOptions.check.js +3 -3
  218. package/schemas/WebpackOptions.json +2 -2
  219. package/schemas/plugins/BannerPlugin.check.js +3 -3
  220. package/schemas/plugins/HtmlGeneratorOptions.check.js +3 -3
  221. package/schemas/plugins/HtmlParserOptions.check.js +3 -3
  222. package/schemas/plugins/IgnorePlugin.check.js +3 -3
  223. package/schemas/plugins/LoaderOptionsPlugin.check.js +3 -3
  224. package/schemas/plugins/ManifestPlugin.check.js +3 -3
  225. package/schemas/plugins/ProgressPlugin.check.js +3 -3
  226. package/schemas/plugins/SSRManifestPlugin.check.js +3 -3
  227. package/schemas/plugins/SourceMapDevToolPlugin.check.js +3 -3
  228. package/schemas/plugins/WatchIgnorePlugin.check.js +3 -3
  229. package/schemas/plugins/asset/AssetGeneratorOptions.check.js +3 -3
  230. package/schemas/plugins/asset/AssetInlineGeneratorOptions.check.js +3 -3
  231. package/schemas/plugins/asset/AssetParserOptions.check.js +3 -3
  232. package/schemas/plugins/asset/AssetResourceGeneratorOptions.check.js +3 -3
  233. package/schemas/plugins/container/ContainerPlugin.check.js +3 -3
  234. package/schemas/plugins/container/ContainerReferencePlugin.check.js +3 -3
  235. package/schemas/plugins/container/ExternalsType.check.js +3 -3
  236. package/schemas/plugins/container/ModuleFederationPlugin.check.js +3 -3
  237. package/schemas/plugins/css/CssAutoOrModuleParserOptions.check.js +3 -3
  238. package/schemas/plugins/css/CssGeneratorOptions.check.js +3 -3
  239. package/schemas/plugins/css/CssModuleGeneratorOptions.check.js +3 -3
  240. package/schemas/plugins/css/CssModuleParserOptions.check.js +3 -3
  241. package/schemas/plugins/css/CssParserOptions.check.js +3 -3
  242. package/schemas/plugins/debug/ProfilingPlugin.check.js +3 -3
  243. package/schemas/plugins/define/DotenvPluginOptions.check.js +7 -0
  244. package/schemas/plugins/define/DotenvPluginOptions.json +3 -0
  245. package/schemas/plugins/dll/DllPlugin.check.js +3 -3
  246. package/schemas/plugins/dll/DllReferencePlugin.check.js +3 -3
  247. package/schemas/plugins/ids/HashedModuleIdsPlugin.check.js +3 -3
  248. package/schemas/plugins/ids/OccurrenceChunkIdsPlugin.check.js +3 -3
  249. package/schemas/plugins/ids/OccurrenceModuleIdsPlugin.check.js +3 -3
  250. package/schemas/plugins/json/JsonModulesPluginGenerator.check.js +3 -3
  251. package/schemas/plugins/json/JsonModulesPluginParser.check.js +3 -3
  252. package/schemas/plugins/optimize/AggressiveSplittingPlugin.check.js +3 -3
  253. package/schemas/plugins/optimize/LimitChunkCountPlugin.check.js +3 -3
  254. package/schemas/plugins/optimize/MergeDuplicateChunksPlugin.check.js +3 -3
  255. package/schemas/plugins/optimize/MinChunkSizePlugin.check.js +3 -3
  256. package/schemas/plugins/output/CleanOptions.check.js +7 -0
  257. package/schemas/plugins/output/CleanOptions.json +3 -0
  258. package/schemas/plugins/schemes/HttpUriPlugin.check.js +3 -3
  259. package/schemas/plugins/schemes/VirtualUrlPlugin.check.js +3 -3
  260. package/schemas/plugins/sharing/ConsumeSharedPlugin.check.js +3 -3
  261. package/schemas/plugins/sharing/ProvideSharedPlugin.check.js +3 -3
  262. package/schemas/plugins/sharing/SharePlugin.check.js +3 -3
  263. package/types.d.ts +1482 -358
package/types.d.ts CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  ObjectExpression,
63
63
  ObjectPattern,
64
64
  PrivateIdentifier,
65
- Program as ProgramImport,
65
+ Program,
66
66
  Property,
67
67
  PropertyDefinition,
68
68
  RegExpLiteral,
@@ -145,6 +145,7 @@ import {
145
145
  } from "webpack-sources/types/helpers/stringBufferUtils";
146
146
  type SetSamplingIntervalParameterType =
147
147
  import("inspector").Profiler.SetSamplingIntervalParameterType;
148
+ type StopReturnType = import("inspector").Profiler.StopReturnType;
148
149
 
149
150
  declare interface Abortable {
150
151
  signal?: AbortSignal;
@@ -264,7 +265,7 @@ declare interface AdditionalDataKnown {
264
265
  /**
265
266
  * the AST webpack should parse instead of the source
266
267
  */
267
- webpackAST: PreparsedAst;
268
+ webpackAST?: PreparsedAst;
268
269
  }
269
270
  type AfterContextResolveData = ContextResolveData &
270
271
  ContextOptions & {
@@ -358,7 +359,7 @@ declare interface AllCodeGenerationSchemas {
358
359
  /**
359
360
  * chunk init fragments for javascript modules
360
361
  */
361
- chunkInitFragments: InitFragment<any>[];
362
+ chunkInitFragments: InitFragment<ChunkRenderContextJavascriptModulesPlugin>[];
362
363
 
363
364
  /**
364
365
  * native external reexport source and attributes
@@ -409,7 +410,7 @@ type AnalyzableForm =
409
410
  "import" | "url" | "url-runtime" | "url-inline" | "wasm" | "wasm-relative";
410
411
  type AnyLoaderContext = NormalModuleLoaderContext<any> &
411
412
  LoaderRunnerMutableContext<any> &
412
- LoaderRunnerReadonlyContext<any> &
413
+ LoaderRunnerReadonlyContext<any, LoaderData> &
413
414
  LoaderPluginLoaderContext &
414
415
  HotModuleReplacementPluginLoaderContext;
415
416
 
@@ -470,17 +471,17 @@ declare interface Asset {
470
471
  */
471
472
  info: AssetInfo;
472
473
  }
473
- declare abstract class AssetBytesGenerator extends Generator {
474
+ declare abstract class AssetBytesGenerator extends Generator<AssetNormalModule> {
474
475
  /**
475
476
  * Generates fallback output for the provided error condition.
476
477
  */
477
478
  generateError(
478
479
  error: Error,
479
- module: NormalModule,
480
+ module: AssetNormalModule,
480
481
  generateContext: GenerateContext
481
482
  ): null | Source;
482
483
  }
483
- declare abstract class AssetBytesParser extends Parser {}
484
+ declare abstract class AssetBytesParser extends Parser<BuiltAssetModule> {}
484
485
  declare interface AssetDependencyMeta {
485
486
  sourceType: "asset-url" | "css-url";
486
487
  }
@@ -497,7 +498,7 @@ declare interface AssetEmittedInfo {
497
498
  }
498
499
  type AssetFilterItemTypes =
499
500
  string | RegExp | ((name: string, asset: StatsAsset) => boolean);
500
- declare abstract class AssetGenerator extends Generator {
501
+ declare abstract class AssetGenerator extends Generator<AssetNormalModule> {
501
502
  dataUrlOptions?:
502
503
  | AssetGeneratorDataUrlOptions
503
504
  | ((
@@ -512,19 +513,19 @@ declare abstract class AssetGenerator extends Generator {
512
513
  /**
513
514
  * Returns mime type.
514
515
  */
515
- getMimeType(module: NormalModule): string;
516
+ getMimeType(module: AssetNormalModule): string;
516
517
 
517
518
  /**
518
519
  * Generates data uri.
519
520
  */
520
- generateDataUri(module: NormalModule, renderedSource?: Source): string;
521
+ generateDataUri(module: AssetNormalModule, renderedSource?: Source): string;
521
522
 
522
523
  /**
523
524
  * Generates fallback output for the provided error condition.
524
525
  */
525
526
  generateError(
526
527
  error: Error,
527
- module: NormalModule,
528
+ module: AssetNormalModule,
528
529
  generateContext: GenerateContext
529
530
  ): null | Source;
530
531
  }
@@ -589,7 +590,8 @@ declare class AssetModulesPlugin {
589
590
  declare interface AssetModulesPluginOptions {
590
591
  sideEffectFree?: boolean;
591
592
  }
592
- declare abstract class AssetParser extends Parser {
593
+ type AssetNormalModule = NormalModule & { buildInfo?: AssetModuleBuildInfo };
594
+ declare abstract class AssetParser extends Parser<BuiltAssetModule> {
593
595
  dataUrlCondition?:
594
596
  | boolean
595
597
  | AssetParserDataUrlOptions
@@ -653,17 +655,17 @@ declare interface AssetResourceGeneratorOptions {
653
655
  */
654
656
  publicPath?: string | TemplatePathFn<PathData>;
655
657
  }
656
- declare abstract class AssetSourceGenerator extends Generator {
658
+ declare abstract class AssetSourceGenerator extends Generator<AssetNormalModule> {
657
659
  /**
658
660
  * Generates fallback output for the provided error condition.
659
661
  */
660
662
  generateError(
661
663
  error: Error,
662
- module: NormalModule,
664
+ module: AssetNormalModule,
663
665
  generateContext: GenerateContext
664
666
  ): null | Source;
665
667
  }
666
- declare abstract class AssetSourceParser extends Parser {}
668
+ declare abstract class AssetSourceParser extends Parser<BuiltAssetModule> {}
667
669
 
668
670
  /**
669
671
  * Where an asset which is a symbolic link points, as the link itself spells it.
@@ -734,7 +736,7 @@ declare class AsyncDependenciesBlock extends DependenciesBlock {
734
736
  request?: null | string;
735
737
  chunkName?: null | string;
736
738
  get circular(): boolean;
737
- module: any;
739
+ module: void;
738
740
  }
739
741
 
740
742
  /**
@@ -839,7 +841,7 @@ declare interface AsyncWebAssemblyModulesPluginOptions {
839
841
  */
840
842
  mangleImports?: boolean;
841
843
  }
842
- declare abstract class AsyncWebAssemblyParser extends Parser {}
844
+ declare abstract class AsyncWebAssemblyParser extends Parser<BuiltAsyncWasmModule> {}
843
845
  type AtRule = NodeSyntaxParser & {
844
846
  name: string;
845
847
  nameStart: number;
@@ -1058,7 +1060,7 @@ declare interface BasenameCacheEntry {
1058
1060
  */
1059
1061
  declare abstract class BasicEvaluatedExpression {
1060
1062
  expression?:
1061
- | ProgramImport
1063
+ | Program
1062
1064
  | ImportDeclaration
1063
1065
  | ExportNamedDeclaration
1064
1066
  | ExportAllDeclaration
@@ -1118,10 +1120,12 @@ declare abstract class BasicEvaluatedExpression {
1118
1120
  | MethodDefinition
1119
1121
  | PropertyDefinition
1120
1122
  | VariableDeclarator
1121
- | AssignmentProperty
1122
1123
  | Property
1123
1124
  | CatchClause
1124
1125
  | ClassBody
1126
+ | SwitchCase
1127
+ | TemplateElement
1128
+ | AssignmentProperty
1125
1129
  | ImportSpecifier
1126
1130
  | ImportDefaultSpecifier
1127
1131
  | ImportNamespaceSpecifier
@@ -1129,9 +1133,7 @@ declare abstract class BasicEvaluatedExpression {
1129
1133
  | ObjectPattern
1130
1134
  | ArrayPattern
1131
1135
  | RestElement
1132
- | AssignmentPattern
1133
- | SwitchCase
1134
- | TemplateElement;
1136
+ | AssignmentPattern;
1135
1137
  quasis?: BasicEvaluatedExpression[];
1136
1138
  parts?: BasicEvaluatedExpression[];
1137
1139
  items?: BasicEvaluatedExpression[];
@@ -1317,7 +1319,7 @@ declare abstract class BasicEvaluatedExpression {
1317
1319
  */
1318
1320
  setExpression(
1319
1321
  expression?:
1320
- | ProgramImport
1322
+ | Program
1321
1323
  | ImportDeclaration
1322
1324
  | ExportNamedDeclaration
1323
1325
  | ExportAllDeclaration
@@ -1377,10 +1379,12 @@ declare abstract class BasicEvaluatedExpression {
1377
1379
  | MethodDefinition
1378
1380
  | PropertyDefinition
1379
1381
  | VariableDeclarator
1380
- | AssignmentProperty
1381
1382
  | Property
1382
1383
  | CatchClause
1383
1384
  | ClassBody
1385
+ | SwitchCase
1386
+ | TemplateElement
1387
+ | AssignmentProperty
1384
1388
  | ImportSpecifier
1385
1389
  | ImportDefaultSpecifier
1386
1390
  | ImportNamespaceSpecifier
@@ -1389,8 +1393,6 @@ declare abstract class BasicEvaluatedExpression {
1389
1393
  | ArrayPattern
1390
1394
  | RestElement
1391
1395
  | AssignmentPattern
1392
- | SwitchCase
1393
- | TemplateElement
1394
1396
  ): BasicEvaluatedExpression;
1395
1397
  }
1396
1398
  type BeforeContextResolveData = ContextResolveData & ContextOptions;
@@ -1453,6 +1455,8 @@ declare interface BufferEntry {
1453
1455
  bufferedMap?: null | BufferedMap;
1454
1456
  scopes?: ScopesReplay;
1455
1457
  }
1458
+ type BufferSerializableType =
1459
+ Buffer | (() => BufferSerializableType[] | Promise<BufferSerializableType[]>);
1456
1460
  declare interface BufferedMap {
1457
1461
  /**
1458
1462
  * version
@@ -1538,6 +1542,48 @@ declare interface BuildDiagnostics {
1538
1542
  }
1539
1543
  type BuildInfo = KnownBuildInfo & Record<string, any>;
1540
1544
  type BuildMeta = KnownBuildMeta & Record<string, any>;
1545
+ type BuiltAssetModule = NormalModule & {
1546
+ buildInfo: AssetModuleBuildInfo;
1547
+ buildMeta: BuildMeta;
1548
+ };
1549
+ type BuiltAsyncWasmModule = NormalModule & {
1550
+ buildInfo: NormalModuleBuildInfo;
1551
+ buildMeta: BuildMeta;
1552
+ };
1553
+ type BuiltCssModule = NormalModule & {
1554
+ buildInfo: CssModuleBuildInfo;
1555
+ buildMeta: CssModuleBuildMeta;
1556
+ };
1557
+ type BuiltHtmlModule = NormalModule & {
1558
+ buildInfo: HtmlModuleBuildInfo;
1559
+ buildMeta: BuildMeta;
1560
+ };
1561
+ type BuiltJavascriptModule = NormalModule & {
1562
+ buildInfo: JavascriptModuleBuildInfo;
1563
+ buildMeta: JavascriptModuleBuildMeta;
1564
+ };
1565
+ type BuiltJsonModule = NormalModule & {
1566
+ buildInfo: JsonModuleBuildInfo;
1567
+ buildMeta: BuildMeta;
1568
+ };
1569
+
1570
+ /**
1571
+ * The map a minify writes, its mappings decoded, less the keys that say nothing.
1572
+ */
1573
+ declare interface BuiltSourceMap {
1574
+ version: number;
1575
+ file?: string;
1576
+ names: string[];
1577
+ sourceRoot?: string;
1578
+ sources: string[];
1579
+ sourcesContent?: (undefined | null | string)[];
1580
+ mappings: DecodedSegment[][];
1581
+ ignoreList: number[];
1582
+ }
1583
+ type BuiltSyncWasmModule = NormalModule & {
1584
+ buildInfo: NormalModuleBuildInfo;
1585
+ buildMeta: SyncWasmModuleBuildMeta;
1586
+ };
1541
1587
  type BuiltinEmbeddedRendererOptions = Pick<
1542
1588
  CssProcessOptions,
1543
1589
  | "environment"
@@ -1564,7 +1610,9 @@ declare class BunTargetPlugin {
1564
1610
  */
1565
1611
  apply(compiler: Compiler): void;
1566
1612
  }
1567
- declare abstract class ByTypeGenerator extends Generator {
1613
+ declare abstract class ByTypeGenerator<
1614
+ TModule extends NormalModule = NormalModule
1615
+ > extends Generator<TModule> {
1568
1616
  map: { [index: string]: undefined | Generator };
1569
1617
  generateError?: (
1570
1618
  error: Error,
@@ -4182,7 +4230,7 @@ declare class Compilation {
4182
4230
  * the load itself; anything the tap reads off the requirement set must be
4183
4231
  * captured before queueing, since `create` runs later.
4184
4232
  */
4185
- addLazyRuntimeModule<T>(
4233
+ addLazyRuntimeModule<T extends object>(
4186
4234
  chunk: Chunk,
4187
4235
  load: () => Promise<T>,
4188
4236
  create: (loaded: T) => RuntimeModule,
@@ -4759,10 +4807,75 @@ declare interface CompressHelpers {
4759
4807
  */
4760
4808
  declare interface CompressorShape {
4761
4809
  [index: string]: any;
4762
- options: Record<string, any>;
4810
+ options: Partial<any>;
4763
4811
  stack: NodeShape[];
4764
- option(name: string): any;
4765
- has_directive(directive: string): any;
4812
+ option<
4813
+ K extends
4814
+ | "module"
4815
+ | "warnings"
4816
+ | "inline"
4817
+ | "arguments"
4818
+ | "expression"
4819
+ | "evaluate"
4820
+ | "unused"
4821
+ | "properties"
4822
+ | "arrows"
4823
+ | "booleans"
4824
+ | "booleans_as_integers"
4825
+ | "collapse_vars"
4826
+ | "comparisons"
4827
+ | "computed_props"
4828
+ | "conditionals"
4829
+ | "dead_code"
4830
+ | "defaults"
4831
+ | "directives"
4832
+ | "drop_console"
4833
+ | "drop_debugger"
4834
+ | "ecma"
4835
+ | "builtins_ecma"
4836
+ | "builtins_pure"
4837
+ | "global_defs"
4838
+ | "hoist_funs"
4839
+ | "hoist_props"
4840
+ | "hoist_vars"
4841
+ | "ie8"
4842
+ | "if_return"
4843
+ | "join_vars"
4844
+ | "keep_classnames"
4845
+ | "keep_fargs"
4846
+ | "keep_fnames"
4847
+ | "keep_infinity"
4848
+ | "lhs_constants"
4849
+ | "loops"
4850
+ | "negate_iife"
4851
+ | "passes"
4852
+ | "pure_getters"
4853
+ | "pure_funcs"
4854
+ | "pure_conversions"
4855
+ | "pure_heritage"
4856
+ | "pure_new"
4857
+ | "reduce_funcs"
4858
+ | "reduce_vars"
4859
+ | "sequences"
4860
+ | "side_effects"
4861
+ | "switches"
4862
+ | "top_retain"
4863
+ | "toplevel"
4864
+ | "typeofs"
4865
+ | "unsafe"
4866
+ | "unsafe_arrows"
4867
+ | "unsafe_comps"
4868
+ | "unsafe_Function"
4869
+ | "unsafe_math"
4870
+ | "unsafe_symbols"
4871
+ | "unsafe_methods"
4872
+ | "unsafe_proto"
4873
+ | "unsafe_regexp"
4874
+ | "unsafe_undefined"
4875
+ >(
4876
+ name: K
4877
+ ): any[K];
4878
+ has_directive(directive: string): undefined | true | NodeShape;
4766
4879
  parent(level?: number): NodeShape;
4767
4880
  self(): NodeShape;
4768
4881
  find_parent(test: (value: unknown) => boolean): undefined | NodeShape;
@@ -5364,8 +5477,11 @@ declare class ConstDependency extends NullDependency {
5364
5477
  | "url"
5365
5478
  | "module-dependency"
5366
5479
  | "esm-import"
5480
+ | "provided"
5367
5481
  | "dynamic-import"
5368
5482
  | "esm-reexport"
5483
+ | "esm-export-specifier"
5484
+ | "esm-live-export"
5369
5485
  | "esm-side-effect-import"
5370
5486
  | "context-element"
5371
5487
  | "esm-bare-side-effect-import"
@@ -5389,9 +5505,7 @@ declare class ConstDependency extends NullDependency {
5389
5505
  declare class ConstDependencyTemplate extends NullDependencyTemplate {
5390
5506
  constructor();
5391
5507
  }
5392
- declare interface Constructor {
5393
- new (...params: any[]): any;
5394
- }
5508
+ type Constructor = abstract new (...params: never[]) => object;
5395
5509
  declare class ConsumeSharedPlugin {
5396
5510
  /**
5397
5511
  * Creates an instance of ConsumeSharedPlugin.
@@ -5869,12 +5983,11 @@ declare interface CopyObjectPattern {
5869
5983
  * Everything beside the content of the file the transform depends on, serialized into the cache key as JSON.
5870
5984
  */
5871
5985
  keys?:
5872
- | CopyTransformCacheKeys
5986
+ | JsonObjectFs
5873
5987
  | ((
5874
- defaultKeys: CopyTransformCacheKeys,
5988
+ defaultKeys: JsonObjectFs,
5875
5989
  absoluteFilename: string
5876
- ) =>
5877
- CopyTransformCacheKeys | Promise<CopyTransformCacheKeys>);
5990
+ ) => JsonObjectFs | Promise<JsonObjectFs>);
5878
5991
  };
5879
5992
  /**
5880
5993
  * Modifies the content of a copied file.
@@ -5928,9 +6041,6 @@ declare class CopyPlugin {
5928
6041
  ignore: SyncBailHook<[string], boolean | void>;
5929
6042
  };
5930
6043
  }
5931
- declare interface CopyTransformCacheKeys {
5932
- [index: string]: any;
5933
- }
5934
6044
  type CreateData = NormalModuleCreateData & { settings: ModuleSettings };
5935
6045
 
5936
6046
  /**
@@ -6106,7 +6216,7 @@ declare interface CssEnvironment {
6106
6216
  */
6107
6217
  vendorPrefixes?: boolean;
6108
6218
  }
6109
- declare abstract class CssGenerator extends Generator {
6219
+ declare abstract class CssGenerator extends Generator<CssNormalModule> {
6110
6220
  options: CssModuleGeneratorOptions;
6111
6221
 
6112
6222
  /**
@@ -6125,7 +6235,7 @@ declare abstract class CssGenerator extends Generator {
6125
6235
  * Processes the provided module.
6126
6236
  */
6127
6237
  sourceModule(
6128
- module: NormalModule,
6238
+ module: CssNormalModule,
6129
6239
  initFragments: InitFragment<GenerateContext>[],
6130
6240
  source: ReplaceSource,
6131
6241
  generateContext: GenerateContext & { cssData: CssData }
@@ -6136,7 +6246,7 @@ declare abstract class CssGenerator extends Generator {
6136
6246
  */
6137
6247
  generateError(
6138
6248
  error: Error,
6139
- module: NormalModule,
6249
+ module: CssNormalModule,
6140
6250
  generateContext: GenerateContext
6141
6251
  ): null | Source;
6142
6252
  }
@@ -6944,7 +7054,11 @@ type CssNodeType =
6944
7054
  | 26
6945
7055
  | 27
6946
7056
  | 28;
6947
- declare abstract class CssParser extends Parser {
7057
+ type CssNormalModule = NormalModule & {
7058
+ buildInfo?: CssModuleBuildInfo;
7059
+ buildMeta?: CssModuleBuildMeta;
7060
+ };
7061
+ declare abstract class CssParser extends Parser<BuiltCssModule> {
6948
7062
  defaultMode: "global" | "auto" | "local" | "pure";
6949
7063
  options: {
6950
7064
  /**
@@ -7251,7 +7365,7 @@ declare interface CssPrintOptions {
7251
7365
  convertApproximateColors?: boolean;
7252
7366
 
7253
7367
  /**
7254
- * drop a declaration a later one in the same block overrides even where nothing states that the target can read the later value; off by default, and only read while printing. With a `browserslist` selection the drop is already made wherever every browser it names is known to read the later value, so this widens the case where no target is selected — a selection naming a browser the tables do not cover still answers for the whole of it
7368
+ * drop a declaration a later one in the same block overrides even where no target is selected, wherever Chromium, Gecko and WebKit each read the later value; off by default, and only read while printing. With a `browserslist` selection the drop is already made wherever every browser it names is known to read the later value, so this widens the case where no target is selected — a selection naming a browser the tables do not cover still answers for the whole of it
7255
7369
  */
7256
7370
  dropOverriddenDeclarations?: boolean;
7257
7371
 
@@ -7357,7 +7471,7 @@ declare interface CssProcessOptions {
7357
7471
  mergeDistantRules?: boolean;
7358
7472
 
7359
7473
  /**
7360
- * drop a declaration a later one in the same block overrides even where nothing states that the target can read the later value; off by default, and only read while printing. With a `browserslist` selection the drop is already made wherever every browser it names is known to read the later value, so this widens the case where no target is selected — a selection naming a browser the tables do not cover still answers for the whole of it
7474
+ * drop a declaration a later one in the same block overrides even where no target is selected, wherever Chromium, Gecko and WebKit each read the later value; off by default, and only read while printing. With a `browserslist` selection the drop is already made wherever every browser it names is known to read the later value, so this widens the case where no target is selected — a selection naming a browser the tables do not cover still answers for the whole of it
7361
7475
  */
7362
7476
  dropOverriddenDeclarations?: boolean;
7363
7477
 
@@ -7774,6 +7888,13 @@ declare interface DecodedEntitiesWithMap {
7774
7888
  text: string;
7775
7889
  map?: number[];
7776
7890
  }
7891
+ type DecodedSegment =
7892
+ | [number, number, number, number]
7893
+ | [number]
7894
+ | [number, number, number, number, number];
7895
+ type DecodedSourceMap = Omit<RawSourceMap, "mappings"> & {
7896
+ mappings: DecodedSegment[][];
7897
+ };
7777
7898
  declare interface DefaultHandlerOptions {
7778
7899
  progressBar?: false | Required<ProgressPluginOptionsProgressBarBranch3Object>;
7779
7900
  estimatedTime?: boolean;
@@ -8021,8 +8142,11 @@ declare class Dependency {
8021
8142
  | "url"
8022
8143
  | "module-dependency"
8023
8144
  | "esm-import"
8145
+ | "provided"
8024
8146
  | "dynamic-import"
8025
8147
  | "esm-reexport"
8148
+ | "esm-export-specifier"
8149
+ | "esm-live-export"
8026
8150
  | "esm-side-effect-import"
8027
8151
  | "context-element"
8028
8152
  | "esm-bare-side-effect-import"
@@ -8146,8 +8270,8 @@ declare class Dependency {
8146
8270
  * Restores this instance from the provided deserializer context.
8147
8271
  */
8148
8272
  deserialize(__0: ObjectDeserializerContextObjectMiddlewareObject_2): void;
8149
- module: any;
8150
- get disconnect(): any;
8273
+ module: void;
8274
+ get disconnect(): void;
8151
8275
 
8152
8276
  /**
8153
8277
  * Compares two dependencies by source location for sorting a module's
@@ -8190,8 +8314,11 @@ declare class Dependency {
8190
8314
  | "url"
8191
8315
  | "module-dependency"
8192
8316
  | "esm-import"
8317
+ | "provided"
8193
8318
  | "dynamic-import"
8194
8319
  | "esm-reexport"
8320
+ | "esm-export-specifier"
8321
+ | "esm-live-export"
8195
8322
  | "esm-side-effect-import"
8196
8323
  | "context-element"
8197
8324
  | "esm-bare-side-effect-import"
@@ -8212,9 +8339,7 @@ declare class Dependency {
8212
8339
  | "css-icss-export"
8213
8340
  >;
8214
8341
  }
8215
- declare interface DependencyConstructor {
8216
- new (...args: any[]): Dependency;
8217
- }
8342
+ type DependencyConstructor = abstract new (...args: never[]) => Dependency;
8218
8343
 
8219
8344
  /**
8220
8345
  * branch guard: the dependency is live only when the formula evaluates to `value`
@@ -8307,9 +8432,9 @@ declare interface DependencyTemplateContext {
8307
8432
  codeGenerationResults: CodeGenerationResults;
8308
8433
 
8309
8434
  /**
8310
- * chunkInitFragments
8435
+ * init fragments for the chunk, rendered with its render context
8311
8436
  */
8312
- chunkInitFragments: InitFragment<GenerateContext>[];
8437
+ chunkInitFragments: InitFragment<ChunkRenderContextJavascriptModulesPlugin>[];
8313
8438
 
8314
8439
  /**
8315
8440
  * get access to the code generation data
@@ -8961,8 +9086,11 @@ declare class ESMImportDependency extends ModuleDependency {
8961
9086
  | "url"
8962
9087
  | "module-dependency"
8963
9088
  | "esm-import"
9089
+ | "provided"
8964
9090
  | "dynamic-import"
8965
9091
  | "esm-reexport"
9092
+ | "esm-export-specifier"
9093
+ | "esm-live-export"
8966
9094
  | "esm-side-effect-import"
8967
9095
  | "context-element"
8968
9096
  | "esm-bare-side-effect-import"
@@ -9182,7 +9310,7 @@ declare interface EffectUse {
9182
9310
  type: EffectUseType;
9183
9311
  value: {
9184
9312
  loader: string;
9185
- options?: null | string | Record<string, any>;
9313
+ options?: null | string | { [index: string]: any };
9186
9314
  ident?: string;
9187
9315
  };
9188
9316
  }
@@ -9358,6 +9486,7 @@ declare class EnableWasmLoadingPlugin {
9358
9486
  */
9359
9487
  static checkEnabled(compiler: Compiler, type: string): void;
9360
9488
  }
9489
+ type EncodedSourceMap = Omit<BuiltSourceMap, "mappings"> & { mappings: string };
9361
9490
  type EncodingOptionFs =
9362
9491
  | undefined
9363
9492
  | null
@@ -9824,9 +9953,9 @@ declare class EnvironmentPlugin {
9824
9953
  /**
9825
9954
  * Creates an instance of EnvironmentPlugin.
9826
9955
  */
9827
- constructor(...keys: (string | Record<string, any> | string[])[]);
9956
+ constructor(...keys: (string | string[] | JsonObjectFs)[]);
9828
9957
  keys: string[];
9829
- defaultValues: Record<string, any>;
9958
+ defaultValues: JsonObjectFs;
9830
9959
 
9831
9960
  /**
9832
9961
  * Applies the plugin by registering its hooks on the compiler.
@@ -10672,7 +10801,7 @@ declare interface ExposesObject {
10672
10801
  [index: string]: ExposesObjectValue;
10673
10802
  }
10674
10803
  type ExposesObjectValue = string | ExposesConfig | string[];
10675
- type ExpressionEstreeIndex =
10804
+ type Expression =
10676
10805
  | ImportExpressionImport
10677
10806
  | UnaryExpression
10678
10807
  | ArrayExpression
@@ -10708,38 +10837,6 @@ declare interface ExpressionExpressionInfo {
10708
10837
  getMembersOptionals: () => boolean[];
10709
10838
  getMemberRanges: () => [number, number][];
10710
10839
  }
10711
- type ExpressionSyntaxParser =
10712
- | (ImportExpressionImport & NodeLike)
10713
- | (UnaryExpression & NodeLike)
10714
- | (ArrayExpression & NodeLike)
10715
- | (ArrowFunctionExpression & NodeLike)
10716
- | (AssignmentExpression & NodeLike)
10717
- | (AwaitExpression & NodeLike)
10718
- | (BinaryExpression & NodeLike)
10719
- | (SimpleCallExpression & NodeLike)
10720
- | (NewExpression & NodeLike)
10721
- | (ChainExpression & NodeLike)
10722
- | (ClassExpression & NodeLike)
10723
- | (ConditionalExpression & NodeLike)
10724
- | (FunctionExpression & NodeLike)
10725
- | (Identifier & NodeLike)
10726
- | (SimpleLiteral & NodeLike)
10727
- | (RegExpLiteral & NodeLike)
10728
- | (BigIntLiteral & NodeLike)
10729
- | (LogicalExpression & NodeLike)
10730
- | (MemberExpression & NodeLike)
10731
- | (MetaProperty & NodeLike)
10732
- | (ObjectExpression & NodeLike)
10733
- | (SequenceExpression & NodeLike)
10734
- | (TaggedTemplateExpression & NodeLike)
10735
- | (TemplateLiteral & NodeLike)
10736
- | (ThisExpression & NodeLike)
10737
- | (UpdateExpression & NodeLike)
10738
- | (YieldExpression & NodeLike)
10739
- | (NodeLike & {
10740
- type: "ParenthesizedExpression";
10741
- expression: ExpressionSyntaxParser;
10742
- });
10743
10840
  type ExternalItem =
10744
10841
  | string
10745
10842
  | RegExp
@@ -11627,13 +11724,6 @@ type FilterItemTypes = string | RegExp | ((value: string) => boolean);
11627
11724
  declare interface Flags {
11628
11725
  [index: string]: Argument;
11629
11726
  }
11630
-
11631
- /**
11632
- * terser's `format` options, defaulted
11633
- */
11634
- declare interface FormatOptions {
11635
- [index: string]: any;
11636
- }
11637
11727
  declare interface FoundTargetItem {
11638
11728
  module: Module;
11639
11729
  connection: ModuleGraphConnection;
@@ -11730,37 +11820,37 @@ type GeneratedValue =
11730
11820
  | Function
11731
11821
  | RegExp
11732
11822
  | PromiseLike<CodeValuePrimitive>;
11733
- declare class Generator {
11823
+ declare class Generator<TModule extends NormalModule = NormalModule> {
11734
11824
  constructor();
11735
11825
 
11736
11826
  /**
11737
11827
  * Returns the source types available for this module.
11738
11828
  */
11739
- getTypes(module: NormalModule): ReadonlySet<string>;
11829
+ getTypes(module: TModule): ReadonlySet<string>;
11740
11830
  getTypesDependOnIncomingConnections(): boolean;
11741
11831
 
11742
11832
  /**
11743
11833
  * Returns the estimated size for the requested source type.
11744
11834
  */
11745
- getSize(module: NormalModule, type?: string): number;
11835
+ getSize(module: TModule, type?: string): number;
11746
11836
 
11747
11837
  /**
11748
11838
  * Generates generated code for this runtime module.
11749
11839
  */
11750
- generate(module: NormalModule, __1: GenerateContext): null | Source;
11840
+ generate(module: TModule, __1: GenerateContext): null | Source;
11751
11841
 
11752
11842
  /**
11753
11843
  * Returns the reason this module cannot be concatenated, when one exists.
11754
11844
  */
11755
11845
  getConcatenationBailoutReason(
11756
- module: NormalModule,
11846
+ module: TModule,
11757
11847
  context: ConcatenationBailoutReasonContext
11758
11848
  ): undefined | string;
11759
11849
 
11760
11850
  /**
11761
11851
  * Updates the hash with the data contributed by this instance.
11762
11852
  */
11763
- updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
11853
+ updateHash(hash: Hash, __1: UpdateHashContextGenerator<TModule>): void;
11764
11854
 
11765
11855
  /**
11766
11856
  * Returns generator by type.
@@ -11951,6 +12041,148 @@ declare interface GetOptionsMethod<OptionsType> {
11951
12041
  (): OptionsType;
11952
12042
  (schema: Parameters<typeof validateFunction>[0]): OptionsType;
11953
12043
  }
12044
+ type GivenCompressOptions = Omit<Partial<any>, "global_defs" | "pure_funcs"> & {
12045
+ global_defs?: false | object;
12046
+ pure_funcs?: null | string[] | ((node: PureCallView) => boolean);
12047
+ };
12048
+
12049
+ /**
12050
+ * terser's `format` options as a caller gives them; `source_map` is left out,
12051
+ * as the minify writes it from `sourceMap`.
12052
+ */
12053
+ declare interface GivenFormatOptions {
12054
+ code?: boolean;
12055
+ ast?: boolean;
12056
+
12057
+ /**
12058
+ * which comments are kept
12059
+ */
12060
+ comments?:
12061
+ string | boolean | RegExp | ((node: any, comment: KeptComment) => boolean);
12062
+
12063
+ /**
12064
+ * whether the output is laid out to read, always false here
12065
+ */
12066
+ beautify?: boolean;
12067
+
12068
+ /**
12069
+ * whether every body is braced, always false here
12070
+ */
12071
+ braces?: boolean;
12072
+
12073
+ /**
12074
+ * how far a level indents, unread here
12075
+ */
12076
+ indent_level?: number;
12077
+
12078
+ /**
12079
+ * how far the output indents, unread here
12080
+ */
12081
+ indent_start?: number;
12082
+
12083
+ /**
12084
+ * how long a line may be, unread here
12085
+ */
12086
+ max_line_len?: number | false;
12087
+
12088
+ /**
12089
+ * how wide a line may be, unread here
12090
+ */
12091
+ width?: number;
12092
+
12093
+ /**
12094
+ * whether properties are written in shorthand, undefined until read from `ecma`
12095
+ */
12096
+ shorthand?: boolean;
12097
+
12098
+ /**
12099
+ * which edition the output may use
12100
+ */
12101
+ ecma?: number;
12102
+
12103
+ /**
12104
+ * whether the output works around that engine
12105
+ */
12106
+ ie8?: boolean;
12107
+
12108
+ /**
12109
+ * whether the output works around that engine
12110
+ */
12111
+ safari10?: boolean;
12112
+
12113
+ /**
12114
+ * whether only ASCII is written
12115
+ */
12116
+ ascii_only?: boolean;
12117
+
12118
+ /**
12119
+ * whether `</script` is escaped
12120
+ */
12121
+ inline_script?: boolean;
12122
+
12123
+ /**
12124
+ * whether numbers are written as read
12125
+ */
12126
+ keep_numbers?: boolean;
12127
+
12128
+ /**
12129
+ * whether quoted keys stay quoted
12130
+ */
12131
+ keep_quoted_props?: boolean;
12132
+
12133
+ /**
12134
+ * text written first
12135
+ */
12136
+ preamble?: null | string;
12137
+
12138
+ /**
12139
+ * whether annotation comments are kept
12140
+ */
12141
+ preserve_annotations?: boolean;
12142
+
12143
+ /**
12144
+ * whether every key is quoted
12145
+ */
12146
+ quote_keys?: boolean;
12147
+
12148
+ /**
12149
+ * which quote strings are written with
12150
+ */
12151
+ quote_style?: number;
12152
+
12153
+ /**
12154
+ * whether statements end in semicolons rather than line breaks
12155
+ */
12156
+ semicolons?: boolean;
12157
+
12158
+ /**
12159
+ * whether a shebang is kept
12160
+ */
12161
+ shebang?: boolean;
12162
+
12163
+ /**
12164
+ * whether the output works around that engine
12165
+ */
12166
+ webkit?: boolean;
12167
+
12168
+ /**
12169
+ * whether an immediately called function is parenthesized
12170
+ */
12171
+ wrap_iife?: boolean;
12172
+
12173
+ /**
12174
+ * whether a function passed as an argument is parenthesized
12175
+ */
12176
+ wrap_func_args?: boolean;
12177
+ spidermonkey?: boolean;
12178
+ }
12179
+ type GivenMangleOptions = Omit<Partial<any>, "properties"> & {
12180
+ properties?: boolean | any;
12181
+ };
12182
+ type GivenSourceMapOptions = Omit<Partial<any>, "content"> & {
12183
+ content?:
12184
+ null | string | object | RawSourceMap | DecodedSourceMap | IndexSourceMap;
12185
+ };
11954
12186
 
11955
12187
  /**
11956
12188
  * Match glob patterns against the value, `!` in front of a pattern excludes it. Path separators are normalized to `/` on every OS, and a relative pattern matches at any depth.
@@ -12240,13 +12472,10 @@ declare interface HashedModuleIdsPluginOptions {
12240
12472
  */
12241
12473
  hashFunction?: string | typeof Hash;
12242
12474
  }
12243
- type Head<T extends ReadonlyArray<any>> = T extends readonly [
12244
- infer H,
12245
- ...infer _Rest
12246
- ]
12475
+ type Head<T> = T extends readonly [infer H, ...infer _Rest]
12247
12476
  ? H
12248
12477
  : T extends readonly []
12249
- ? any
12478
+ ? never
12250
12479
  : T extends readonly (infer E)[]
12251
12480
  ? E
12252
12481
  : never;
@@ -12377,7 +12606,7 @@ type HtmlFaviconIcon =
12377
12606
  */
12378
12607
  type?: string;
12379
12608
  };
12380
- declare abstract class HtmlGenerator extends Generator {
12609
+ declare abstract class HtmlGenerator extends Generator<HtmlNormalModule> {
12381
12610
  options: HtmlGeneratorOptions;
12382
12611
 
12383
12612
  /**
@@ -12402,7 +12631,7 @@ declare abstract class HtmlGenerator extends Generator {
12402
12631
  * Processes the provided module.
12403
12632
  */
12404
12633
  sourceModule(
12405
- module: NormalModule,
12634
+ module: HtmlNormalModule,
12406
12635
  initFragments: InitFragment<GenerateContext>[],
12407
12636
  source: ReplaceSource,
12408
12637
  generateContext: GenerateContext
@@ -12413,7 +12642,7 @@ declare abstract class HtmlGenerator extends Generator {
12413
12642
  */
12414
12643
  generateError(
12415
12644
  error: Error,
12416
- module: NormalModule,
12645
+ module: HtmlNormalModule,
12417
12646
  generateContext: GenerateContext
12418
12647
  ): null | Source;
12419
12648
  }
@@ -12768,6 +12997,7 @@ type HtmlNodePath<T = number, S = unknown> = Omit<
12768
12997
  ): null | string;
12769
12998
  };
12770
12999
  type HtmlNodeType = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
13000
+ type HtmlNormalModule = NormalModule & { buildInfo?: HtmlModuleBuildInfo };
12771
13001
  declare interface HtmlParseOptions {
12772
13002
  /**
12773
13003
  * context element name for fragment parsing (e.g. `td`, `svg path`); omit for a full document
@@ -12789,7 +13019,7 @@ declare interface HtmlParseOptions {
12789
13019
  */
12790
13020
  scripting?: boolean;
12791
13021
  }
12792
- declare abstract class HtmlParser extends Parser {
13022
+ declare abstract class HtmlParser extends Parser<BuiltHtmlModule> {
12793
13023
  magicCommentContext: ContextImport;
12794
13024
  template?: (source: string, context: HtmlTemplateContext) => string;
12795
13025
  fragmentContext?: string;
@@ -12802,7 +13032,10 @@ declare abstract class HtmlParser extends Parser {
12802
13032
  * dependency offsets against it) and the generator (which renders from
12803
13033
  * `module.originalSource()`) stay in agreement.
12804
13034
  */
12805
- applyTemplate(source: string | Buffer, module: NormalModule): string | Buffer;
13035
+ applyTemplate(
13036
+ source: string | Buffer,
13037
+ module: HtmlNormalModule
13038
+ ): string | Buffer;
12806
13039
  }
12807
13040
 
12808
13041
  /**
@@ -12996,7 +13229,7 @@ declare interface HtmlProcessOptions {
12996
13229
  removeEmptyAttributes?: boolean;
12997
13230
 
12998
13231
  /**
12999
- * drop an element with no children and no attributes, unless its bare form is meaningful (default false)
13232
+ * drop an element with no children and no attributes where its bare form renders nothing and nothing reads it (default false)
13000
13233
  */
13001
13234
  removeEmptyElements?: boolean;
13002
13235
 
@@ -14051,6 +14284,18 @@ type ImportSource =
14051
14284
  undefined | null | string | SimpleLiteral | RegExpLiteral | BigIntLiteral;
14052
14285
  type Imported = true | [string, string][];
14053
14286
 
14287
+ /**
14288
+ * a map made of sections, each a map of its own, or its JSON
14289
+ */
14290
+ declare interface IndexSourceMap {
14291
+ version: number;
14292
+ file?: string;
14293
+ sections: {
14294
+ offset: { line: number; column: number };
14295
+ map: string | RawSourceMap | DecodedSourceMap | IndexSourceMap;
14296
+ }[];
14297
+ }
14298
+
14054
14299
  /**
14055
14300
  * Options for infrastructure level logging.
14056
14301
  */
@@ -14376,7 +14621,7 @@ declare interface IteratorObject<T, TReturn = unknown, TNext = unknown>
14376
14621
  [Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
14377
14622
  [Symbol.dispose](): void;
14378
14623
  }
14379
- declare abstract class JavascriptGenerator extends Generator {
14624
+ declare abstract class JavascriptGenerator extends Generator<JavascriptNormalModule> {
14380
14625
  /**
14381
14626
  * Processes the provided dependency.
14382
14627
  */
@@ -14413,7 +14658,7 @@ declare abstract class JavascriptGenerator extends Generator {
14413
14658
  */
14414
14659
  generateError(
14415
14660
  error: Error,
14416
- module: NormalModule,
14661
+ module: JavascriptNormalModule,
14417
14662
  generateContext: GenerateContext
14418
14663
  ): null | Source;
14419
14664
  }
@@ -14995,7 +15240,11 @@ declare class JavascriptModulesPlugin {
14995
15240
  };
14996
15241
  static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
14997
15242
  }
14998
- declare class JavascriptParser extends Parser {
15243
+ type JavascriptNormalModule = NormalModule & {
15244
+ buildInfo?: JavascriptModuleBuildInfo;
15245
+ buildMeta?: JavascriptModuleBuildMeta;
15246
+ };
15247
+ declare class JavascriptParser extends Parser<BuiltJavascriptModule> {
14999
15248
  /**
15000
15249
  * Creates an instance of JavascriptParser.
15001
15250
  */
@@ -15326,13 +15575,10 @@ declare class JavascriptParser extends Parser {
15326
15575
  /**
15327
15576
  * @since 5.105.0
15328
15577
  */
15329
- collectGuards: SyncBailHook<
15330
- [ExpressionEstreeIndex],
15331
- void | GuardCollection
15332
- >;
15578
+ collectGuards: SyncBailHook<[Expression], void | GuardCollection>;
15333
15579
  classExtendsExpression: SyncBailHook<
15334
15580
  [
15335
- ExpressionEstreeIndex,
15581
+ Expression,
15336
15582
  ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration
15337
15583
  ],
15338
15584
  boolean | void
@@ -15349,7 +15595,7 @@ declare class JavascriptParser extends Parser {
15349
15595
  */
15350
15596
  classBodyValue: SyncBailHook<
15351
15597
  [
15352
- ExpressionEstreeIndex,
15598
+ Expression,
15353
15599
  MethodDefinition | PropertyDefinition,
15354
15600
  ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration
15355
15601
  ],
@@ -15458,11 +15704,11 @@ declare class JavascriptParser extends Parser {
15458
15704
  * @since 5.101.3
15459
15705
  */
15460
15706
  collectDestructuringAssignmentProperties: SyncBailHook<
15461
- [ExpressionEstreeIndex],
15707
+ [Expression],
15462
15708
  boolean | void
15463
15709
  >;
15464
- canRename: HookMap<SyncBailHook<[ExpressionEstreeIndex], boolean | void>>;
15465
- rename: HookMap<SyncBailHook<[ExpressionEstreeIndex], boolean | void>>;
15710
+ canRename: HookMap<SyncBailHook<[Expression], boolean | void>>;
15711
+ rename: HookMap<SyncBailHook<[Expression], boolean | void>>;
15466
15712
  assign: HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>;
15467
15713
  write: HookMap<SyncBailHook<[WriteStatement], boolean | void>>;
15468
15714
  writeMemberChain: HookMap<
@@ -15471,7 +15717,7 @@ declare class JavascriptParser extends Parser {
15471
15717
  assignMemberChain: HookMap<
15472
15718
  SyncBailHook<[AssignmentExpression, string[]], boolean | void>
15473
15719
  >;
15474
- typeof: HookMap<SyncBailHook<[ExpressionEstreeIndex], boolean | void>>;
15720
+ typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
15475
15721
  importCall: SyncBailHook<
15476
15722
  [
15477
15723
  ImportExpressionJavascriptParser,
@@ -15522,13 +15768,7 @@ declare class JavascriptParser extends Parser {
15522
15768
  >;
15523
15769
  memberChainOfCallMemberChain: HookMap<
15524
15770
  SyncBailHook<
15525
- [
15526
- ExpressionEstreeIndex,
15527
- string[],
15528
- CallExpression,
15529
- string[],
15530
- [number, number][]
15531
- ],
15771
+ [Expression, string[], CallExpression, string[], [number, number][]],
15532
15772
  boolean | void
15533
15773
  >
15534
15774
  >;
@@ -15550,7 +15790,7 @@ declare class JavascriptParser extends Parser {
15550
15790
  * @since 5.71.0
15551
15791
  */
15552
15792
  binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
15553
- expression: HookMap<SyncBailHook<[ExpressionEstreeIndex], boolean | void>>;
15793
+ expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
15554
15794
  expressionMemberChain: HookMap<
15555
15795
  SyncBailHook<
15556
15796
  [MemberExpression, string[], boolean[], [number, number][]],
@@ -15568,18 +15808,12 @@ declare class JavascriptParser extends Parser {
15568
15808
  [LogicalExpression],
15569
15809
  boolean | void
15570
15810
  >;
15571
- program: SyncBailHook<
15572
- [ProgramImport, CommentJavascriptParser[]],
15573
- boolean | void
15574
- >;
15811
+ program: SyncBailHook<[Program, CommentJavascriptParser[]], boolean | void>;
15575
15812
  /**
15576
15813
  * @since 5.99.0
15577
15814
  */
15578
15815
  terminate: SyncBailHook<[ReturnStatement | ThrowStatement], boolean | void>;
15579
- finish: SyncBailHook<
15580
- [ProgramImport, CommentJavascriptParser[]],
15581
- boolean | void
15582
- >;
15816
+ finish: SyncBailHook<[Program, CommentJavascriptParser[]], boolean | void>;
15583
15817
  /**
15584
15818
  * @since 5.99.9
15585
15819
  */
@@ -15657,11 +15891,11 @@ declare class JavascriptParser extends Parser {
15657
15891
  | ForOfStatement
15658
15892
  | ExportDefaultDeclaration;
15659
15893
  destructuringAssignmentProperties?: WeakMap<
15660
- ExpressionEstreeIndex,
15894
+ Expression,
15661
15895
  Set<DestructuringAssignmentProperty>
15662
15896
  >;
15663
15897
  currentTagData?:
15664
- | Record<string, any>
15898
+ | object
15665
15899
  | TopLevelSymbol
15666
15900
  | ESMSettings
15667
15901
  | ImportSettings
@@ -15673,7 +15907,7 @@ declare class JavascriptParser extends Parser {
15673
15907
  * Destructuring assignment properties for.
15674
15908
  */
15675
15909
  destructuringAssignmentPropertiesFor(
15676
- node: ExpressionEstreeIndex
15910
+ node: Expression
15677
15911
  ): undefined | Set<DestructuringAssignmentProperty>;
15678
15912
 
15679
15913
  /**
@@ -16141,6 +16375,14 @@ declare class JavascriptParser extends Parser {
16141
16375
  statement: FunctionDeclaration | MaybeNamedFunctionDeclaration
16142
16376
  ): void;
16143
16377
 
16378
+ /**
16379
+ * Bind a function declaration in the block holding it, when it does not
16380
+ * hoist to the enclosing scope.
16381
+ */
16382
+ blockPreWalkFunctionDeclaration(
16383
+ statement: FunctionDeclaration | MaybeNamedFunctionDeclaration
16384
+ ): void;
16385
+
16144
16386
  /**
16145
16387
  * Walk function declaration.
16146
16388
  */
@@ -16163,7 +16405,7 @@ declare class JavascriptParser extends Parser {
16163
16405
  */
16164
16406
  enterDestructuringAssignment(
16165
16407
  pattern: Pattern,
16166
- expression: ExpressionEstreeIndex
16408
+ expression: Expression
16167
16409
  ):
16168
16410
  | undefined
16169
16411
  | ImportExpressionImport
@@ -16880,14 +17122,12 @@ declare class JavascriptParser extends Parser {
16880
17122
  /**
16881
17123
  * Returns parsed string.
16882
17124
  */
16883
- parseString(expression: ExpressionEstreeIndex): string;
17125
+ parseString(expression: Expression): string;
16884
17126
 
16885
17127
  /**
16886
17128
  * Parses calculated string.
16887
17129
  */
16888
- parseCalculatedString(
16889
- expression: ExpressionEstreeIndex
16890
- ): CalculatedStringResult;
17130
+ parseCalculatedString(expression: Expression): CalculatedStringResult;
16891
17131
 
16892
17132
  /**
16893
17133
  * Returns evaluation result.
@@ -16992,7 +17232,7 @@ declare class JavascriptParser extends Parser {
16992
17232
  /**
16993
17233
  * Checks whether this javascript parser is statement level expression.
16994
17234
  */
16995
- isStatementLevelExpression(expr: ExpressionEstreeIndex): boolean;
17235
+ isStatementLevelExpression(expr: Expression): boolean;
16996
17236
 
16997
17237
  /**
16998
17238
  * Returns tag data.
@@ -17002,7 +17242,7 @@ declare class JavascriptParser extends Parser {
17002
17242
  tag: symbol
17003
17243
  ):
17004
17244
  | undefined
17005
- | Record<string, any>
17245
+ | object
17006
17246
  | TopLevelSymbol
17007
17247
  | ESMSettings
17008
17248
  | ImportSettings
@@ -17016,7 +17256,7 @@ declare class JavascriptParser extends Parser {
17016
17256
  name: string,
17017
17257
  tag: symbol,
17018
17258
  data?:
17019
- | Record<string, any>
17259
+ | object
17020
17260
  | TopLevelSymbol
17021
17261
  | ESMSettings
17022
17262
  | ImportSettings
@@ -17251,7 +17491,7 @@ declare class JavascriptParser extends Parser {
17251
17491
  * Gets name for expression.
17252
17492
  */
17253
17493
  getNameForExpression(
17254
- expression: ExpressionEstreeIndex
17494
+ expression: Expression
17255
17495
  ):
17256
17496
  | undefined
17257
17497
  | {
@@ -17263,7 +17503,7 @@ declare class JavascriptParser extends Parser {
17263
17503
  /**
17264
17504
  * Whether a definition is a variable rather than a free name or a scope.
17265
17505
  */
17266
- static isVariableInfo(value: unknown): boolean;
17506
+ static isVariableInfo(value?: string | VariableInfo | ScopeInfo): boolean;
17267
17507
 
17268
17508
  /**
17269
17509
  * Returns parser.
@@ -17566,7 +17806,7 @@ declare interface JavascriptParserOptions {
17566
17806
  */
17567
17807
  wrappedContextRegExp?: RegExp;
17568
17808
  }
17569
- type JavascriptParserState = ParserStateBase &
17809
+ type JavascriptParserState = ParserStateBase<BuiltJavascriptModule> &
17570
17810
  Record<string, any> &
17571
17811
  KnownJavascriptParserState;
17572
17812
  declare interface JoinCacheEntry {
@@ -17592,7 +17832,7 @@ declare abstract class JsonData {
17592
17832
  */
17593
17833
  updateHash(hash: Hash): void;
17594
17834
  }
17595
- declare abstract class JsonGenerator extends Generator {
17835
+ declare abstract class JsonGenerator extends Generator<JsonNormalModule> {
17596
17836
  options: JsonGeneratorOptions;
17597
17837
 
17598
17838
  /**
@@ -17600,7 +17840,7 @@ declare abstract class JsonGenerator extends Generator {
17600
17840
  */
17601
17841
  generateError(
17602
17842
  error: Error,
17603
- module: NormalModule,
17843
+ module: JsonNormalModule,
17604
17844
  generateContext: GenerateContext
17605
17845
  ): null | Source;
17606
17846
  }
@@ -17631,6 +17871,7 @@ declare class JsonModulesPlugin {
17631
17871
  */
17632
17872
  apply(compiler: Compiler): void;
17633
17873
  }
17874
+ type JsonNormalModule = NormalModule & { buildInfo?: JsonModuleBuildInfo };
17634
17875
  declare interface JsonObjectFs {
17635
17876
  [index: string]:
17636
17877
  undefined | null | string | number | boolean | JsonObjectFs | JsonValueFs[];
@@ -17645,7 +17886,7 @@ declare interface JsonObjectResolver {
17645
17886
  | JsonObjectResolver
17646
17887
  | JsonValueResolver[];
17647
17888
  }
17648
- declare abstract class JsonParser extends Parser {
17889
+ declare abstract class JsonParser extends Parser<BuiltJsonModule> {
17649
17890
  options: JsonParserOptions;
17650
17891
  }
17651
17892
 
@@ -17743,6 +17984,18 @@ declare class JsonpTemplatePlugin {
17743
17984
  ): JsonpCompilationPluginHooks;
17744
17985
  }
17745
17986
 
17987
+ /**
17988
+ * a comment as a `comments` callback is handed it: terser's comment token, its offset, line from 1 and column from 0, and the file it was read from
17989
+ */
17990
+ declare interface KeptComment {
17991
+ type: "comment1" | "comment2" | "comment3" | "comment4";
17992
+ value: string;
17993
+ pos: number;
17994
+ line: number;
17995
+ col: number;
17996
+ file?: string;
17997
+ }
17998
+
17746
17999
  /**
17747
18000
  * Defines the known asset info type used by this module.
17748
18001
  */
@@ -18128,6 +18381,16 @@ declare interface KnownMeta {
18128
18381
  * generate export definitions on demand
18129
18382
  */
18130
18383
  onDemandExports?: boolean;
18384
+
18385
+ /**
18386
+ * module-level `let` names a module library declares in the chunk's scope instead
18387
+ */
18388
+ liveBindings?: Map<string, LiveBinding>;
18389
+
18390
+ /**
18391
+ * module-level names a module keeps declared and mirrors to the chunk's scope on each write
18392
+ */
18393
+ liveSetters?: Map<string, LiveBinding>;
18131
18394
  }
18132
18395
 
18133
18396
  /**
@@ -18294,7 +18557,7 @@ declare interface KnownStatsChunkOrigin {
18294
18557
  * Defines the known stats compilation type used by this module.
18295
18558
  */
18296
18559
  declare interface KnownStatsCompilation {
18297
- env?: any;
18560
+ env?: StatsJsonValue;
18298
18561
  name?: string;
18299
18562
  hash?: string;
18300
18563
  version?: string;
@@ -18360,6 +18623,161 @@ declare interface KnownStatsFactoryContext {
18360
18623
  cachedGetWarnings: (compilation: Compilation) => Error[];
18361
18624
  }
18362
18625
 
18626
+ /**
18627
+ * The `[object, data]` each `extract` key webpack registers receives.
18628
+ */
18629
+ declare interface KnownStatsFactoryExtract {
18630
+ compilation: [StatsCompilation, Compilation];
18631
+ asset: [StatsAsset, PreprocessedAsset];
18632
+ asset$visible: [StatsAsset, PreprocessedAsset];
18633
+ chunkGroup: [StatsChunkGroup, ChunkGroupInfoWithName];
18634
+ module: [StatsModule, Module];
18635
+ module$visible: [StatsModule, Module];
18636
+ moduleIssuer: [StatsModuleIssuer, Module];
18637
+ profile: [StatsProfile, ModuleProfile];
18638
+ moduleReason: [StatsModuleReason, ModuleGraphConnection];
18639
+ chunk: [StatsChunk, Chunk];
18640
+ chunkOrigin: [StatsChunkOrigin, OriginRecord];
18641
+ error: [StatsError, WebpackError];
18642
+ warning: [StatsError, WebpackError];
18643
+ cause: [StatsError, WebpackError];
18644
+ moduleTraceItem: [StatsModuleTraceItem, ModuleTrace];
18645
+ moduleTraceDependency: [StatsModuleTraceDependency, Dependency];
18646
+ }
18647
+
18648
+ declare interface KnownStatsFactoryItemFactories {
18649
+ compilation: Compilation;
18650
+ asset: PreprocessedAsset;
18651
+ asset$visible: PreprocessedAsset;
18652
+ chunkGroup: ChunkGroupInfoWithName;
18653
+ module: Module;
18654
+ module$visible: Module;
18655
+ moduleIssuer: Module;
18656
+ profile: ModuleProfile;
18657
+ moduleReason: ModuleGraphConnection;
18658
+ chunk: Chunk;
18659
+ chunkOrigin: OriginRecord;
18660
+ error: WebpackError;
18661
+ warning: WebpackError;
18662
+ cause: WebpackError;
18663
+ moduleTraceItem: ModuleTrace;
18664
+ moduleTraceDependency: Dependency;
18665
+ "compilation.children[].compilation": Compilation;
18666
+ }
18667
+
18668
+ /**
18669
+ * The item `getItemName` receives for each `<array path>[]` key webpack registers.
18670
+ */
18671
+ declare interface KnownStatsFactoryItemNames {
18672
+ "compilation.assets[]": PreprocessedAsset;
18673
+ "compilation.chunks[]": Chunk;
18674
+ "compilation.modules[]": Module;
18675
+ "compilation.entrypoints[]": ChunkGroupInfoWithName;
18676
+ "compilation.namedChunkGroups[]": ChunkGroupInfoWithName;
18677
+ "compilation.errors[]": Error;
18678
+ "compilation.warnings[]": Error;
18679
+ "compilation.hints[]": Error;
18680
+ "compilation.children[]": Compilation;
18681
+ "asset.related[]": PreprocessedAsset;
18682
+ "error.errors[]": Error;
18683
+ "warning.errors[]": Error;
18684
+ "chunk.modules[]": Module;
18685
+ "chunk.rootModules[]": Module;
18686
+ "chunk.origins[]": OriginRecord;
18687
+ "module.issuerPath[]": Module;
18688
+ "module.reasons[]": ModuleGraphConnection;
18689
+ "module.modules[]": Module;
18690
+ "module.children[]": Module;
18691
+ "moduleTrace[]": ModuleTrace;
18692
+ "moduleTraceItem.dependencies[]": Dependency;
18693
+ }
18694
+ declare interface KnownStatsFactoryRawItems {
18695
+ "compilation.assets": PreprocessedAsset;
18696
+ "compilation.chunks": Chunk;
18697
+ "compilation.modules": Module;
18698
+ "compilation.entrypoints": ChunkGroupInfoWithName;
18699
+ "compilation.namedChunkGroups": ChunkGroupInfoWithName;
18700
+ "compilation.errors": Error;
18701
+ "compilation.warnings": Error;
18702
+ "compilation.hints": Error;
18703
+ "compilation.children": Compilation;
18704
+ "asset.related": PreprocessedAsset;
18705
+ "error.errors": Error;
18706
+ "warning.errors": Error;
18707
+ "chunk.modules": Module;
18708
+ "chunk.rootModules": Module;
18709
+ "chunk.origins": OriginRecord;
18710
+ "module.issuerPath": Module;
18711
+ "module.reasons": ModuleGraphConnection;
18712
+ "module.modules": Module;
18713
+ "module.children": Module;
18714
+ moduleTrace: ModuleTrace;
18715
+ "moduleTraceItem.dependencies": Dependency;
18716
+ }
18717
+ declare interface KnownStatsFactoryResultItems {
18718
+ "compilation.assets": StatsAsset;
18719
+ "compilation.chunks": StatsChunk;
18720
+ "compilation.modules": StatsModule;
18721
+ "compilation.entrypoints": StatsChunkGroup;
18722
+ "compilation.namedChunkGroups": StatsChunkGroup;
18723
+ "compilation.errors": StatsError;
18724
+ "compilation.warnings": StatsError;
18725
+ "compilation.hints": StatsError;
18726
+ "compilation.children": StatsCompilation;
18727
+ "asset.related": StatsAsset;
18728
+ "error.errors": StatsError;
18729
+ "warning.errors": StatsError;
18730
+ "chunk.modules": StatsModule;
18731
+ "chunk.rootModules": StatsModule;
18732
+ "chunk.origins": StatsChunkOrigin;
18733
+ "module.issuerPath": StatsModuleIssuer;
18734
+ "module.reasons": StatsModuleReason;
18735
+ "module.modules": StatsModule;
18736
+ "module.children": StatsModule;
18737
+ moduleTrace: StatsModuleTraceItem;
18738
+ "moduleTraceItem.dependencies": StatsModuleTraceDependency;
18739
+ }
18740
+
18741
+ declare interface KnownStatsFactoryResults {
18742
+ compilation: StatsCompilation;
18743
+ asset: StatsAsset;
18744
+ asset$visible: StatsAsset;
18745
+ chunkGroup: StatsChunkGroup;
18746
+ module: StatsModule;
18747
+ module$visible: StatsModule;
18748
+ moduleIssuer: StatsModuleIssuer;
18749
+ profile: StatsProfile;
18750
+ moduleReason: StatsModuleReason;
18751
+ chunk: StatsChunk;
18752
+ chunkOrigin: StatsChunkOrigin;
18753
+ error: StatsError;
18754
+ warning: StatsError;
18755
+ cause: StatsError;
18756
+ moduleTraceItem: StatsModuleTraceItem;
18757
+ moduleTraceDependency: StatsModuleTraceDependency;
18758
+ moduleTrace: StatsModuleTraceItem[];
18759
+ "compilation.assets": StatsAsset[];
18760
+ "compilation.chunks": StatsChunk[];
18761
+ "compilation.modules": StatsModule[];
18762
+ "compilation.errors": StatsError[];
18763
+ "compilation.warnings": StatsError[];
18764
+ "compilation.hints": StatsError[];
18765
+ "compilation.children": StatsCompilation[];
18766
+ "asset.related": StatsAsset[];
18767
+ "error.errors": StatsError[];
18768
+ "warning.errors": StatsError[];
18769
+ "chunk.modules": StatsModule[];
18770
+ "chunk.rootModules": StatsModule[];
18771
+ "chunk.origins": StatsChunkOrigin[];
18772
+ "module.issuerPath": StatsModuleIssuer[];
18773
+ "module.reasons": StatsModuleReason[];
18774
+ "module.modules": StatsModule[];
18775
+ "module.children": StatsModule[];
18776
+ "moduleTraceItem.dependencies": StatsModuleTraceDependency[];
18777
+ "compilation.entrypoints": Record<string, StatsChunkGroup>;
18778
+ "compilation.namedChunkGroups": Record<string, StatsChunkGroup>;
18779
+ }
18780
+
18363
18781
  /**
18364
18782
  * Defines the known stats logging type used by this module.
18365
18783
  */
@@ -18475,6 +18893,88 @@ declare interface KnownStatsModuleTraceItem {
18475
18893
  moduleId?: string | number;
18476
18894
  }
18477
18895
 
18896
+ /**
18897
+ * The item `getItemName` receives for each `<array path>[]` key of `KnownStatsPrintItems`.
18898
+ */
18899
+ declare interface KnownStatsPrintItemNames {
18900
+ "compilation.assets[]": StatsAsset;
18901
+ "compilation.modules[]": StatsModule;
18902
+ "compilation.chunks[]": StatsChunk;
18903
+ "compilation.entrypoints[]": StatsChunkGroup;
18904
+ "compilation.namedChunkGroups[]": StatsChunkGroup;
18905
+ "compilation.errors[]": StatsError;
18906
+ "compilation.warnings[]": StatsError;
18907
+ "compilation.hints[]": StatsError;
18908
+ "compilation.logging[]": KnownStatsLogging &
18909
+ Record<string, StatsJsonValue> & { name: string };
18910
+ "compilation.children[]": StatsCompilation;
18911
+ "asset.related[]": StatsAsset;
18912
+ "asset.children[]": StatsAsset;
18913
+ "module.modules[]": StatsModule;
18914
+ "module.children[]": StatsModule;
18915
+ "module.reasons[]": StatsModuleReason;
18916
+ "moduleReason.children[]": StatsModuleReason;
18917
+ "module.issuerPath[]": StatsModuleIssuer;
18918
+ "chunk.origins[]": StatsChunkOrigin;
18919
+ "chunk.modules[]": StatsModule;
18920
+ "loggingGroup.entries[]": StatsLoggingEntry;
18921
+ "loggingEntry.children[]": StatsLoggingEntry;
18922
+ "error.moduleTrace[]": StatsModuleTraceItem;
18923
+ "error.errors[]": StatsError;
18924
+ "moduleTraceItem.dependencies[]": StatsModuleTraceDependency;
18925
+ }
18926
+
18927
+ /**
18928
+ * The item of each array path webpack prints stats objects for.
18929
+ */
18930
+ declare interface KnownStatsPrintItems {
18931
+ "compilation.assets": StatsAsset;
18932
+ "compilation.modules": StatsModule;
18933
+ "compilation.chunks": StatsChunk;
18934
+ "compilation.entrypoints": StatsChunkGroup;
18935
+ "compilation.namedChunkGroups": StatsChunkGroup;
18936
+ "compilation.errors": StatsError;
18937
+ "compilation.warnings": StatsError;
18938
+ "compilation.hints": StatsError;
18939
+ "compilation.logging": KnownStatsLogging &
18940
+ Record<string, StatsJsonValue> & { name: string };
18941
+ "compilation.children": StatsCompilation;
18942
+ "asset.related": StatsAsset;
18943
+ "asset.children": StatsAsset;
18944
+ "module.modules": StatsModule;
18945
+ "module.children": StatsModule;
18946
+ "module.reasons": StatsModuleReason;
18947
+ "moduleReason.children": StatsModuleReason;
18948
+ "module.issuerPath": StatsModuleIssuer;
18949
+ "chunk.origins": StatsChunkOrigin;
18950
+ "chunk.modules": StatsModule;
18951
+ "loggingGroup.entries": StatsLoggingEntry;
18952
+ "loggingEntry.children": StatsLoggingEntry;
18953
+ "error.moduleTrace": StatsModuleTraceItem;
18954
+ "error.errors": StatsError;
18955
+ "moduleTraceItem.dependencies": StatsModuleTraceDependency;
18956
+ }
18957
+
18958
+ /**
18959
+ * The value `print` receives for each object key webpack prints; the key also matches same-named fields.
18960
+ */
18961
+ declare interface KnownStatsPrintObjects {
18962
+ compilation: StatsCompilation;
18963
+ asset: StatsAsset;
18964
+ chunk: StatsChunk;
18965
+ chunkGroup: StatsChunkGroup;
18966
+ module: null | string | StatsModule;
18967
+ moduleReason: StatsModuleReason;
18968
+ moduleIssuer: StatsModuleIssuer;
18969
+ chunkOrigin: StatsChunkOrigin;
18970
+ error: StatsError;
18971
+ profile: StatsProfile;
18972
+ loggingGroup: KnownStatsLogging &
18973
+ Record<string, StatsJsonValue> & { name: string };
18974
+ moduleTraceItem: StatsModuleTraceItem;
18975
+ moduleTraceDependency: StatsModuleTraceDependency;
18976
+ }
18977
+
18478
18978
  /**
18479
18979
  * Defines the known stats printer color functions type used by this module.
18480
18980
  */
@@ -18742,11 +19242,7 @@ declare interface LazyCompilationOptions {
18742
19242
  type LazyFunction<
18743
19243
  InputValue,
18744
19244
  OutputValue,
18745
- InternalLazyTarget extends SerializerMiddleware<
18746
- any,
18747
- any,
18748
- Record<string, any>
18749
- >,
19245
+ InternalLazyTarget extends SerializerMiddleware,
18750
19246
  InternalLazyOptions extends undefined | LazyOptions
18751
19247
  > = (() => InputValue | Promise<InputValue>) &
18752
19248
  Partial<{ options: InternalLazyOptions }>;
@@ -19061,6 +19557,26 @@ declare interface LimitChunkCountPluginOptions {
19061
19557
  */
19062
19558
  maxChunks: number;
19063
19559
  }
19560
+
19561
+ /**
19562
+ * A module-level `let` a module library declares in the chunk's scope instead.
19563
+ */
19564
+ declare interface LiveBinding {
19565
+ /**
19566
+ * the name the chunk's scope declares
19567
+ */
19568
+ name: string;
19569
+
19570
+ /**
19571
+ * the keys of the runtimes declaring it
19572
+ */
19573
+ runtimes: Set<string>;
19574
+
19575
+ /**
19576
+ * the keys of the runtimes where a module mirrors it through the setters a module library registers, not by name
19577
+ */
19578
+ registered: Set<string>;
19579
+ }
19064
19580
  declare interface LoadScriptCompilationHooks {
19065
19581
  createScript: SyncWaterfallHook<[string, Chunk], string>;
19066
19582
  }
@@ -19122,12 +19638,15 @@ declare interface Loader {
19122
19638
  type LoaderContextLibIndex<OptionsType> =
19123
19639
  NormalModuleLoaderContext<OptionsType> &
19124
19640
  LoaderRunnerMutableContext<OptionsType> &
19125
- LoaderRunnerReadonlyContext<OptionsType> &
19641
+ LoaderRunnerReadonlyContext<OptionsType, LoaderData> &
19126
19642
  LoaderPluginLoaderContext &
19127
19643
  HotModuleReplacementPluginLoaderContext;
19128
- type LoaderContextNormalModule<T> = NormalModuleLoaderContext<T> &
19644
+ type LoaderContextNormalModule<
19645
+ T,
19646
+ DataType = LoaderData
19647
+ > = NormalModuleLoaderContext<T> &
19129
19648
  LoaderRunnerMutableContext<T> &
19130
- LoaderRunnerReadonlyContext<T> &
19649
+ LoaderRunnerReadonlyContext<T, DataType> &
19131
19650
  LoaderPluginLoaderContext &
19132
19651
  HotModuleReplacementPluginLoaderContext;
19133
19652
  declare interface LoaderContextUtils {
@@ -19146,6 +19665,14 @@ declare interface LoaderContextUtils {
19146
19665
  */
19147
19666
  createHash: (algorithm?: string | typeof Hash) => Hash;
19148
19667
  }
19668
+
19669
+ /**
19670
+ * What a loader keeps between its pitch and normal phase. Open by default: a
19671
+ * loader stores whatever it likes, and reads it back without narrowing.
19672
+ */
19673
+ declare interface LoaderData {
19674
+ [index: string]: any;
19675
+ }
19149
19676
  type LoaderDefinition<
19150
19677
  OptionsType = {},
19151
19678
  ContextAdditions = {}
@@ -19160,7 +19687,7 @@ declare interface LoaderDefinitionFunction<
19160
19687
  (
19161
19688
  this: NormalModuleLoaderContext<OptionsType> &
19162
19689
  LoaderRunnerMutableContext<OptionsType> &
19163
- LoaderRunnerReadonlyContext<OptionsType> &
19690
+ LoaderRunnerReadonlyContext<OptionsType, LoaderData> &
19164
19691
  LoaderPluginLoaderContext &
19165
19692
  HotModuleReplacementPluginLoaderContext &
19166
19693
  ContextAdditions,
@@ -19169,18 +19696,22 @@ declare interface LoaderDefinitionFunction<
19169
19696
  additionalData?: AdditionalData
19170
19697
  ): string | void | Buffer | Promise<string | Buffer>;
19171
19698
  }
19172
- declare interface LoaderEntry {
19699
+ declare interface LoaderEntry<
19700
+ OptionsType = Record<string, any>,
19701
+ DataType = LoaderData
19702
+ > {
19173
19703
  request: string;
19174
19704
  path: string;
19175
19705
  query: string;
19176
19706
  fragment: string;
19177
- options?: string | Record<string, any>;
19707
+ options?: null | string | OptionsType;
19178
19708
  ident: string;
19179
19709
  normal?:
19180
- LoaderDefinitionFunction<any, {}> | RawLoaderDefinitionFunction<any, {}>;
19181
- pitch?: PitchLoaderDefinitionFunction<any, {}>;
19710
+ | LoaderDefinitionFunction<OptionsType, {}>
19711
+ | RawLoaderDefinitionFunction<OptionsType, {}>;
19712
+ pitch?: PitchLoaderDefinitionFunction<OptionsType, {}>;
19182
19713
  raw?: boolean;
19183
- data?: Record<string, any>;
19714
+ data?: DataType;
19184
19715
  pitchExecuted: boolean;
19185
19716
  normalExecuted: boolean;
19186
19717
  type?: "module" | "commonjs";
@@ -19331,7 +19862,7 @@ declare interface LoaderRunnerMutableContext<OptionsType> {
19331
19862
  * An array of all the loaders. It is writeable in the pitch phase.
19332
19863
  * loaders = [{request: string, path: string, query: string, module: function}]
19333
19864
  */
19334
- loaders: LoaderEntry[];
19865
+ loaders: LoaderEntry<Record<string, any>, LoaderData>[];
19335
19866
 
19336
19867
  /**
19337
19868
  * The resource path.
@@ -19374,9 +19905,12 @@ declare interface LoaderRunnerMutableContext<OptionsType> {
19374
19905
  * The members the runner never lets a loader assign. They carry no
19375
19906
  * documentation, so a type literal loses nothing and keeps `readonly`
19376
19907
  */
19377
- declare interface LoaderRunnerReadonlyContext<OptionsType> {
19908
+ declare interface LoaderRunnerReadonlyContext<
19909
+ OptionsType,
19910
+ DataType = LoaderData
19911
+ > {
19378
19912
  readonly currentRequest: string;
19379
- readonly data: any;
19913
+ readonly data: DataType;
19380
19914
  readonly previousRequest: string;
19381
19915
  readonly query: string | OptionsType;
19382
19916
  readonly remainingRequest: string;
@@ -19987,7 +20521,11 @@ declare interface Minifier {
19987
20521
  ) => Promise<MinifyOutput>;
19988
20522
  phases: string[];
19989
20523
  corrections?: { enabled: boolean };
19990
- improvements?: { enabled: boolean; lets: { enabled: boolean } };
20524
+ improvements?: {
20525
+ enabled: boolean;
20526
+ lets: { enabled: boolean };
20527
+ literalsLast: { enabled: boolean };
20528
+ };
19991
20529
  modules: MinifierModules;
19992
20530
  }
19993
20531
 
@@ -20007,32 +20545,41 @@ declare interface MinifyOptions {
20007
20545
  /**
20008
20546
  * what the compressor does, or false to leave the tree as read
20009
20547
  */
20010
- compress?: boolean | Record<string, any>;
20548
+ compress?: boolean | GivenCompressOptions;
20011
20549
 
20012
20550
  /**
20013
20551
  * which names are renamed, or false to keep them
20014
20552
  */
20015
- mangle?: boolean | Record<string, any>;
20553
+ mangle?: boolean | GivenMangleOptions;
20016
20554
 
20017
20555
  /**
20018
20556
  * how the output is written
20019
20557
  */
20020
- format?: Record<string, any>;
20558
+ format?: GivenFormatOptions;
20021
20559
 
20022
20560
  /**
20023
20561
  * the older spelling of `format`, which may not be named beside it
20024
20562
  */
20025
- output?: Record<string, any>;
20563
+ output?: GivenFormatOptions;
20026
20564
 
20027
20565
  /**
20028
20566
  * how the source is read
20029
20567
  */
20030
- parse?: Record<string, any>;
20568
+ parse?: {
20569
+ bare_returns?: boolean;
20570
+ ecma?: null | number;
20571
+ filename?: null | string;
20572
+ html5_comments?: boolean;
20573
+ module?: boolean;
20574
+ shebang?: boolean;
20575
+ toplevel?: any;
20576
+ spidermonkey?: boolean;
20577
+ };
20031
20578
 
20032
20579
  /**
20033
20580
  * whether a source map is written, and how
20034
20581
  */
20035
- sourceMap?: boolean | Record<string, any>;
20582
+ sourceMap?: boolean | GivenSourceMapOptions;
20036
20583
 
20037
20584
  /**
20038
20585
  * whether the source is a module
@@ -20052,7 +20599,7 @@ declare interface MinifyOptions {
20052
20599
  /**
20053
20600
  * names held across assets, which this writes into
20054
20601
  */
20055
- nameCache?: null | Record<string, any>;
20602
+ nameCache?: null | { vars?: any; props?: any };
20056
20603
 
20057
20604
  /**
20058
20605
  * which class names survive
@@ -20088,12 +20635,12 @@ declare interface MinifyOutput {
20088
20635
  /**
20089
20636
  * the source map, as a string or an object
20090
20637
  */
20091
- map?: string | Record<string, any>;
20638
+ map?: string | EncodedSourceMap;
20092
20639
 
20093
20640
  /**
20094
20641
  * the map with its mappings read
20095
20642
  */
20096
- decoded_map?: null | Record<string, any>;
20643
+ decoded_map?: null | BuiltSourceMap;
20097
20644
 
20098
20645
  /**
20099
20646
  * the tree, where `format.ast` asked for it
@@ -20670,8 +21217,11 @@ declare class ModuleDependency extends Dependency {
20670
21217
  | "url"
20671
21218
  | "module-dependency"
20672
21219
  | "esm-import"
21220
+ | "provided"
20673
21221
  | "dynamic-import"
20674
21222
  | "esm-reexport"
21223
+ | "esm-export-specifier"
21224
+ | "esm-live-export"
20675
21225
  | "esm-side-effect-import"
20676
21226
  | "context-element"
20677
21227
  | "esm-bare-side-effect-import"
@@ -20730,7 +21280,7 @@ declare class ModuleDependency extends Dependency {
20730
21280
  /**
20731
21281
  * Represents ModuleExternalInitFragment.
20732
21282
  */
20733
- declare class ModuleExternalInitFragment extends InitFragment<GenerateContext> {
21283
+ declare class ModuleExternalInitFragment extends InitFragment<ChunkRenderContextJavascriptModulesPlugin> {
20734
21284
  /**
20735
21285
  * Creates an instance of ModuleExternalInitFragment.
20736
21286
  */
@@ -21324,7 +21874,7 @@ declare class ModuleGraph {
21324
21874
  /**
21325
21875
  * Returns computed value or cached.
21326
21876
  */
21327
- cached<T extends any[], R>(
21877
+ cached<T extends TupleElement[], R>(
21328
21878
  fn: (moduleGraph: ModuleGraph, ...args: T) => R,
21329
21879
  ...args: T
21330
21880
  ): R;
@@ -21339,7 +21889,7 @@ declare class ModuleGraph {
21339
21889
  /**
21340
21890
  * Dependency cache provide.
21341
21891
  */
21342
- dependencyCacheProvide<D extends Dependency, ARGS extends any[], R>(
21892
+ dependencyCacheProvide<D extends Dependency, ARGS extends TupleElement[], R>(
21343
21893
  dependency: D,
21344
21894
  ...args: [
21345
21895
  ARGS,
@@ -21455,6 +22005,7 @@ type ModuleInfo = ConcatenatedModuleInfo | ExternalModuleInfo;
21455
22005
  declare interface ModuleMemCachesItem {
21456
22006
  buildInfo: BuildInfo;
21457
22007
  references?: WeakMap<Dependency, Module>;
22008
+ lazyRequests?: string;
21458
22009
  memCache: WeakTupleMap<any[], any>;
21459
22010
  }
21460
22011
 
@@ -22224,7 +22775,7 @@ declare interface NodeEnvironmentPluginOptions {
22224
22775
  infrastructureLogging: InfrastructureLogging;
22225
22776
  }
22226
22777
  type NodeEstreeIndex =
22227
- | ProgramImport
22778
+ | Program
22228
22779
  | ImportDeclaration
22229
22780
  | ExportNamedDeclaration
22230
22781
  | ExportAllDeclaration
@@ -22284,10 +22835,12 @@ type NodeEstreeIndex =
22284
22835
  | MethodDefinition
22285
22836
  | PropertyDefinition
22286
22837
  | VariableDeclarator
22287
- | AssignmentProperty
22288
22838
  | Property
22289
22839
  | CatchClause
22290
22840
  | ClassBody
22841
+ | SwitchCase
22842
+ | TemplateElement
22843
+ | AssignmentProperty
22291
22844
  | ImportSpecifier
22292
22845
  | ImportDefaultSpecifier
22293
22846
  | ImportNamespaceSpecifier
@@ -22295,9 +22848,7 @@ type NodeEstreeIndex =
22295
22848
  | ObjectPattern
22296
22849
  | ArrayPattern
22297
22850
  | RestElement
22298
- | AssignmentPattern
22299
- | SwitchCase
22300
- | TemplateElement;
22851
+ | AssignmentPattern;
22301
22852
 
22302
22853
  /**
22303
22854
  * a node as this parser builds one, whichever fields the options asked for
@@ -22306,7 +22857,7 @@ declare interface NodeLike {
22306
22857
  type: string;
22307
22858
  start: number;
22308
22859
  end: number;
22309
- loc?: any;
22860
+ loc?: null | SourceLocation;
22310
22861
  sourceFile?: string;
22311
22862
  range?: [number, number];
22312
22863
  }
@@ -22519,8 +23070,8 @@ declare interface NodeShape {
22519
23070
  label: NodeShape;
22520
23071
  property: NodeShape;
22521
23072
  flags: number;
22522
- startToken: TokenEs5;
22523
- endToken: TokenEs5;
23073
+ startToken: any;
23074
+ endToken: any;
22524
23075
  expression: NodeShape;
22525
23076
  callee: NodeShape;
22526
23077
  object: NodeShape;
@@ -22545,10 +23096,10 @@ declare interface NodeShape {
22545
23096
  superClass: NodeShape;
22546
23097
  scope: NodeShape;
22547
23098
  definition: SymbolDefinition;
22548
- fixed_value(): any;
23099
+ fixed_value(): undefined | null | false | NodeShape;
22549
23100
  tail_node(): NodeShape;
22550
23101
  clone(deep?: boolean): NodeShape;
22551
- transform(walker?: any, inList?: boolean): NodeShape;
23102
+ transform(walker: CompressorShape, inList?: boolean): NodeShape;
22552
23103
  optimize(compressor: CompressorShape): NodeShape;
22553
23104
  has_side_effects(compressor: CompressorShape): boolean;
22554
23105
  may_throw(compressor: CompressorShape): boolean;
@@ -22557,9 +23108,23 @@ declare interface NodeShape {
22557
23108
  firstInStatement?: boolean
22558
23109
  ): null | NodeShape;
22559
23110
  is_constant_expression(scope?: NodeShape): boolean | "f";
22560
- evaluate(compressor: CompressorShape): any;
23111
+ evaluate(
23112
+ compressor: CompressorShape
23113
+ ):
23114
+ | undefined
23115
+ | null
23116
+ | string
23117
+ | number
23118
+ | bigint
23119
+ | boolean
23120
+ | symbol
23121
+ | RegExp
23122
+ | NodeShape
23123
+ | any
23124
+ | { [index: string]: any }
23125
+ | ((...args: any[]) => any);
22561
23126
  negate(compressor: CompressorShape, firstInStatement?: boolean): NodeShape;
22562
- size(compressor?: CompressorShape, stack?: any): number;
23127
+ size(compressor?: CompressorShape, stack?: NodeShape[]): number;
22563
23128
  }
22564
23129
  declare class NodeSourcePlugin {
22565
23130
  constructor();
@@ -23527,8 +24092,11 @@ declare class NullDependency extends Dependency {
23527
24092
  | "url"
23528
24093
  | "module-dependency"
23529
24094
  | "esm-import"
24095
+ | "provided"
23530
24096
  | "dynamic-import"
23531
24097
  | "esm-reexport"
24098
+ | "esm-export-specifier"
24099
+ | "esm-live-export"
23532
24100
  | "esm-side-effect-import"
23533
24101
  | "context-element"
23534
24102
  | "esm-bare-side-effect-import"
@@ -23572,7 +24140,7 @@ declare namespace ObjectDeserializerContextObjectMiddlewareObject_1 {
23572
24140
  * re-types the same context to `Tail<T>` so successive reads stay positional.
23573
24141
  */
23574
24142
  declare interface ObjectDeserializerContextObjectMiddlewareObject_2<
23575
- T extends ReadonlyArray<any> = ReadonlyArray<any>
24143
+ T = ReadonlyArray<any>
23576
24144
  > {
23577
24145
  read: () => Head<T>;
23578
24146
  rest: ObjectDeserializerContextObjectMiddlewareObject_2<Tail<T>>;
@@ -23631,15 +24199,18 @@ declare interface ObjectEncodingOptionsResolver {
23631
24199
 
23632
24200
  /**
23633
24201
  * Defines the object serializer type used by this module.
24202
+ * Methods, so a serializer may narrow `value` to the class it is registered for.
23634
24203
  */
23635
- declare interface ObjectSerializer {
23636
- serialize: (
23637
- value: any,
23638
- context: ObjectSerializerContextObjectMiddlewareObject_3<any>
23639
- ) => void;
23640
- deserialize: (
23641
- context: ObjectDeserializerContextObjectMiddlewareObject_2<any>
23642
- ) => any;
24204
+ declare interface ObjectSerializer<T extends object = object> {
24205
+ serialize(
24206
+ value: T,
24207
+ context: ObjectSerializerContextObjectMiddlewareObject_3<ReadonlyArray<any>>
24208
+ ): void;
24209
+ deserialize(
24210
+ context: ObjectDeserializerContextObjectMiddlewareObject_2<
24211
+ ReadonlyArray<any>
24212
+ >
24213
+ ): object;
23643
24214
  }
23644
24215
 
23645
24216
  /**
@@ -23659,8 +24230,8 @@ declare interface ObjectSerializerContextObjectMiddlewareObject_1 {
23659
24230
  obj?: LazyOptions
23660
24231
  ) => LazyFunction<
23661
24232
  any,
23662
- any,
23663
- SerializerMiddleware<any, any, Record<string, any>>,
24233
+ PrimitiveSerializableType[],
24234
+ SerializerMiddleware,
23664
24235
  LazyOptions
23665
24236
  >;
23666
24237
  }
@@ -23679,8 +24250,8 @@ declare namespace ObjectSerializerContextObjectMiddlewareObject_2 {
23679
24250
  obj?: LazyOptions
23680
24251
  ) => LazyFunction<
23681
24252
  any,
23682
- any,
23683
- SerializerMiddleware<any, any, Record<string, any>>,
24253
+ PrimitiveSerializableType[],
24254
+ SerializerMiddleware,
23684
24255
  LazyOptions
23685
24256
  >);
23686
24257
  }
@@ -23690,7 +24261,7 @@ declare namespace ObjectSerializerContextObjectMiddlewareObject_2 {
23690
24261
  * `T` is the tuple of values written in order; each `write` consumes the head.
23691
24262
  */
23692
24263
  declare interface ObjectSerializerContextObjectMiddlewareObject_3<
23693
- T extends ReadonlyArray<any> = ReadonlyArray<any>
24264
+ T = ReadonlyArray<any>
23694
24265
  > {
23695
24266
  write: (
23696
24267
  value: Head<T>
@@ -23704,8 +24275,8 @@ declare interface ObjectSerializerContextObjectMiddlewareObject_3<
23704
24275
  obj?: LazyOptions
23705
24276
  ) => LazyFunction<
23706
24277
  any,
23707
- any,
23708
- SerializerMiddleware<any, any, Record<string, any>>,
24278
+ PrimitiveSerializableType[],
24279
+ SerializerMiddleware,
23709
24280
  LazyOptions
23710
24281
  >;
23711
24282
  }
@@ -23729,8 +24300,8 @@ declare interface ObjectSerializerContextObjectMiddlewareObject_4 {
23729
24300
  obj?: LazyOptions
23730
24301
  ) => LazyFunction<
23731
24302
  any,
23732
- any,
23733
- SerializerMiddleware<any, any, Record<string, any>>,
24303
+ PrimitiveSerializableType[],
24304
+ SerializerMiddleware,
23734
24305
  LazyOptions
23735
24306
  >;
23736
24307
  }
@@ -24011,7 +24582,7 @@ declare interface OptimizationMinimizeCss {
24011
24582
  customSelectors?: boolean;
24012
24583
 
24013
24584
  /**
24014
- * Drop a declaration a later one in the same block overrides even where nothing states that the target can read the later value. Off by default. With a `browserslist` target this is already done wherever every browser it names is known to read the later value, so the option only widens the case where no target is selected and there are no engines to name — which is what csso and cssnano do unconditionally. What it gives up is the fallback pair: `color:#c65d06;color:lab(50% 100 -100)` loses the hex, so an engine that cannot read `lab()` is left with nothing. A selection naming a browser the compat tables do not cover is still answered for the whole of it rather than by this option, since naming a browser states a target the option does not override.
24585
+ * Drop a declaration a later one in the same block overrides even where no target is selected, assuming the engines shipping today: wherever Chromium, Gecko and WebKit each read the later value. Off by default. With a `browserslist` target this is already done wherever every browser it names is known to read the later value, so the option only widens the case where no target is selected and there are no engines to name — which is what csso and cssnano do unconditionally. What it gives up is the fallback pair: `color:#c65d06;color:lab(50% 100 -100)` loses the hex, so an engine that cannot read `lab()` is left with nothing. A selection naming a browser the compat tables do not cover is still answered for the whole of it rather than by this option, since naming a browser states a target the option does not override.
24015
24586
  * @since 5.112.0
24016
24587
  */
24017
24588
  dropOverriddenDeclarations?: boolean;
@@ -24235,7 +24806,7 @@ declare interface OptimizationMinimizeHtml {
24235
24806
  removeEmptyAttributes?: boolean;
24236
24807
 
24237
24808
  /**
24238
- * Drop an element that has no children and no attributes. Kept anyway when its bare form is still doing a job (`canvas`, `slot`, `template`, `textarea`, `progress`, `meter`, `output`, `dialog`, and the table structure), when it is a void element, or when it is foreign content. Off by default: CSS can give an empty element a size or a `::before`, and the minifier cannot see the stylesheet. Emptiness is read off the output rather than the source, so a run of nested empties goes together and an element left empty only by a dropped comment or by whitespace `collapseWhitespace` deletes goes with them.
24809
+ * Drop an element that has no children and no attributes, where its bare form renders nothing and nothing reads it: a generic container such as `div`, `span` or `section`, an inline phrase element, an empty `title`, `script` or `style`, or an attribute-less `meta`, `link` or `base`. Every other element is kept, including widgets, list items, elements with margins and custom elements. Off by default: CSS can give an empty element a size or a `::before`, and the minifier cannot see the stylesheet. Emptiness is read off the output rather than the source, so a run of nested empties goes together and an element left empty only by a dropped comment or by whitespace `collapseWhitespace` deletes goes with them.
24239
24810
  * @since 5.110.0
24240
24811
  */
24241
24812
  removeEmptyElements?: boolean;
@@ -24959,18 +25530,18 @@ declare interface OptionsSyntaxParser {
24959
25530
  /**
24960
25531
  * where tokens are reported
24961
25532
  */
24962
- onToken?: any[] | ((token?: any) => void);
25533
+ onToken?:
25534
+ ((token: TokenSyntaxParserClass) => void) | TokenSyntaxParserClass[];
24963
25535
 
24964
25536
  /**
24965
25537
  * the parser itself at each token, for a reader that copies what it needs rather than taking a token of its own
24966
25538
  */
24967
- onTokenRead?: (parser?: any) => void;
25539
+ onTokenRead?: (parser: SyntaxParser) => void;
24968
25540
 
24969
25541
  /**
24970
25542
  * where comments are reported
24971
25543
  */
24972
25544
  onComment?:
24973
- | any[]
24974
25545
  | ((
24975
25546
  isBlock: boolean,
24976
25547
  text: string,
@@ -24978,7 +25549,8 @@ declare interface OptionsSyntaxParser {
24978
25549
  end: number,
24979
25550
  startLoc?: null | Position,
24980
25551
  endLoc?: null | Position
24981
- ) => void);
25552
+ ) => void)
25553
+ | CollectedComment[];
24982
25554
 
24983
25555
  /**
24984
25556
  * whether nodes carry `range`
@@ -26003,7 +26575,7 @@ declare interface ParseOptionsSyntaxParser {
26003
26575
  * Defines the parse result type used by this module.
26004
26576
  */
26005
26577
  declare interface ParseResult {
26006
- ast: ProgramImport;
26578
+ ast: Program;
26007
26579
  comments: CommentJavascriptParser[];
26008
26580
  }
26009
26581
 
@@ -26018,6 +26590,38 @@ declare interface ParsedDataURI {
26018
26590
  base64: boolean;
26019
26591
  payload: string;
26020
26592
  }
26593
+ type ParsedExpression =
26594
+ | (ImportExpressionImport & NodeLike)
26595
+ | (UnaryExpression & NodeLike)
26596
+ | (ArrayExpression & NodeLike)
26597
+ | (ArrowFunctionExpression & NodeLike)
26598
+ | (AssignmentExpression & NodeLike)
26599
+ | (AwaitExpression & NodeLike)
26600
+ | (BinaryExpression & NodeLike)
26601
+ | (SimpleCallExpression & NodeLike)
26602
+ | (NewExpression & NodeLike)
26603
+ | (ChainExpression & NodeLike)
26604
+ | (ClassExpression & NodeLike)
26605
+ | (ConditionalExpression & NodeLike)
26606
+ | (FunctionExpression & NodeLike)
26607
+ | (Identifier & NodeLike)
26608
+ | (SimpleLiteral & NodeLike)
26609
+ | (RegExpLiteral & NodeLike)
26610
+ | (BigIntLiteral & NodeLike)
26611
+ | (LogicalExpression & NodeLike)
26612
+ | (MemberExpression & NodeLike)
26613
+ | (MetaProperty & NodeLike)
26614
+ | (ObjectExpression & NodeLike)
26615
+ | (SequenceExpression & NodeLike)
26616
+ | (TaggedTemplateExpression & NodeLike)
26617
+ | (TemplateLiteral & NodeLike)
26618
+ | (ThisExpression & NodeLike)
26619
+ | (UpdateExpression & NodeLike)
26620
+ | (YieldExpression & NodeLike)
26621
+ | (NodeLike & {
26622
+ type: "ParenthesizedExpression";
26623
+ expression: ParsedExpression;
26624
+ });
26021
26625
  declare interface ParsedIdentifier {
26022
26626
  /**
26023
26627
  * request
@@ -26054,7 +26658,8 @@ declare interface ParsedIdentifier {
26054
26658
  */
26055
26659
  internal: boolean;
26056
26660
  }
26057
- declare class Parser {
26661
+ type ParsedProgram = Program & NodeLike;
26662
+ declare class Parser<TModule extends NormalModule = NormalModule> {
26058
26663
  constructor();
26059
26664
 
26060
26665
  /**
@@ -26062,8 +26667,8 @@ declare class Parser {
26062
26667
  */
26063
26668
  parse(
26064
26669
  source: string | Buffer | PreparsedAst,
26065
- state: ParserState
26066
- ): ParserState;
26670
+ state: ParserState<NormalModule>
26671
+ ): ParserState<NormalModule>;
26067
26672
  }
26068
26673
 
26069
26674
  /**
@@ -26210,28 +26815,37 @@ declare class ParserScope {
26210
26815
  * The `loc` a node carries when `options.locations` is on.
26211
26816
  */
26212
26817
  declare class ParserSourceLocation {
26213
- constructor(p: any, start?: null | PositionLike, end?: null | PositionLike);
26818
+ constructor(
26819
+ p: { sourceFile: null | string },
26820
+ start?: null | PositionLike,
26821
+ end?: null | PositionLike
26822
+ );
26214
26823
  start?: null | PositionLike;
26215
26824
  end?: null | PositionLike;
26216
- source: any;
26825
+ source?: string;
26217
26826
  }
26218
- type ParserState = ParserStateBase & Record<string, any>;
26827
+ type ParserState<TModule extends NormalModule = NormalModule> =
26828
+ ParserStateBase<TModule> & Record<string, any>;
26219
26829
 
26220
26830
  /**
26221
26831
  * Defines the parser state base type used by this module.
26222
26832
  */
26223
- declare interface ParserStateBase {
26833
+ declare interface ParserStateBase<TModule extends NormalModule = NormalModule> {
26224
26834
  source: string | Buffer;
26225
26835
  current: NormalModule;
26226
- module: NormalModule;
26836
+
26837
+ /**
26838
+ * the module being parsed
26839
+ */
26840
+ module: TModule;
26227
26841
  compilation: Compilation;
26228
26842
  options: WebpackOptionsNormalizedWithDefaults;
26229
26843
  }
26230
26844
  type PartOf<R, M extends Record<number, number>, D> = number extends (R & {
26231
- readonly __nodeType: unknown;
26845
+ readonly __nodeType: number;
26232
26846
  })["__nodeType"]
26233
26847
  ? D
26234
- : M[(R & { readonly __nodeType: unknown })["__nodeType"] & number];
26848
+ : M[(R & { readonly __nodeType: number })["__nodeType"]];
26235
26849
  declare interface PathCacheFunctions {
26236
26850
  /**
26237
26851
  * cached join
@@ -26537,13 +27151,13 @@ declare interface PitchLoaderDefinitionFunction<
26537
27151
  (
26538
27152
  this: NormalModuleLoaderContext<OptionsType> &
26539
27153
  LoaderRunnerMutableContext<OptionsType> &
26540
- LoaderRunnerReadonlyContext<OptionsType> &
27154
+ LoaderRunnerReadonlyContext<OptionsType, LoaderData> &
26541
27155
  LoaderPluginLoaderContext &
26542
27156
  HotModuleReplacementPluginLoaderContext &
26543
27157
  ContextAdditions,
26544
27158
  remainingRequest: string,
26545
27159
  previousRequest: string,
26546
- data: Record<string, any>
27160
+ data: LoaderData
26547
27161
  ): string | void | Buffer | Promise<string | Buffer>;
26548
27162
  }
26549
27163
 
@@ -26671,6 +27285,19 @@ declare class PrefixSource extends Source {
26671
27285
  declare interface PreparsedAst {
26672
27286
  [index: string]: any;
26673
27287
  }
27288
+ type PreprocessedAsset = Asset & {
27289
+ type: string;
27290
+ related?: PreprocessedAsset[];
27291
+ };
27292
+ type PrimitiveSerializableType =
27293
+ | undefined
27294
+ | null
27295
+ | string
27296
+ | number
27297
+ | bigint
27298
+ | boolean
27299
+ | Buffer
27300
+ | (() => PrimitiveSerializableType[] | Promise<PrimitiveSerializableType[]>);
26674
27301
 
26675
27302
  /**
26676
27303
  * The per-node output store handed to a language node printer as its `writer`. It
@@ -26761,6 +27388,18 @@ declare class PrintContext<TPath, TNode, TPrintOptions = object> {
26761
27388
  */
26762
27389
  printNode(node: TNode, path: TPath): void;
26763
27390
 
27391
+ /**
27392
+ * Store `text` as what `node` printed, where the grammar already knows what
27393
+ * the node printer would return and so does not call it.
27394
+ */
27395
+ printedAs(node: TNode, text: string): void;
27396
+
27397
+ /**
27398
+ * Store that `node` printed as its source, which `sourceText` reads only once
27399
+ * something asks for its text.
27400
+ */
27401
+ printedSource(node: TNode, sourceText: (node: TNode) => string): void;
27402
+
26764
27403
  /**
26765
27404
  * Print one node and hand its text straight back — for a node inside one being
26766
27405
  * printed in pieces, whose text is emitted as it is printed, so the store
@@ -26808,6 +27447,12 @@ declare class PrintContext<TPath, TNode, TPrintOptions = object> {
26808
27447
  */
26809
27448
  rewriteRetractable(index: number, text: string): void;
26810
27449
 
27450
+ /**
27451
+ * {@link rewriteRetractable} with text that is asked for only once the output
27452
+ * is read: a piece rewritten many times over is then built once, not each time.
27453
+ */
27454
+ deferRetractable(index: number, source: { readonly text: string }): void;
27455
+
26811
27456
  /**
26812
27457
  * {@link take} for a top-level node a later sibling may still make dead — the
26813
27458
  * unprefixed twin of a vendor-prefixed rule, which can stand anywhere after
@@ -26947,7 +27592,15 @@ declare class Profiler {
26947
27592
  session?: SessionImportInspectorClass_2;
26948
27593
  inspector: Inspector;
26949
27594
  hasSession(): boolean;
26950
- startProfiling(): Promise<void> | Promise<[any, any, any]>;
27595
+ startProfiling():
27596
+ | Promise<void>
27597
+ | Promise<
27598
+ [
27599
+ void | Partial<StopReturnType>,
27600
+ void | Partial<StopReturnType>,
27601
+ void | Partial<StopReturnType>
27602
+ ]
27603
+ >;
26951
27604
 
26952
27605
  /**
26953
27606
  * Returns promise for the result.
@@ -26955,7 +27608,7 @@ declare class Profiler {
26955
27608
  sendCommand(
26956
27609
  method: string,
26957
27610
  params?: SetSamplingIntervalParameterType
26958
- ): Promise<any>;
27611
+ ): Promise<void | Partial<StopReturnType>>;
26959
27612
  destroy(): Promise<void>;
26960
27613
 
26961
27614
  /**
@@ -26982,7 +27635,6 @@ declare interface ProfilingPluginOptions {
26982
27635
  */
26983
27636
  outputPath?: string;
26984
27637
  }
26985
- type ProgramSyntaxParser = ProgramImport & NodeLike;
26986
27638
  declare class ProgressPlugin {
26987
27639
  /**
26988
27640
  * Creates an instance of ProgressPlugin.
@@ -27171,6 +27823,9 @@ declare interface ProvidesObject {
27171
27823
  [index: string]: ProvidesObjectValue;
27172
27824
  }
27173
27825
  type ProvidesObjectValue = string | ProvidesConfig;
27826
+ type PureCallView = NodeShape & {
27827
+ print_to_string(given?: Partial<any>): string;
27828
+ };
27174
27829
  type PureCondition =
27175
27830
  boolean | ((compilation: Compilation, module: Module) => boolean);
27176
27831
  type QualifiedRule = NodeSyntaxParser & {
@@ -27211,7 +27866,7 @@ declare interface RawLoaderDefinitionFunction<
27211
27866
  (
27212
27867
  this: NormalModuleLoaderContext<OptionsType> &
27213
27868
  LoaderRunnerMutableContext<OptionsType> &
27214
- LoaderRunnerReadonlyContext<OptionsType> &
27869
+ LoaderRunnerReadonlyContext<OptionsType, LoaderData> &
27215
27870
  LoaderPluginLoaderContext &
27216
27871
  HotModuleReplacementPluginLoaderContext &
27217
27872
  ContextAdditions,
@@ -28758,12 +29413,12 @@ declare interface ResolvedOptionsSyntaxParser {
28758
29413
  /**
28759
29414
  * where tokens are reported
28760
29415
  */
28761
- onToken: null | ((token?: any) => void);
29416
+ onToken: null | ((token: TokenSyntaxParserClass) => void);
28762
29417
 
28763
29418
  /**
28764
29419
  * the parser itself at each token
28765
29420
  */
28766
- onTokenRead: null | ((parser?: any) => void);
29421
+ onTokenRead: null | ((parser: SyntaxParser) => void);
28767
29422
 
28768
29423
  /**
28769
29424
  * where comments are reported
@@ -29068,16 +29723,16 @@ declare interface RuleCondition {
29068
29723
  | "dependency"
29069
29724
  | "resource"
29070
29725
  | "scheme"
29726
+ | "phase"
29727
+ | "attributes"
29071
29728
  | "realResource"
29072
29729
  | "resourceQuery"
29073
29730
  | "resourceFragment"
29074
- | "attributes"
29075
29731
  | "mimetype"
29076
29732
  | "descriptionData"
29077
29733
  | "descriptionRelativePath"
29078
29734
  | "issuer"
29079
- | "issuerLayer"
29080
- | "phase"]
29735
+ | "issuerLayer"]
29081
29736
  ) => boolean;
29082
29737
  }
29083
29738
 
@@ -30798,8 +31453,8 @@ declare interface Selector<A, B> {
30798
31453
  * Represents Serializer.
30799
31454
  */
30800
31455
  declare abstract class Serializer<DeserializedValue, SerializedValue, Context> {
30801
- serializeMiddlewares: SerializerMiddleware<any, any, any>[];
30802
- deserializeMiddlewares: SerializerMiddleware<any, any, any>[];
31456
+ serializeMiddlewares: SerializerMiddleware[];
31457
+ deserializeMiddlewares: SerializerMiddleware[];
30803
31458
  context?: Context;
30804
31459
 
30805
31460
  /**
@@ -30823,9 +31478,9 @@ declare abstract class Serializer<DeserializedValue, SerializedValue, Context> {
30823
31478
  * Represents SerializerMiddleware.
30824
31479
  */
30825
31480
  declare abstract class SerializerMiddleware<
30826
- DeserializedType,
30827
- SerializedType,
30828
- Context
31481
+ DeserializedType = ComplexSerializableType,
31482
+ SerializedType = ComplexSerializableType,
31483
+ Context = object
30829
31484
  > {
30830
31485
  /**
30831
31486
  * Serializes this instance into the provided serializer context.
@@ -31736,8 +32391,8 @@ type SourceValue = string | Buffer;
31736
32391
  /**
31737
32392
  * terser's `Splice`: what a transform returns to put several nodes in its place.
31738
32393
  */
31739
- declare abstract class Splice {
31740
- v: NodeShape[];
32394
+ declare abstract class Splice<T = NodeShape> {
32395
+ v: T[];
31741
32396
  }
31742
32397
 
31743
32398
  /**
@@ -31960,8 +32615,8 @@ declare interface StarListSerializerContext {
31960
32615
  obj?: LazyOptions
31961
32616
  ) => LazyFunction<
31962
32617
  any,
31963
- any,
31964
- SerializerMiddleware<any, any, Record<string, any>>,
32618
+ PrimitiveSerializableType[],
32619
+ SerializerMiddleware,
31965
32620
  LazyOptions
31966
32621
  >;
31967
32622
  }
@@ -32279,12 +32934,12 @@ declare class Stats {
32279
32934
  | "verbose"
32280
32935
  ): string;
32281
32936
  }
32282
- type StatsAsset = KnownStatsAsset & Record<string, any>;
32283
- type StatsChunk = KnownStatsChunk & Record<string, any>;
32284
- type StatsChunkGroup = KnownStatsChunkGroup & Record<string, any>;
32285
- type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
32286
- type StatsCompilation = KnownStatsCompilation & Record<string, any>;
32287
- type StatsError = KnownStatsError & Record<string, any>;
32937
+ type StatsAsset = KnownStatsAsset & Record<string, StatsJsonValue>;
32938
+ type StatsChunk = KnownStatsChunk & Record<string, StatsJsonValue>;
32939
+ type StatsChunkGroup = KnownStatsChunkGroup & Record<string, StatsJsonValue>;
32940
+ type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, StatsJsonValue>;
32941
+ type StatsCompilation = KnownStatsCompilation & Record<string, StatsJsonValue>;
32942
+ type StatsError = KnownStatsError & Record<string, StatsJsonValue>;
32288
32943
  declare abstract class StatsFactory {
32289
32944
  hooks: StatsFactoryHooks;
32290
32945
 
@@ -32298,51 +32953,399 @@ declare abstract class StatsFactory {
32298
32953
  ): CreatedObject<FactoryData, FallbackCreatedObject>;
32299
32954
  }
32300
32955
  type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
32956
+ type StatsFactoryExtractHookMap = {
32957
+ for<
32958
+ K extends
32959
+ | "module"
32960
+ | "error"
32961
+ | "asset"
32962
+ | "compilation"
32963
+ | "chunk"
32964
+ | "profile"
32965
+ | "warning"
32966
+ | "asset$visible"
32967
+ | "chunkGroup"
32968
+ | "module$visible"
32969
+ | "moduleIssuer"
32970
+ | "moduleReason"
32971
+ | "chunkOrigin"
32972
+ | "cause"
32973
+ | "moduleTraceItem"
32974
+ | "moduleTraceDependency"
32975
+ >(
32976
+ key: K
32977
+ ): SyncBailHook<
32978
+ [
32979
+ KnownStatsFactoryExtract[K][0],
32980
+ KnownStatsFactoryExtract[K][1],
32981
+ StatsFactoryContext
32982
+ ],
32983
+ void
32984
+ >;
32985
+ for<O = any, D = any>(
32986
+ key: string
32987
+ ): SyncBailHook<[O, D, StatsFactoryContext], void>;
32988
+ } & HookMap<SyncBailHook<[any, any, StatsFactoryContext], void>>;
32989
+ type StatsFactoryGetItemFactoryHookMap = {
32990
+ for<
32991
+ K extends
32992
+ | "module"
32993
+ | "error"
32994
+ | "asset"
32995
+ | "compilation"
32996
+ | "chunk"
32997
+ | "profile"
32998
+ | "warning"
32999
+ | "asset$visible"
33000
+ | "chunkGroup"
33001
+ | "module$visible"
33002
+ | "moduleIssuer"
33003
+ | "moduleReason"
33004
+ | "chunkOrigin"
33005
+ | "cause"
33006
+ | "moduleTraceItem"
33007
+ | "moduleTraceDependency"
33008
+ | "compilation.children[].compilation"
33009
+ >(
33010
+ key: K
33011
+ ): SyncBailHook<
33012
+ [KnownStatsFactoryItemFactories[K], StatsFactoryContext],
33013
+ void | StatsFactory
33014
+ >;
33015
+ for<I = any>(
33016
+ key: string
33017
+ ): SyncBailHook<[I, StatsFactoryContext], void | StatsFactory>;
33018
+ } & HookMap<SyncBailHook<[any, StatsFactoryContext], void | StatsFactory>>;
33019
+ type StatsFactoryGetItemNameHookMap = {
33020
+ for<
33021
+ K extends
33022
+ | "compilation.assets[]"
33023
+ | "compilation.chunks[]"
33024
+ | "compilation.modules[]"
33025
+ | "compilation.entrypoints[]"
33026
+ | "compilation.namedChunkGroups[]"
33027
+ | "compilation.errors[]"
33028
+ | "compilation.warnings[]"
33029
+ | "compilation.hints[]"
33030
+ | "compilation.children[]"
33031
+ | "asset.related[]"
33032
+ | "error.errors[]"
33033
+ | "warning.errors[]"
33034
+ | "chunk.modules[]"
33035
+ | "chunk.rootModules[]"
33036
+ | "chunk.origins[]"
33037
+ | "module.issuerPath[]"
33038
+ | "module.reasons[]"
33039
+ | "module.modules[]"
33040
+ | "module.children[]"
33041
+ | "moduleTrace[]"
33042
+ | "moduleTraceItem.dependencies[]"
33043
+ >(
33044
+ key: K
33045
+ ): SyncBailHook<
33046
+ [KnownStatsFactoryItemNames[K], StatsFactoryContext],
33047
+ string | void
33048
+ >;
33049
+ for<I = any>(
33050
+ key: string
33051
+ ): SyncBailHook<[I, StatsFactoryContext], string | void>;
33052
+ } & HookMap<SyncBailHook<[any, StatsFactoryContext], string | void>>;
33053
+ type StatsFactoryGroupResultsHookMap = {
33054
+ for<
33055
+ K extends
33056
+ | "moduleTrace"
33057
+ | "compilation.assets"
33058
+ | "compilation.chunks"
33059
+ | "compilation.modules"
33060
+ | "compilation.entrypoints"
33061
+ | "compilation.namedChunkGroups"
33062
+ | "compilation.errors"
33063
+ | "compilation.warnings"
33064
+ | "compilation.hints"
33065
+ | "compilation.children"
33066
+ | "asset.related"
33067
+ | "error.errors"
33068
+ | "warning.errors"
33069
+ | "chunk.modules"
33070
+ | "chunk.rootModules"
33071
+ | "chunk.origins"
33072
+ | "module.issuerPath"
33073
+ | "module.reasons"
33074
+ | "module.modules"
33075
+ | "module.children"
33076
+ | "moduleTraceItem.dependencies",
33077
+ G = object
33078
+ >(
33079
+ key: K
33080
+ ): SyncBailHook<
33081
+ [GroupConfig<KnownStatsFactoryResultItems[K], G>[], StatsFactoryContext],
33082
+ void
33083
+ >;
33084
+ for<I = any, G = any>(
33085
+ key: string
33086
+ ): SyncBailHook<[GroupConfig<I, G>[], StatsFactoryContext], void>;
33087
+ } & HookMap<SyncBailHook<[GroupConfig<any, any>[], StatsFactoryContext], void>>;
32301
33088
 
32302
33089
  /**
32303
33090
  * Defines the stats factory hooks type used by this module.
32304
33091
  */
32305
33092
  declare interface StatsFactoryHooks {
32306
- extract: HookMap<SyncBailHook<[any, any, StatsFactoryContext], void>>;
32307
- filter: HookMap<
32308
- SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
32309
- >;
32310
- sort: HookMap<
32311
- SyncBailHook<
32312
- [((a?: any, b?: any) => 0 | 1 | -1)[], StatsFactoryContext],
32313
- void
32314
- >
33093
+ extract: StatsFactoryExtractHookMap;
33094
+ filter: StatsFactoryItemFilterHookMap;
33095
+ sort: StatsFactoryItemSortHookMap;
33096
+ filterSorted: StatsFactoryItemFilterHookMap;
33097
+ groupResults: StatsFactoryGroupResultsHookMap;
33098
+ sortResults: StatsFactoryResultSortHookMap;
33099
+ filterResults: StatsFactoryResultFilterHookMap;
33100
+ merge: StatsFactoryMergeHookMap;
33101
+ result: StatsFactoryResultHookMap;
33102
+ getItemName: StatsFactoryGetItemNameHookMap;
33103
+ getItemFactory: StatsFactoryGetItemFactoryHookMap;
33104
+ }
33105
+ type StatsFactoryItemFilterHookMap = {
33106
+ for<
33107
+ K extends
33108
+ | "moduleTrace"
33109
+ | "compilation.assets"
33110
+ | "compilation.chunks"
33111
+ | "compilation.modules"
33112
+ | "compilation.entrypoints"
33113
+ | "compilation.namedChunkGroups"
33114
+ | "compilation.errors"
33115
+ | "compilation.warnings"
33116
+ | "compilation.hints"
33117
+ | "compilation.children"
33118
+ | "asset.related"
33119
+ | "error.errors"
33120
+ | "warning.errors"
33121
+ | "chunk.modules"
33122
+ | "chunk.rootModules"
33123
+ | "chunk.origins"
33124
+ | "module.issuerPath"
33125
+ | "module.reasons"
33126
+ | "module.modules"
33127
+ | "module.children"
33128
+ | "moduleTraceItem.dependencies"
33129
+ >(
33130
+ key: K
33131
+ ): SyncBailHook<
33132
+ [KnownStatsFactoryRawItems[K], StatsFactoryContext, number, number],
33133
+ boolean | void
32315
33134
  >;
32316
- filterSorted: HookMap<
32317
- SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
33135
+ for<I = any>(
33136
+ key: string
33137
+ ): SyncBailHook<[I, StatsFactoryContext, number, number], boolean | void>;
33138
+ } & HookMap<
33139
+ SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
33140
+ >;
33141
+ type StatsFactoryItemSortHookMap = {
33142
+ for<
33143
+ K extends
33144
+ | "moduleTrace"
33145
+ | "compilation.assets"
33146
+ | "compilation.chunks"
33147
+ | "compilation.modules"
33148
+ | "compilation.entrypoints"
33149
+ | "compilation.namedChunkGroups"
33150
+ | "compilation.errors"
33151
+ | "compilation.warnings"
33152
+ | "compilation.hints"
33153
+ | "compilation.children"
33154
+ | "asset.related"
33155
+ | "error.errors"
33156
+ | "warning.errors"
33157
+ | "chunk.modules"
33158
+ | "chunk.rootModules"
33159
+ | "chunk.origins"
33160
+ | "module.issuerPath"
33161
+ | "module.reasons"
33162
+ | "module.modules"
33163
+ | "module.children"
33164
+ | "moduleTraceItem.dependencies"
33165
+ >(
33166
+ key: K
33167
+ ): SyncBailHook<
33168
+ [Comparator<KnownStatsFactoryRawItems[K]>[], StatsFactoryContext],
33169
+ void
32318
33170
  >;
32319
- groupResults: HookMap<
32320
- SyncBailHook<[GroupConfig<any, any>[], StatsFactoryContext], void>
33171
+ for<I = any>(
33172
+ key: string
33173
+ ): SyncBailHook<[Comparator<I>[], StatsFactoryContext], void>;
33174
+ } & HookMap<SyncBailHook<[Comparator<any>[], StatsFactoryContext], void>>;
33175
+ type StatsFactoryMergeHookMap = {
33176
+ for<
33177
+ K extends
33178
+ | "moduleTrace"
33179
+ | "compilation.assets"
33180
+ | "compilation.chunks"
33181
+ | "compilation.modules"
33182
+ | "compilation.entrypoints"
33183
+ | "compilation.namedChunkGroups"
33184
+ | "compilation.errors"
33185
+ | "compilation.warnings"
33186
+ | "compilation.hints"
33187
+ | "compilation.children"
33188
+ | "asset.related"
33189
+ | "error.errors"
33190
+ | "warning.errors"
33191
+ | "chunk.modules"
33192
+ | "chunk.rootModules"
33193
+ | "chunk.origins"
33194
+ | "module.issuerPath"
33195
+ | "module.reasons"
33196
+ | "module.modules"
33197
+ | "module.children"
33198
+ | "moduleTraceItem.dependencies",
33199
+ R = Record<string, KnownStatsFactoryResultItems[K]>
33200
+ >(
33201
+ key: K
33202
+ ): SyncBailHook<
33203
+ [KnownStatsFactoryResultItems[K][], StatsFactoryContext],
33204
+ void | R
32321
33205
  >;
32322
- sortResults: HookMap<
32323
- SyncBailHook<
32324
- [((a?: any, b?: any) => 0 | 1 | -1)[], StatsFactoryContext],
32325
- void
32326
- >
33206
+ for<I = any, R = any>(
33207
+ key: string
33208
+ ): SyncBailHook<[I[], StatsFactoryContext], void | R>;
33209
+ } & HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
33210
+ type StatsFactoryResultFilterHookMap = {
33211
+ for<
33212
+ K extends
33213
+ | "moduleTrace"
33214
+ | "compilation.assets"
33215
+ | "compilation.chunks"
33216
+ | "compilation.modules"
33217
+ | "compilation.entrypoints"
33218
+ | "compilation.namedChunkGroups"
33219
+ | "compilation.errors"
33220
+ | "compilation.warnings"
33221
+ | "compilation.hints"
33222
+ | "compilation.children"
33223
+ | "asset.related"
33224
+ | "error.errors"
33225
+ | "warning.errors"
33226
+ | "chunk.modules"
33227
+ | "chunk.rootModules"
33228
+ | "chunk.origins"
33229
+ | "module.issuerPath"
33230
+ | "module.reasons"
33231
+ | "module.modules"
33232
+ | "module.children"
33233
+ | "moduleTraceItem.dependencies"
33234
+ >(
33235
+ key: K
33236
+ ): SyncBailHook<
33237
+ [KnownStatsFactoryResultItems[K], StatsFactoryContext, number, number],
33238
+ boolean | void
32327
33239
  >;
32328
- filterResults: HookMap<
32329
- SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
33240
+ for<I = any>(
33241
+ key: string
33242
+ ): SyncBailHook<[I, StatsFactoryContext, number, number], boolean | void>;
33243
+ } & HookMap<
33244
+ SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
33245
+ >;
33246
+ type StatsFactoryResultHookMap = {
33247
+ for<
33248
+ K extends
33249
+ | "module"
33250
+ | "error"
33251
+ | "asset"
33252
+ | "compilation"
33253
+ | "chunk"
33254
+ | "moduleTrace"
33255
+ | "profile"
33256
+ | "warning"
33257
+ | "asset$visible"
33258
+ | "chunkGroup"
33259
+ | "module$visible"
33260
+ | "moduleIssuer"
33261
+ | "moduleReason"
33262
+ | "chunkOrigin"
33263
+ | "cause"
33264
+ | "moduleTraceItem"
33265
+ | "moduleTraceDependency"
33266
+ | "compilation.assets"
33267
+ | "compilation.chunks"
33268
+ | "compilation.modules"
33269
+ | "compilation.entrypoints"
33270
+ | "compilation.namedChunkGroups"
33271
+ | "compilation.errors"
33272
+ | "compilation.warnings"
33273
+ | "compilation.hints"
33274
+ | "compilation.children"
33275
+ | "asset.related"
33276
+ | "error.errors"
33277
+ | "warning.errors"
33278
+ | "chunk.modules"
33279
+ | "chunk.rootModules"
33280
+ | "chunk.origins"
33281
+ | "module.issuerPath"
33282
+ | "module.reasons"
33283
+ | "module.modules"
33284
+ | "module.children"
33285
+ | "moduleTraceItem.dependencies"
33286
+ >(
33287
+ key: K
33288
+ ): SyncBailHook<
33289
+ [KnownStatsFactoryResults[K], StatsFactoryContext],
33290
+ KnownStatsFactoryResults[K]
32330
33291
  >;
32331
- merge: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
32332
- result: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
32333
- getItemName: HookMap<SyncBailHook<[any, StatsFactoryContext], string | void>>;
32334
- getItemFactory: HookMap<
32335
- SyncBailHook<[any, StatsFactoryContext], void | StatsFactory>
33292
+ for<R = any>(key: string): SyncBailHook<[R, StatsFactoryContext], R>;
33293
+ } & HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
33294
+ type StatsFactoryResultSortHookMap = {
33295
+ for<
33296
+ K extends
33297
+ | "moduleTrace"
33298
+ | "compilation.assets"
33299
+ | "compilation.chunks"
33300
+ | "compilation.modules"
33301
+ | "compilation.entrypoints"
33302
+ | "compilation.namedChunkGroups"
33303
+ | "compilation.errors"
33304
+ | "compilation.warnings"
33305
+ | "compilation.hints"
33306
+ | "compilation.children"
33307
+ | "asset.related"
33308
+ | "error.errors"
33309
+ | "warning.errors"
33310
+ | "chunk.modules"
33311
+ | "chunk.rootModules"
33312
+ | "chunk.origins"
33313
+ | "module.issuerPath"
33314
+ | "module.reasons"
33315
+ | "module.modules"
33316
+ | "module.children"
33317
+ | "moduleTraceItem.dependencies"
33318
+ >(
33319
+ key: K
33320
+ ): SyncBailHook<
33321
+ [Comparator<KnownStatsFactoryResultItems[K]>[], StatsFactoryContext],
33322
+ void
32336
33323
  >;
32337
- }
32338
- type StatsLogging = KnownStatsLogging & Record<string, any>;
32339
- type StatsLoggingEntry = KnownStatsLoggingEntry & Record<string, any>;
32340
- type StatsModule = KnownStatsModule & Record<string, any>;
32341
- type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
32342
- type StatsModuleReason = KnownStatsModuleReason & Record<string, any>;
33324
+ for<I = any>(
33325
+ key: string
33326
+ ): SyncBailHook<[Comparator<I>[], StatsFactoryContext], void>;
33327
+ } & HookMap<SyncBailHook<[Comparator<any>[], StatsFactoryContext], void>>;
33328
+ type StatsJsonValue =
33329
+ | undefined
33330
+ | null
33331
+ | string
33332
+ | number
33333
+ | boolean
33334
+ | Buffer
33335
+ | StatsJsonValue[]
33336
+ | { [index: string]: StatsJsonValue };
33337
+ type StatsLogging = KnownStatsLogging & Record<string, StatsJsonValue>;
33338
+ type StatsLoggingEntry = KnownStatsLoggingEntry &
33339
+ Record<string, StatsJsonValue>;
33340
+ type StatsModule = KnownStatsModule & Record<string, StatsJsonValue>;
33341
+ type StatsModuleIssuer = KnownStatsModuleIssuer &
33342
+ Record<string, StatsJsonValue>;
33343
+ type StatsModuleReason = KnownStatsModuleReason &
33344
+ Record<string, StatsJsonValue>;
32343
33345
  type StatsModuleTraceDependency = KnownStatsModuleTraceDependency &
32344
- Record<string, any>;
32345
- type StatsModuleTraceItem = KnownStatsModuleTraceItem & Record<string, any>;
33346
+ Record<string, StatsJsonValue>;
33347
+ type StatsModuleTraceItem = KnownStatsModuleTraceItem &
33348
+ Record<string, StatsJsonValue>;
32346
33349
  type StatsObject<T, F> = T extends Compilation
32347
33350
  ? StatsCompilation
32348
33351
  : T extends ChunkGroupInfoWithName
@@ -32867,16 +33870,12 @@ declare interface StatsPrintHooks {
32867
33870
  undefined | string | void
32868
33871
  >
32869
33872
  >;
32870
- sortItems: HookMap<
32871
- SyncBailHook<[any[], StatsPrinterContext], boolean | void>
32872
- >;
32873
- getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string | void>>;
33873
+ sortItems: StatsPrinterSortItemsHookMap;
33874
+ getItemName: StatsPrinterGetItemNameHookMap;
32874
33875
  printItems: HookMap<
32875
33876
  SyncBailHook<[string[], StatsPrinterContext], undefined | string>
32876
33877
  >;
32877
- print: HookMap<
32878
- SyncBailHook<[any, StatsPrinterContext], undefined | string | void>
32879
- >;
33878
+ print: StatsPrinterPrintHookMap;
32880
33879
  result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext], string>>;
32881
33880
  }
32882
33881
  declare abstract class StatsPrinter {
@@ -32885,9 +33884,9 @@ declare abstract class StatsPrinter {
32885
33884
  /**
32886
33885
  * Returns printed result.
32887
33886
  */
32888
- print(
33887
+ print<T>(
32889
33888
  type: string,
32890
- object?: any,
33889
+ object: T,
32891
33890
  baseContext?: StatsPrinterContext
32892
33891
  ): undefined | string;
32893
33892
  }
@@ -32895,7 +33894,109 @@ type StatsPrinterContext = KnownStatsPrinterColorFunctions &
32895
33894
  KnownStatsPrinterFormatters &
32896
33895
  KnownStatsPrinterContext &
32897
33896
  Record<string, any>;
32898
- type StatsProfile = KnownStatsProfile & Record<string, any>;
33897
+ type StatsPrinterGetItemNameHookMap = {
33898
+ for<
33899
+ K extends
33900
+ | "compilation.assets[]"
33901
+ | "compilation.chunks[]"
33902
+ | "compilation.modules[]"
33903
+ | "compilation.entrypoints[]"
33904
+ | "compilation.namedChunkGroups[]"
33905
+ | "compilation.errors[]"
33906
+ | "compilation.warnings[]"
33907
+ | "compilation.hints[]"
33908
+ | "compilation.children[]"
33909
+ | "asset.related[]"
33910
+ | "error.errors[]"
33911
+ | "chunk.modules[]"
33912
+ | "chunk.origins[]"
33913
+ | "module.issuerPath[]"
33914
+ | "module.reasons[]"
33915
+ | "module.modules[]"
33916
+ | "module.children[]"
33917
+ | "moduleTraceItem.dependencies[]"
33918
+ | "compilation.logging[]"
33919
+ | "asset.children[]"
33920
+ | "moduleReason.children[]"
33921
+ | "loggingGroup.entries[]"
33922
+ | "loggingEntry.children[]"
33923
+ | "error.moduleTrace[]"
33924
+ >(
33925
+ key: K
33926
+ ): SyncBailHook<
33927
+ [KnownStatsPrintItemNames[K], StatsPrinterContext],
33928
+ string | void
33929
+ >;
33930
+ for<I = any>(
33931
+ key: string
33932
+ ): SyncBailHook<[I, StatsPrinterContext], string | void>;
33933
+ } & HookMap<SyncBailHook<[any, StatsPrinterContext], string | void>>;
33934
+ type StatsPrinterPrintHookMap = {
33935
+ for<
33936
+ K extends
33937
+ | "module"
33938
+ | "error"
33939
+ | "asset"
33940
+ | "compilation"
33941
+ | "chunk"
33942
+ | "profile"
33943
+ | "chunkGroup"
33944
+ | "moduleIssuer"
33945
+ | "moduleReason"
33946
+ | "chunkOrigin"
33947
+ | "moduleTraceItem"
33948
+ | "moduleTraceDependency"
33949
+ | "loggingGroup"
33950
+ >(
33951
+ key: K
33952
+ ): SyncBailHook<
33953
+ [KnownStatsPrintObjects[K], StatsPrinterContext],
33954
+ undefined | string | void
33955
+ >;
33956
+ for<T = any>(
33957
+ key: string
33958
+ ): SyncBailHook<[T, StatsPrinterContext], undefined | string | void>;
33959
+ } & HookMap<
33960
+ SyncBailHook<[any, StatsPrinterContext], undefined | string | void>
33961
+ >;
33962
+ type StatsPrinterSortItemsHookMap = {
33963
+ for<
33964
+ K extends
33965
+ | "compilation.assets"
33966
+ | "compilation.chunks"
33967
+ | "compilation.modules"
33968
+ | "compilation.entrypoints"
33969
+ | "compilation.namedChunkGroups"
33970
+ | "compilation.errors"
33971
+ | "compilation.warnings"
33972
+ | "compilation.hints"
33973
+ | "compilation.children"
33974
+ | "asset.related"
33975
+ | "error.errors"
33976
+ | "chunk.modules"
33977
+ | "chunk.origins"
33978
+ | "module.issuerPath"
33979
+ | "module.reasons"
33980
+ | "module.modules"
33981
+ | "module.children"
33982
+ | "moduleTraceItem.dependencies"
33983
+ | "compilation.logging"
33984
+ | "asset.children"
33985
+ | "moduleReason.children"
33986
+ | "loggingGroup.entries"
33987
+ | "loggingEntry.children"
33988
+ | "error.moduleTrace"
33989
+ >(
33990
+ key: K
33991
+ ): SyncBailHook<
33992
+ [KnownStatsPrintItems[K][], StatsPrinterContext],
33993
+ boolean | void
33994
+ >;
33995
+ for<I = any>(
33996
+ key: string
33997
+ ): SyncBailHook<[I[], StatsPrinterContext], boolean | void>;
33998
+ } & HookMap<SyncBailHook<[any[], StatsPrinterContext], boolean | void>>;
33999
+ type StatsProfile = KnownStatsProfile & Record<string, StatsJsonValue>;
32899
34000
  type StatsValue =
32900
34001
  | boolean
32901
34002
  | StatsOptions
@@ -33557,12 +34658,12 @@ declare class SyntaxParser {
33557
34658
  static parse(
33558
34659
  input: string,
33559
34660
  options?: Partial<OptionsSyntaxParser>
33560
- ): ProgramSyntaxParser;
34661
+ ): ParsedProgram;
33561
34662
  static parseExpressionAt(
33562
34663
  input: string,
33563
34664
  pos: number,
33564
34665
  options?: Partial<OptionsSyntaxParser>
33565
- ): ExpressionSyntaxParser;
34666
+ ): ParsedExpression;
33566
34667
  static tokenizer(
33567
34668
  input: string,
33568
34669
  options?: Partial<OptionsSyntaxParser>
@@ -33586,7 +34687,19 @@ declare class SyntaxTree {
33586
34687
  * Sets one field of a node: a child node, an array of them for a list,
33587
34688
  * `0` or null where ESTree has null.
33588
34689
  */
33589
- set(node: number, name: string, value: unknown): void;
34690
+ set(
34691
+ node: number,
34692
+ name: string,
34693
+ value?:
34694
+ | null
34695
+ | string
34696
+ | number
34697
+ | bigint
34698
+ | boolean
34699
+ | RegExp
34700
+ | (null | number)[]
34701
+ | { cooked?: null | string; raw: string }
34702
+ ): void;
33590
34703
 
33591
34704
  /**
33592
34705
  * Writes a parsed node and everything under it, its children taking ids
@@ -33598,7 +34711,17 @@ declare class SyntaxTree {
33598
34711
  end(node: number): number;
33599
34712
  range(node: number): [number, number];
33600
34713
  name(node: number): string;
33601
- value(node: number): unknown;
34714
+ value(
34715
+ node: number
34716
+ ):
34717
+ | undefined
34718
+ | null
34719
+ | string
34720
+ | number
34721
+ | bigint
34722
+ | boolean
34723
+ | RegExp
34724
+ | { cooked?: null | string; raw: string };
33602
34725
  fieldCount(field: number, node: number): number;
33603
34726
  field(i: number, field: number, node: number): number;
33604
34727
  flag(flag: number, node: number): boolean;
@@ -33621,7 +34744,7 @@ declare const TRANSITIVE_ONLY: unique symbol;
33621
34744
  declare interface TagInfo {
33622
34745
  tag: symbol;
33623
34746
  data?:
33624
- | Record<string, any>
34747
+ | object
33625
34748
  | TopLevelSymbol
33626
34749
  | ESMSettings
33627
34750
  | ImportSettings
@@ -33629,12 +34752,7 @@ declare interface TagInfo {
33629
34752
  | CompatibilitySettings;
33630
34753
  next?: TagInfo;
33631
34754
  }
33632
- type Tail<T extends ReadonlyArray<any>> = T extends readonly [
33633
- infer _First,
33634
- ...infer R
33635
- ]
33636
- ? R
33637
- : T;
34755
+ type Tail<T> = T extends readonly [infer _First, ...infer R] ? R : T;
33638
34756
  declare interface TargetItemWithConnection {
33639
34757
  module: Module;
33640
34758
  connection: ModuleGraphConnection;
@@ -33775,18 +34893,10 @@ declare interface TokContextLike {
33775
34893
  token: string;
33776
34894
  isExpr: boolean;
33777
34895
  preserveSpace?: boolean;
33778
- override?: any;
34896
+ override?: (parser: SyntaxParser) => void;
33779
34897
  generator?: boolean;
33780
34898
  }
33781
34899
 
33782
- /**
33783
- * one of terser's tokens
33784
- */
33785
- declare interface TokenEs5 {
33786
- [index: number]: any;
33787
- [index: string]: any;
33788
- }
33789
-
33790
34900
  /**
33791
34901
  * Position-based view over the lexer — webpack's stand-in for the spec's
33792
34902
  * "normalize into a token stream" (CSS Syntax §9). It unifies the lexer and the
@@ -33886,13 +34996,13 @@ declare class TokenStream {
33886
34996
  * A token as `options.onToken` receives one.
33887
34997
  */
33888
34998
  declare class TokenSyntaxParserClass {
33889
- constructor(p?: any);
33890
- type: any;
34999
+ constructor(p: SyntaxParser);
35000
+ type: TokenType;
33891
35001
  value: any;
33892
- start: any;
33893
- end: any;
35002
+ start: number;
35003
+ end: number;
33894
35004
  loc?: ParserSourceLocation;
33895
- range?: any[];
35005
+ range?: number[];
33896
35006
  }
33897
35007
  type TokenSyntaxParserObject = NodeSyntaxParser & {
33898
35008
  value: string;
@@ -34010,6 +35120,8 @@ declare interface TsconfigPathsMap {
34010
35120
  */
34011
35121
  fileDependencies: Set<string>;
34012
35122
  }
35123
+ type TupleElement =
35124
+ undefined | null | string | number | bigint | boolean | symbol | object;
34013
35125
  declare class TypeScriptPlugin {
34014
35126
  constructor();
34015
35127
  apply(compiler: Compiler): void;
@@ -34108,11 +35220,13 @@ declare interface UpdateHashContextDependency {
34108
35220
  /**
34109
35221
  * Represents the generator runtime component.
34110
35222
  */
34111
- declare interface UpdateHashContextGenerator {
35223
+ declare interface UpdateHashContextGenerator<
35224
+ TModule extends NormalModule = NormalModule
35225
+ > {
34112
35226
  /**
34113
35227
  * the module
34114
35228
  */
34115
- module: NormalModule;
35229
+ module: TModule;
34116
35230
  chunkGraph: ChunkGraph;
34117
35231
  runtime: RuntimeSpec;
34118
35232
  runtimeTemplate?: RuntimeTemplate;
@@ -34241,7 +35355,7 @@ declare interface VirtualModule {
34241
35355
  * The source function that provides the virtual content.
34242
35356
  */
34243
35357
  source: (
34244
- loaderContext: LoaderContextNormalModule<any>
35358
+ loaderContext: LoaderContextNormalModule<Record<string, any>, LoaderData>
34245
35359
  ) => string | Buffer | Promise<string | Buffer>;
34246
35360
 
34247
35361
  /**
@@ -34257,7 +35371,7 @@ declare interface VirtualModule {
34257
35371
  type VirtualModuleContent =
34258
35372
  | string
34259
35373
  | ((
34260
- loaderContext: LoaderContextNormalModule<any>
35374
+ loaderContext: LoaderContextNormalModule<Record<string, any>, LoaderData>
34261
35375
  ) => string | Buffer | Promise<string | Buffer>)
34262
35376
  | VirtualModule;
34263
35377
  declare interface VirtualModules {
@@ -34549,7 +35663,7 @@ declare abstract class Watching {
34549
35663
  * Stores values by tuple keys while using `WeakMap` for object elements so the
34550
35664
  * cache can release entries when those objects are collected.
34551
35665
  */
34552
- declare abstract class WeakTupleMap<K extends any[], V> {
35666
+ declare abstract class WeakTupleMap<K extends TupleElement[], V> {
34553
35667
  /**
34554
35668
  * Stores a value at the node identified by the provided tuple key.
34555
35669
  */
@@ -34594,7 +35708,7 @@ declare abstract class WeakTupleMap<K extends any[], V> {
34594
35708
  */
34595
35709
  clear(): void;
34596
35710
  }
34597
- declare abstract class WebAssemblyParser extends Parser {}
35711
+ declare abstract class WebAssemblyParser extends Parser<BuiltSyncWasmModule> {}
34598
35712
 
34599
35713
  /**
34600
35714
  * Defines the web assembly render context type used by this module.
@@ -34664,7 +35778,7 @@ declare class WebpackError extends Error {
34664
35778
  /**
34665
35779
  * Whether an error is a webpack error rather than any other thrown value.
34666
35780
  */
34667
- static isWebpackError(value: unknown): boolean;
35781
+ static isWebpackError<T>(value: T): boolean;
34668
35782
 
34669
35783
  /**
34670
35784
  * Creates a `.stack` property on `targetObject`, which when accessed returns
@@ -35065,12 +36179,12 @@ declare class WebpackParser extends SyntaxParser {
35065
36179
  static parse(
35066
36180
  input: string,
35067
36181
  options?: Partial<OptionsSyntaxParser>
35068
- ): ProgramSyntaxParser;
36182
+ ): ParsedProgram;
35069
36183
  static parseExpressionAt(
35070
36184
  input: string,
35071
36185
  pos: number,
35072
36186
  options?: Partial<OptionsSyntaxParser>
35073
- ): ExpressionSyntaxParser;
36187
+ ): ParsedExpression;
35074
36188
  static tokenizer(
35075
36189
  input: string,
35076
36190
  options?: Partial<OptionsSyntaxParser>
@@ -35402,6 +36516,7 @@ declare namespace exports {
35402
36516
  export let initializeSharing: "__webpack_require__.I";
35403
36517
  export let instantiateWasm: "__webpack_require__.v";
35404
36518
  export let interceptModuleExecution: "__webpack_require__.i";
36519
+ export let liveExportSetters: "__webpack_require__.lE";
35405
36520
  export let loadScript: "__webpack_require__.l";
35406
36521
  export let makeDeferredNamespaceObject: "__webpack_require__.z";
35407
36522
  export let makeNamespaceObject: "__webpack_require__.r";
@@ -35778,7 +36893,7 @@ declare namespace exports {
35778
36893
  export let parse: (
35779
36894
  input: string,
35780
36895
  options: ParserOptionsSyntaxParser
35781
- ) => ProgramImport;
36896
+ ) => Program;
35782
36897
  export let positionAt: (
35783
36898
  lineStarts: number[],
35784
36899
  offset: number
@@ -35790,7 +36905,7 @@ declare namespace exports {
35790
36905
  fields?: string[]
35791
36906
  ) =>
35792
36907
  | null
35793
- | ProgramImport
36908
+ | Program
35794
36909
  | ImportDeclaration
35795
36910
  | ExportNamedDeclaration
35796
36911
  | ExportAllDeclaration
@@ -35850,10 +36965,12 @@ declare namespace exports {
35850
36965
  | MethodDefinition
35851
36966
  | PropertyDefinition
35852
36967
  | VariableDeclarator
35853
- | AssignmentProperty
35854
36968
  | Property
35855
36969
  | CatchClause
35856
36970
  | ClassBody
36971
+ | SwitchCase
36972
+ | TemplateElement
36973
+ | AssignmentProperty
35857
36974
  | ImportSpecifier
35858
36975
  | ImportDefaultSpecifier
35859
36976
  | ImportNamespaceSpecifier
@@ -35861,9 +36978,7 @@ declare namespace exports {
35861
36978
  | ObjectPattern
35862
36979
  | ArrayPattern
35863
36980
  | RestElement
35864
- | AssignmentPattern
35865
- | SwitchCase
35866
- | TemplateElement;
36981
+ | AssignmentPattern;
35867
36982
  export {
35868
36983
  DestructuringErrors,
35869
36984
  Label,
@@ -35889,7 +37004,7 @@ declare namespace exports {
35889
37004
  export let plainIdentifier: (name: string) => string;
35890
37005
  export let load: () => Promise<Minifier>;
35891
37006
  export let PHASES: Phase[];
35892
- export let FORMAT_DEFAULTS: FormatOptions;
37007
+ export let FORMAT_DEFAULTS: any;
35893
37008
  export let IGNORED_FORMAT_OPTIONS: string[];
35894
37009
  export let createAst: () => Ast;
35895
37010
  export let createModules: () => MinifierModules;
@@ -35917,7 +37032,7 @@ declare namespace exports {
35917
37032
  fields?: string[]
35918
37033
  ) =>
35919
37034
  | null
35920
- | ProgramImport
37035
+ | Program
35921
37036
  | ImportDeclaration
35922
37037
  | ExportNamedDeclaration
35923
37038
  | ExportAllDeclaration
@@ -35977,10 +37092,12 @@ declare namespace exports {
35977
37092
  | MethodDefinition
35978
37093
  | PropertyDefinition
35979
37094
  | VariableDeclarator
35980
- | AssignmentProperty
35981
37095
  | Property
35982
37096
  | CatchClause
35983
37097
  | ClassBody
37098
+ | SwitchCase
37099
+ | TemplateElement
37100
+ | AssignmentProperty
35984
37101
  | ImportSpecifier
35985
37102
  | ImportDefaultSpecifier
35986
37103
  | ImportNamespaceSpecifier
@@ -35988,9 +37105,7 @@ declare namespace exports {
35988
37105
  | ObjectPattern
35989
37106
  | ArrayPattern
35990
37107
  | RestElement
35991
- | AssignmentPattern
35992
- | SwitchCase
35993
- | TemplateElement;
37108
+ | AssignmentPattern;
35994
37109
  }
35995
37110
  export {
35996
37111
  EnableChunkLoadingPlugin,
@@ -36095,6 +37210,7 @@ declare namespace exports {
36095
37210
  export let initializeSharing: "__webpack_require__.I";
36096
37211
  export let instantiateWasm: "__webpack_require__.v";
36097
37212
  export let interceptModuleExecution: "__webpack_require__.i";
37213
+ export let liveExportSetters: "__webpack_require__.lE";
36098
37214
  export let loadScript: "__webpack_require__.l";
36099
37215
  export let makeDeferredNamespaceObject: "__webpack_require__.z";
36100
37216
  export let makeNamespaceObject: "__webpack_require__.r";
@@ -37582,11 +38698,11 @@ declare namespace exports {
37582
38698
  export { RuntimeSpecMap, RuntimeSpecSet };
37583
38699
  }
37584
38700
  export namespace serialization {
37585
- export const register: (
37586
- Constructor: Constructor,
38701
+ export const register: <C extends Constructor>(
38702
+ Constructor: C,
37587
38703
  request: string,
37588
38704
  name: null | string,
37589
- serializer: ObjectSerializer
38705
+ serializer: ObjectSerializer<InstanceType<C>>
37590
38706
  ) => void;
37591
38707
  export const registerLegacyRequest: (
37592
38708
  Constructor: Constructor,
@@ -37599,14 +38715,20 @@ declare namespace exports {
37599
38715
  ) => void;
37600
38716
  export const registerNotSerializable: (Constructor: Constructor) => void;
37601
38717
  export const NOT_SERIALIZABLE: object;
37602
- export const buffersSerializer: Serializer<any, any, any>;
38718
+ export const buffersSerializer: Serializer<
38719
+ ComplexSerializableType,
38720
+ BufferSerializableType[],
38721
+ object
38722
+ >;
37603
38723
  export let createFileSerializer: <D, S, C>(
37604
38724
  fs: IntermediateFileSystem,
37605
38725
  hashFunction: HashFunction
37606
38726
  ) => Serializer<D, S, C>;
37607
38727
  export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
37608
38728
  }
37609
- export const makeSerializable: <T extends Constructor>(
38729
+ export const makeSerializable: <
38730
+ T extends { new (...params: never[]): object }
38731
+ >(
37610
38732
  Constructor: T,
37611
38733
  request: string | (string | [string, null | string])[],
37612
38734
  name?: null | string
@@ -37627,6 +38749,8 @@ declare namespace exports {
37627
38749
  }
37628
38750
  export namespace dataURL {
37629
38751
  export let EMBEDDED_LANGUAGES: string[];
38752
+ export let JSON_TYPE: "json";
38753
+ export let SVG_TYPE: "svg";
37630
38754
  export let URIRegEx: RegExp;
37631
38755
  export let askEmbeddedRenderer: (
37632
38756
  render: (