@types/async 3.2.11 → 3.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. async/README.md +1 -1
  2. async/index.d.ts +34 -8
  3. async/package.json +2 -2
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: Thu, 23 Dec 2021 23:34:16 GMT
11
+ * Last updated: Sun, 26 Dec 2021 12:01:22 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `async`
14
14
 
async/index.d.ts CHANGED
@@ -28,6 +28,7 @@ export interface AsyncFunctionEx<T, E = Error> { (callback: (err?: E | null, ...
28
28
  export interface AsyncIterator<T, E = Error> { (item: T, callback: ErrorCallback<E>): void; }
29
29
  export interface AsyncForEachOfIterator<T, E = Error> { (item: T, key: number|string, callback: ErrorCallback<E>): void; }
30
30
  export interface AsyncResultIterator<T, R, E = Error> { (item: T, callback: AsyncResultCallback<R, E>): void; }
31
+ export interface AsyncResultIteratorPromise<T, R> { (item: T): Promise<R>; }
31
32
  export interface AsyncMemoIterator<T, R, E = Error> { (memo: R | undefined, item: T, callback: AsyncResultCallback<R, E>): void; }
32
33
  export interface AsyncBooleanIterator<T, E = Error> { (item: T, callback: AsyncBooleanResultCallback<E>): void; }
33
34
 
@@ -244,11 +245,26 @@ export function forEachOfLimit<T, E = Error>(obj: IterableCollection<T>, limit:
244
245
  export const eachOf: typeof forEachOf;
245
246
  export const eachOfSeries: typeof forEachOf;
246
247
  export const eachOfLimit: typeof forEachOfLimit;
247
- export function map<T, R, E = Error>(arr: T[] | IterableIterator<T> | Dictionary<T>, iterator: AsyncResultIterator<T, R, E>, callback: AsyncResultArrayCallback<R, E>): void;
248
- export function map<T, R, E = Error>(arr: T[] | IterableIterator<T> | Dictionary<T>, iterator: AsyncResultIterator<T, R, E>): Promise<R[]>;
248
+ export function map<T, R, E = Error>(
249
+ arr: T[] | IterableIterator<T> | Dictionary<T>,
250
+ iterator: (AsyncResultIterator<T, R, E> | AsyncResultIteratorPromise<T, R>),
251
+ callback: AsyncResultArrayCallback<R, E>
252
+ ): void;
253
+ export function map<T, R, E = Error>(
254
+ arr: T[] | IterableIterator<T> | Dictionary<T>,
255
+ iterator: (AsyncResultIterator<T, R, E> | AsyncResultIteratorPromise<T, R>)
256
+ ): Promise<R[]>;
257
+
249
258
  export const mapSeries: typeof map;
250
- export function mapLimit<T, R, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncResultIterator<T, R, E>, callback: AsyncResultArrayCallback<R, E>): void;
251
- export function mapLimit<T, R, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncResultIterator<T, R, E>): Promise<R[]>;
259
+ export function mapLimit<T, R, E = Error>(
260
+ arr: IterableCollection<T>,
261
+ limit: number, iterator: (AsyncResultIterator<T, R, E> | AsyncResultIteratorPromise<T, R>),
262
+ callback: AsyncResultArrayCallback<R, E>
263
+ ): void;
264
+ export function mapLimit<T, R, E = Error>(
265
+ arr: IterableCollection<T>,
266
+ limit: number, iterator: (AsyncResultIterator<T, R, E> | AsyncResultIteratorPromise<T, R>)
267
+ ): Promise<R[]>;
252
268
 
253
269
  export function mapValuesLimit<T, R, E = Error>(
254
270
  obj: Dictionary<T>,
@@ -413,11 +429,21 @@ export function reflectAll<T, E = Error>(tasks: Array<AsyncFunction<T, E>>): Arr
413
429
  export function timeout<T, E = Error>(fn: AsyncFunction<T, E>, milliseconds: number, info?: any): AsyncFunction<T, E>;
414
430
  export function timeout<T, R, E = Error>(fn: AsyncResultIterator<T, R, E>, milliseconds: number, info?: any): AsyncResultIterator<T, R, E>;
415
431
 
416
- export function times<T, E = Error>(n: number, iterator: AsyncResultIterator<number, T, E>, callback: AsyncResultArrayCallback<T, E>): void;
417
- export function times<T, E = Error>(n: number, iterator: AsyncResultIterator<number, T, E>): Promise<T>;
432
+ export function times<T, E = Error>(n: number, iterator: (AsyncResultIterator<number, T, E> | AsyncResultIteratorPromise<number, T>), callback: AsyncResultArrayCallback<T, E>): void;
433
+ export function times<T, E = Error>(n: number, iterator: (AsyncResultIterator<number, T, E> | AsyncResultIteratorPromise<number, T>)): Promise<T>;
434
+
418
435
  export const timesSeries: typeof times;
419
- export function timesLimit<T, E = Error>(n: number, limit: number, iterator: AsyncResultIterator<number, T, E>, callback: AsyncResultArrayCallback<T, E>): void;
420
- export function timesLimit<T, E = Error>(n: number, limit: number, iterator: AsyncResultIterator<number, T, E>): Promise<T>;
436
+ export function timesLimit<T, E = Error>(
437
+ n: number,
438
+ limit: number,
439
+ iterator: (AsyncResultIterator<number, T, E> | AsyncResultIteratorPromise<number, T>),
440
+ callback: AsyncResultArrayCallback<T, E>
441
+ ): void;
442
+ export function timesLimit<T, E = Error>(
443
+ n: number,
444
+ limit: number,
445
+ iterator: (AsyncResultIterator<number, T, E> | AsyncResultIteratorPromise<number, T>)
446
+ ): Promise<T>;
421
447
 
422
448
  export function transform<T, R, E = Error>(arr: T[], iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void, callback?: AsyncResultArrayCallback<T, E>): void;
423
449
  export function transform<T, R, E = Error>(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void, callback?: AsyncResultArrayCallback<T, E>): void;
async/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/async",
3
- "version": "3.2.11",
3
+ "version": "3.2.12",
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": "a84804e41d003d56b766481633495eb03d525b60ec3e3cb24da339ce3492108e",
63
+ "typesPublisherContentHash": "a14b6ee9ce4edbdcc61a907887cacbfbbd4e0f6ec63b045475e37be787ce4e65",
64
64
  "typeScriptVersion": "3.8"
65
65
  }