mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Updating async times and timesSeries definitions
This commit is contained in:
@@ -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) {
|
||||
|
||||
Vendored
+3
-4
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user