@types/async 3.2.14 → 3.2.16
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.
- async/README.md +1 -1
- async/index.d.ts +24 -7
- async/package.json +3 -3
async/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for Async (https://github.com/caolan/asyn
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/async.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Mon, 28 Nov 2022 01:03:02 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `async`
|
|
14
14
|
|
async/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
export as namespace async;
|
|
16
16
|
|
|
17
17
|
export interface Dictionary<T> { [key: string]: T; }
|
|
18
|
-
export type IterableCollection<T> = T[] | IterableIterator<T> | Dictionary<T>;
|
|
18
|
+
export type IterableCollection<T> = T[] | IterableIterator<T> | AsyncIterable<T> | Dictionary<T>;
|
|
19
19
|
|
|
20
20
|
export interface ErrorCallback<E = Error> { (err?: E | null): void; }
|
|
21
21
|
export interface AsyncBooleanResultCallback<E = Error> { (err?: E | null, truthValue?: boolean): void; }
|
|
@@ -247,12 +247,12 @@ export const eachOf: typeof forEachOf;
|
|
|
247
247
|
export const eachOfSeries: typeof forEachOf;
|
|
248
248
|
export const eachOfLimit: typeof forEachOfLimit;
|
|
249
249
|
export function map<T, R, E = Error>(
|
|
250
|
-
arr:
|
|
250
|
+
arr: IterableCollection<T>,
|
|
251
251
|
iterator: (AsyncResultIterator<T, R, E> | AsyncResultIteratorPromise<T, R>),
|
|
252
252
|
callback: AsyncResultArrayCallback<R, E>
|
|
253
253
|
): void;
|
|
254
254
|
export function map<T, R, E = Error>(
|
|
255
|
-
arr:
|
|
255
|
+
arr: IterableCollection<T>,
|
|
256
256
|
iterator: (AsyncResultIterator<T, R, E> | AsyncResultIteratorPromise<T, R>)
|
|
257
257
|
): Promise<R[]>;
|
|
258
258
|
|
|
@@ -302,20 +302,25 @@ export const foldr: typeof reduce;
|
|
|
302
302
|
export function detect<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncBooleanIterator<T, E>, callback: AsyncResultCallback<T, E>): void;
|
|
303
303
|
export function detect<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncBooleanIterator<T, E>): Promise<T>;
|
|
304
304
|
export const detectSeries: typeof detect;
|
|
305
|
-
export function detectLimit<T, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncBooleanIterator<T, E>, callback
|
|
305
|
+
export function detectLimit<T, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncBooleanIterator<T, E>, callback: AsyncResultCallback<T, E>): void;
|
|
306
|
+
export function detectLimit<T, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncBooleanIterator<T, E>): Promise<T>;
|
|
306
307
|
export const find: typeof detect;
|
|
307
308
|
export const findSeries: typeof detect;
|
|
308
309
|
export const findLimit: typeof detectLimit;
|
|
309
|
-
export function sortBy<T, V, E = Error>(arr: T[] | IterableIterator<T>, iterator: AsyncResultIterator<T, V, E>, callback
|
|
310
|
+
export function sortBy<T, V, E = Error>(arr: T[] | IterableIterator<T>, iterator: AsyncResultIterator<T, V, E>, callback: AsyncResultArrayCallback<T, E>): void;
|
|
311
|
+
export function sortBy<T, V, E = Error>(arr: T[] | IterableIterator<T>, iterator: AsyncResultIterator<T, V, E>):
|
|
312
|
+
Promise<T[]>;
|
|
310
313
|
export function some<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncBooleanResultCallback<E>): void;
|
|
311
314
|
export const someSeries: typeof some;
|
|
312
315
|
export function someLimit<T, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncBooleanResultCallback<E>): void;
|
|
313
316
|
export const any: typeof some;
|
|
314
317
|
export const anySeries: typeof someSeries;
|
|
315
318
|
export const anyLimit: typeof someLimit;
|
|
316
|
-
export function every<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncBooleanIterator<T, E>, callback
|
|
319
|
+
export function every<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncBooleanIterator<T, E>, callback: AsyncBooleanResultCallback<E>): void;
|
|
320
|
+
export function every<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncBooleanIterator<T, E>): Promise<boolean>;
|
|
317
321
|
export const everySeries: typeof every;
|
|
318
|
-
export function everyLimit<T, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncBooleanIterator<T, E>, callback
|
|
322
|
+
export function everyLimit<T, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncBooleanIterator<T, E>, callback: AsyncBooleanResultCallback<E>): void;
|
|
323
|
+
export function everyLimit<T, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncBooleanIterator<T, E>): Promise<boolean>;
|
|
319
324
|
export const all: typeof every;
|
|
320
325
|
export const allSeries: typeof every;
|
|
321
326
|
export const allLimit: typeof everyLimit;
|
|
@@ -325,6 +330,15 @@ export function concat<T, R, E = Error>(arr: IterableCollection<T>, iterator: As
|
|
|
325
330
|
export function concatLimit<T, R, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncResultIterator<T, R[], E>, callback: AsyncResultArrayCallback<R, E>): void;
|
|
326
331
|
export function concatLimit<T, R, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncResultIterator<T, R[], E>): Promise<R[]>;
|
|
327
332
|
export const concatSeries: typeof concat;
|
|
333
|
+
export const flatMap: typeof concat;
|
|
334
|
+
export const flatMapLimit: typeof concatLimit;
|
|
335
|
+
export const flatMapSeries: typeof concatSeries;
|
|
336
|
+
|
|
337
|
+
export function groupBy<T, K, E = Error>(iterable: IterableCollection<T>, iterator: AsyncResultIterator<T, K, E>, callback: AsyncResultCallback<Record<string, T[]>, E>): void;
|
|
338
|
+
export function groupBy<T, K, E = Error>(iterable: IterableCollection<T>, iterator: AsyncResultIterator<T, K, E>): Promise<Record<string, T[]>>;
|
|
339
|
+
export function groupByLimit<T, K, E = Error>(iterable: IterableCollection<T>, limit: number, iterator: AsyncResultIterator<T, K, E>, callback: AsyncResultCallback<Record<string, T[]>, E>): void;
|
|
340
|
+
export function groupByLimit<T, K, E = Error>(iterable: IterableCollection<T>, limit: number, iterator: AsyncResultIterator<T, K, E>): Promise<Record<string, T[]>>;
|
|
341
|
+
export const groupBySeries: typeof groupBy;
|
|
328
342
|
|
|
329
343
|
// Control Flow
|
|
330
344
|
export function series<T, E = Error>(tasks: Array<AsyncFunction<T, E>>, callback?: AsyncResultArrayCallback<T, E>): void;
|
|
@@ -467,6 +481,9 @@ export function transform<T, R, E = Error>(
|
|
|
467
481
|
|
|
468
482
|
export function race<T, E = Error>(tasks: Array<AsyncFunction<T, E>>, callback: AsyncResultCallback<T, E>): void;
|
|
469
483
|
|
|
484
|
+
export function tryEach<T, E = Error>(tasks: IterableCollection<AsyncFunction<T>>, callback: AsyncResultCallback<T, E>): void;
|
|
485
|
+
export function tryEach<T>(tasks: IterableCollection<AsyncFunction<T>>): Promise<T>;
|
|
486
|
+
|
|
470
487
|
// Utils
|
|
471
488
|
export function memoize(fn: Function, hasher?: Function): Function;
|
|
472
489
|
export function unmemoize(fn: Function): Function;
|
async/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/async",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.16",
|
|
4
4
|
"description": "TypeScript definitions for Async",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/async",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
},
|
|
61
61
|
"scripts": {},
|
|
62
62
|
"dependencies": {},
|
|
63
|
-
"typesPublisherContentHash": "
|
|
64
|
-
"typeScriptVersion": "4.
|
|
63
|
+
"typesPublisherContentHash": "0c43e7edb7679f9dc405a71ec88c63003edb5518065190eaa27da3af1f3b94f2",
|
|
64
|
+
"typeScriptVersion": "4.1"
|
|
65
65
|
}
|