@ohos-ports/rspack-core 2.2.2-beta.0 → 2.3.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/README.md +9 -0
  2. package/compiled/@rspack/lite-tapable/dist/index.d.ts +20 -6
  3. package/compiled/@rspack/lite-tapable/package.json +1 -1
  4. package/compiled/http-proxy-middleware/index.d.ts +10 -10
  5. package/compiled/http-proxy-middleware/package.json +1 -1
  6. package/compiled/open/package.json +1 -1
  7. package/compiled/tinypool/README.md +4 -4
  8. package/compiled/tinypool/dist/index.d.ts +3 -2
  9. package/compiled/tinypool/dist/index.js +3 -3
  10. package/compiled/tinypool/package.json +1 -1
  11. package/compiled/watchpack/index.js +276 -49
  12. package/compiled/watchpack/package.json +1 -1
  13. package/compiled/watchpack/types/DirectoryWatcher.d.ts +24 -0
  14. package/compiled/watchpack/types/index.d.ts +1 -1
  15. package/compiled/watchpack/types/watchEventSource.d.ts +9 -0
  16. package/compiled/webpack-sources/index.d.ts +61 -0
  17. package/compiled/webpack-sources/index.js +858 -224
  18. package/compiled/webpack-sources/package.json +8 -1
  19. package/compiled/webpack-sources/types/CachedSource.d.ts +192 -0
  20. package/compiled/webpack-sources/types/CompatSource.d.ts +87 -0
  21. package/compiled/webpack-sources/types/ConcatSource.d.ts +75 -0
  22. package/compiled/webpack-sources/types/OriginalSource.d.ts +87 -0
  23. package/compiled/webpack-sources/types/PrefixSource.d.ts +59 -0
  24. package/compiled/webpack-sources/types/RawSource.d.ts +75 -0
  25. package/compiled/webpack-sources/types/ReplaceSource.d.ts +107 -0
  26. package/compiled/webpack-sources/types/SizeOnlySource.d.ts +24 -0
  27. package/compiled/webpack-sources/types/Source.d.ts +189 -0
  28. package/compiled/webpack-sources/types/SourceMapSource.d.ts +136 -0
  29. package/compiled/webpack-sources/types/helpers/createMappingsSerializer.d.ts +60 -0
  30. package/compiled/webpack-sources/types/helpers/getFromStreamChunks.d.ts +16 -0
  31. package/compiled/webpack-sources/types/helpers/getGeneratedSourceInfo.d.ts +31 -0
  32. package/compiled/webpack-sources/types/helpers/getName.d.ts +15 -0
  33. package/compiled/webpack-sources/types/helpers/getSource.d.ts +15 -0
  34. package/compiled/webpack-sources/types/helpers/readMappings.d.ts +19 -0
  35. package/compiled/webpack-sources/types/helpers/scopes.d.ts +119 -0
  36. package/compiled/webpack-sources/types/helpers/splitIntoLines.d.ts +6 -0
  37. package/compiled/webpack-sources/types/helpers/splitIntoPotentialTokens.d.ts +37 -0
  38. package/compiled/webpack-sources/types/helpers/streamAndGetSourceAndMap.d.ts +39 -0
  39. package/compiled/webpack-sources/types/helpers/streamChunks.d.ts +56 -0
  40. package/compiled/webpack-sources/types/helpers/streamChunksOfCombinedSourceMap.d.ts +42 -0
  41. package/compiled/webpack-sources/types/helpers/streamChunksOfRawSource.d.ts +16 -0
  42. package/compiled/webpack-sources/types/helpers/streamChunksOfSourceMap.d.ts +19 -0
  43. package/compiled/webpack-sources/types/helpers/stringBufferUtils.d.ts +55 -0
  44. package/compiled/webpack-sources/types/index.d.ts +50 -0
  45. package/dist/BuildInfo.d.ts +13 -4
  46. package/dist/Chunk.d.ts +3 -3
  47. package/dist/ChunkGraph.d.ts +2 -2
  48. package/dist/Chunks.d.ts +2 -2
  49. package/dist/CodeGenerationResults.d.ts +6 -1
  50. package/dist/Compilation.d.ts +16 -53
  51. package/dist/Compiler.d.ts +9 -10
  52. package/dist/ConcatenatedModule.d.ts +5 -1
  53. package/dist/ContextModule.d.ts +3 -1
  54. package/dist/Diagnostics.d.ts +2 -6
  55. package/dist/Entrypoint.d.ts +1 -1
  56. package/dist/ExportsInfo.d.ts +1 -1
  57. package/dist/ExternalModule.d.ts +7 -6
  58. package/dist/FileSystem.d.ts +3 -1
  59. package/dist/FileSystemDependencies.d.ts +15 -0
  60. package/dist/FileSystemInfo.d.ts +1 -0
  61. package/dist/Module.d.ts +19 -11
  62. package/dist/ModuleGraph.d.ts +6 -6
  63. package/dist/ModuleGraphConnection.d.ts +9 -3
  64. package/dist/Modules.d.ts +3 -0
  65. package/dist/NativeWatchFileSystem.d.ts +20 -8
  66. package/dist/NormalModule.d.ts +14 -6
  67. package/dist/NormalModuleFactory.d.ts +2 -1
  68. package/dist/Resolver.d.ts +10 -2
  69. package/dist/ResolverFactory.d.ts +1 -1
  70. package/dist/RspackError.d.ts +2 -2
  71. package/dist/RuntimeGlobals.d.ts +4 -3
  72. package/dist/RuntimeModule.d.ts +1 -1
  73. package/dist/RuntimeTemplate.d.ts +1 -0
  74. package/dist/Stats.d.ts +1 -1
  75. package/dist/builtin-loader/lightningcss/target.d.ts +1 -1
  76. package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
  77. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
  78. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
  79. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
  80. package/dist/builtin-plugin/BannerPlugin.d.ts +2 -2
  81. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
  82. package/dist/builtin-plugin/CaseSensitivePlugin.d.ts +1 -1
  83. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
  84. package/dist/builtin-plugin/CircularCheckRspackPlugin.d.ts +1 -1
  85. package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +1 -1
  86. package/dist/builtin-plugin/CircularModulesInfoPlugin.d.ts +1 -1
  87. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
  88. package/dist/builtin-plugin/CompactHashedChunkIdsPlugin.d.ts +1 -1
  89. package/dist/builtin-plugin/CompactHashedModuleIdsPlugin.d.ts +1 -1
  90. package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -1
  91. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +2 -2
  92. package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
  93. package/dist/builtin-plugin/CssHttpExternalsRspackPlugin.d.ts +1 -1
  94. package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
  95. package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
  96. package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
  97. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
  98. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
  99. package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -1
  100. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +2 -2
  101. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
  102. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
  103. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
  104. package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +1 -1
  105. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
  106. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
  107. package/dist/builtin-plugin/EntryPlugin.d.ts +2 -2
  108. package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +1 -1
  109. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +2 -2
  110. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +5 -4
  111. package/dist/builtin-plugin/ExternalsPlugin.d.ts +1 -1
  112. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
  113. package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
  114. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
  115. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
  116. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
  117. package/dist/builtin-plugin/HashedModuleIdsPlugin.d.ts +2 -2
  118. package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +1 -1
  119. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
  120. package/dist/builtin-plugin/HttpUriPlugin.d.ts +5 -1
  121. package/dist/builtin-plugin/IgnorePlugin.d.ts +2 -2
  122. package/dist/builtin-plugin/ImportedByDeferModulesPlugin.d.ts +9 -0
  123. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
  124. package/dist/builtin-plugin/InlineExportsPlugin.d.ts +1 -1
  125. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
  126. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
  127. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
  128. package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
  129. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
  130. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
  131. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
  132. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
  133. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
  134. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
  135. package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +1 -1
  136. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
  137. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
  138. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
  139. package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
  140. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -1
  141. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
  142. package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +1 -1
  143. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +2 -2
  144. package/dist/builtin-plugin/ProgressPlugin.d.ts +2 -2
  145. package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
  146. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
  147. package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -1
  148. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
  149. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +2 -2
  150. package/dist/builtin-plugin/RslibPlugin.d.ts +4 -4
  151. package/dist/builtin-plugin/RstestPlugin.d.ts +2 -2
  152. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +2 -2
  153. package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
  154. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
  155. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
  156. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +2 -2
  157. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +1 -1
  158. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +3 -2
  159. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
  160. package/dist/builtin-plugin/SyncModuleIdsPlugin.d.ts +1 -1
  161. package/dist/builtin-plugin/URLPlugin.d.ts +1 -1
  162. package/dist/builtin-plugin/WorkerPlugin.d.ts +1 -1
  163. package/dist/builtin-plugin/base.d.ts +1 -1
  164. package/dist/builtin-plugin/css-extract/index.d.ts +1 -1
  165. package/dist/builtin-plugin/css-extract/utils.d.ts +4 -1
  166. package/dist/builtin-plugin/html-plugin/hooks.d.ts +1 -1
  167. package/dist/builtin-plugin/html-plugin/plugin.d.ts +2 -2
  168. package/dist/builtin-plugin/index.d.ts +1 -0
  169. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +3 -3
  170. package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +1 -1
  171. package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +1 -1
  172. package/dist/config/adapter.d.ts +1 -1
  173. package/dist/config/adapterRuleUse.d.ts +3 -2
  174. package/dist/config/normalization.d.ts +5 -8
  175. package/dist/config/target.d.ts +2 -0
  176. package/dist/config/types.d.ts +104 -19
  177. package/dist/container/ContainerPlugin.d.ts +1 -1
  178. package/dist/container/ContainerReferencePlugin.d.ts +1 -1
  179. package/dist/container/ModuleFederationManifestPlugin.d.ts +1 -1
  180. package/dist/container/ModuleFederationPluginV1.d.ts +5 -1
  181. package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
  182. package/dist/cssExtractHmr.js +1 -1
  183. package/dist/cssExtractLoader.js +7 -5
  184. package/dist/exports.d.ts +7 -7
  185. package/dist/index.js +1845 -1070
  186. package/dist/lib/Cache.d.ts +3 -0
  187. package/dist/lib/DllReferencePlugin.d.ts +1 -1
  188. package/dist/lib/WebpackError.d.ts +1 -1
  189. package/dist/loader-runner/codeFilter.d.ts +9 -0
  190. package/dist/loader-runner/dependencies.d.ts +5 -4
  191. package/dist/loader-runner/index.d.ts +3 -2
  192. package/dist/loader-runner/service.d.ts +6 -5
  193. package/dist/loader-runner/worker.d.ts +5 -2
  194. package/dist/l~0.js +34 -0
  195. package/dist/l~3.js +34 -0
  196. package/dist/node/NodeWatchFileSystem.d.ts +7 -4
  197. package/dist/sharing/CollectSharedEntryPlugin.d.ts +1 -1
  198. package/dist/sharing/ConsumeSharedPlugin.d.ts +1 -1
  199. package/dist/sharing/ProvideSharedPlugin.d.ts +1 -1
  200. package/dist/sharing/SharePlugin.d.ts +13 -1
  201. package/dist/sharing/ShareRuntimePlugin.d.ts +1 -1
  202. package/dist/sharing/SharedContainerPlugin.d.ts +1 -1
  203. package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +2 -2
  204. package/dist/sources.d.ts +3 -0
  205. package/dist/stats/StatsFactory.d.ts +4 -2
  206. package/dist/stats/StatsPrinter.d.ts +5 -5
  207. package/dist/stats/statsFactoryUtils.d.ts +12 -6
  208. package/dist/swc.d.ts +1 -1
  209. package/dist/taps/compilation.d.ts +1 -1
  210. package/dist/taps/types.d.ts +1 -1
  211. package/dist/util/SplitChunkSize.d.ts +1 -1
  212. package/dist/util/bindingHelpers.d.ts +9 -0
  213. package/dist/util/createModule.d.ts +3 -0
  214. package/dist/util/fs.d.ts +22 -16
  215. package/dist/util/resolveLayerExternals.d.ts +1 -0
  216. package/dist/util/source.d.ts +13 -4
  217. package/dist/util/symbols.d.ts +10 -0
  218. package/dist/util/watchTimeInfo.d.ts +11 -0
  219. package/dist/worker.js +386 -353
  220. package/hot/lazy-compilation-node.js +1 -1
  221. package/hot/lazy-compilation-web.js +1 -1
  222. package/package.json +8 -32
  223. package/compiled/webpack-sources/types.d.ts +0 -500
  224. package/dist/612~0.js +0 -32
  225. package/dist/612~3.js +0 -32
  226. package/dist/loader-runner/cache.d.ts +0 -18
  227. package/dist/util/MergeCaller.d.ts +0 -10
  228. package/dist/util/fake.d.ts +0 -11
