Updating async times and timesSeries definitions

This commit is contained in:
Jacob Danton
2015-04-19 09:42:48 -07:00
parent e57df787f4
commit 1f3834cb93
3 changed files with 35 additions and 4 deletions
+11
View File
@@ -106,6 +106,17 @@ async.series<number>({
},
function (err, results) { });
async.times(5, function(n, next) {
next(null, n)
}, function(err, results) {
console.log(results)
})
async.timesSeries(5, function(n, next) {
next(null, n)
}, function(err, results) {
console.log(results)
})
async.parallel([
function (callback) {
+3 -4
View File
@@ -1,4 +1,4 @@
// Type definitions for Async 0.1.23
// Type definitions for Async 0.9.2
// Project: https://github.com/caolan/async
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -9,7 +9,6 @@ interface ErrorCallback { (err?: Error): void; }
interface AsyncResultCallback<T> { (err: Error, result: T): void; }
interface AsyncResultArrayCallback<T> { (err: Error, results: T[]): void; }
interface AsyncResultObjectCallback<T> { (err: Error, results: Dictionary<T>): void; }
interface AsyncTimesCallback<T> { (n: number, callback: AsyncResultArrayCallback<T>): void; }
interface AsyncIterator<T> { (item: T, callback: ErrorCallback): void; }
interface AsyncResultIterator<T, R> { (item: T, callback: AsyncResultCallback<R>): void; }
@@ -105,8 +104,8 @@ interface Async {
apply(fn: Function, ...arguments: any[]): AsyncFunction<any>;
nextTick(callback: Function): void;
times<T> (n: number, callback: AsyncTimesCallback<T>): void;
timesSeries<T> (n: number, callback: AsyncTimesCallback<T>): void;
times<R> (n: number, iterator: AsyncResultIterator<number, R>, callback: AsyncResultArrayCallback<R>): void;
timesSeries<R> (n: number, iterator: AsyncResultIterator<number, R>, callback: AsyncResultArrayCallback<R>): void;
// Utils
memoize(fn: Function, hasher?: Function): Function;
+21
View File
@@ -0,0 +1,21 @@
{
"version": "1.4.1",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false
},
"filesGlob": [
"./**/*.ts",
"!./node_modules/**/*.ts"
],
"files": [
"./async-explicit-tests.ts",
"./async-tests.ts",
"./async.d.ts",
"./asyncamd-tests.ts"
]
}