@types/async 3.2.10 → 3.2.13

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 +2 -2
  2. async/index.d.ts +40 -12
  3. async/package.json +3 -8
async/README.md CHANGED
@@ -8,9 +8,9 @@ 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: Mon, 15 Nov 2021 17:01:34 GMT
11
+ * Last updated: Tue, 26 Apr 2022 19:01:45 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `async`
14
14
 
15
15
  # Credits
16
- These definitions were written by [Boris Yankov](https://github.com/borisyankov), [Arseniy Maximov](https://github.com/kern0), [Joe Herman](https://github.com/Penryn), [Angus Fenying](https://github.com/fenying), [Pascal Martin](https://github.com/pascalmartin), [Dmitri Trofimov](https://github.com/Dmitri1337), [Etienne Rossignon](https://github.com/erossignon), [Lifeng Zhu](https://github.com/Juliiii), [Tümay Çeber](https://github.com/brendtumi), and [Andrew Pensinger](https://github.com/apnsngr).
16
+ These definitions were written by [Boris Yankov](https://github.com/borisyankov), [Arseniy Maximov](https://github.com/kern0), [Joe Herman](https://github.com/Penryn), [Angus Fenying](https://github.com/fenying), [Pascal Martin](https://github.com/pascalmartin), [Etienne Rossignon](https://github.com/erossignon), [Lifeng Zhu](https://github.com/Juliiii), [Tümay Çeber](https://github.com/brendtumi), and [Andrew Pensinger](https://github.com/apnsngr).
async/index.d.ts CHANGED
@@ -5,7 +5,6 @@
5
5
  // Joe Herman <https://github.com/Penryn>
6
6
  // Angus Fenying <https://github.com/fenying>
7
7
  // Pascal Martin <https://github.com/pascalmartin>
8
- // Dmitri Trofimov <https://github.com/Dmitri1337>
9
8
  // Etienne Rossignon <https://github.com/erossignon>
10
9
  // Lifeng Zhu <https://github.com/Juliiii>
11
10
  // Tümay Çeber <https://github.com/brendtumi>
@@ -29,6 +28,7 @@ export interface AsyncFunctionEx<T, E = Error> { (callback: (err?: E | null, ...
29
28
  export interface AsyncIterator<T, E = Error> { (item: T, callback: ErrorCallback<E>): void; }
30
29
  export interface AsyncForEachOfIterator<T, E = Error> { (item: T, key: number|string, callback: ErrorCallback<E>): void; }
31
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>; }
32
32
  export interface AsyncMemoIterator<T, R, E = Error> { (memo: R | undefined, item: T, callback: AsyncResultCallback<R, E>): void; }
33
33
  export interface AsyncBooleanIterator<T, E = Error> { (item: T, callback: AsyncBooleanResultCallback<E>): void; }
34
34
 
@@ -245,11 +245,26 @@ export function forEachOfLimit<T, E = Error>(obj: IterableCollection<T>, limit:
245
245
  export const eachOf: typeof forEachOf;
246
246
  export const eachOfSeries: typeof forEachOf;
247
247
  export const eachOfLimit: typeof forEachOfLimit;
248
- export function map<T, R, E = Error>(arr: T[] | IterableIterator<T> | Dictionary<T>, iterator: AsyncResultIterator<T, R, E>, callback: AsyncResultArrayCallback<R, E>): void;
249
- 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
+
250
258
  export const mapSeries: typeof map;
251
- export function mapLimit<T, R, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncResultIterator<T, R, E>, callback: AsyncResultArrayCallback<R, E>): void;
252
- 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[]>;
253
268
 
254
269
  export function mapValuesLimit<T, R, E = Error>(
255
270
  obj: Dictionary<T>,
@@ -277,12 +292,14 @@ export const selectLimit: typeof filterLimit;
277
292
  export const reject: typeof filter;
278
293
  export const rejectSeries: typeof filter;
279
294
  export const rejectLimit: typeof filterLimit;
280
- export function reduce<T, R, E = Error>(arr: T[] | IterableIterator<T>, memo: R, iterator: AsyncMemoIterator<T, R, E>, callback?: AsyncResultCallback<R, E>): void;
295
+ export function reduce<T, R, E = Error>(arr: T[] | IterableIterator<T>, memo: R, iterator: AsyncMemoIterator<T, R, E>, callback: AsyncResultCallback<R, E>): void;
296
+ export function reduce<T, R, E = Error>(arr: T[] | IterableIterator<T>, memo: R, iterator: AsyncMemoIterator<T, R, E>): Promise<R>;
281
297
  export const inject: typeof reduce;
282
298
  export const foldl: typeof reduce;
283
299
  export const reduceRight: typeof reduce;
284
300
  export const foldr: typeof reduce;
285
- export function detect<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncResultCallback<T, E>): void;
301
+ export function detect<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncBooleanIterator<T, E>, callback: AsyncResultCallback<T, E>): void;
302
+ export function detect<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncBooleanIterator<T, E>): Promise<T>;
286
303
  export const detectSeries: typeof detect;
287
304
  export function detectLimit<T, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncResultCallback<T, E>): void;
288
305
  export const find: typeof detect;
@@ -302,7 +319,8 @@ export const all: typeof every;
302
319
  export const allSeries: typeof every;
303
320
  export const allLimit: typeof everyLimit;
304
321
 
305
- export function concat<T, R, E = Error>(arr: IterableCollection<T>, iterator: AsyncResultIterator<T, R[], E>, callback?: AsyncResultArrayCallback<R, E>): void;
322
+ export function concat<T, R, E = Error>(arr: IterableCollection<T>, iterator: AsyncResultIterator<T, R[], E>, callback: AsyncResultArrayCallback<R, E>): void;
323
+ export function concat<T, R, E = Error>(arr: IterableCollection<T>, iterator: AsyncResultIterator<T, R[], E>): Promise<R[]>;
306
324
  export function concatLimit<T, R, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncResultIterator<T, R[], E>, callback: AsyncResultArrayCallback<R, E>): void;