@@ -0,0 +1,39 @@
1
+ export = streamAndGetSourceAndMap;
2
+ /**
3
+ * @param {SourceMaybeWithStreamChunksFunction} inputSource input source
4
+ * @param {Options} options options
5
+ * @param {OnChunk} onChunk on chunk
6
+ * @param {OnSource} onSource on source
7
+ * @param {OnName} onName on name
8
+ * @returns {{ result: GeneratedSourceInfo, source: string, map: RawSourceMap | null }} result
9
+ */
10
+ declare function streamAndGetSourceAndMap(
11
+ inputSource: SourceMaybeWithStreamChunksFunction,
12
+ options: Options,
13
+ onChunk: OnChunk,
14
+ onSource: OnSource,
15
+ onName: OnName,
16
+ ): {
17
+ result: GeneratedSourceInfo;
18
+ source: string;
19
+ map: RawSourceMap | null;
20
+ };
21
+ declare namespace streamAndGetSourceAndMap {
22
+ export {
23
+ RawSourceMap,
24
+ GeneratedSourceInfo,
25
+ OnChunk,
26
+ OnName,
27
+ OnSource,
28
+ Options,
29
+ SourceMaybeWithStreamChunksFunction,
30
+ };
31
+ }
32
+ type RawSourceMap = import("../Source").RawSourceMap;
33
+ type GeneratedSourceInfo = import("./streamChunks").GeneratedSourceInfo;
34
+ type OnChunk = import("./streamChunks").OnChunk;
35
+ type OnName = import("./streamChunks").OnName;
36
+ type OnSource = import("./streamChunks").OnSource;
37
+ type Options = import("./streamChunks").Options;
38
+ type SourceMaybeWithStreamChunksFunction =
39
+ import("./streamChunks").SourceMaybeWithStreamChunksFunction;
@@ -0,0 +1,56 @@
1
+ declare namespace _exports {
2
+ export {
3
+ Source,
4
+ GeneratedSourceInfo,
5
+ OnChunk,
6
+ ScopeBindings,
7
+ OnSource,
8
+ OnName,
9
+ Options,
10
+ StreamChunksFunction,
11
+ SourceMaybeWithStreamChunksFunction,
12
+ };
13
+ }
14
+ declare function _exports(
15
+ source: SourceMaybeWithStreamChunksFunction,
16
+ options: Options,
17
+ onChunk: OnChunk,
18
+ onSource: OnSource,
19
+ onName: OnName,
20
+ ): GeneratedSourceInfo;
21
+ export = _exports;
22
+ type Source = import("../Source");
23
+ type GeneratedSourceInfo =
24
+ import("./getGeneratedSourceInfo").GeneratedSourceInfo;
25
+ type OnChunk = (
26
+ chunk: string | undefined,
27
+ generatedLine: number,
28
+ generatedColumn: number,
29
+ sourceIndex: number,
30
+ originalLine: number,
31
+ originalColumn: number,
32
+ nameIndex: number,
33
+ ) => void;
34
+ type ScopeBindings = Map<string, string>;
35
+ type OnSource = (
36
+ sourceIndex: number,
37
+ source: string | null,
38
+ sourceContent: string | undefined,
39
+ scopeBindings?: ScopeBindings,
40
+ ) => void;
41
+ type OnName = (nameIndex: number, name: string) => void;
42
+ type Options = {
43
+ source?: boolean;
44
+ finalSource?: boolean;
45
+ columns?: boolean;
46
+ scopes?: boolean;
47
+ };
48
+ type StreamChunksFunction = (
49
+ options: Options,
50
+ onChunk: OnChunk,
51
+ onSource: OnSource,
52
+ onName: OnName,
53
+ ) => any;
54
+ type SourceMaybeWithStreamChunksFunction = Source & {
55
+ streamChunks?: StreamChunksFunction;
56
+ };
@@ -0,0 +1,42 @@
1
+ export = streamChunksOfCombinedSourceMap;
2
+ /** @typedef {import("../Source").RawSourceMap} RawSourceMap */
3
+ /** @typedef {import("./getGeneratedSourceInfo").GeneratedSourceInfo} GeneratedSourceInfo */
4
+ /** @typedef {import("./streamChunks").OnChunk} onChunk */
5
+ /** @typedef {import("./streamChunks").OnName} OnName */
6
+ /** @typedef {import("./streamChunks").OnSource} OnSource */
7
+ /**
8
+ * @param {string} source source
9
+ * @param {RawSourceMap} sourceMap source map
10
+ * @param {string} innerSourceName inner source name
11
+ * @param {string} innerSource inner source
12
+ * @param {RawSourceMap} innerSourceMap inner source map
13
+ * @param {boolean | undefined} removeInnerSource do remove inner source
14
+ * @param {onChunk} onChunk on chunk
15
+ * @param {OnSource} onSource on source
16
+ * @param {OnName} onName on name
17
+ * @param {boolean} finalSource finalSource
18
+ * @param {boolean} columns columns
19
+ * @returns {GeneratedSourceInfo} generated source info
20
+ */
21
+ declare function streamChunksOfCombinedSourceMap(
22
+ source: string,
23
+ sourceMap: RawSourceMap,
24
+ innerSourceName: string,
25
+ innerSource: string,
26
+ innerSourceMap: RawSourceMap,
27
+ removeInnerSource: boolean | undefined,
28
+ onChunk: onChunk,
29
+ onSource: OnSource,
30
+ onName: OnName,
31
+ finalSource: boolean,
32
+ columns: boolean,
33
+ ): GeneratedSourceInfo;
34
+ declare namespace streamChunksOfCombinedSourceMap {
35
+ export { RawSourceMap, GeneratedSourceInfo, onChunk, OnName, OnSource };
36
+ }
37
+ type RawSourceMap = import("../Source").RawSourceMap;
38
+ type GeneratedSourceInfo =
39
+ import("./getGeneratedSourceInfo").GeneratedSourceInfo;
40
+ type onChunk = import("./streamChunks").OnChunk;
41
+ type OnName = import("./streamChunks").OnName;
42
+ type OnSource = import("./streamChunks").OnSource;
@@ -0,0 +1,16 @@
1
+ declare namespace _exports {
2
+ export { GeneratedSourceInfo, OnChunk, OnName, OnSource };
3
+ }
4
+ declare function _exports(
5
+ source: string,
6
+ onChunk: OnChunk,
7
+ onSource: OnSource,
8
+ onName: OnName,
9
+ finalSource: boolean,
10
+ ): GeneratedSourceInfo;
11
+ export = _exports;
12
+ type GeneratedSourceInfo =
13
+ import("./getGeneratedSourceInfo").GeneratedSourceInfo;
14
+ type OnChunk = import("./streamChunks").OnChunk;
15
+ type OnName = import("./streamChunks").OnName;
16
+ type OnSource = import("./streamChunks").OnSource;
@@ -0,0 +1,19 @@
1
+ declare namespace _exports {
2
+ export { RawSourceMap, GeneratedSourceInfo, OnChunk, OnName, OnSource };
3
+ }
4
+ declare function _exports(
5
+ source: string,
6
+ sourceMap: RawSourceMap,
7
+ onChunk: OnChunk,
8
+ onSource: OnSource,
9
+ onName: OnName,
10
+ finalSource: boolean,
11
+ columns: boolean,
12
+ ): GeneratedSourceInfo;
13
+ export = _exports;
14
+ type RawSourceMap = import("../Source").RawSourceMap;
15
+ type GeneratedSourceInfo =
16
+ import("./getGeneratedSourceInfo").GeneratedSourceInfo;
17
+ type OnChunk = import("./streamChunks").OnChunk;
18
+ type OnName = import("./streamChunks").OnName;
19
+ type OnSource = import("./streamChunks").OnSource;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Disables the optimization to save both string and buffer in memory. This
3
+ * may increase performance but should reduce memory usage in the Webpack
4
+ * compiler.
5
+ * @returns {void}
6
+ */
7
+ export function disableDualStringBufferCaching(): void;
8
+ /**
9
+ * Enables an optimization to save both string and buffer in memory to avoid
10
+ * repeat conversions between the two formats when they are requested. This
11
+ * is enabled by default. This option can improve performance but can consume
12
+ * additional memory since values are stored twice.
13
+ * @returns {void}
14
+ */
15
+ export function enableDualStringBufferCaching(): void;
16
+ /**
17
+ * Starts a memory optimization to avoid repeat copies of the same string in
18
+ * memory by caching a single reference to the string. This can reduce memory
19
+ * usage if the same string is repeated many times in the compiler, such as
20
+ * when Webpack layers are used with the same files.
21
+ *
22
+ * {@link exitStringInterningRange} should be called when string interning is
23
+ * no longer necessary to free up the memory used by the interned strings. If
24
+ * {@link enterStringInterningRange} has been called multiple times, then
25
+ * this method may not immediately free all the memory until
26
+ * {@link exitStringInterningRange} has been called to end all string
27
+ * interning ranges.
28
+ * @returns {void}
29
+ */
30
+ export function enterStringInterningRange(): void;
31
+ /**
32
+ * Stops the current string interning range. Once all string interning ranges
33
+ * have been exited, this method will free all the memory used by the interned
34
+ * strings. This method should be called once for each time that
35
+ * {@link enterStringInterningRange} was called.
36
+ * @returns {void}
37
+ */
38
+ export function exitStringInterningRange(): void;
39
+ /**
40
+ * Saves the string in a map to ensure that only one copy of the string exists
41
+ * in memory at a given time. This is controlled by {@link enableStringInterning}
42
+ * and {@link disableStringInterning}. Callers are expect to manage the memory
43
+ * of the interned strings by calling {@link disableStringInterning} after the
44
+ * compiler no longer needs to save the interned memory.
45
+ * @param {string} str A string to be interned.
46
+ * @returns {string} The original string or a reference to an existing string of the same value if it has already been interned.
47
+ */
48
+ export function internString(str: string): string;
49
+ /**
50
+ * @returns {boolean} Whether the optimization to cache copies of both the
51
+ * string and buffer version of source content is enabled. This is enabled by
52
+ * default to improve performance but can consume more memory since values are
53
+ * stored twice.
54
+ */
55
+ export function isDualStringBufferCachingEnabled(): boolean;
@@ -0,0 +1,50 @@
1
+ declare namespace _exports {
2
+ export {
3
+ CachedData,
4
+ SourceLike,
5
+ ConcatSourceChild,
6
+ Replacement,
7
+ HashLike,
8
+ MapOptions,
9
+ RawSourceMap,
10
+ SourceAndMap,
11
+ SourceValue,
12
+ GeneratedSourceInfo,
13
+ OnChunk,
14
+ OnName,
15
+ OnSource,
16
+ StreamChunksOptions,
17
+ };
18
+ }
19
+ declare namespace _exports {
20
+ const Source: typeof import("./Source");
21
+ const RawSource: typeof import("./RawSource");
22
+ const OriginalSource: typeof import("./OriginalSource");
23
+ const SourceMapSource: typeof import("./SourceMapSource");
24
+ const CachedSource: typeof import("./CachedSource");
25
+ const ConcatSource: typeof import("./ConcatSource");
26
+ const ReplaceSource: typeof import("./ReplaceSource");
27
+ const PrefixSource: typeof import("./PrefixSource");
28
+ const SizeOnlySource: typeof import("./SizeOnlySource");
29
+ const CompatSource: typeof import("./CompatSource");
30
+ namespace util {
31
+ const scopes: typeof import("./helpers/scopes");
32
+ const stringBufferUtils: typeof import("./helpers/stringBufferUtils");
33
+ }
34
+ }
35
+ export = _exports;
36
+ type CachedData = import("./CachedSource").CachedData;
37
+ type SourceLike = import("./CompatSource").SourceLike;
38
+ type ConcatSourceChild = import("./ConcatSource").Child;
39
+ type Replacement = import("./ReplaceSource").Replacement;
40
+ type HashLike = import("./Source").HashLike;
41
+ type MapOptions = import("./Source").MapOptions;
42
+ type RawSourceMap = import("./Source").RawSourceMap;
43
+ type SourceAndMap = import("./Source").SourceAndMap;
44
+ type SourceValue = import("./Source").SourceValue;
45
+ type GeneratedSourceInfo =
46
+ import("./helpers/getGeneratedSourceInfo").GeneratedSourceInfo;
47
+ type OnChunk = import("./helpers/streamChunks").OnChunk;
48
+ type OnName = import("./helpers/streamChunks").OnName;
49
+ type OnSource = import("./helpers/streamChunks").OnSource;
50
+ type StreamChunksOptions = import("./helpers/streamChunks").Options;
@@ -1,11 +1,18 @@
1
- import binding from '@ohos-ports/rspack-binding';
2
- import type { Source } from '../compiled/webpack-sources/types.js';
1
+ import binding from '@rspack/binding';
2
+ import type { Source } from '../compiled/webpack-sources/index.js';
3
+ import { BUILD_INFO_ASSETS_SYMBOL, BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL, BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL, BUILD_INFO_FILE_DEPENDENCIES_SYMBOL, BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL, COMMIT_CUSTOM_FIELDS_SYMBOL } from './util/symbols.js';
3
4
  declare const $assets: unique symbol;
