caolan/async: add missing optional type to 'retry' (#9506)

* async: add function type to interval of 'retry'

* fix return type number
This commit is contained in:
Steve Van Opstal
2016-06-03 00:26:29 +09:00
committed by Masahiro Wakame
parent 18ae8e8b46
commit 2901b0c3c4
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -378,6 +378,7 @@ async.auto({
async.retry(3, function (callback, results) { }, function (err, result) { });
async.retry({ times: 3, interval: 200 }, function (callback, results) { }, function (err, result) { });
async.retry({ times: 3, interval: (retryCount) => { return 200 * retryCount; } }, function (callback, results) { }, function (err, result) { });
async.parallel([
+1 -1
View File
@@ -136,7 +136,7 @@ interface Async {
cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo;
auto(tasks: any, callback?: (error: Error, results: any) => void): void;
retry<T>(opts: number, task: (callback : AsyncResultCallback<T>, results: any) => void, callback: (error: Error, results: any) => void): void;
retry<T>(opts: { times: number, interval: number }, task: (callback: AsyncResultCallback<T>, results : any) => void, callback: (error: Error, results: any) => void): void;
retry<T>(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback<T>, results : any) => void, callback: (error: Error, results: any) => void): void;
iterator(tasks: Function[]): Function;
apply(fn: Function, ...arguments: any[]): AsyncFunction<any>;
nextTick(callback: Function): void;