@rspack/core 1.0.9 → 1.0.11
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/Dependency.d.ts +7 -6
- package/dist/Module.d.ts +19 -17
- package/dist/builtin-plugin/css-extract/utils.d.ts +1 -0
- package/dist/config/types.d.ts +545 -0
- package/dist/config/zod.d.ts +202 -1347
- package/dist/cssExtractHmr.js +224 -0
- package/dist/cssExtractLoader.js +277 -0
- package/dist/index.js +23347 -31
- package/dist/{builtin-plugin/css-extract/hmr/hotModuleReplacement.d.ts → runtime/cssExtractHmr.d.ts} +1 -0
- package/dist/runtime/moduleFederationDefaultRuntime.d.ts +2 -0
- package/dist/stats/statsFactoryUtils.d.ts +1 -0
- package/package.json +8 -5
- package/compiled/json-parse-even-better-errors/index.d.ts +0 -1
- package/compiled/json-parse-even-better-errors/index.js +0 -193
- package/compiled/json-parse-even-better-errors/package.json +0 -1
- package/compiled/neo-async/index.d.ts +0 -685
- package/compiled/neo-async/index.js +0 -9207
- package/compiled/neo-async/license +0 -22
- package/compiled/neo-async/package.json +0 -1
- package/compiled/zod-validation-error/index.d.ts +0 -41
- package/compiled/zod-validation-error/index.js +0 -335
- package/compiled/zod-validation-error/license +0 -9
- package/compiled/zod-validation-error/package.json +0 -1
- package/dist/Chunk.js +0 -118
- package/dist/ChunkGraph.js +0 -27
- package/dist/ChunkGroup.js +0 -76
- package/dist/Compilation.js +0 -854
- package/dist/Compiler.js +0 -920
- package/dist/ContextModuleFactory.js +0 -36
- package/dist/DependenciesBlock.js +0 -30
- package/dist/Dependency.js +0 -32
- package/dist/Entrypoint.js +0 -21
- package/dist/ErrorHelpers.js +0 -62
- package/dist/ExecuteModulePlugin.js +0 -46
- package/dist/FileSystem.js +0 -34
- package/dist/FileSystemInfo.js +0 -2
- package/dist/Module.js +0 -143
- package/dist/ModuleTypeConstants.js +0 -92
- package/dist/MultiCompiler.js +0 -440
- package/dist/MultiStats.js +0 -161
- package/dist/MultiWatching.js +0 -62
- package/dist/NormalModule.js +0 -97
- package/dist/NormalModuleFactory.js +0 -43
- package/dist/Resolver.js +0 -39
- package/dist/ResolverFactory.js +0 -61
- package/dist/RspackError.js +0 -21
- package/dist/RuleSetCompiler.js +0 -10
- package/dist/RuntimeGlobals.js +0 -357
- package/dist/RuntimeModule.js +0 -58
- package/dist/Stats.js +0 -161
- package/dist/Template.js +0 -206
- package/dist/Watching.js +0 -290
- package/dist/builtin-loader/index.js +0 -17
- package/dist/builtin-loader/lightningcss/index.js +0 -175
- package/dist/builtin-loader/swc/index.js +0 -5
- package/dist/builtin-loader/swc/pluginImport.js +0 -35
- package/dist/builtin-loader/swc/react.js +0 -7
- package/dist/builtin-loader/swc/types.js +0 -2
- package/dist/builtin-plugin/APIPlugin.js +0 -6
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.js +0 -6
- package/dist/builtin-plugin/AssetModulesPlugin.js +0 -6
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.js +0 -6
- package/dist/builtin-plugin/BannerPlugin.js +0 -22
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.js +0 -12
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.js +0 -6
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.js +0 -6
- package/dist/builtin-plugin/ContextReplacementPlugin.js +0 -43
- package/dist/builtin-plugin/CopyRspackPlugin.js +0 -21
- package/dist/builtin-plugin/CssModulesPlugin.js +0 -6
- package/dist/builtin-plugin/DataUriPlugin.js +0 -6
- package/dist/builtin-plugin/DefinePlugin.js +0 -44
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.js +0 -6
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.js +0 -6
- package/dist/builtin-plugin/DynamicEntryPlugin.js +0 -36
- package/dist/builtin-plugin/ElectronTargetPlugin.js +0 -6
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.js +0 -6
- package/dist/builtin-plugin/EnableLibraryPlugin.js +0 -39
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.js +0 -6
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.js +0 -6
- package/dist/builtin-plugin/EntryPlugin.js +0 -34
- package/dist/builtin-plugin/EvalDevToolModulePlugin.js +0 -6
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.js +0 -16
- package/dist/builtin-plugin/ExternalsPlugin.js +0 -51
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.js +0 -6
- package/dist/builtin-plugin/FileUriPlugin.js +0 -6
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.js +0 -6
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.js +0 -6
- package/dist/builtin-plugin/HotModuleReplacementPlugin.js +0 -18
- package/dist/builtin-plugin/HtmlRspackPlugin.js +0 -285
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.js +0 -11
- package/dist/builtin-plugin/IgnorePlugin.js +0 -20
- package/dist/builtin-plugin/InferAsyncModulesPlugin.js +0 -6
- package/dist/builtin-plugin/JavascriptModulesPlugin.js +0 -55
- package/dist/builtin-plugin/JsLoaderRspackPlugin.js +0 -9
- package/dist/builtin-plugin/JsonModulesPlugin.js +0 -6
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +0 -30
- package/dist/builtin-plugin/LimitChunkCountPlugin.js +0 -8
- package/dist/builtin-plugin/MangleExportsPlugin.js +0 -6
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.js +0 -6
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.js +0 -6
- package/dist/builtin-plugin/ModuleConcatenationPlugin.js +0 -6
- package/dist/builtin-plugin/NamedChunkIdsPlugin.js +0 -6
- package/dist/builtin-plugin/NamedModuleIdsPlugin.js +0 -6
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.js +0 -6
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.js +0 -6
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.js +0 -6
- package/dist/builtin-plugin/NodeTargetPlugin.js +0 -6
- package/dist/builtin-plugin/ProgressPlugin.js +0 -15
- package/dist/builtin-plugin/ProvidePlugin.js +0 -14
- package/dist/builtin-plugin/RealContentHashPlugin.js +0 -6
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.js +0 -6
- package/dist/builtin-plugin/RuntimeChunkPlugin.js +0 -6
- package/dist/builtin-plugin/RuntimePlugin.js +0 -6
- package/dist/builtin-plugin/SideEffectsFlagPlugin.js +0 -6
- package/dist/builtin-plugin/SizeLimitsPlugin.js +0 -9
- package/dist/builtin-plugin/SourceMapDevToolPlugin.js +0 -14
- package/dist/builtin-plugin/SplitChunksPlugin.js +0 -92
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +0 -80
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.js +0 -6
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.js +0 -6
- package/dist/builtin-plugin/WorkerPlugin.js +0 -31
- package/dist/builtin-plugin/base.js +0 -58
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.js +0 -182
- package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.d.ts +0 -2
- package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.js +0 -31
- package/dist/builtin-plugin/css-extract/index.js +0 -105
- package/dist/builtin-plugin/css-extract/loader.js +0 -204
- package/dist/builtin-plugin/css-extract/utils.js +0 -51
- package/dist/builtin-plugin/index.js +0 -84
- package/dist/builtin-plugin/lazy-compilation/backend.js +0 -139
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.js +0 -6
- package/dist/builtin-plugin/lazy-compilation/plugin.js +0 -60
- package/dist/config/adapter.js +0 -691
- package/dist/config/adapterRuleUse.js +0 -107
- package/dist/config/browserslistTargetHandler.js +0 -345
- package/dist/config/defaults.js +0 -876
- package/dist/config/index.js +0 -20
- package/dist/config/normalization.js +0 -299
- package/dist/config/target.js +0 -318
- package/dist/config/types.js +0 -3
- package/dist/config/zod.js +0 -1028
- package/dist/container/ContainerPlugin.js +0 -50
- package/dist/container/ContainerReferencePlugin.js +0 -49
- package/dist/container/ModuleFederationPlugin.js +0 -137
- package/dist/container/ModuleFederationPluginV1.js +0 -63
- package/dist/container/ModuleFederationRuntimePlugin.js +0 -6
- package/dist/container/options.js +0 -48
- package/dist/error/ConcurrentCompilationError.js +0 -20
- package/dist/exports.js +0 -183
- package/dist/lib/AbstractMethodError.js +0 -51
- package/dist/lib/Cache.js +0 -111
- package/dist/lib/CacheFacade.js +0 -321
- package/dist/lib/Dependency.js +0 -11
- package/dist/lib/EntryOptionPlugin.js +0 -89
- package/dist/lib/EnvironmentPlugin.js +0 -57
- package/dist/lib/HookWebpackError.js +0 -83
- package/dist/lib/IgnoreWarningsPlugin.js +0 -35
- package/dist/lib/LoaderOptionsPlugin.js +0 -74
- package/dist/lib/LoaderTargetPlugin.js +0 -37
- package/dist/lib/ModuleFilenameHelpers.js +0 -83
- package/dist/lib/NormalModuleReplacementPlugin.js +0 -85
- package/dist/lib/WebpackError.js +0 -20
- package/dist/lib/cache/MemoryCachePlugin.js +0 -40
- package/dist/lib/cache/getLazyHashedEtag.js +0 -73
- package/dist/lib/cache/mergeEtags.js +0 -74
- package/dist/lib/formatLocation.js +0 -64
- package/dist/loader-runner/LoaderLoadingError.js +0 -19
- package/dist/loader-runner/index.js +0 -735
- package/dist/loader-runner/loadLoader.js +0 -64
- package/dist/logging/Logger.js +0 -143
- package/dist/logging/createConsoleLogger.js +0 -176
- package/dist/logging/runtime.js +0 -37
- package/dist/logging/truncateArgs.js +0 -81
- package/dist/node/NodeEnvironmentPlugin.js +0 -50
- package/dist/node/NodeTemplatePlugin.js +0 -26
- package/dist/node/NodeWatchFileSystem.js +0 -144
- package/dist/node/nodeConsole.js +0 -146
- package/dist/rspack.js +0 -123
- package/dist/rspackOptionsApply.js +0 -274
- package/dist/sharing/ConsumeSharedPlugin.js +0 -69
- package/dist/sharing/ProvideSharedPlugin.js +0 -50
- package/dist/sharing/SharePlugin.js +0 -66
- package/dist/sharing/ShareRuntimePlugin.js +0 -26
- package/dist/sharing/utils.js +0 -8
- package/dist/stats/DefaultStatsFactoryPlugin.js +0 -1173
- package/dist/stats/DefaultStatsPresetPlugin.js +0 -305
- package/dist/stats/DefaultStatsPrinterPlugin.js +0 -1069
- package/dist/stats/StatsFactory.js +0 -167
- package/dist/stats/StatsPrinter.js +0 -142
- package/dist/stats/statsFactoryUtils.js +0 -341
- package/dist/util/ArrayQueue.js +0 -108
- package/dist/util/AssetInfo.js +0 -39
- package/dist/util/IterableHelpers.js +0 -35
- package/dist/util/MergeCaller.js +0 -24
- package/dist/util/SizeFormatHelpers.js +0 -24
- package/dist/util/SplitChunkSize.js +0 -18
- package/dist/util/assertNotNil.js +0 -9
- package/dist/util/assetCondition.js +0 -2
- package/dist/util/bindingVersionCheck.js +0 -124
- package/dist/util/cleverMerge.js +0 -504
- package/dist/util/comparators.js +0 -108
- package/dist/util/createHash.js +0 -161
- package/dist/util/createReadonlyMap.js +0 -29
- package/dist/util/fake.js +0 -28
- package/dist/util/fs.js +0 -120
- package/dist/util/hash/BatchedHash.js +0 -69
- package/dist/util/hash/index.js +0 -39
- package/dist/util/hash/md4.js +0 -27
- package/dist/util/hash/wasm-hash.js +0 -167
- package/dist/util/hash/xxhash64.js +0 -27
- package/dist/util/identifier.js +0 -330
- package/dist/util/index.js +0 -123
- package/dist/util/memoize.js +0 -61
- package/dist/util/scheme.js +0 -57
- package/dist/util/smartGrouping.js +0 -148
- package/dist/util/source.js +0 -42
- package/dist/util/validate.js +0 -77
- package/dist/util/webpack.js +0 -27
- /package/dist/{container/default.runtime.js → moduleFederationDefaultRuntime.js} +0 -0
|
@@ -1,685 +0,0 @@
|
|
|
1
|
-
interface Dictionary<T> {
|
|
2
|
-
[key: string]: T;
|
|
3
|
-
}
|
|
4
|
-
type IterableCollection<T> = T[] | IterableIterator<T> | Dictionary<T>;
|
|
5
|
-
|
|
6
|
-
interface ErrorCallback<E = Error> {
|
|
7
|
-
(err?: E | null): void;
|
|
8
|
-
}
|
|
9
|
-
interface AsyncBooleanResultCallback<E = Error> {
|
|
10
|
-
(err?: E | null, truthValue?: boolean): void;
|
|
11
|
-
}
|
|
12
|
-
interface AsyncResultCallback<T, E = Error> {
|
|
13
|
-
(err?: E | null, result?: T): void;
|
|
14
|
-
}
|
|
15
|
-
interface AsyncResultArrayCallback<T, E = Error> {
|
|
16
|
-
(err?: E | null, results?: Array<T | undefined>): void;
|
|
17
|
-
}
|
|
18
|
-
interface AsyncResultObjectCallback<T, E = Error> {
|
|
19
|
-
(err: E | undefined, results: Dictionary<T | undefined>): void;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
interface AsyncFunction<T, E = Error> {
|
|
23
|
-
(callback: (err?: E | null, result?: T) => void): void;
|
|
24
|
-
}
|
|
25
|
-
interface AsyncFunctionEx<T, E = Error> {
|
|
26
|
-
(callback: (err?: E | null, ...results: T[]) => void): void;
|
|
27
|
-
}
|
|
28
|
-
interface AsyncIterator<T, E = Error> {
|
|
29
|
-
(item: T, callback: ErrorCallback<E>): void;
|
|
30
|
-
}
|
|
31
|
-
interface AsyncForEachOfIterator<T, E = Error> {
|
|
32
|
-
(item: T, key: number | string, callback: ErrorCallback<E>): void;
|
|
33
|
-
}
|
|
34
|
-
interface AsyncResultIterator<T, R, E = Error> {
|
|
35
|
-
(item: T, callback: AsyncResultCallback<R, E>): void;
|
|
36
|
-
}
|
|
37
|
-
interface AsyncMemoIterator<T, R, E = Error> {
|
|
38
|
-
(memo: R | undefined, item: T, callback: AsyncResultCallback<R, E>): void;
|
|
39
|
-
}
|
|
40
|
-
interface AsyncBooleanIterator<T, E = Error> {
|
|
41
|
-
(item: T, callback: AsyncBooleanResultCallback<E>): void;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
interface AsyncWorker<T, E = Error> {
|
|
45
|
-
(task: T, callback: ErrorCallback<E>): void;
|
|
46
|
-
}
|
|
47
|
-
interface AsyncVoidFunction<E = Error> {
|
|
48
|
-
(callback: ErrorCallback<E>): void;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
type AsyncAutoTasks<R extends Dictionary<any>, E> = { [K in keyof R]: AsyncAutoTask<R[K], R, E> };
|
|
52
|
-
type AsyncAutoTask<R1, R extends Dictionary<any>, E> =
|
|
53
|
-
| AsyncAutoTaskFunctionWithoutDependencies<R1, E>
|
|
54
|
-
| Array<keyof R | AsyncAutoTaskFunction<R1, R, E>>;
|
|
55
|
-
interface AsyncAutoTaskFunctionWithoutDependencies<R1, E = Error> {
|
|
56
|
-
(cb: AsyncResultCallback<R1, E> | ErrorCallback<E>): void;
|
|
57
|
-
}
|
|
58
|
-
interface AsyncAutoTaskFunction<R1, R extends Dictionary<any>, E = Error> {
|
|
59
|
-
(results: R, cb: AsyncResultCallback<R1, E> | ErrorCallback<E>): void;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
interface DataContainer<T> {
|
|
63
|
-
data: T;
|
|
64
|
-
priority: number;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface CallbackContainer {
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
69
|
-
callback: Function;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
interface PriorityContainer {
|
|
73
|
-
priority: number;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
interface QueueObject<T> {
|
|
77
|
-
/**
|
|
78
|
-
* Returns the number of items waiting to be processed.
|
|
79
|
-
*/
|
|
80
|
-
length(): number;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Indicates whether or not any items have been pushed and processed by the queue.
|
|
84
|
-
*/
|
|
85
|
-
started: boolean;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Returns the number of items currently being processed.
|
|
89
|
-
*/
|
|
90
|
-
running(): number;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Returns an array of items currently being processed.
|
|
94
|
-
*/
|
|
95
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
96
|
-
workersList<TWorker extends DataContainer<T>, CallbackContainer>(): TWorker[];
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Returns false if there are items waiting or being processed, or true if not.
|
|
100
|
-
*/
|
|
101
|
-
idle(): boolean;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* An integer for determining how many worker functions should be run in parallel.
|
|
105
|
-
* This property can be changed after a queue is created to alter the concurrency on-the-fly.
|
|
106
|
-
*/
|
|
107
|
-
concurrency: number;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* An integer that specifies how many items are passed to the worker function at a time.
|
|
111
|
-
* Only applies if this is a cargo object
|
|
112
|
-
*/
|
|
113
|
-
payload: number;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Add a new task to the queue. Calls `callback` once the worker has finished
|
|
117
|
-
* processing the task.
|
|
118
|
-
*
|
|
119
|
-
* Instead of a single task, a tasks array can be submitted.
|
|
120
|
-
* The respective callback is used for every task in the list.
|
|
121
|
-
*/
|
|
122
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
123
|
-
push<R>(task: T | T[]): Promise<R>;
|
|
124
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
125
|
-
push<R, E = Error>(task: T | T[], callback: AsyncResultCallback<R, E>): void;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Add a new task to the front of the queue
|
|
129
|
-
*/
|
|
130
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
131
|
-
unshift<R>(task: T | T[]): Promise<R>;
|
|
132
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
133
|
-
unshift<R, E = Error>(task: T | T[], callback: AsyncResultCallback<R, E>): void;
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* The same as `q.push`, except this returns a promise that rejects if an error occurs.
|
|
137
|
-
* The `callback` arg is ignored
|
|
138
|
-
*/
|
|
139
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
140
|
-
pushAsync<R>(task: T | T[]): Promise<R>;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* The same as `q.unshift`, except this returns a promise that rejects if an error occurs.
|
|
144
|
-
* The `callback` arg is ignored
|
|
145
|
-
*/
|
|
146
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
147
|
-
unshiftAsync<R>(task: T | T[]): Promise<R>;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Remove items from the queue that match a test function.
|
|
151
|
-
* The test function will be passed an object with a `data` property,
|
|
152
|
-
* and a `priority` property, if this is a `priorityQueue` object.
|
|
153
|
-
*/
|
|
154
|
-
remove(filter: (node: DataContainer<T>) => boolean): void;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* A function that sets a callback that is called when the number of
|
|
158
|
-
* running workers hits the `concurrency` limit, and further tasks will be
|
|
159
|
-
* queued.
|
|
160
|
-
*
|
|
161
|
-
* If the callback is omitted, `q.saturated()` returns a promise
|
|
162
|
-
* for the next occurrence.
|
|
163
|
-
*/
|
|
164
|
-
saturated(): Promise<void>;
|
|
165
|
-
saturated(handler: () => void): void;
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* A function that sets a callback that is called when the number
|
|
169
|
-
* of running workers is less than the `concurrency` & `buffer` limits,
|
|
170
|
-
* and further tasks will not be queued
|
|
171
|
-
*
|
|
172
|
-
* If the callback is omitted, `q.unsaturated()` returns a promise
|
|
173
|
-
* for the next occurrence.
|
|
174
|
-
*/
|
|
175
|
-
unsaturated(): Promise<void>;
|
|
176
|
-
unsaturated(handler: () => void): void;
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* A minimum threshold buffer in order to say that the `queue` is `unsaturated`.
|
|
180
|
-
*/
|
|
181
|
-
buffer: number;
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* A function that sets a callback that is called when the last item from the `queue`
|
|
185
|
-
* is given to a `worker`.
|
|
186
|
-
*
|
|
187
|
-
* If the callback is omitted, `q.empty()` returns a promise for the next occurrence.
|
|
188
|
-
*/
|
|
189
|
-
empty(): Promise<void>;
|
|
190
|
-
empty(handler: () => void): void;
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* A function that sets a callback that is called when the last item from
|
|
194
|
-
* the `queue` has returned from the `worker`.
|
|
195
|
-
*
|
|
196
|
-
* If the callback is omitted, `q.drain()` returns a promise for the next occurrence.
|
|
197
|
-
*/
|
|
198
|
-
drain(): Promise<void>;
|
|
199
|
-
drain(handler: () => void): void;
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* A function that sets a callback that is called when a task errors.
|
|
203
|
-
*
|
|
204
|
-
* If the callback is omitted, `q.error()` returns a promise that rejects on the next error.
|
|
205
|
-
*/
|
|
206
|
-
error(): Promise<never>;
|
|
207
|
-
error(handler: (error: Error, task: T) => void): void;
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* A boolean for determining whether the queue is in a paused state.
|
|
211
|
-
*/
|
|
212
|
-
paused: boolean;
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* A function that pauses the processing of tasks until `q.resume()` is called.
|
|
216
|
-
*/
|
|
217
|
-
pause(): void;
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* A function that resumes the processing of queued tasks when the queue
|
|
221
|
-
* is paused.
|
|
222
|
-
*/
|
|
223
|
-
resume(): void;
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* A function that removes the drain callback and empties remaining tasks
|
|
227
|
-
* from the queue forcing it to go idle. No more tasks should be pushed to
|
|
228
|
-
* the queue after calling this function.
|
|
229
|
-
*/
|
|
230
|
-
kill(): void;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* A priorityQueue object to manage the tasks.
|
|
235
|
-
*
|
|
236
|
-
* There are two differences between queue and priorityQueue objects:
|
|
237
|
-
* - `push(task, priority, [callback])` — priority should be a number. If an array of tasks is given, all tasks will be assigned the same priority.
|
|
238
|
-
* - The `unshift` method was removed.
|
|
239
|
-
*/
|
|
240
|
-
// FIXME: can not use Omit due to ts version restriction. Replace Pick with Omit, when ts 3.5+ will be allowed
|
|
241
|
-
interface AsyncPriorityQueue<T> extends Pick<QueueObject<T>, Exclude<keyof QueueObject<T>, "push" | "unshift">> {
|
|
242
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
243
|
-
push<R>(task: T | T[], priority?: number): Promise<R>;
|
|
244
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
245
|
-
push<R, E = Error>(task: T | T[], priority: number, callback: AsyncResultCallback<R, E>): void;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* @deprecated this is a type that left here for backward compatibility.
|
|
250
|
-
* Please use QueueObject instead
|
|
251
|
-
*/
|
|
252
|
-
type AsyncQueue<T> = QueueObject<T>;
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* @deprecated this is a type that left here for backward compatibility.
|
|
256
|
-
* Please use QueueObject instead
|
|
257
|
-
*/
|
|
258
|
-
type AsyncCargoQueue<T = any> = QueueObject<T>;
|
|
259
|
-
|
|
260
|
-
// Collections
|
|
261
|
-
declare function each<T, E = Error>(
|
|
262
|
-
arr: IterableCollection<T>,
|
|
263
|
-
iterator: AsyncIterator<T, E>,
|
|
264
|
-
callback: ErrorCallback<E>,
|
|
265
|
-
): void;
|
|
266
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
267
|
-
declare function each<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncIterator<T, E>): Promise<void>;
|
|
268
|
-
declare const eachSeries: typeof each;
|
|
269
|
-
declare function eachLimit<T, E = Error>(
|
|
270
|
-
arr: IterableCollection<T>,
|
|
271
|
-
limit: number,
|
|
272
|
-
iterator: AsyncIterator<T, E>,
|
|
273
|
-
callback: ErrorCallback<E>,
|
|
274
|
-
): void;
|
|
275
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
276
|
-
declare function eachLimit<T, E = Error>(
|
|
277
|
-
arr: IterableCollection<T>,
|
|
278
|
-
limit: number,
|
|
279
|
-
iterator: AsyncIterator<T, E>,
|
|
280
|
-
): Promise<void>;
|
|
281
|
-
declare const forEach: typeof each;
|
|
282
|
-
declare const forEachSeries: typeof each;
|
|
283
|
-
declare const forEachLimit: typeof eachLimit;
|
|
284
|
-
declare function forEachOf<T, E = Error>(
|
|
285
|
-
obj: IterableCollection<T>,
|
|
286
|
-
iterator: AsyncForEachOfIterator<T, E>,
|
|
287
|
-
callback: ErrorCallback<E>,
|
|
288
|
-
): void;
|
|
289
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
290
|
-
declare function forEachOf<T, E = Error>(
|
|
291
|
-
obj: IterableCollection<T>,
|
|
292
|
-
iterator: AsyncForEachOfIterator<T, E>,
|
|
293
|
-
): Promise<void>;
|
|
294
|
-
declare const forEachOfSeries: typeof forEachOf;
|
|
295
|
-
declare function forEachOfLimit<T, E = Error>(
|
|
296
|
-
obj: IterableCollection<T>,
|
|
297
|
-
limit: number,
|
|
298
|
-
iterator: AsyncForEachOfIterator<T, E>,
|
|
299
|
-
callback: ErrorCallback<E>,
|
|
300
|
-
): void;
|
|
301
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
302
|
-
declare function forEachOfLimit<T, E = Error>(
|
|
303
|
-
obj: IterableCollection<T>,
|
|
304
|
-
limit: number,
|
|
305
|
-
iterator: AsyncForEachOfIterator<T, E>,
|
|
306
|
-
): Promise<void>;
|
|
307
|
-
declare const eachOf: typeof forEachOf;
|
|
308
|
-
declare const eachOfSeries: typeof forEachOf;
|
|
309
|
-
declare const eachOfLimit: typeof forEachOfLimit;
|
|
310
|
-
declare function map<T, R, E = Error>(
|
|
311
|
-
arr: T[] | IterableIterator<T> | Dictionary<T>,
|
|
312
|
-
iterator: AsyncResultIterator<T, R, E>,
|
|
313
|
-
callback: AsyncResultArrayCallback<R, E>,
|
|
314
|
-
): void;
|
|
315
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
316
|
-
declare function map<T, R, E = Error>(
|
|
317
|
-
arr: T[] | IterableIterator<T> | Dictionary<T>,
|
|
318
|
-
iterator: AsyncResultIterator<T, R, E>,
|
|
319
|
-
): Promise<R[]>;
|
|
320
|
-
declare const mapSeries: typeof map;
|
|
321
|
-
declare function mapLimit<T, R, E = Error>(
|
|
322
|
-
arr: IterableCollection<T>,
|
|
323
|
-
limit: number,
|
|
324
|
-
iterator: AsyncResultIterator<T, R, E>,
|
|
325
|
-
callback: AsyncResultArrayCallback<R, E>,
|
|
326
|
-
): void;
|
|
327
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
328
|
-
declare function mapLimit<T, R, E = Error>(
|
|
329
|
-
arr: IterableCollection<T>,
|
|
330
|
-
limit: number,
|
|
331
|
-
iterator: AsyncResultIterator<T, R, E>,
|
|
332
|
-
): Promise<R[]>;
|
|
333
|
-
|
|
334
|
-
declare function mapValuesLimit<T, R, E = Error>(
|
|
335
|
-
obj: Dictionary<T>,
|
|
336
|
-
limit: number,
|
|
337
|
-
iteratee: (value: T, key: string, callback: AsyncResultCallback<R, E>) => void,
|
|
338
|
-
callback: AsyncResultObjectCallback<R, E>,
|
|
339
|
-
): void;
|
|
340
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
341
|
-
declare function mapValuesLimit<T, R, E = Error>(
|
|
342
|
-
obj: Dictionary<T>,
|
|
343
|
-
limit: number,
|
|
344
|
-
iteratee: (value: T, key: string, callback: AsyncResultCallback<R, E>) => void,
|
|
345
|
-
): Promise<R>;
|
|
346
|
-
|
|
347
|
-
declare function mapValues<T, R, E = Error>(
|
|
348
|
-
obj: Dictionary<T>,
|
|
349
|
-
iteratee: (value: T, key: string, callback: AsyncResultCallback<R, E>) => void,
|
|
350
|
-
callback: AsyncResultObjectCallback<R, E>,
|
|
351
|
-
): void;
|
|
352
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
353
|
-
declare function mapValues<T, R, E = Error>(
|
|
354
|
-
obj: Dictionary<T>,
|
|
355
|
-
iteratee: (value: T, key: string, callback: AsyncResultCallback<R, E>) => void,
|
|
356
|
-
): Promise<R>;
|
|
357
|
-
declare const mapValuesSeries: typeof mapValues;
|
|
358
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
359
|
-
declare function filter<T, E = Error>(
|
|
360
|
-
arr: IterableCollection<T>,
|
|
361
|
-
iterator: AsyncBooleanIterator<T, E>,
|
|
362
|
-
callback: AsyncResultArrayCallback<T, E>,
|
|
363
|
-
): void;
|
|
364
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
365
|
-
declare function filter<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncBooleanIterator<T, E>): Promise<T[]>;
|
|
366
|
-
declare const filterSeries: typeof filter;
|
|
367
|
-
declare function filterLimit<T, E = Error>(
|
|
368
|
-
arr: IterableCollection<T>,
|
|
369
|
-
limit: number,
|
|
370
|
-
iterator: AsyncBooleanIterator<T, E>,
|
|
371
|
-
callback: AsyncResultArrayCallback<T, E>,
|
|
372
|
-
): void;
|
|
373
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
374
|
-
declare function filterLimit<T, E = Error>(
|
|
375
|
-
arr: IterableCollection<T>,
|
|
376
|
-
limit: number,
|
|
377
|
-
iterator: AsyncBooleanIterator<T, E>,
|
|
378
|
-
): Promise<T[]>;
|
|
379
|
-
declare const select: typeof filter;
|
|
380
|
-
declare const selectSeries: typeof filter;
|
|
381
|
-
declare const selectLimit: typeof filterLimit;
|
|
382
|
-
declare const reject: typeof filter;
|
|
383
|
-
declare const rejectSeries: typeof filter;
|
|
384
|
-
declare const rejectLimit: typeof filterLimit;
|
|
385
|
-
declare function reduce<T, R, E = Error>(
|
|
386
|
-
arr: T[] | IterableIterator<T>,
|
|
387
|
-
memo: R,
|
|
388
|
-
iterator: AsyncMemoIterator<T, R, E>,
|
|
389
|
-
callback?: AsyncResultCallback<R, E>,
|
|
390
|
-
): void;
|
|
391
|
-
declare const inject: typeof reduce;
|
|
392
|
-
declare const foldl: typeof reduce;
|
|
393
|
-
declare const reduceRight: typeof reduce;
|
|
394
|
-
declare const foldr: typeof reduce;
|
|
395
|
-
declare function detect<T, E = Error>(
|
|
396
|
-
arr: IterableCollection<T>,
|
|
397
|
-
iterator: AsyncBooleanIterator<T, E>,
|
|
398
|
-
callback?: AsyncResultCallback<T, E>,
|
|
399
|
-
): void;
|
|
400
|
-
declare const detectSeries: typeof detect;
|
|
401
|
-
declare function detectLimit<T, E = Error>(
|
|
402
|
-
arr: IterableCollection<T>,
|
|
403
|
-
limit: number,
|
|
404
|
-
iterator: AsyncBooleanIterator<T, E>,
|
|
405
|
-
callback?: AsyncResultCallback<T, E>,
|
|
406
|
-
): void;
|
|
407
|
-
declare const find: typeof detect;
|
|
408
|
-
declare const findSeries: typeof detect;
|
|
409
|
-
declare const findLimit: typeof detectLimit;
|
|
410
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
411
|
-
declare function sortBy<T, V, E = Error>(
|
|
412
|
-
arr: T[] | IterableIterator<T>,
|
|
413
|
-
iterator: AsyncResultIterator<T, V, E>,
|
|
414
|
-
callback?: AsyncResultArrayCallback<T, E>,
|
|
415
|
-
): void;
|
|
416
|
-
declare function some<T, E = Error>(
|
|
417
|
-
arr: IterableCollection<T>,
|
|
418
|
-
iterator: AsyncBooleanIterator<T, E>,
|
|
419
|
-
callback?: AsyncBooleanResultCallback<E>,
|
|
420
|
-
): void;
|
|
421
|
-
declare const someSeries: typeof some;
|
|
422
|
-
declare function someLimit<T, E = Error>(
|
|
423
|
-
arr: IterableCollection<T>,
|
|
424
|
-
limit: number,
|
|
425
|
-
iterator: AsyncBooleanIterator<T, E>,
|
|
426
|
-
callback?: AsyncBooleanResultCallback<E>,
|
|
427
|
-
): void;
|
|
428
|
-
declare const any: typeof some;
|
|
429
|
-
declare const anySeries: typeof someSeries;
|
|
430
|
-
declare const anyLimit: typeof someLimit;
|
|
431
|
-
declare function every<T, E = Error>(
|
|
432
|
-
arr: IterableCollection<T>,
|
|
433
|
-
iterator: AsyncBooleanIterator<T, E>,
|
|
434
|
-
callback?: AsyncBooleanResultCallback<E>,
|
|
435
|
-
): void;
|
|
436
|
-
declare const everySeries: typeof every;
|
|
437
|
-
declare function everyLimit<T, E = Error>(
|
|
438
|
-
arr: IterableCollection<T>,
|
|
439
|
-
limit: number,
|
|
440
|
-
iterator: AsyncBooleanIterator<T, E>,
|
|
441
|
-
callback?: AsyncBooleanResultCallback<E>,
|
|
442
|
-
): void;
|
|
443
|
-
declare const all: typeof every;
|
|
444
|
-
declare const allSeries: typeof every;
|
|
445
|
-
declare const allLimit: typeof everyLimit;
|
|
446
|
-
|
|
447
|
-
declare function concat<T, R, E = Error>(
|
|
448
|
-
arr: IterableCollection<T>,
|
|
449
|
-
iterator: AsyncResultIterator<T, R[], E>,
|
|
450
|
-
callback?: AsyncResultArrayCallback<R, E>,
|
|
451
|
-
): void;
|
|
452
|
-
declare function concatLimit<T, R, E = Error>(
|
|
453
|
-
arr: IterableCollection<T>,
|
|
454
|
-
limit: number,
|
|
455
|
-
iterator: AsyncResultIterator<T, R[], E>,
|
|
456
|
-
callback?: AsyncResultArrayCallback<R, E>,
|
|
457
|
-
): void;
|
|
458
|
-
declare const concatSeries: typeof concat;
|
|
459
|
-
|
|
460
|
-
// Control Flow
|
|
461
|
-
declare function series<T, E = Error>(
|
|
462
|
-
tasks: Array<AsyncFunction<T, E>>,
|
|
463
|
-
callback?: AsyncResultArrayCallback<T, E>,
|
|
464
|
-
): void;
|
|
465
|
-
declare function series<T, E = Error>(
|
|
466
|
-
tasks: Dictionary<AsyncFunction<T, E>>,
|
|
467
|
-
callback?: AsyncResultObjectCallback<T, E>,
|
|
468
|
-
): void;
|
|
469
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
470
|
-
declare function series<T, R, E = Error>(
|
|
471
|
-
tasks: Array<AsyncFunction<T, E>> | Dictionary<AsyncFunction<T, E>>,
|
|
472
|
-
): Promise<R>;
|
|
473
|
-
declare function parallel<T, E = Error>(
|
|
474
|
-
tasks: Array<AsyncFunction<T, E>>,
|
|
475
|
-
callback?: AsyncResultArrayCallback<T, E>,
|
|
476
|
-
): void;
|
|
477
|
-
declare function parallel<T, E = Error>(
|
|
478
|
-
tasks: Dictionary<AsyncFunction<T, E>>,
|
|
479
|
-
callback?: AsyncResultObjectCallback<T, E>,
|
|
480
|
-
): void;
|
|
481
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
482
|
-
declare function parallel<T, R, E = Error>(
|
|
483
|
-
tasks: Array<AsyncFunction<T, E>> | Dictionary<AsyncFunction<T, E>>,
|
|
484
|
-
): Promise<R>;
|
|
485
|
-
declare function parallelLimit<T, E = Error>(
|
|
486
|
-
tasks: Array<AsyncFunction<T, E>>,
|
|
487
|
-
limit: number,
|
|
488
|
-
callback?: AsyncResultArrayCallback<T, E>,
|
|
489
|
-
): void;
|
|
490
|
-
declare function parallelLimit<T, E = Error>(
|
|
491
|
-
tasks: Dictionary<AsyncFunction<T, E>>,
|
|
492
|
-
limit: number,
|
|
493
|
-
callback?: AsyncResultObjectCallback<T, E>,
|
|
494
|
-
): void;
|
|
495
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
496
|
-
declare function parallelLimit<T, R, E = Error>(
|
|
497
|
-
tasks: Array<AsyncFunction<T, E>> | Dictionary<AsyncFunction<T, E>>,
|
|
498
|
-
limit: number,
|
|
499
|
-
): Promise<R>;
|
|
500
|
-
declare function whilst<E = Error>(
|
|
501
|
-
test: (cb: (err: any, truth: boolean) => boolean) => boolean,
|
|
502
|
-
fn: AsyncVoidFunction<E>,
|
|
503
|
-
callback: ErrorCallback<E>,
|
|
504
|
-
): void;
|
|
505
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
506
|
-
declare function whilst<R, E = Error>(
|
|
507
|
-
test: (cb: (err: any, truth: boolean) => boolean) => boolean,
|
|
508
|
-
fn: AsyncVoidFunction<E>,
|
|
509
|
-
): Promise<R>;
|
|
510
|
-
declare function doWhilst<T, E = Error>(
|
|
511
|
-
fn: AsyncFunctionEx<T, E>,
|
|
512
|
-
test: (...results: T[]) => boolean,
|
|
513
|
-
callback: ErrorCallback<E>,
|
|
514
|
-
): void;
|
|
515
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
516
|
-
declare function doWhilst<T, R, E = Error>(fn: AsyncFunctionEx<T, E>, test: (...results: T[]) => boolean): Promise<R>;
|
|
517
|
-
declare function until<E = Error>(test: () => boolean, fn: AsyncVoidFunction<E>, callback: ErrorCallback<E>): void;
|
|
518
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
519
|
-
declare function until<R, E = Error>(test: () => boolean, fn: AsyncVoidFunction<E>): Promise<R>;
|
|
520
|
-
declare function doUntil<T, E = Error>(
|
|
521
|
-
fn: AsyncFunctionEx<T, E>,
|
|
522
|
-
test: (...results: T[]) => boolean,
|
|
523
|
-
callback: ErrorCallback<E>,
|
|
524
|
-
): void;
|
|
525
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
526
|
-
declare function doUntil<T, R, E = Error>(fn: AsyncFunctionEx<T, E>, test: (...results: T[]) => boolean): Promise<R>;
|
|
527
|
-
declare function during<E = Error>(
|
|
528
|
-
test: (testCallback: AsyncBooleanResultCallback<E>) => void,
|
|
529
|
-
fn: AsyncVoidFunction<E>,
|
|
530
|
-
callback: ErrorCallback<E>,
|
|
531
|
-
): void;
|
|
532
|
-
declare function doDuring<E = Error>(
|
|
533
|
-
fn: AsyncVoidFunction<E>,
|
|
534
|
-
test: (testCallback: AsyncBooleanResultCallback<E>) => void,
|
|
535
|
-
callback: ErrorCallback<E>,
|
|
536
|
-
): void;
|
|
537
|
-
declare function forever<E = Error>(next: (next: ErrorCallback<E>) => void, errBack: ErrorCallback<E>): void;
|
|
538
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
539
|
-
declare function waterfall<T, E = Error>(tasks: Function[], callback?: AsyncResultCallback<T, E>): void; // eslint-disable-line @definitelytyped/no-unnecessary-generics
|
|
540
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
541
|
-
declare function compose(...fns: Function[]): Function;
|
|
542
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
543
|
-
declare function seq(...fns: Function[]): Function;
|
|
544
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
545
|
-
declare function applyEach(fns: Function[], ...argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional.
|
|
546
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
547
|
-
declare function applyEachSeries(fns: Function[], ...argsAndCallback: any[]): void; // applyEachSeries(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional.
|
|
548
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
549
|
-
declare function queue<T, E = Error>(worker: AsyncWorker<T, E>, concurrency?: number): QueueObject<T>;
|
|
550
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
551
|
-
declare function queue<T, R, E = Error>(worker: AsyncResultIterator<T, R, E>, concurrency?: number): QueueObject<T>;
|
|
552
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
553
|
-
declare function priorityQueue<T, E = Error>(worker: AsyncWorker<T, E>, concurrency?: number): AsyncPriorityQueue<T>;
|
|
554
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
555
|
-
declare function cargo<T, E = Error>(worker: AsyncWorker<T[], E>, payload?: number): QueueObject<T>;
|
|
556
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
557
|
-
declare function cargoQueue<T, E = Error>(
|
|
558
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
559
|
-
worker: AsyncWorker<T[], E>,
|
|
560
|
-
concurrency?: number,
|
|
561
|
-
payload?: number,
|
|
562
|
-
): QueueObject<T>;
|
|
563
|
-
declare function auto<R extends Dictionary<any>, E = Error>(
|
|
564
|
-
tasks: AsyncAutoTasks<R, E>,
|
|
565
|
-
concurrency?: number,
|
|
566
|
-
callback?: AsyncResultCallback<R, E>,
|
|
567
|
-
): void;
|
|
568
|
-
declare function auto<R extends Dictionary<any>, E = Error>(
|
|
569
|
-
tasks: AsyncAutoTasks<R, E>,
|
|
570
|
-
callback?: AsyncResultCallback<R, E>,
|
|
571
|
-
): void;
|
|
572
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
573
|
-
declare function autoInject<E = Error>(tasks: any, callback?: AsyncResultCallback<any, E>): void;
|
|
574
|
-
|
|
575
|
-
interface RetryOptions {
|
|
576
|
-
times?: number;
|
|
577
|
-
interval?: number | ((retryCount: number) => number);
|
|
578
|
-
errorFilter?: (error: Error) => boolean;
|
|
579
|
-
}
|
|
580
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
581
|
-
declare function retry<T, E = Error>(
|
|
582
|
-
opts?: number | RetryOptions,
|
|
583
|
-
task?: (callback: AsyncResultCallback<T, E>, results: any) => void,
|
|
584
|
-
): Promise<void>;
|
|
585
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
586
|
-
declare function retry<T, E = Error>(
|
|
587
|
-
opts?: number | RetryOptions,
|
|
588
|
-
task?: (callback: AsyncResultCallback<T, E>, results: any) => void,
|
|
589
|
-
callback?: AsyncResultCallback<any, E>,
|
|
590
|
-
): void;
|
|
591
|
-
|
|
592
|
-
declare function retryable<T, E = Error>(task: AsyncFunction<T, E>): AsyncFunction<T, E>;
|
|
593
|
-
declare function retryable<T, E = Error>(
|
|
594
|
-
opts: number | (RetryOptions & { arity?: number }),
|
|
595
|
-
task: AsyncFunction<T, E>,
|
|
596
|
-
): AsyncFunction<T, E>;
|
|
597
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
598
|
-
declare function apply<E = Error>(fn: Function, ...args: any[]): AsyncFunction<any, E>; // eslint-disable-line @definitelytyped/no-unnecessary-generics
|
|
599
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
600
|
-
declare function nextTick(callback: Function, ...args: any[]): void;
|
|
601
|
-
declare const setImmediate: typeof nextTick;
|
|
602
|
-
|
|
603
|
-
declare function reflect<T, E = Error>(
|
|
604
|
-
fn: AsyncFunction<T, E>,
|
|
605
|
-
): (callback: (err: null, result: { error?: E; value?: T }) => void) => void;
|
|
606
|
-
declare function reflectAll<T, E = Error>(
|
|
607
|
-
tasks: Array<AsyncFunction<T, E>>,
|
|
608
|
-
): Array<(callback: (err: null, result: { error?: E; value?: T }) => void) => void>;
|
|
609
|
-
|
|
610
|
-
declare function timeout<T, E = Error>(fn: AsyncFunction<T, E>, milliseconds: number, info?: any): AsyncFunction<T, E>;
|
|
611
|
-
declare function timeout<T, R, E = Error>(
|
|
612
|
-
fn: AsyncResultIterator<T, R, E>,
|
|
613
|
-
milliseconds: number,
|
|
614
|
-
info?: any,
|
|
615
|
-
): AsyncResultIterator<T, R, E>;
|
|
616
|
-
|
|
617
|
-
declare function times<T, E = Error>(
|
|
618
|
-
n: number,
|
|
619
|
-
iterator: AsyncResultIterator<number, T, E>,
|
|
620
|
-
callback: AsyncResultArrayCallback<T, E>,
|
|
621
|
-
): void;
|
|
622
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
623
|
-
declare function times<T, E = Error>(n: number, iterator: AsyncResultIterator<number, T, E>): Promise<T>;
|
|
624
|
-
declare const timesSeries: typeof times;
|
|
625
|
-
declare function timesLimit<T, E = Error>(
|
|
626
|
-
n: number,
|
|
627
|
-
limit: number,
|
|
628
|
-
iterator: AsyncResultIterator<number, T, E>,
|
|
629
|
-
callback: AsyncResultArrayCallback<T, E>,
|
|
630
|
-
): void;
|
|
631
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
632
|
-
declare function timesLimit<T, E = Error>(
|
|
633
|
-
n: number,
|
|
634
|
-
limit: number,
|
|
635
|
-
iterator: AsyncResultIterator<number, T, E>,
|
|
636
|
-
): Promise<T>;
|
|
637
|
-
|
|
638
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
639
|
-
declare function transform<T, R, E = Error>(
|
|
640
|
-
arr: T[],
|
|
641
|
-
iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void,
|
|
642
|
-
callback?: AsyncResultArrayCallback<T, E>,
|
|
643
|
-
): void;
|
|
644
|
-
declare function transform<T, R, E = Error>(
|
|
645
|
-
arr: T[],
|
|
646
|
-
acc: R[],
|
|
647
|
-
iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void,
|
|
648
|
-
callback?: AsyncResultArrayCallback<T, E>,
|
|
649
|
-
): void;
|
|
650
|
-
|
|
651
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
652
|
-
declare function transform<T, R, E = Error>(
|
|
653
|
-
arr: { [key: string]: T },
|
|
654
|
-
iteratee: (acc: { [key: string]: R }, item: T, key: string, callback: (error?: E) => void) => void,
|
|
655
|
-
callback?: AsyncResultObjectCallback<T, E>,
|
|
656
|
-
): void;
|
|
657
|
-
|
|
658
|
-
declare function transform<T, R, E = Error>(
|
|
659
|
-
arr: { [key: string]: T },
|
|
660
|
-
acc: { [key: string]: R },
|
|
661
|
-
iteratee: (acc: { [key: string]: R }, item: T, key: string, callback: (error?: E) => void) => void,
|
|
662
|
-
callback?: AsyncResultObjectCallback<T, E>,
|
|
663
|
-
): void;
|
|
664
|
-
|
|
665
|
-
declare function race<T, E = Error>(tasks: Array<AsyncFunction<T, E>>, callback: AsyncResultCallback<T, E>): void;
|
|
666
|
-
|
|
667
|
-
// Utils
|
|
668
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
669
|
-
declare function memoize(fn: Function, hasher?: Function): Function;
|
|
670
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
671
|
-
declare function unmemoize(fn: Function): Function;
|
|
672
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
673
|
-
declare function ensureAsync(fn: (...argsAndCallback: any[]) => void): Function;
|
|
674
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
675
|
-
declare function constant(...values: any[]): AsyncFunction<any>;
|
|
676
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
677
|
-
declare function asyncify(fn: Function): (...args: any[]) => any;
|
|
678
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
679
|
-
declare function wrapSync(fn: Function): Function;
|
|
680
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
681
|
-
declare function log(fn: Function, ...args: any[]): void;
|
|
682
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
683
|
-
declare function dir(fn: Function, ...args: any[]): void;
|
|
684
|
-
|
|
685
|
-
export { type AsyncAutoTask, type AsyncAutoTaskFunction, type AsyncAutoTaskFunctionWithoutDependencies, type AsyncAutoTasks, type AsyncBooleanIterator, type AsyncBooleanResultCallback, type AsyncCargoQueue, type AsyncForEachOfIterator, type AsyncFunction, type AsyncFunctionEx, type AsyncIterator, type AsyncMemoIterator, type AsyncPriorityQueue, type AsyncQueue, type AsyncResultArrayCallback, type AsyncResultCallback, type AsyncResultIterator, type AsyncResultObjectCallback, type AsyncVoidFunction, type AsyncWorker, type CallbackContainer, type DataContainer, type Dictionary, type ErrorCallback, type IterableCollection, type PriorityContainer, type QueueObject, type RetryOptions, all, allLimit, allSeries, any, anyLimit, anySeries, apply, applyEach, applyEachSeries, asyncify, auto, autoInject, cargo, cargoQueue, compose, concat, concatLimit, concatSeries, constant, detect, detectLimit, detectSeries, dir, doDuring, doUntil, doWhilst, during, each, eachLimit, eachOf, eachOfLimit, eachOfSeries, eachSeries, ensureAsync, every, everyLimit, everySeries, filter, filterLimit, filterSeries, find, findLimit, findSeries, foldl, foldr, forEach, forEachLimit, forEachOf, forEachOfLimit, forEachOfSeries, forEachSeries, forever, inject, log, map, mapLimit, mapSeries, mapValues, mapValuesLimit, mapValuesSeries, memoize, nextTick, parallel, parallelLimit, priorityQueue, queue, race, reduce, reduceRight, reflect, reflectAll, reject, rejectLimit, rejectSeries, retry, retryable, select, selectLimit, selectSeries, seq, series, setImmediate, some, someLimit, someSeries, sortBy, timeout, times, timesLimit, timesSeries, transform, unmemoize, until, waterfall, whilst, wrapSync };
|