4
- declare module '@ohos-ports/rspack-binding' {
5
+ declare module '@rspack/binding' {
5
6
  interface Assets {
6
7
  [$assets]: Record<string, Source>;
7
8
  }
8
9
  interface KnownBuildInfo {
10
+ [BUILD_INFO_ASSETS_SYMBOL]: binding.Assets;
11
+ [BUILD_INFO_FILE_DEPENDENCIES_SYMBOL]: string[];
12
+ [BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL]: string[];
13
+ [BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL]: string[];
14
+ [BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL]: string[];
15
+ [COMMIT_CUSTOM_FIELDS_SYMBOL](): void;
9
16
  assets: Record<string, Source>;
10
17
  fileDependencies: Set<string>;
11
18
  contextDependencies: Set<string>;
@@ -13,5 +20,7 @@ declare module '@ohos-ports/rspack-binding' {
13
20
  buildDependencies: Set<string>;
14
21
  }
15
22
  }
16
- export type { BuildInfo } from '@ohos-ports/rspack-binding';
23
+ export type { BuildInfo } from '@rspack/binding';
17
24
  export declare const commitCustomFieldsToRust: (buildInfo: binding.BuildInfo) => void;
25
+ export declare const pickCustomBuildInfoFields: (buildInfo: Record<string, unknown> | undefined) => Record<string, unknown>;
26
+ export declare const replaceCustomBuildInfoFields: (buildInfo: Record<string, unknown>, custom: Record<string, unknown>) => void;
package/dist/Chunk.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { type ChunkGroup } from '@ohos-ports/rspack-binding';
1
+ import { type ChunkGroup } from '@rspack/binding';
2
2
  interface ChunkMaps {
3
3
  hash: Record<string | number, string>;
4
4
  contentHash: Record<string | number, Record<string, string>>;
5
5
  name: Record<string | number, string>;
6
6
  }
7
- declare module '@ohos-ports/rspack-binding' {
7
+ declare module '@rspack/binding' {
8
8
  interface Chunk {
9
9
  readonly files: ReadonlySet<string>;
10
10
  readonly runtime: ReadonlySet<string>;
@@ -13,4 +13,4 @@ declare module '@ohos-ports/rspack-binding' {
13
13
  getChunkMaps(realHash: boolean): ChunkMaps;
14
14
  }
15
15
  }
16
- export { Chunk } from '@ohos-ports/rspack-binding';
16
+ export { Chunk } from '@rspack/binding';
@@ -1,9 +1,9 @@
1
1
  import type { RuntimeSpec } from './util/runtime.js';
2
- declare module '@ohos-ports/rspack-binding' {
2
+ declare module '@rspack/binding' {
3
3
  interface ChunkGraph {
4
4
  getModuleChunksIterable(module: Module): Iterable<Chunk>;
5
5
  getOrderedChunkModulesIterable(chunk: Chunk, compareFn: (a: Module, b: Module) => number): Iterable<Module>;
6
6
  getModuleHash(module: Module, runtime: RuntimeSpec): string | null;
7
7
  }
8
8
  }
9
- export { ChunkGraph } from '@ohos-ports/rspack-binding';
9
+ export { ChunkGraph } from '@rspack/binding';
package/dist/Chunks.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Chunks } from '@ohos-ports/rspack-binding';
2
- declare module '@ohos-ports/rspack-binding' {
1
+ import { Chunks } from '@rspack/binding';
2
+ declare module '@rspack/binding' {
3
3
  interface Chunks {
4
4
  [Symbol.iterator](): SetIterator<Chunk>;
5
5
  entries(): SetIterator<[Chunk, Chunk]>;
@@ -1 +1,6 @@
1
- export {};
1
+ import type { Source } from '../compiled/webpack-sources/index.js';
2
+ declare module '@rspack/binding' {
3
+ interface Sources {
4
+ get(sourceType: string): Source | null;
5
+ }
6
+ }
@@ -7,18 +7,18 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation } from '@ohos-ports/rspack-binding';
11
- import binding from '@ohos-ports/rspack-binding';
12
- export type { AssetInfo } from '@ohos-ports/rspack-binding';
10
+ import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation } from '@rspack/binding';
11
+ import binding from '@rspack/binding';
12
+ export type { AssetInfo } from '@rspack/binding';
13
13
  import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.js';
14
- import type { Source } from '../compiled/webpack-sources/types.js';
14
+ import type { Source } from '../compiled/webpack-sources/index.js';
15
15
  import type { EntryOptions, EntryPlugin } from './builtin-plugin/index.js';
16
16
  import './Chunk.js';
17
17
  import type { Chunk } from './Chunk.js';
18
18
  import type { ChunkGraph } from './ChunkGraph.js';
19
19
  import type { Compiler } from './Compiler.js';
20
20
  import type { ContextModuleFactory } from './ContextModuleFactory.js';
21
- import type { Filename, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance, StatsOptions, StatsValue } from './config/index.js';
21
+ import type { Falsy, Filename, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance, StatsOptions, StatsValue } from './config/index.js';
22
22
  import type { Entrypoint } from './Entrypoint.js';
23
23
  import WebpackError from './lib/WebpackError.js';
24
24
  import { Logger } from './logging/Logger.js';
@@ -37,7 +37,9 @@ import type Hash from './util/hash/index.js';
37
37
  import './Chunks.js';
38
38
  import './ChunkGraph.js';
39
39
  import './CodeGenerationResults.js';
40
+ import { type FileSystemDependencies } from './FileSystemDependencies.js';
40
41
  import type { CodeGenerationResult } from './taps/compilation.js';
42
+ import { COMPILATION_HOOKS_MAP_SYMBOL } from './util/symbols.js';
41
43
  export type Assets = Record<string, Source>;
42
44
  export interface Asset {
43
45
  name: string;
@@ -133,6 +135,7 @@ export interface KnownNormalizedStatsOptions {
133
135
  optimizationBailout: boolean;
134
136
  depth: boolean;
135
137
  assets: boolean;
138
+ cacheInfo: boolean;
136
139
  chunks: boolean;
137
140
  errors: boolean;
138
141
  errorsCount: boolean;
@@ -190,7 +193,7 @@ export declare class Compilation {
190
193
  runtimeModule: liteTapable.SyncHook<[RuntimeModule, Chunk]>;
191
194
  seal: liteTapable.SyncHook<[]>;
192
195
  afterSeal: liteTapable.AsyncSeriesHook<[], void>;
193
- needAdditionalPass: liteTapable.SyncBailHook<[], boolean>;
196
+ needAdditionalPass: liteTapable.SyncBailHook<[], boolean | void>;
194
197
  }>;
195
198
  name?: string;
196
199
  startTime?: number;
@@ -210,7 +213,7 @@ export declare class Compilation {
210
213
  createSnapshot(): null;
211
214
  };
212
215
  needAdditionalPass: boolean;
213
- [binding.COMPILATION_HOOKS_MAP_SYMBOL]: WeakMap<object, unknown>;
216
+ [COMPILATION_HOOKS_MAP_SYMBOL]: WeakMap<object, unknown>;
214
217
  constructor(compiler: Compiler, inner: JsCompilation);
215
218
  get hash(): Readonly<string | null>;
216
219
  get fullHash(): Readonly<string | null>;
@@ -262,7 +265,7 @@ export declare class Compilation {
262
265
  * Get an array of Asset
263
266
  */
264
267
  getAssets(): readonly Asset[];
265
- getAsset(name: string): Readonly<Asset> | void;
268
+ getAsset(name: string): Readonly<Asset> | undefined;
266
269
  /**
267
270
  * Note: This is not a webpack public API, maybe removed in future.
268
271
  *
@@ -296,58 +299,18 @@ export declare class Compilation {
296
299
  info: AssetInfo;
297
300
  };
298
301
  getLogger(name: string | (() => string)): Logger;
299
- fileDependencies: {
300
- [Symbol.iterator](): Generator<string, void, unknown>;
301
- has: (dep: string) => boolean;
302
- add: (dep: string) => void;
303
- addAll: (deps: Iterable<string>) => void;
304
- delete: (dep: string) => boolean;
305
- keys(): SetIterator<string>;
306
- values(): SetIterator<string>;
307
- entries(): SetIterator<[string, string]>;
308
- readonly size: number;
309
- };
310
302
  get __internal__addedFileDependencies(): string[];
311
303
  get __internal__removedFileDependencies(): string[];
312
304
  get __internal__addedContextDependencies(): string[];
313
305
  get __internal__removedContextDependencies(): string[];
314
306
  get __internal__addedMissingDependencies(): string[];
315
307
  get __internal__removedMissingDependencies(): string[];
316
- contextDependencies: {
317
- [Symbol.iterator](): Generator<string, void, unknown>;
318
- has: (dep: string) => boolean;
319
- add: (dep: string) => void;
320
- addAll: (deps: Iterable<string>) => void;
321
- delete: (dep: string) => boolean;
322
- keys(): SetIterator<string>;
323
- values(): SetIterator<string>;
324
- entries(): SetIterator<[string, string]>;
325
- readonly size: number;
326
- };
327
- missingDependencies: {
328
- [Symbol.iterator](): Generator<string, void, unknown>;
329
- has: (dep: string) => boolean;
330
- add: (dep: string) => void;
331
- addAll: (deps: Iterable<string>) => void;
332
- delete: (dep: string) => boolean;
333
- keys(): SetIterator<string>;
334
- values(): SetIterator<string>;
335
- entries(): SetIterator<[string, string]>;
336
- readonly size: number;
337
- };
338
- buildDependencies: {
339
- [Symbol.iterator](): Generator<string, void, unknown>;
340
- has: (dep: string) => boolean;
341
- add: (dep: string) => void;
342
- addAll: (deps: Iterable<string>) => void;
343
- delete: (dep: string) => boolean;
344
- keys(): SetIterator<string>;
345
- values(): SetIterator<string>;
346
- entries(): SetIterator<[string, string]>;
347
- readonly size: number;
348
- };
308
+ fileDependencies: FileSystemDependencies;
309
+ contextDependencies: FileSystemDependencies;
310
+ missingDependencies: FileSystemDependencies;
311
+ buildDependencies: FileSystemDependencies;
349
312
  getStats(): Stats;
350
- createChildCompiler(name: string, outputOptions: OutputNormalized, plugins: RspackPluginInstance[]): Compiler;
313
+ createChildCompiler(name: string, outputOptions: OutputNormalized, plugins?: (RspackPluginInstance | Falsy)[]): Compiler;
351
314
  rebuildModule(module: Module, f: (err: Error | null, module: Module | null) => void): void;
352
315
  addRuntimeModule(chunk: Chunk, runtimeModule: RuntimeModule): void;
353
316
  addInclude(context: string, dependency: ReturnType<typeof EntryPlugin.createDependency>, options: EntryOptions, callback: (err?: null | WebpackError, module?: Module) => void): void;
@@ -7,15 +7,14 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type binding from '@ohos-ports/rspack-binding';
10
+ import type binding from '@rspack/binding';
11
11
  import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.js';
12
- import type Watchpack from '../compiled/watchpack/index.js';
13
- import type { Source } from '../compiled/webpack-sources/types.js';
12
+ import type { Source } from '../compiled/webpack-sources/index.js';
14
13
  import type { Chunk } from './Chunk.js';
15
14
  import type { CompilationParams } from './Compilation.js';
16
15
  import { Compilation } from './Compilation.js';
17
16
  import { ContextModuleFactory } from './ContextModuleFactory.js';
18
- import type { EntryNormalized, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance } from './config/index.js';
17
+ import type { EntryNormalized, Falsy, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance, WatchOptions } from './config/index.js';
19
18
  import type { ExtractedTargetProperties, PlatformTargetProperties } from './config/target.js';
20
19
  import type { FileSystemInfoEntry } from './FileSystemInfo.js';
21
20
  import type { rspack } from './index.js';
@@ -26,7 +25,7 @@ import { NormalModuleFactory } from './NormalModuleFactory.js';
26
25
  import { ResolverFactory } from './ResolverFactory.js';
27
26
  import { RuleSetCompiler } from './RuleSetCompiler.js';
28
27
  import { Stats } from './Stats.js';
29
- import type { InputFileSystem, IntermediateFileSystem, OutputFileSystem, WatchFileSystem } from './util/fs.js';
28
+ import type { ExistenceOnlyTimeEntry, InputFileSystem, IntermediateFileSystem, OutputFileSystem, WatchFileSystem } from './util/fs.js';
30
29
  import { Watching } from './Watching.js';
31
30
  export interface AssetEmittedInfo {
32
31
  content: Buffer;
@@ -45,7 +44,7 @@ export type CompilerHooks = {
45
44
  normalModuleFactory: liteTapable.SyncHook<NormalModuleFactory>;
46
45
  contextModuleFactory: liteTapable.SyncHook<ContextModuleFactory>;
47
46
  initialize: liteTapable.SyncHook<[]>;
48
- shouldEmit: liteTapable.SyncBailHook<[Compilation], boolean>;
47
+ shouldEmit: liteTapable.SyncBailHook<[Compilation], boolean | void>;
49
48
  /**
50
49
  * Called when infrastructure logging is triggered, allowing plugins to intercept, modify, or handle log messages.
51
50
  * If the hook returns `true`, the default infrastructure logging will be prevented.
@@ -101,8 +100,8 @@ declare class Compiler {
101
100
  records: Record<string, any[]>;
102
101
  modifiedFiles?: ReadonlySet<string>;
103
102
  removedFiles?: ReadonlySet<string>;
104
- fileTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | 'ignore' | null>;
105
- contextTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | 'ignore' | null>;
103
+ fileTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | ExistenceOnlyTimeEntry | 'ignore' | null>;
104
+ contextTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | ExistenceOnlyTimeEntry | 'ignore' | null>;
106
105
  fsStartTime?: number;
107
106
  watchMode: boolean;
108
107
  context: string;
@@ -157,7 +156,7 @@ declare class Compiler {
157
156
  * @param handler - signals when the call finishes
158
157
  * @returns a compiler watcher
159
158
  */
160
- watch(watchOptions: Watchpack.WatchOptions, handler: liteTapable.Callback<Error, Stats>): Watching;
159
+ watch(watchOptions: WatchOptions, handler: liteTapable.Callback<Error, Stats>): Watching;
161
160
  /**
162
161
  * @param callback - signals when the call finishes
163
162
  * @param options - additional data like modifiedFiles, removedFiles
@@ -176,7 +175,7 @@ declare class Compiler {
176
175
  * @param plugins - the plugins to apply
177
176
  * @returns a child compiler
178
177
  */
179
- createChildCompiler(compilation: Compilation, compilerName: string, compilerIndex: number, outputOptions: OutputNormalized, plugins: RspackPluginInstance[]): Compiler;
178
+ createChildCompiler(compilation: Compilation, compilerName: string, compilerIndex: number, outputOptions: OutputNormalized, plugins?: (RspackPluginInstance | Falsy)[]): Compiler;
180
179
  isChild(): boolean;
181
180
  /**
182
181
  * Create a compilation and run it, which is the basic method that `compiler.run` and `compiler.watch` depend on.
@@ -1 +1,5 @@
1
- export { ConcatenatedModule } from '@ohos-ports/rspack-binding';
1
+ import { Module } from './Module.js';
2
+ export declare class ConcatenatedModule extends Module {
3
+ get rootModule(): Module;
4
+ get modules(): Module[];
5
+ }
@@ -1 +1,3 @@
1
- export { ContextModule } from '@ohos-ports/rspack-binding';
1
+ import { Module } from './Module.js';
2
+ export declare class ContextModule extends Module {
3
+ }
@@ -1,7 +1,3 @@
1
- import type { Diagnostics } from '@ohos-ports/rspack-binding';
1
+ import type { Diagnostics } from '@rspack/binding';
2
2
  import type { RspackError } from './RspackError.js';
3
- declare const $proxy: unique symbol;
4
- export declare function createDiagnosticArray(adm: Diagnostics & {
5
- [$proxy]?: RspackError[];
6
- }): RspackError[];
7
- export {};
3
+ export declare function createDiagnosticArray(adm: Diagnostics): RspackError[];
@@ -1,2 +1,2 @@
1
- import type { ChunkGroup } from '@ohos-ports/rspack-binding';
1
+ import type { ChunkGroup } from '@rspack/binding';
2
2
  export type Entrypoint = ChunkGroup;
@@ -1,4 +1,4 @@
1
- import type { JsExportsInfo } from '@ohos-ports/rspack-binding';
1
+ import type { JsExportsInfo } from '@rspack/binding';
2
2
  import type { RuntimeSpec } from './util/runtime.js';
3
3
  /**
4
4
  * Unused: 0
@@ -1,15 +1,16 @@
1
- import binding from '@ohos-ports/rspack-binding';
2
1
  import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.js';
3
2
  import type { Chunk } from './Chunk.js';
4
3
  import { type Compilation } from './Compilation.js';
5
- export type ExternalModule = binding.ExternalModule;
4
+ import { Module } from './Module.js';
6
5
  export type ExternalModuleCompilationHooks = {
7
6
  chunkCondition: liteTapable.SyncBailHook<[
8
7
  Chunk,
9
8
  Compilation
10
9
  ], boolean | undefined>;
11
10
  };
12
- declare const ExternalModule: typeof binding.ExternalModule & {
13
- getCompilationHooks(compilation: Compilation): ExternalModuleCompilationHooks;
14
- };
15
- export { ExternalModule };
11
+ export declare class ExternalModule extends Module {
12
+ #private;
13
+ readonly userRequest: string;
14
+ constructor();
15
+ static getCompilationHooks(compilation: Compilation): ExternalModuleCompilationHooks;
16
+ }
@@ -1,4 +1,4 @@
1
- import type { NodeFsStats, ThreadsafeNodeFS } from '@ohos-ports/rspack-binding';
1
+ import type { NodeFsStats, ThreadsafeNodeFS } from '@rspack/binding';
2
2
  import { type InputFileSystem, type IntermediateFileSystem, type OutputFileSystem } from './util/fs.js';
3
3
  declare class ThreadsafeInputNodeFS implements ThreadsafeNodeFS {
4
4
  writeFile: (name: string, content: Buffer) => Promise<void>;
@@ -10,6 +10,7 @@ declare class ThreadsafeInputNodeFS implements ThreadsafeNodeFS {
10
10
  readFile: (name: string) => Promise<Buffer | string | void>;
11
11
  stat: (name: string) => Promise<NodeFsStats | void>;
12
12
  lstat: (name: string) => Promise<NodeFsStats | void>;
13
+ readlink: (name: string) => Promise<string | void>;
13
14
  chmod?: (name: string, mode: number) => Promise<void>;
14
15
  realpath: (name: string) => Promise<string | void>;
15
16
  open: (name: string, flags: string) => Promise<number | void>;
@@ -34,6 +35,7 @@ declare class ThreadsafeOutputNodeFS implements ThreadsafeNodeFS {
34
35
  readFile: (name: string) => Promise<Buffer | string | void>;
35
36
  stat: (name: string) => Promise<NodeFsStats | void>;
36
37
  lstat: (name: string) => Promise<NodeFsStats | void>;
38
+ readlink: (name: string) => Promise<string | void>;
37
39
  chmod?: (name: string, mode: number) => Promise<void>;
38
40
  realpath: (name: string) => Promise<string | void>;
39
41
  open: (name: string, flags: string) => Promise<number | void>;