307
325
  export function concatLimit<T, R, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncResultIterator<T, R[], E>): Promise<R[]>;
308
326
  export const concatSeries: typeof concat;
@@ -414,11 +432,21 @@ export function reflectAll<T, E = Error>(tasks: Array<AsyncFunction<T, E>>): Arr
414
432
  export function timeout<T, E = Error>(fn: AsyncFunction<T, E>, milliseconds: number, info?: any): AsyncFunction<T, E>;
415
433
  export function timeout<T, R, E = Error>(fn: AsyncResultIterator<T, R, E>, milliseconds: number, info?: any): AsyncResultIterator<T, R, E>;
416
434
 
417
- export function times<T, E = Error>(n: number, iterator: AsyncResultIterator<number, T, E>, callback: AsyncResultArrayCallback<T, E>): void;
418
- export function times<T, E = Error>(n: number, iterator: AsyncResultIterator<number, T, E>): Promise<T>;
435
+ export function times<T, E = Error>(n: number, iterator: (AsyncResultIterator<number, T, E> | AsyncResultIteratorPromise<number, T>), callback: AsyncResultArrayCallback<T, E>): void;
436
+ export function times<T, E = Error>(n: number, iterator: (AsyncResultIterator<number, T, E> | AsyncResultIteratorPromise<number, T>)): Promise<T>;
437
+
419
438
  export const timesSeries: typeof times;
420
- export function timesLimit<T, E = Error>(n: number, limit: number, iterator: AsyncResultIterator<number, T, E>, callback: AsyncResultArrayCallback<T, E>): void;
421
- export function timesLimit<T, E = Error>(n: number, limit: number, iterator: AsyncResultIterator<number, T, E>): Promise<T>;
439
+ export function timesLimit<T, E = Error>(
440
+ n: number,
441
+ limit: number,
442
+ iterator: (AsyncResultIterator<number, T, E> | AsyncResultIteratorPromise<number, T>),
443
+ callback: AsyncResultArrayCallback<T, E>
444
+ ): void;
445
+ export function timesLimit<T, E = Error>(
446
+ n: number,
447
+ limit: number,
448
+ iterator: (AsyncResultIterator<number, T, E> | AsyncResultIteratorPromise<number, T>)
449
+ ): Promise<T>;
422
450
 
423
451
  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;
424
452
  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.10",
3
+ "version": "3.2.13",
4
4
  "description": "TypeScript definitions for Async",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/async",
6
6
  "license": "MIT",
@@ -30,11 +30,6 @@
30
30
  "url": "https://github.com/pascalmartin",
31
31
  "githubUsername": "pascalmartin"
32
32
  },
33
- {
34
- "name": "Dmitri Trofimov",
35
- "url": "https://github.com/Dmitri1337",
36
- "githubUsername": "Dmitri1337"
37
- },
38
33
  {
39
34
  "name": "Etienne Rossignon",
40
35
  "url": "https://github.com/erossignon",
@@ -65,6 +60,6 @@
65
60
  },
66
61
  "scripts": {},
67
62
  "dependencies": {},
68
- "typesPublisherContentHash": "59988f58dbf614557dca35731704e62c7ac12321c056e72f522cfca75059a6c9",
69
- "typeScriptVersion": "3.7"
63
+ "typesPublisherContentHash": "22f27984669b642fb97f4bfad08565120dfd1343e70b2d79ba4d08616f3347f7",
64
+ "typeScriptVersion": "3.9"
70
65
  }