@types/async 3.2.5 → 3.2.9

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 (4) hide show
  1. async/LICENSE +0 -0
  2. async/README.md +1 -1
  3. async/index.d.ts +26 -19
  4. async/package.json +4 -3
async/LICENSE CHANGED
File without changes
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: Mon, 30 Nov 2020 19:12:26 GMT
11
+ * Last updated: Mon, 25 Oct 2021 23:31:43 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `async`
14
14
 
async/index.d.ts CHANGED
@@ -302,7 +302,8 @@ export const allSeries: typeof every;
302
302
  export const allLimit: typeof everyLimit;
303
303
 
304
304
  export function concat<T, R, E = Error>(arr: IterableCollection<T>, iterator: AsyncResultIterator<T, R[], E>, callback?: AsyncResultArrayCallback<R, E>): void;
305
- export function concatLimit<T, R, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncResultIterator<T, R[], E>, callback?: AsyncResultArrayCallback<R, E>): void;
305
+ export function concatLimit<T, R, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncResultIterator<T, R[], E>, callback: AsyncResultArrayCallback<R, E>): void;
306
+ export function concatLimit<T, R, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncResultIterator<T, R[], E>): Promise<R[]>;
306
307
  export const concatSeries: typeof concat;
307
308
 
308
309
  // Control Flow
@@ -340,38 +341,44 @@ export function cargoQueue<T, E = Error>(
340
341
  concurrency?: number,
341
342
  payload?: number,
342
343
  ): QueueObject<T>;
343
- export function auto<R extends Dictionary<any>, E = Error>(tasks: AsyncAutoTasks<R, E>, concurrency?: number, callback?: AsyncResultCallback<R, E>): void;
344
- export function auto<R extends Dictionary<any>, E = Error>(tasks: AsyncAutoTasks<R, E>, callback?: AsyncResultCallback<R, E>): void;
344
+ export function auto<R extends Dictionary<any>, E = Error>(tasks: AsyncAutoTasks<R, E>, concurrency?: number): Promise<R>;
345
+ export function auto<R extends Dictionary<any>, E = Error>(tasks: AsyncAutoTasks<R, E>, concurrency: number, callback: AsyncResultCallback<R, E>): void;
346
+ export function auto<R extends Dictionary<any>, E = Error>(tasks: AsyncAutoTasks<R, E>, callback: AsyncResultCallback<R, E>): void;
345
347
  export function autoInject<E = Error>(tasks: any, callback?: AsyncResultCallback<any, E>): void;
346
348
 
347
- export interface RetryOptions {
348
- times?: number;
349
- interval?: number | ((retryCount: number) => number);
350
- errorFilter?: (error: Error) => boolean;
349
+ export interface RetryOptions<E> {
350
+ times?: number | undefined;
351
+ interval?: number | ((retryCount: number) => number) | undefined;
352
+ errorFilter?: ((error: E) => boolean) | undefined;
351
353
  }
352
354
  export function retry<T, E = Error>(
353
- opts?: number | RetryOptions,
354
- task?: (callback: AsyncResultCallback<T, E>, results: any) => void,
355
- ): Promise<void>;
355
+ task: (() => Promise<T>) | ((callback: AsyncResultCallback<T, E>) => void),
356
+ ): Promise<T>;
356
357
  export function retry<T, E = Error>(
357
- opts?: number | RetryOptions,
358
- task?: (callback: AsyncResultCallback<T, E>, results: any) => void,
359
- callback?: AsyncResultCallback<any, E>,
358
+ opts: number | RetryOptions<E>,
359
+ task: (() => Promise<T>) | ((callback: AsyncResultCallback<T, E>) => void),
360
+ ): Promise<T>;
361
+ export function retry<T, E = Error>(
362
+ task: (() => Promise<T>) | ((callback: AsyncResultCallback<T, E>) => void),
363
+ callback: AsyncResultCallback<T, E>,
364
+ ): void;
365
+ export function retry<T, E = Error>(
366
+ opts: number | RetryOptions<E>,
367
+ task: (() => Promise<T>) | ((callback: AsyncResultCallback<T, E>) => void),
368
+ callback: AsyncResultCallback<T, E>,
360
369
  ): void;
361
370
 
362
371
  export function retryable<T, E = Error>(task: AsyncFunction<T, E>): AsyncFunction<T, E>;
363
372
  export function retryable<T, E = Error>(
364
- opts:
365
- | number
366
- | RetryOptions & {arity?: number},
367
- task: AsyncFunction<T, E>
373
+ opts: number | (RetryOptions<E> & { arity?: number | undefined }),
374
+ task: AsyncFunction<T, E>,
368
375
  ): AsyncFunction<T, E>;
369
376
  export function apply<E = Error>(fn: Function, ...args: any[]): AsyncFunction<any, E>;
370
377
  export function nextTick(callback: Function, ...args: any[]): void;
371
378
  export const setImmediate: typeof nextTick;
372
379
 
373
- export function reflect<T, E = Error>(fn: AsyncFunction<T, E>): (callback: (err: null, result: {error?: E, value?: T}) => void) => void;
374
- export function reflectAll<T, E = Error>(tasks: Array<AsyncFunction<T, E>>): Array<(callback: (err: null, result: {error?: E, value?: T}) => void) => void>;
380
+ export function reflect<T, E = Error>(fn: AsyncFunction<T, E>): (callback: (err: null, result: {error?: E | undefined, value?: T | undefined}) => void) => void;
381
+ export function reflectAll<T, E = Error>(tasks: Array<AsyncFunction<T, E>>): Array<(callback: (err: null, result: {error?: E | undefined, value?: T | undefined}) => void) => void>;
375
382
 
376
383
  export function timeout<T, E = Error>(fn: AsyncFunction<T, E>, milliseconds: number, info?: any): AsyncFunction<T, E>;
377
384
  export function timeout<T, R, E = Error>(fn: AsyncResultIterator<T, R, E>, milliseconds: number, info?: any): AsyncResultIterator<T, R, E>;
async/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@types/async",
3
- "version": "3.2.5",
3
+ "version": "3.2.9",
4
4
  "description": "TypeScript definitions for Async",
5
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/async",
5
6
  "license": "MIT",
6
7
  "contributors": [
7
8
  {
@@ -59,6 +60,6 @@
59
60
  },
60
61
  "scripts": {},
61
62
  "dependencies": {},
62
- "typesPublisherContentHash": "5d3403505c739b80abfffa8203dc15c69212c682e9995f3b0e840012bd4e0ebe",
63
- "typeScriptVersion": "3.3"
63
+ "typesPublisherContentHash": "3c13f25d612c145c9116a228ba5391d96870617945c1981226a0774dc0a98be9",
64
+ "typeScriptVersion": "3.7"
64
65
  }