@rspack-canary/browser 1.4.12-canary-f056cdd6-20250801072217 → 1.4.12-canary-d2f8a578-20250801090118
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.
- package/dist/BuildInfo.d.ts +17 -0
- package/dist/Chunk.d.ts +16 -0
- package/dist/ChunkGraph.d.ts +9 -0
- package/dist/Chunks.d.ts +12 -0
- package/dist/CodeGenerationResults.d.ts +1 -0
- package/dist/Compilation.d.ts +420 -0
- package/dist/Compiler.d.ts +192 -0
- package/dist/ConcatenatedModule.d.ts +1 -0
- package/dist/ContextModule.d.ts +1 -0
- package/dist/ContextModuleFactory.d.ts +13 -0
- package/dist/Diagnostics.d.ts +7 -0
- package/dist/Entrypoint.d.ts +2 -0
- package/dist/ErrorHelpers.d.ts +3 -0
- package/dist/ExecuteModulePlugin.d.ts +4 -0
- package/dist/ExportsInfo.d.ts +20 -0
- package/dist/ExternalModule.d.ts +1 -0
- package/dist/FileSystem.d.ts +54 -0
- package/dist/FileSystemInfo.d.ts +5 -0
- package/dist/Module.d.ts +53 -0
- package/dist/ModuleGraph.d.ts +19 -0
- package/dist/ModuleTypeConstants.d.ts +8 -0
- package/dist/MultiCompiler.d.ts +78 -0
- package/dist/MultiStats.d.ts +22 -0
- package/dist/MultiWatching.d.ts +27 -0
- package/dist/NativeWatchFileSystem.d.ts +17 -0
- package/dist/NormalModule.d.ts +15 -0
- package/dist/NormalModuleFactory.d.ts +23 -0
- package/dist/Resolver.d.ts +24 -0
- package/dist/ResolverFactory.d.ts +14 -0
- package/dist/RspackError.d.ts +9 -0
- package/dist/RuleSetCompiler.d.ts +9 -0
- package/dist/RuntimeGlobals.d.ts +325 -0
- package/dist/RuntimeModule.d.ts +32 -0
- package/dist/Stats.d.ts +17 -0
- package/dist/Template.d.ts +77 -0
- package/dist/Watching.d.ts +47 -0
- package/dist/browser/buffer.d.ts +1 -0
- package/dist/browser/fs.d.ts +12 -0
- package/dist/browser/index.d.ts +5 -0
- package/dist/browser/service.d.ts +3 -0
- package/dist/builtin-loader/index.d.ts +1 -0
- package/dist/builtin-loader/lightningcss/index.d.ts +117 -0
- package/dist/builtin-loader/swc/collectTypeScriptInfo.d.ts +21 -0
- package/dist/builtin-loader/swc/index.d.ts +5 -0
- package/dist/builtin-loader/swc/pluginImport.d.ts +33 -0
- package/dist/builtin-loader/swc/types.d.ts +83 -0
- package/dist/builtin-plugin/APIPlugin.d.ts +9 -0
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +9 -0
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/BannerPlugin.d.ts +40 -0
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +14 -0
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +9 -0
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +59 -0
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +9 -0
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +9 -0
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +14 -0
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +21 -0
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/DataUriPlugin.d.ts +9 -0
- package/dist/builtin-plugin/DefinePlugin.d.ts +16 -0
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +8 -0
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +8 -0
- package/dist/builtin-plugin/DllEntryPlugin.d.ts +12 -0
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +11 -0
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +12 -0
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +9 -0
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +25 -0
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +11 -0
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +9 -0
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +9 -0
- package/dist/builtin-plugin/EntryPlugin.d.ts +32 -0
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +11 -0
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +10 -0
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +11 -0
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +9 -0
- package/dist/builtin-plugin/FileUriPlugin.d.ts +9 -0
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +9 -0
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +9 -0
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +10 -0
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +7 -0
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +9 -0
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +36 -0
- package/dist/builtin-plugin/IgnorePlugin.d.ts +19 -0
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +15 -0
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +10 -0
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +17 -0
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +32 -0
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +14 -0
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +9 -0
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +9 -0
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +8 -0
- package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +9 -0
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +9 -0
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +9 -0
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +8 -0
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +8 -0
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +9 -0
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +9 -0
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/ProgressPlugin.d.ts +11 -0
- package/dist/builtin-plugin/ProvidePlugin.d.ts +10 -0
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +9 -0
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +9 -0
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +49 -0
- package/dist/builtin-plugin/RslibPlugin.d.ts +11 -0
- package/dist/builtin-plugin/RstestPlugin.d.ts +11 -0
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +11 -0
- package/dist/builtin-plugin/RuntimePlugin.d.ts +28 -0
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +9 -0
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +19 -0
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +11 -0
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +11 -0
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +40 -0
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +214 -0
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +7 -0
- package/dist/builtin-plugin/WorkerPlugin.d.ts +13 -0
- package/dist/builtin-plugin/base.d.ts +45 -0
- package/dist/builtin-plugin/css-extract/index.d.ts +24 -0
- package/dist/builtin-plugin/css-extract/loader.d.ts +21 -0
- package/dist/builtin-plugin/css-extract/utils.d.ts +6 -0
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +32 -0
- package/dist/builtin-plugin/html-plugin/index.d.ts +2 -0
- package/dist/builtin-plugin/html-plugin/options.d.ts +83 -0
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +24 -0
- package/dist/builtin-plugin/html-plugin/taps.d.ts +2 -0
- package/dist/builtin-plugin/index.d.ts +80 -0
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +24 -0
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +4 -0
- package/dist/config/adapter.d.ts +8 -0
- package/dist/config/adapterRuleUse.d.ts +333 -0
- package/dist/config/browserslistTargetHandler.d.ts +15 -0
- package/dist/config/defaults.d.ts +13 -0
- package/dist/config/devServer.d.ts +207 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/normalization.d.ts +154 -0
- package/dist/config/target.d.ts +89 -0
- package/dist/config/types.d.ts +2282 -0
- package/dist/container/ContainerPlugin.d.ts +40 -0
- package/dist/container/ContainerReferencePlugin.d.ts +33 -0
- package/dist/container/ModuleFederationPlugin.d.ts +13 -0
- package/dist/container/ModuleFederationPluginV1.d.ts +22 -0
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +12 -0
- package/dist/container/index.d.ts +4 -0
- package/dist/container/options.d.ts +3 -0
- package/dist/error/ConcurrentCompilationError.d.ts +14 -0
- package/dist/exports.d.ts +166 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.mjs +57013 -0
- package/dist/index.mjs.LICENSE.txt +10 -0
- package/dist/lib/AbstractMethodError.d.ts +23 -0
- package/dist/lib/Cache.d.ts +65 -0
- package/dist/lib/CacheFacade.d.ts +139 -0
- package/dist/lib/DllPlugin.d.ts +42 -0
- package/dist/lib/DllReferencePlugin.d.ts +119 -0
- package/dist/lib/EntryOptionPlugin.d.ts +33 -0
- package/dist/lib/EnvironmentPlugin.d.ts +22 -0
- package/dist/lib/HookWebpackError.d.ts +40 -0
- package/dist/lib/IgnoreWarningsPlugin.d.ts +25 -0
- package/dist/lib/LoaderOptionsPlugin.d.ts +28 -0
- package/dist/lib/LoaderTargetPlugin.d.ts +24 -0
- package/dist/lib/ModuleFilenameHelpers.d.ts +53 -0
- package/dist/lib/NormalModuleReplacementPlugin.d.ts +29 -0
- package/dist/lib/WebpackError.d.ts +21 -0
- package/dist/lib/cache/MemoryCachePlugin.d.ts +5 -0
- package/dist/lib/cache/getLazyHashedEtag.d.ts +35 -0
- package/dist/lib/cache/mergeEtags.d.ts +17 -0
- package/dist/loader-runner/LoaderLoadingError.d.ts +13 -0
- package/dist/loader-runner/ModuleError.d.ts +7 -0
- package/dist/loader-runner/ModuleWarning.d.ts +7 -0
- package/dist/loader-runner/index.d.ts +34 -0
- package/dist/loader-runner/loadLoader.d.ts +12 -0
- package/dist/loader-runner/service.d.ts +71 -0
- package/dist/loader-runner/utils.d.ts +7 -0
- package/dist/loader-runner/worker.d.ts +14 -0
- package/dist/logging/Logger.d.ts +61 -0
- package/dist/logging/createConsoleLogger.d.ts +35 -0
- package/dist/logging/truncateArgs.d.ts +16 -0
- package/dist/node/NodeEnvironmentPlugin.d.ts +10 -0
- package/dist/node/NodeTemplatePlugin.d.ts +18 -0
- package/dist/node/NodeWatchFileSystem.d.ts +18 -0
- package/dist/node/nodeConsole.d.ts +15 -0
- package/dist/rspack.d.ts +16 -0
- package/dist/rspack.wasi-browser.js +101 -0
- package/dist/rspackOptionsApply.d.ts +4 -0
- package/dist/runtime/cssExtractHmr.d.ts +4 -0
- package/dist/runtime/moduleFederationDefaultRuntime.d.ts +2 -0
- package/dist/schema/config.d.ts +995 -0
- package/dist/schema/loaders.d.ts +399 -0
- package/dist/schema/plugins.d.ts +166 -0
- package/dist/schema/utils.d.ts +3 -0
- package/dist/schema/validate.d.ts +9 -0
- package/dist/sharing/ConsumeSharedPlugin.d.ts +41 -0
- package/dist/sharing/ProvideSharedPlugin.d.ts +34 -0
- package/dist/sharing/SharePlugin.d.ts +51 -0
- package/dist/sharing/ShareRuntimePlugin.d.ts +9 -0
- package/dist/sharing/utils.d.ts +1 -0
- package/dist/stats/DefaultStatsFactoryPlugin.d.ts +4 -0
- package/dist/stats/DefaultStatsPresetPlugin.d.ts +4 -0
- package/dist/stats/DefaultStatsPrinterPlugin.d.ts +13 -0
- package/dist/stats/StatsFactory.d.ts +57 -0
- package/dist/stats/StatsPrinter.d.ts +57 -0
- package/dist/stats/statsFactoryUtils.d.ts +325 -0
- package/dist/swc.d.ts +7 -0
- package/dist/taps/compilation.d.ts +8 -0
- package/dist/taps/compiler.d.ts +2 -0
- package/dist/taps/contextModuleFactory.d.ts +2 -0
- package/dist/taps/index.d.ts +6 -0
- package/dist/taps/javascriptModules.d.ts +2 -0
- package/dist/taps/normalModuleFactory.d.ts +2 -0
- package/dist/taps/types.d.ts +11 -0
- package/dist/trace/index.d.ts +46 -0
- package/dist/trace/traceHookPlugin.d.ts +5 -0
- package/dist/util/ArrayQueue.d.ts +45 -0
- package/dist/util/AsyncTask.d.ts +7 -0
- package/dist/util/MergeCaller.d.ts +10 -0
- package/dist/util/SizeFormatHelpers.d.ts +10 -0
- package/dist/util/SplitChunkSize.d.ts +5 -0
- package/dist/util/assertNotNil.d.ts +1 -0
- package/dist/util/assetCondition.d.ts +2 -0
- package/dist/util/asyncLib.d.ts +54 -0
- package/dist/util/bindingVersionCheck.d.ts +5 -0
- package/dist/util/cleverMerge.d.ts +24 -0
- package/dist/util/comparators.d.ts +16 -0
- package/dist/util/createHash.d.ts +16 -0
- package/dist/util/createReadonlyMap.d.ts +1 -0
- package/dist/util/fake.d.ts +9 -0
- package/dist/util/fs.d.ts +352 -0
- package/dist/util/hash/index.d.ts +26 -0
- package/dist/util/hash/md4.d.ts +11 -0
- package/dist/util/hash/wasm-hash.d.ts +51 -0
- package/dist/util/hash/xxhash64.d.ts +11 -0
- package/dist/util/identifier.d.ts +31 -0
- package/dist/util/index.d.ts +11 -0
- package/dist/util/memoize.d.ts +2 -0
- package/dist/util/require.d.ts +3 -0
- package/dist/util/runtime.d.ts +2 -0
- package/dist/util/smartGrouping.d.ts +21 -0
- package/dist/util/source.d.ts +7 -0
- package/dist/wasi-worker-browser.mjs +34 -0
- package/package.json +3 -3
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/ArrayQueue.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* @template T
|
|
12
|
+
*/
|
|
13
|
+
declare class ArrayQueue<T> {
|
|
14
|
+
_list: Array<T>;
|
|
15
|
+
_listReversed: Array<T>;
|
|
16
|
+
constructor(items?: T[]);
|
|
17
|
+
/**
|
|
18
|
+
* Returns the number of elements in this queue.
|
|
19
|
+
* @returns {number} The number of elements in this queue.
|
|
20
|
+
*/
|
|
21
|
+
get length(): number;
|
|
22
|
+
/**
|
|
23
|
+
* Empties the queue.
|
|
24
|
+
*/
|
|
25
|
+
clear(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Appends the specified element to this queue.
|
|
28
|
+
* @param {T} item The element to add.
|
|
29
|
+
* @returns {void}
|
|
30
|
+
*/
|
|
31
|
+
enqueue(item: T): void;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves and removes the head of this queue.
|
|
34
|
+
* @returns {T | undefined} The head of the queue of `undefined` if this queue is empty.
|
|
35
|
+
*/
|
|
36
|
+
dequeue(): T | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Finds and removes an item
|
|
39
|
+
* @param {T} item the item
|
|
40
|
+
* @returns {void}
|
|
41
|
+
*/
|
|
42
|
+
delete(item: T): void;
|
|
43
|
+
[Symbol.iterator](): Generator<T, void, unknown>;
|
|
44
|
+
}
|
|
45
|
+
export default ArrayQueue;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type TaskCallback<Ret> = (err: Error | null, ret: Ret | null) => void;
|
|
2
|
+
export declare class AsyncTask<Param, Ret> {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(task: (param: Param[], callback: (results: [Error | null, Ret | null][]) => void) => void);
|
|
5
|
+
exec(param: Param, callback: TaskCallback<Ret>): void;
|
|
6
|
+
}
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/tree/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/util
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
export declare const formatSize: (size: unknown) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertNotNill(value: unknown): asserts value;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/suguru03/neo-async/blob/master/lib/async.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Suguru Motegi
|
|
7
|
+
* Copyright (c) 2014-2018 Suguru Motegi
|
|
8
|
+
* https://github.com/suguru03/neo-async/blob/master/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
export interface Dictionary<T> {
|
|
11
|
+
[key: string]: T;
|
|
12
|
+
}
|
|
13
|
+
export type IterableCollection<T> = T[] | IterableIterator<T> | Dictionary<T>;
|
|
14
|
+
export type ErrorCallback<E = Error> = (err?: E | null) => void;
|
|
15
|
+
export type AsyncIterator<T, E = Error> = (item: T, callback: ErrorCallback<E>) => void;
|
|
16
|
+
/**
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* // array
|
|
20
|
+
* var order = [];
|
|
21
|
+
* var array = [1, 3, 2];
|
|
22
|
+
* var iterator = function(num, done) {
|
|
23
|
+
* setTimeout(function() {
|
|
24
|
+
* order.push(num);
|
|
25
|
+
* done();
|
|
26
|
+
* }, num * 10);
|
|
27
|
+
* };
|
|
28
|
+
* asyncLib.each(array, iterator, function(err, res) {
|
|
29
|
+
* console.log(res); // undefined
|
|
30
|
+
* console.log(order); // [1, 2, 3]
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
*
|
|
35
|
+
* // break
|
|
36
|
+
* var order = [];
|
|
37
|
+
* var array = [1, 3, 2];
|
|
38
|
+
* var iterator = function(num, done) {
|
|
39
|
+
* setTimeout(function() {
|
|
40
|
+
* order.push(num);
|
|
41
|
+
* done(null, num !== 2);
|
|
42
|
+
* }, num * 10);
|
|
43
|
+
* };
|
|
44
|
+
* asyncLib.each(array, iterator, function(err, res) {
|
|
45
|
+
* console.log(res); // undefined
|
|
46
|
+
* console.log(order); // [1, 2]
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
declare function each<T, E = Error>(collection: IterableCollection<T>, iterator: AsyncIterator<T, E>, originalCallback: ErrorCallback<E>): void;
|
|
51
|
+
declare const _default: {
|
|
52
|
+
each: typeof each;
|
|
53
|
+
};
|
|
54
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const DELETE: unique symbol;
|
|
2
|
+
/**
|
|
3
|
+
* Merges two given objects and caches the result to avoid computation if same objects passed as arguments again.
|
|
4
|
+
* @example
|
|
5
|
+
* // performs cleverMerge(first, second), stores the result in WeakMap and returns result
|
|
6
|
+
* cachedCleverMerge({a: 1}, {a: 2})
|
|
7
|
+
* {a: 2}
|
|
8
|
+
* // when same arguments passed, gets the result from WeakMap and returns it.
|
|
9
|
+
* cachedCleverMerge({a: 1}, {a: 2})
|
|
10
|
+
* {a: 2}
|
|
11
|
+
* @param first first object
|
|
12
|
+
* @param second second object
|
|
13
|
+
* @returns merged object of first and second object
|
|
14
|
+
*/
|
|
15
|
+
export declare const cachedCleverMerge: <First, Second>(first: First, second: Second) => First | Second | (First & Second);
|
|
16
|
+
/**
|
|
17
|
+
* Merges two objects. Objects are deeply clever merged.
|
|
18
|
+
* Arrays might reference the old value with "...".
|
|
19
|
+
* Non-object values take preference over object values.
|
|
20
|
+
* @param first first object
|
|
21
|
+
* @param second second object
|
|
22
|
+
* @returns merged object of first and second object
|
|
23
|
+
*/
|
|
24
|
+
export declare const cleverMerge: <First, Second>(first: First, second: Second) => First | Second | (First & Second);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/tree/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/util
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
export type Comparator = <T>(arg0: T, arg1: T) => -1 | 0 | 1;
|
|
11
|
+
type Selector<A, B> = (input: A) => B;
|
|
12
|
+
export declare const concatComparators: (...comps: Array<Comparator>) => Comparator;
|
|
13
|
+
export declare const compareIds: <T = string | number>(a: T, b: T) => -1 | 0 | 1;
|
|
14
|
+
export declare const compareSelect: <T, R>(getter: Selector<T, R>, comparator: Comparator) => Comparator;
|
|
15
|
+
export declare const compareNumbers: (a: number, b: number) => 0 | 1 | -1;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/createHash.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
import Hash from "./hash";
|
|
11
|
+
/**
|
|
12
|
+
* Creates a hash by name or function
|
|
13
|
+
* @param algorithm the algorithm name or a constructor creating a hash
|
|
14
|
+
* @returns the hash
|
|
15
|
+
*/
|
|
16
|
+
export declare const createHash: (algorithm: "debug" | "xxhash64" | "md4" | "native-md4" | (string & {}) | (new () => Hash)) => Hash;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createReadonlyMap<T>(obj: Pick<ReadonlyMap<string, T>, "get" | "keys">): ReadonlyMap<string, Readonly<T>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type FakeHook<T> = T & {
|
|
2
|
+
_fakeHook: true;
|
|
3
|
+
};
|
|
4
|
+
export declare function createFakeCompilationDependencies(getDeps: () => string[], addDeps: (deps: string[]) => void): {
|
|
5
|
+
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
6
|
+
has(dep: string): boolean;
|
|
7
|
+
add: (dep: string) => void;
|
|
8
|
+
addAll: (deps: Iterable<string>) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/fs.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
import type { Abortable } from "node:events";
|
|
11
|
+
import type { WatchOptions } from "../config";
|
|
12
|
+
export interface Watcher {
|
|
13
|
+
close(): void;
|
|
14
|
+
pause(): void;
|
|
15
|
+
getAggregatedChanges?(): Set<string>;
|
|
16
|
+
getAggregatedRemovals?(): Set<string>;
|
|
17
|
+
getFileTimeInfoEntries?(): Map<string, FileSystemInfoEntry | "ignore">;
|
|
18
|
+
getContextTimeInfoEntries?(): Map<string, FileSystemInfoEntry | "ignore">;
|
|
19
|
+
getInfo(): WatcherInfo;
|
|
20
|
+
}
|
|
21
|
+
export interface WatcherInfo {
|
|
22
|
+
changes: Set<string>;
|
|
23
|
+
removals: Set<string>;
|
|
24
|
+
fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
|
|
25
|
+
contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
|
|
26
|
+
}
|
|
27
|
+
export type IStatsBase<T> = {
|
|
28
|
+
isFile: () => boolean;
|
|
29
|
+
isDirectory: () => boolean;
|
|
30
|
+
isBlockDevice: () => boolean;
|
|
31
|
+
isCharacterDevice: () => boolean;
|
|
32
|
+
isSymbolicLink: () => boolean;
|
|
33
|
+
isFIFO: () => boolean;
|
|
34
|
+
isSocket: () => boolean;
|
|
35
|
+
dev: T;
|
|
36
|
+
ino: T;
|
|
37
|
+
mode: T;
|
|
38
|
+
nlink: T;
|
|
39
|
+
uid: T;
|
|
40
|
+
gid: T;
|
|
41
|
+
rdev: T;
|
|
42
|
+
size: T;
|
|
43
|
+
blksize: T;
|
|
44
|
+
blocks: T;
|
|
45
|
+
atimeMs: T;
|
|
46
|
+
mtimeMs: T;
|
|
47
|
+
ctimeMs: T;
|
|
48
|
+
birthtimeMs: T;
|
|
49
|
+
atime: Date;
|
|
50
|
+
mtime: Date;
|
|
51
|
+
ctime: Date;
|
|
52
|
+
birthtime: Date;
|
|
53
|
+
};
|
|
54
|
+
export type IStats = IStatsBase<number>;
|
|
55
|
+
export type IBigIntStats = IStatsBase<bigint> & {
|
|
56
|
+
atimeNs: bigint;
|
|
57
|
+
mtimeNs: bigint;
|
|
58
|
+
ctimeNs: bigint;
|
|
59
|
+
birthtimeNs: bigint;
|
|
60
|
+
};
|
|
61
|
+
interface IDirent {
|
|
62
|
+
isFile: () => boolean;
|
|
63
|
+
isDirectory: () => boolean;
|
|
64
|
+
isBlockDevice: () => boolean;
|
|
65
|
+
isCharacterDevice: () => boolean;
|
|
66
|
+
isSymbolicLink: () => boolean;
|
|
67
|
+
isFIFO: () => boolean;
|
|
68
|
+
isSocket: () => boolean;
|
|
69
|
+
name: string | Buffer;
|
|
70
|
+
}
|
|
71
|
+
export interface OutputFileSystem {
|
|
72
|
+
writeFile: (arg0: string | number, arg1: string | Buffer, arg2: (arg0?: null | NodeJS.ErrnoException) => void) => void;
|
|
73
|
+
mkdir: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException) => void) => void;
|
|
74
|
+
readdir: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: (string | Buffer)[] | IDirent[]) => void) => void;
|
|
75
|
+
rmdir: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException) => void) => void;
|
|
76
|
+
unlink: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException) => void) => void;
|
|
77
|
+
stat: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void) => void;
|
|
78
|
+
lstat?: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void) => void;
|
|
79
|
+
readFile: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void) => void;
|
|
80
|
+
chmod: (arg0: string, arg1: number, arg2: (arg0?: NodeJS.ErrnoException | null) => void) => void;
|
|
81
|
+
join?: (arg0: string, arg1: string) => string;
|
|
82
|
+
relative?: (arg0: string, arg1: string) => string;
|
|
83
|
+
dirname?: (arg0: string) => string;
|
|
84
|
+
}
|
|
85
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
86
|
+
export type JsonArray = JsonValue[];
|
|
87
|
+
export type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
88
|
+
export type JsonObject = {
|
|
89
|
+
[Key in string]: JsonValue;
|
|
90
|
+
} & {
|
|
91
|
+
[Key in string]?: JsonValue | undefined;
|
|
92
|
+
};
|
|
93
|
+
export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void;
|
|
94
|
+
export type StringCallback = (err: NodeJS.ErrnoException | null, data?: string) => void;
|
|
95
|
+
export type BufferCallback = (err: NodeJS.ErrnoException | null, data?: Buffer) => void;
|
|
96
|
+
export type StringOrBufferCallback = (err: NodeJS.ErrnoException | null, data?: string | Buffer) => void;
|
|
97
|
+
export type ReaddirStringCallback = (err: NodeJS.ErrnoException | null, files?: string[]) => void;
|
|
98
|
+
export type ReaddirBufferCallback = (err: NodeJS.ErrnoException | null, files?: Buffer[]) => void;
|
|
99
|
+
export type ReaddirStringOrBufferCallback = (err: NodeJS.ErrnoException | null, files?: string[] | Buffer[]) => void;
|
|
100
|
+
export type ReaddirDirentCallback = (err: NodeJS.ErrnoException | null, files?: IDirent[]) => void;
|
|
101
|
+
export type StatsCallback = (err: NodeJS.ErrnoException | null, stats?: IStats) => void;
|
|
102
|
+
export type BigIntStatsCallback = (err: NodeJS.ErrnoException | null, stats?: IBigIntStats) => void;
|
|
103
|
+
export type StatsOrBigIntStatsCallback = (err: NodeJS.ErrnoException | null, stats?: IStats | IBigIntStats) => void;
|
|
104
|
+
export type NumberCallback = (err: NodeJS.ErrnoException | null, data?: number) => void;
|
|
105
|
+
export type ReadJsonCallback = (err: NodeJS.ErrnoException | Error | null, data?: JsonObject) => void;
|
|
106
|
+
export type PathLike = string | Buffer | URL;
|
|
107
|
+
export type PathOrFileDescriptor = PathLike | number;
|
|
108
|
+
export type ObjectEncodingOptions = {
|
|
109
|
+
encoding?: BufferEncoding | null;
|
|
110
|
+
};
|
|
111
|
+
export type ReadFile = {
|
|
112
|
+
(path: PathOrFileDescriptor, options: ({
|
|
113
|
+
encoding: null | undefined;
|
|
114
|
+
flag?: string;
|
|
115
|
+
} & Abortable) | null | undefined, callback: BufferCallback): void;
|
|
116
|
+
(path: PathOrFileDescriptor, options: ({
|
|
117
|
+
encoding: BufferEncoding;
|
|
118
|
+
flag?: string;
|
|
119
|
+
} & Abortable) | BufferEncoding, callback: StringCallback): void;
|
|
120
|
+
(path: PathOrFileDescriptor, options: (ObjectEncodingOptions & {
|
|
121
|
+
flag?: string;
|
|
122
|
+
} & Abortable) | BufferEncoding | null | undefined, callback: StringOrBufferCallback): void;
|
|
123
|
+
(path: PathOrFileDescriptor, callback: BufferCallback): void;
|
|
124
|
+
};
|
|
125
|
+
export type ReadFileSync = {
|
|
126
|
+
(path: PathOrFileDescriptor, options: {
|
|
127
|
+
encoding: null | undefined;
|
|
128
|
+
flag?: string;
|
|
129
|
+
} | null): Buffer;
|
|
130
|
+
(path: PathOrFileDescriptor, options: {
|
|
131
|
+
encoding: BufferEncoding;
|
|
132
|
+
flag?: string;
|
|
133
|
+
} | BufferEncoding): string;
|
|
134
|
+
(path: PathOrFileDescriptor, options: (ObjectEncodingOptions & {
|
|
135
|
+
flag?: string;
|
|
136
|
+
}) | BufferEncoding | null): string | Buffer;
|
|
137
|
+
};
|
|
138
|
+
export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null;
|
|
139
|
+
export type BufferEncodingOption = "buffer" | {
|
|
140
|
+
encoding: "buffer";
|
|
141
|
+
};
|
|
142
|
+
export type StatOptions = {
|
|
143
|
+
bigint?: boolean;
|
|
144
|
+
};
|
|
145
|
+
export type StatSyncOptions = {
|
|
146
|
+
bigint?: boolean;
|
|
147
|
+
throwIfNoEntry?: boolean;
|
|
148
|
+
};
|
|
149
|
+
export type Readlink = {
|
|
150
|
+
(path: PathLike, options: EncodingOption, callback: StringCallback): void;
|
|
151
|
+
(path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void;
|
|
152
|
+
(path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void;
|
|
153
|
+
(path: PathLike, callback: StringCallback): void;
|
|
154
|
+
};
|
|
155
|
+
export type ReadlinkSync = {
|
|
156
|
+
(path: PathLike, options: EncodingOption): string;
|
|
157
|
+
(path: PathLike, options: BufferEncodingOption): Buffer;
|
|
158
|
+
(path: PathLike, options: EncodingOption): string | Buffer;
|
|
159
|
+
};
|
|
160
|
+
export type Readdir = {
|
|
161
|
+
(path: PathLike, options: {
|
|
162
|
+
encoding: BufferEncoding | null;
|
|
163
|
+
withFileTypes?: false;
|
|
164
|
+
recursive?: boolean;
|
|
165
|
+
} | BufferEncoding | null | undefined, callback: ReaddirStringCallback): void;
|
|
166
|
+
(path: PathLike, options: {
|
|
167
|
+
encoding: "buffer";
|
|
168
|
+
withFileTypes?: false;
|
|
169
|
+
recursive?: boolean;
|
|
170
|
+
} | "buffer", callback: ReaddirBufferCallback): void;
|
|
171
|
+
(path: PathLike, callback: ReaddirStringCallback): void;
|
|
172
|
+
(path: PathLike, options: (ObjectEncodingOptions & {
|
|
173
|
+
withFileTypes: true;
|
|
174
|
+
recursive?: boolean;
|
|
175
|
+
}) | BufferEncoding | null | undefined, callback: ReaddirStringOrBufferCallback): void;
|
|
176
|
+
(path: PathLike, options: ObjectEncodingOptions & {
|
|
177
|
+
withFileTypes: true;
|
|
178
|
+
recursive?: boolean;
|
|
179
|
+
}, callback: ReaddirDirentCallback): void;
|
|
180
|
+
};
|
|
181
|
+
export type ReaddirSync = {
|
|
182
|
+
(path: PathLike, options: {
|
|
183
|
+
encoding: BufferEncoding | null;
|
|
184
|
+
withFileTypes?: false;
|
|
185
|
+
recursive?: boolean;
|
|
186
|
+
} | BufferEncoding | null): string[];
|
|
187
|
+
(path: PathLike, options: {
|
|
188
|
+
encoding: "buffer";
|
|
189
|
+
withFileTypes?: false;
|
|
190
|
+
recursive?: boolean;
|
|
191
|
+
} | "buffer"): Buffer[];
|
|
192
|
+
(path: PathLike, options: (ObjectEncodingOptions & {
|
|
193
|
+
withFileTypes?: false;
|
|
194
|
+
recursive?: boolean;
|
|
195
|
+
}) | BufferEncoding | null): string[] | Buffer[];
|
|
196
|
+
(path: PathLike, options: ObjectEncodingOptions & {
|
|
197
|
+
withFileTypes: true;
|
|
198
|
+
recursive?: boolean;
|
|
199
|
+
}): IDirent[];
|
|
200
|
+
};
|
|
201
|
+
export type Stat = {
|
|
202
|
+
(path: PathLike, callback: StatsCallback): void;
|
|
203
|
+
(path: PathLike, options: (StatOptions & {
|
|
204
|
+
bigint?: false;
|
|
205
|
+
}) | undefined, callback: StatsCallback): void;
|
|
206
|
+
(path: PathLike, options: StatOptions & {
|
|
207
|
+
bigint: true;
|
|
208
|
+
}, callback: BigIntStatsCallback): void;
|
|
209
|
+
(path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void;
|
|
210
|
+
};
|
|
211
|
+
export type StatSync = {
|
|
212
|
+
(path: PathLike, options?: undefined): IStats;
|
|
213
|
+
(path: PathLike, options?: StatSyncOptions & {
|
|
214
|
+
bigint?: false;
|
|
215
|
+
throwIfNoEntry: false;
|
|
216
|
+
}): IStats | undefined;
|
|
217
|
+
(path: PathLike, options: StatSyncOptions & {
|
|
218
|
+
bigint: true;
|
|
219
|
+
throwIfNoEntry: false;
|
|
220
|
+
}): IBigIntStats | undefined;
|
|
221
|
+
(path: PathLike, options?: StatSyncOptions & {
|
|
222
|
+
bigint?: false;
|
|
223
|
+
}): IStats;
|
|
224
|
+
(path: PathLike, options: StatSyncOptions & {
|
|
225
|
+
bigint: true;
|
|
226
|
+
}): IBigIntStats;
|
|
227
|
+
(path: PathLike, options: StatSyncOptions & {
|
|
228
|
+
bigint: boolean;
|
|
229
|
+
throwIfNoEntry?: false;
|
|
230
|
+
}): IStats | IBigIntStats;
|
|
231
|
+
(path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined;
|
|
232
|
+
};
|
|
233
|
+
export type LStat = {
|
|
234
|
+
(path: PathLike, callback: StatsCallback): void;
|
|
235
|
+
(path: PathLike, options: (StatOptions & {
|
|
236
|
+
bigint?: false;
|
|
237
|
+
}) | undefined, callback: StatsCallback): void;
|
|
238
|
+
(path: PathLike, options: StatOptions & {
|
|
239
|
+
bigint: true;
|
|
240
|
+
}, callback: BigIntStatsCallback): void;
|
|
241
|
+
(path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void;
|
|
242
|
+
};
|
|
243
|
+
export type LStatSync = {
|
|
244
|
+
(path: PathLike, options?: undefined): IStats;
|
|
245
|
+
(path: PathLike, options?: StatSyncOptions & {
|
|
246
|
+
bigint?: false;
|
|
247
|
+
throwIfNoEntry: false;
|
|
248
|
+
}): IStats | undefined;
|
|
249
|
+
(path: PathLike, options: StatSyncOptions & {
|
|
250
|
+
bigint: true;
|
|
251
|
+
throwIfNoEntry: false;
|
|
252
|
+
}): IBigIntStats | undefined;
|
|
253
|
+
(path: PathLike, options?: StatSyncOptions & {
|
|
254
|
+
bigint?: false;
|
|
255
|
+
}): IStats;
|
|
256
|
+
(path: PathLike, options: StatSyncOptions & {
|
|
257
|
+
bigint: true;
|
|
258
|
+
}): IBigIntStats;
|
|
259
|
+
(path: PathLike, options: StatSyncOptions & {
|
|
260
|
+
bigint: boolean;
|
|
261
|
+
throwIfNoEntry?: false;
|
|
262
|
+
}): IStats | IBigIntStats;
|
|
263
|
+
(path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined;
|
|
264
|
+
};
|
|
265
|
+
export type RealPath = {
|
|
266
|
+
(path: PathLike, options: EncodingOption, callback: StringCallback): void;
|
|
267
|
+
(path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void;
|
|
268
|
+
(path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void;
|
|
269
|
+
(path: PathLike, callback: StringCallback): void;
|
|
270
|
+
};
|
|
271
|
+
export type RealPathSync = {
|
|
272
|
+
(path: PathLike, options?: EncodingOption): string;
|
|
273
|
+
(path: PathLike, options: BufferEncodingOption): Buffer;
|
|
274
|
+
(path: PathLike, options?: EncodingOption): string | Buffer;
|
|
275
|
+
};
|
|
276
|
+
export type ReadJson = (path: PathOrFileDescriptor, callback: ReadJsonCallback) => void;
|
|
277
|
+
export type ReadJsonSync = (path: PathOrFileDescriptor) => JsonObject;
|
|
278
|
+
export type Purge = (files?: string | string[] | Set<string>) => void;
|
|
279
|
+
export type InputFileSystem = {
|
|
280
|
+
readFile: ReadFile;
|
|
281
|
+
readFileSync?: ReadFileSync;
|
|
282
|
+
readlink: Readlink;
|
|
283
|
+
readlinkSync?: ReadlinkSync;
|
|
284
|
+
readdir: Readdir;
|
|
285
|
+
readdirSync?: ReaddirSync;
|
|
286
|
+
stat: Stat;
|
|
287
|
+
statSync?: StatSync;
|
|
288
|
+
lstat?: LStat;
|
|
289
|
+
lstatSync?: LStatSync;
|
|
290
|
+
realpath?: RealPath;
|
|
291
|
+
realpathSync?: RealPathSync;
|
|
292
|
+
readJson?: ReadJson;
|
|
293
|
+
readJsonSync?: ReadJsonSync;
|
|
294
|
+
purge?: Purge;
|
|
295
|
+
join?: (path1: string, path2: string) => string;
|
|
296
|
+
relative?: (from: string, to: string) => string;
|
|
297
|
+
dirname?: (path: string) => string;
|
|
298
|
+
};
|
|
299
|
+
export type IntermediateFileSystem = InputFileSystem & OutputFileSystem & IntermediateFileSystemExtras;
|
|
300
|
+
export type WriteStreamOptions = {
|
|
301
|
+
flags?: string;
|
|
302
|
+
encoding?: "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "latin1" | "binary" | "base64" | "base64url" | "hex";
|
|
303
|
+
fd?: any;
|
|
304
|
+
mode?: number;
|
|
305
|
+
};
|
|
306
|
+
export type MakeDirectoryOptions = {
|
|
307
|
+
recursive?: boolean;
|
|
308
|
+
mode?: string | number;
|
|
309
|
+
};
|
|
310
|
+
export type MkdirSync = (path: PathLike, options: MakeDirectoryOptions) => undefined | string;
|
|
311
|
+
export type ReadAsyncOptions<TBuffer extends ArrayBufferView = Buffer> = {
|
|
312
|
+
offset?: number;
|
|
313
|
+
length?: number;
|
|
314
|
+
position?: null | number | bigint;
|
|
315
|
+
buffer?: TBuffer;
|
|
316
|
+
};
|
|
317
|
+
export type Read<TBuffer extends ArrayBufferView = Buffer> = (fd: number, options: ReadAsyncOptions<TBuffer>, callback: (err: null | NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer) => void) => void;
|
|
318
|
+
export type WriteAsyncOptions<TBuffer extends ArrayBufferView = Buffer> = {
|
|
319
|
+
offset?: number;
|
|
320
|
+
length?: number;
|
|
321
|
+
position?: null | number | bigint;
|
|
322
|
+
buffer?: TBuffer;
|
|
323
|
+
};
|
|
324
|
+
export type Write<TBuffer extends ArrayBufferView = Buffer> = (fd: number, content: Buffer, options: WriteAsyncOptions<TBuffer>, callback: (err: null | NodeJS.ErrnoException, bytesWrite: number, buffer: TBuffer) => void) => void;
|
|
325
|
+
export type Open = (file: PathLike, flags: undefined | string | number, callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void) => void;
|
|
326
|
+
export type IntermediateFileSystemExtras = {
|
|
327
|
+
rename: (arg0: PathLike, arg1: PathLike, arg2: (arg0: null | NodeJS.ErrnoException) => void) => void;
|
|
328
|
+
mkdirSync: MkdirSync;
|
|
329
|
+
write: Write<Buffer>;
|
|
330
|
+
open: Open;
|
|
331
|
+
read: Read<Buffer>;
|
|
332
|
+
close: (arg0: number, arg1: (arg0: null | NodeJS.ErrnoException) => void) => void;
|
|
333
|
+
};
|
|
334
|
+
export declare function rmrf(fs: OutputFileSystem, p: string, callback: (err?: Error | null) => void): void;
|
|
335
|
+
export declare const mkdirp: (fs: OutputFileSystem, p: string, callback: (error?: Error) => void) => void;
|
|
336
|
+
export interface FileSystemInfoEntry {
|
|
337
|
+
safeTime: number;
|
|
338
|
+
timestamp?: number;
|
|
339
|
+
}
|
|
340
|
+
export interface WatchFileSystem {
|
|
341
|
+
watch(files: Iterable<string> & {
|
|
342
|
+
added?: Iterable<String>;
|
|
343
|
+
removed?: Iterable<String>;
|
|
344
|
+
}, directories: Iterable<string> & {
|
|
345
|
+
added?: Iterable<String>;
|
|
346
|
+
removed?: Iterable<String>;
|
|
347
|
+
}, missing: Iterable<string> & {
|
|
348
|
+
added?: Iterable<String>;
|
|
349
|
+
removed?: Iterable<String>;
|
|
350
|
+
}, startTime: number, options: WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
|
|
351
|
+
}
|
|
352
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default class Hash {
|
|
2
|
+
/**
|
|
3
|
+
* @param data data
|
|
4
|
+
* @param inputEncoding data encoding
|
|
5
|
+
* @returns updated hash
|
|
6
|
+
*/
|
|
7
|
+
update(data: string, inputEncoding: string): this;
|
|
8
|
+
/**
|
|
9
|
+
* @param data data
|
|
10
|
+
* @returns updated hash
|
|
11
|
+
*/
|
|
12
|
+
update(data: Buffer): this;
|
|
13
|
+
/**
|
|
14
|
+
* Calculates the digest without encoding
|
|
15
|
+
* @abstract
|
|
16
|
+
* @returns {Buffer} digest
|
|
17
|
+
*/
|
|
18
|
+
digest(): Buffer;
|
|
19
|
+
/**
|
|
20
|
+
* Calculates the digest with encoding
|
|
21
|
+
* @abstract
|
|
22
|
+
* @param encoding encoding of the return value
|
|
23
|
+
* @returns {string} digest
|
|
24
|
+
*/
|
|
25
|
+
digest(encoding: string): string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/hash/md4.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: () => import("./wasm-hash").WasmHash;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/hash/wasm-hash.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
type Exports = WebAssembly.Instance["exports"] & {
|
|
11
|
+
init: () => void;
|
|
12
|
+
update: (b: number) => void;
|
|
13
|
+
memory: WebAssembly.Memory;
|
|
14
|
+
final: (b: number) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare class WasmHash {
|
|
17
|
+
exports: Exports;
|
|
18
|
+
instancesPool: WebAssembly.Instance[];
|
|
19
|
+
buffered: number;
|
|
20
|
+
mem: Buffer;
|
|
21
|
+
chunkSize: number;
|
|
22
|
+
digestSize: number;
|
|
23
|
+
/**
|
|
24
|
+
* @param instance wasm instance
|
|
25
|
+
* @param instancesPool pool of instances
|
|
26
|
+
* @param chunkSize size of data chunks passed to wasm
|
|
27
|
+
* @param digestSize size of digest returned by wasm
|
|
28
|
+
*/
|
|
29
|
+
constructor(instance: WebAssembly.Instance, instancesPool: WebAssembly.Instance[], chunkSize: number, digestSize: number);
|
|
30
|
+
reset(): void;
|
|
31
|
+
/**
|
|
32
|
+
* @param data data
|
|
33
|
+
* @param encoding encoding
|
|
34
|
+
* @returns itself
|
|
35
|
+
*/
|
|
36
|
+
update(data: Buffer | string, encoding?: BufferEncoding): this;
|
|
37
|
+
/**
|
|
38
|
+
* @param {string} data data
|
|
39
|
+
* @param {BufferEncoding=} encoding encoding
|
|
40
|
+
* @returns {void}
|
|
41
|
+
*/
|
|
42
|
+
_updateWithShortString(data: string, encoding?: BufferEncoding): void;
|
|
43
|
+
/**
|
|
44
|
+
* @param data data
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
_updateWithBuffer(data: Buffer): void;
|
|
48
|
+
digest(type: BufferEncoding): string | Buffer<ArrayBuffer>;
|
|
49
|
+
}
|
|
50
|
+
declare const create: (wasmModule: WebAssembly.Module, instancesPool: WasmHash[], chunkSize: number, digestSize: number) => WasmHash;
|
|
51
|
+
export default create;
|