@rspack/core 1.0.0-alpha.5 → 1.0.0-beta.1
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/compiled/zod/index.d.ts +138 -52
- package/compiled/zod/index.js +300 -103
- package/compiled/zod/package.json +1 -1
- package/compiled/zod-validation-error/index.js +6 -6
- package/dist/Compilation.d.ts +22 -4
- package/dist/Compilation.js +64 -49
- package/dist/Compiler.d.ts +11 -10
- package/dist/Compiler.js +42 -42
- package/dist/ErrorHelpers.js +2 -4
- package/dist/Module.d.ts +1 -0
- package/dist/Module.js +3 -6
- package/dist/ModuleTypeConstants.d.ts +45 -69
- package/dist/ModuleTypeConstants.js +24 -77
- package/dist/NormalModule.d.ts +1 -0
- package/dist/NormalModule.js +1 -0
- package/dist/Stats.js +4 -6
- package/dist/Template.d.ts +31 -147
- package/dist/Template.js +40 -236
- package/dist/builtin-loader/lightningcss/index.d.ts +89 -0
- package/dist/builtin-loader/lightningcss/index.js +175 -0
- package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +25 -49
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.js +9 -13
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +4 -3
- package/dist/builtin-plugin/EntryPlugin.js +1 -0
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +29 -5
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
- package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +9 -9
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +2 -2
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +4 -1
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SplitChunksPlugin.js +5 -15
- package/dist/builtin-plugin/SwcCssMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +15 -23
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +1 -1
- package/dist/builtin-plugin/base.d.ts +1 -1
- package/dist/builtin-plugin/base.js +1 -3
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.js +17 -66
- package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.d.ts +2 -0
- package/dist/builtin-plugin/css-extract/hmr/{normalize-url.js → normalizeUrl.js} +15 -24
- package/dist/builtin-plugin/css-extract/loader.d.ts +8 -3
- package/dist/builtin-plugin/css-extract/loader.js +28 -17
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
- package/dist/config/adapter.d.ts +1 -1
- package/dist/config/adapter.js +39 -25
- package/dist/config/adapterRuleUse.d.ts +5 -5
- package/dist/config/adapterRuleUse.js +23 -1
- package/dist/config/browserslistTargetHandler.d.ts +17 -15
- package/dist/config/browserslistTargetHandler.js +27 -33
- package/dist/config/defaults.js +27 -31
- package/dist/config/normalization.d.ts +8 -3
- package/dist/config/normalization.js +7 -5
- package/dist/config/target.d.ts +48 -109
- package/dist/config/target.js +50 -86
- package/dist/config/zod.d.ts +2660 -2305
- package/dist/config/zod.js +38 -19
- package/dist/container/ContainerPlugin.d.ts +7 -7
- package/dist/container/ContainerReferencePlugin.d.ts +1 -1
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/container/options.js +1 -1
- package/dist/exports.d.ts +4 -4
- package/dist/exports.js +2 -2
- package/dist/lib/AbstractMethodError.d.ts +12 -3
- package/dist/lib/AbstractMethodError.js +29 -21
- package/dist/lib/Cache.d.ts +40 -46
- package/dist/lib/Cache.js +43 -78
- package/dist/lib/CacheFacade.d.ts +119 -143
- package/dist/lib/CacheFacade.js +123 -123
- package/dist/lib/EntryOptionPlugin.d.ts +19 -2
- package/dist/lib/EntryOptionPlugin.js +22 -6
- package/dist/lib/EnvironmentPlugin.d.ts +17 -10
- package/dist/lib/EnvironmentPlugin.js +16 -15
- package/dist/lib/HookWebpackError.d.ts +27 -33
- package/dist/lib/HookWebpackError.js +33 -34
- package/dist/lib/IgnoreWarningsPlugin.d.ts +25 -0
- package/dist/lib/{ignoreWarningsPlugin.js → IgnoreWarningsPlugin.js} +17 -0
- package/dist/lib/LoaderOptionsPlugin.d.ts +18 -9
- package/dist/lib/LoaderOptionsPlugin.js +38 -14
- package/dist/lib/LoaderTargetPlugin.d.ts +17 -8
- package/dist/lib/LoaderTargetPlugin.js +17 -15
- package/dist/lib/ModuleFilenameHelpers.d.ts +10 -1
- package/dist/lib/ModuleFilenameHelpers.js +10 -3
- package/dist/lib/NormalModuleReplacementPlugin.d.ts +15 -5
- package/dist/lib/NormalModuleReplacementPlugin.js +15 -5
- package/dist/lib/WebpackError.d.ts +29 -22
- package/dist/lib/WebpackError.js +17 -29
- package/dist/lib/cache/getLazyHashedEtag.d.ts +24 -24
- package/dist/lib/cache/getLazyHashedEtag.js +20 -23
- package/dist/lib/cache/mergeEtags.d.ts +15 -9
- package/dist/lib/cache/mergeEtags.js +23 -22
- package/dist/lib/formatLocation.d.ts +13 -8
- package/dist/lib/formatLocation.js +20 -20
- package/dist/loader-runner/LoaderLoadingError.d.ts +11 -1
- package/dist/loader-runner/LoaderLoadingError.js +3 -5
- package/dist/loader-runner/index.js +7 -9
- package/dist/loader-runner/loadLoader.d.ts +11 -2
- package/dist/loader-runner/loadLoader.js +17 -19
- package/dist/logging/createConsoleLogger.js +2 -6
- package/dist/logging/truncateArgs.js +5 -9
- package/dist/node/nodeConsole.js +1 -3
- package/dist/rspackOptionsApply.js +2 -2
- package/dist/stats/DefaultStatsFactoryPlugin.js +18 -8
- package/dist/stats/DefaultStatsPresetPlugin.js +4 -4
- package/dist/stats/DefaultStatsPrinterPlugin.js +11 -16
- package/dist/stats/StatsFactory.js +13 -17
- package/dist/stats/StatsPrinter.js +7 -9
- package/dist/util/AssetInfo.js +11 -7
- package/dist/util/SplitChunkSize.js +1 -1
- package/dist/util/cleverMerge.d.ts +33 -57
- package/dist/util/cleverMerge.js +89 -145
- package/dist/util/comparators.d.ts +1 -1
- package/dist/util/comparators.js +3 -5
- package/dist/util/createHash.d.ts +4 -3
- package/dist/util/createHash.js +31 -45
- package/dist/util/fs.js +9 -13
- package/dist/util/hash/BatchedHash.d.ts +24 -9
- package/dist/util/hash/BatchedHash.js +16 -13
- package/dist/util/hash/index.d.ts +9 -9
- package/dist/util/hash/index.js +14 -11
- package/dist/util/hash/md4.d.ts +29 -2
- package/dist/util/hash/md4.js +7 -3
- package/dist/util/hash/wasm-hash.d.ts +52 -5
- package/dist/util/hash/wasm-hash.js +19 -22
- package/dist/util/hash/xxhash64.d.ts +29 -2
- package/dist/util/hash/xxhash64.js +7 -3
- package/dist/util/identifier.js +9 -15
- package/dist/util/index.js +1 -1
- package/dist/util/memoize.js +7 -9
- package/package.json +9 -8
- package/compiled/enhanced-resolve/index.js +0 -5566
- package/dist/builtin-plugin/css-extract/hmr/normalize-url.d.ts +0 -2
- package/dist/lib/ignoreWarningsPlugin.d.ts +0 -7
|
@@ -1,191 +1,167 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/CacheFacade.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 { Cache, CallbackCache, Etag } from "./Cache";
|
|
11
|
+
import type WebpackError from "./WebpackError";
|
|
12
|
+
import type { HashConstructor, HashableObject } from "./cache/getLazyHashedEtag";
|
|
13
|
+
type CallbackNormalErrorCache<T> = (err?: WebpackError | null, result?: T) => void;
|
|
14
|
+
declare abstract class BaseCache {
|
|
15
|
+
abstract get<T>(callback: CallbackCache<T>): void;
|
|
16
|
+
abstract getPromise<T>(): Promise<T | undefined>;
|
|
17
|
+
abstract store<T>(data: T, callback: CallbackCache<void>): void;
|
|
18
|
+
abstract storePromise<T>(data: T): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export declare class MultiItemCache implements BaseCache {
|
|
21
|
+
_items: ItemCacheFacade[];
|
|
3
22
|
/**
|
|
4
|
-
* @param
|
|
5
|
-
* @
|
|
6
|
-
* @param {string | HashConstructor} hashFunction the hash function to use
|
|
23
|
+
* @param items item caches
|
|
24
|
+
* @returns
|
|
7
25
|
*/
|
|
8
|
-
constructor(
|
|
9
|
-
_cache: import("./Cache");
|
|
10
|
-
_name: string;
|
|
11
|
-
_hashFunction: any;
|
|
26
|
+
constructor(items: ItemCacheFacade[]);
|
|
12
27
|
/**
|
|
13
|
-
* @param
|
|
14
|
-
* @returns
|
|
28
|
+
* @param callback signals when the value is retrieved
|
|
29
|
+
* @returns
|
|
15
30
|
*/
|
|
16
|
-
|
|
31
|
+
get<T>(callback: CallbackCache<T>): void;
|
|
17
32
|
/**
|
|
18
|
-
* @
|
|
19
|
-
* @param {Etag | null} etag the etag
|
|
20
|
-
* @returns {ItemCacheFacade} item cache
|
|
33
|
+
* @returns promise with the data
|
|
21
34
|
*/
|
|
22
|
-
|
|
35
|
+
getPromise<T>(): Promise<T | undefined>;
|
|
23
36
|
/**
|
|
24
|
-
* @param
|
|
25
|
-
* @
|
|
37
|
+
* @param data the value to store
|
|
38
|
+
* @param callback signals when the value is stored
|
|
39
|
+
* @returns
|
|
26
40
|
*/
|
|
27
|
-
|
|
41
|
+
store<T>(data: T, callback: CallbackCache<void>): void;
|
|
28
42
|
/**
|
|
29
|
-
* @param
|
|
30
|
-
* @
|
|
31
|
-
* @returns {Etag} an etag that represents both
|
|
43
|
+
* @param data the value to store
|
|
44
|
+
* @returns promise signals when the value is stored
|
|
32
45
|
*/
|
|
33
|
-
|
|
46
|
+
storePromise<T>(data: T): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
export declare class ItemCacheFacade implements BaseCache {
|
|
49
|
+
_cache: Cache;
|
|
50
|
+
_name: string;
|
|
51
|
+
_etag: Etag | null;
|
|
34
52
|
/**
|
|
35
|
-
* @
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
38
|
-
* @
|
|
39
|
-
* @returns {void}
|
|
53
|
+
* @param cache the root cache
|
|
54
|
+
* @param name the child cache item name
|
|
55
|
+
* @param etag the etag
|
|
56
|
+
* @returns
|
|
40
57
|
*/
|
|
41
|
-
|
|
58
|
+
constructor(cache: Cache, name: string, etag: Etag | null);
|
|
42
59
|
/**
|
|
43
|
-
* @
|
|
44
|
-
* @
|
|
45
|
-
* @param {Etag | null} etag the etag
|
|
46
|
-
* @returns {Promise<T>} promise with the data
|
|
60
|
+
* @param callback signals when the value is retrieved
|
|
61
|
+
* @returns
|
|
47
62
|
*/
|
|
48
|
-
|
|
63
|
+
get<T>(callback: CallbackCache<T>): void;
|
|
49
64
|
/**
|
|
50
|
-
* @
|
|
51
|
-
* @param {string} identifier the cache identifier
|
|
52
|
-
* @param {Etag | null} etag the etag
|
|
53
|
-
* @param {T} data the value to store
|
|
54
|
-
* @param {CallbackCache<void>} callback signals when the value is stored
|
|
55
|
-
* @returns {void}
|
|
65
|
+
* @returns promise with the data
|
|
56
66
|
*/
|
|
57
|
-
|
|
67
|
+
getPromise<T>(): Promise<T | undefined>;
|
|
58
68
|
/**
|
|
59
|
-
* @
|
|
60
|
-
* @param
|
|
61
|
-
* @
|
|
62
|
-
* @param {T} data the value to store
|
|
63
|
-
* @returns {Promise<void>} promise signals when the value is stored
|
|
69
|
+
* @param data the value to store
|
|
70
|
+
* @param callback signals when the value is stored
|
|
71
|
+
* @returns
|
|
64
72
|
*/
|
|
65
|
-
|
|
73
|
+
store<T>(data: T, callback: CallbackCache<void>): void;
|
|
66
74
|
/**
|
|
67
|
-
* @
|
|
68
|
-
* @
|
|
69
|
-
* @param {Etag | null} etag the etag
|
|
70
|
-
* @param {function(CallbackNormalErrorCache<T>): void} computer function to compute the value if not cached
|
|
71
|
-
* @param {CallbackNormalErrorCache<T>} callback signals when the value is retrieved
|
|
72
|
-
* @returns {void}
|
|
75
|
+
* @param data the value to store
|
|
76
|
+
* @returns promise signals when the value is stored
|
|
73
77
|
*/
|
|
74
|
-
|
|
78
|
+
storePromise<T>(data: T): Promise<void>;
|
|
75
79
|
/**
|
|
76
|
-
* @
|
|
77
|
-
* @param
|
|
78
|
-
* @
|
|
79
|
-
* @param {function(): Promise<T> | T} computer function to compute the value if not cached
|
|
80
|
-
* @returns {Promise<T>} promise with the data
|
|
80
|
+
* @param computer function to compute the value if not cached
|
|
81
|
+
* @param callback signals when the value is retrieved
|
|
82
|
+
* @returns
|
|
81
83
|
*/
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
declare namespace CacheFacade {
|
|
85
|
-
export { ItemCacheFacade, MultiItemCache, Cache, Etag, WebpackError, HashableObject, HashConstructor, CallbackCache, CallbackNormalErrorCache };
|
|
86
|
-
}
|
|
87
|
-
type Etag = import("./Cache").Etag;
|
|
88
|
-
declare class ItemCacheFacade {
|
|
84
|
+
provide<T>(computer: (callback: CallbackNormalErrorCache<T>) => void, callback: CallbackNormalErrorCache<T>): void;
|
|
89
85
|
/**
|
|
90
|
-
* @param
|
|
91
|
-
* @
|
|
92
|
-
* @param {Etag | null} etag the etag
|
|
86
|
+
* @param computer function to compute the value if not cached
|
|
87
|
+
* @returns promise with the data
|
|
93
88
|
*/
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
providePromise<T>(computer: () => Promise<T> | T): Promise<T>;
|
|
90
|
+
}
|
|
91
|
+
export declare class CacheFacade {
|
|
96
92
|
_name: string;
|
|
97
|
-
|
|
93
|
+
_cache: Cache;
|
|
94
|
+
_hashFunction: string | HashConstructor;
|
|
98
95
|
/**
|
|
99
|
-
* @
|
|
100
|
-
* @param
|
|
101
|
-
* @
|
|
96
|
+
* @param cache the root cache
|
|
97
|
+
* @param name the child cache name
|
|
98
|
+
* @param hashFunction the hash function to use
|
|
102
99
|
*/
|
|
103
|
-
|
|
100
|
+
constructor(cache: Cache, name: string, hashFunction: string | HashConstructor);
|
|
104
101
|
/**
|
|
105
|
-
* @
|
|
106
|
-
* @returns
|
|
102
|
+
* @param name the child cache name#
|
|
103
|
+
* @returns child cache
|
|
107
104
|
*/
|
|
108
|
-
|
|
105
|
+
getChildCache(name: string): CacheFacade;
|
|
109
106
|
/**
|
|
110
|
-
* @
|
|
111
|
-
* @param
|
|
112
|
-
* @
|
|
113
|
-
* @returns {void}
|
|
107
|
+
* @param identifier the cache identifier
|
|
108
|
+
* @param etag the etag
|
|
109
|
+
* @returns item cache
|
|
114
110
|
*/
|
|
115
|
-
|
|
111
|
+
getItemCache(identifier: string, etag: Etag | null): ItemCacheFacade;
|
|
116
112
|
/**
|
|
117
|
-
* @
|
|
118
|
-
* @
|
|
119
|
-
* @returns {Promise<void>} promise signals when the value is stored
|
|
113
|
+
* @param obj an hashable object
|
|
114
|
+
* @returns an etag that is lazy hashed
|
|
120
115
|
*/
|
|
121
|
-
|
|
116
|
+
getLazyHashedEtag(obj: HashableObject): Etag;
|
|
122
117
|
/**
|
|
123
|
-
* @
|
|
124
|
-
* @param
|
|
125
|
-
* @
|
|
126
|
-
* @returns {void}
|
|
118
|
+
* @param a an etag
|
|
119
|
+
* @param b another etag
|
|
120
|
+
* @returns an etag that represents both
|
|
127
121
|
*/
|
|
128
|
-
|
|
122
|
+
mergeEtags(a: Etag, b: Etag): Etag;
|
|
129
123
|
/**
|
|
130
|
-
* @
|
|
131
|
-
* @param
|
|
132
|
-
* @
|
|
124
|
+
* @param identifier the cache identifier
|
|
125
|
+
* @param etag the etag
|
|
126
|
+
* @param callback signals when the value is retrieved
|
|
127
|
+
* @returns
|
|
133
128
|
*/
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
type HashableObject = import("./cache/getLazyHashedEtag").HashableObject;
|
|
137
|
-
type CallbackCache<T> = (err?: (WebpackError | null) | undefined, result?: T | undefined) => void;
|
|
138
|
-
type CallbackNormalErrorCache<T> = (err?: (Error | null) | undefined, result?: T | undefined) => void;
|
|
139
|
-
type Cache = import("./Cache");
|
|
140
|
-
type HashConstructor = any;
|
|
141
|
-
/** @typedef {import("./Cache")} Cache */
|
|
142
|
-
/** @typedef {import("./Cache").Etag} Etag */
|
|
143
|
-
/** @typedef {import("./WebpackError")} WebpackError */
|
|
144
|
-
/** @typedef {import("./cache/getLazyHashedEtag").HashableObject} HashableObject */
|
|
145
|
-
/** @typedef {any} HashConstructor */
|
|
146
|
-
/**
|
|
147
|
-
* @template T
|
|
148
|
-
* @callback CallbackCache
|
|
149
|
-
* @param {(WebpackError | null)=} err
|
|
150
|
-
* @param {T=} result
|
|
151
|
-
* @returns {void}
|
|
152
|
-
*/
|
|
153
|
-
/**
|
|
154
|
-
* @template T
|
|
155
|
-
* @callback CallbackNormalErrorCache
|
|
156
|
-
* @param {(Error | null)=} err
|
|
157
|
-
* @param {T=} result
|
|
158
|
-
* @returns {void}
|
|
159
|
-
*/
|
|
160
|
-
declare class MultiItemCache {
|
|
129
|
+
get<T>(identifier: string, etag: Etag | null, callback: CallbackCache<T>): void;
|
|
161
130
|
/**
|
|
162
|
-
* @param
|
|
131
|
+
* @param identifier the cache identifier
|
|
132
|
+
* @param etag the etag
|
|
133
|
+
* @returns promise with the data
|
|
163
134
|
*/
|
|
164
|
-
|
|
165
|
-
_items: ItemCacheFacade[];
|
|
135
|
+
getPromise<T>(identifier: string, etag: Etag | null): Promise<T | undefined>;
|
|
166
136
|
/**
|
|
167
|
-
* @
|
|
168
|
-
* @param
|
|
169
|
-
* @
|
|
137
|
+
* @param identifier the cache identifier
|
|
138
|
+
* @param etag the etag
|
|
139
|
+
* @param data the value to store
|
|
140
|
+
* @param callback signals when the value is stored
|
|
141
|
+
* @returns
|
|
170
142
|
*/
|
|
171
|
-
|
|
143
|
+
store<T>(identifier: string, etag: Etag | null, data: T, callback: CallbackCache<void>): void;
|
|
172
144
|
/**
|
|
173
|
-
* @
|
|
174
|
-
* @
|
|
145
|
+
* @param identifier the cache identifier
|
|
146
|
+
* @param etag the etag
|
|
147
|
+
* @param data the value to store
|
|
148
|
+
* @returns promise signals when the value is stored
|
|
175
149
|
*/
|
|
176
|
-
|
|
150
|
+
storePromise<T>(identifier: string, etag: Etag | null, data: T): Promise<void>;
|
|
177
151
|
/**
|
|
178
|
-
* @
|
|
179
|
-
* @param
|
|
180
|
-
* @param
|
|
181
|
-
* @
|
|
152
|
+
* @param identifier the cache identifier
|
|
153
|
+
* @param etag the etag
|
|
154
|
+
* @param computer function to compute the value if not cached
|
|
155
|
+
* @param callback signals when the value is retrieved
|
|
156
|
+
* @returns
|
|
182
157
|
*/
|
|
183
|
-
|
|
158
|
+
provide<T>(identifier: string, etag: Etag | null, computer: (callback: CallbackNormalErrorCache<T>) => void, callback: CallbackNormalErrorCache<T>): void;
|
|
184
159
|
/**
|
|
185
|
-
* @
|
|
186
|
-
* @param
|
|
187
|
-
* @
|
|
160
|
+
* @param identifier the cache identifier
|
|
161
|
+
* @param etag the etag
|
|
162
|
+
* @param computer function to compute the value if not cached
|
|
163
|
+
* @returns promise with the data
|
|
188
164
|
*/
|
|
189
|
-
|
|
165
|
+
providePromise<T>(identifier: string, etag: Etag | null, computer: () => Promise<T> | T): Promise<{} | T | null>;
|
|
190
166
|
}
|
|
191
|
-
|
|
167
|
+
export default CacheFacade;
|