mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-03 06:27:46 +08:00
Added forEach variant returning promise
According to line 731 in [source](http://mongodb.github.io/node-mongodb-native/3.1/api/lib_cursor.js.html), callback is optional and if not provided, the fuction returns Promise
This commit is contained in:
1
types/mongodb/index.d.ts
vendored
1
types/mongodb/index.d.ts
vendored
@@ -1268,6 +1268,7 @@ export class Cursor<T = Default> extends Readable {
|
||||
filter(filter: Object): Cursor<T>;
|
||||
/** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#forEach */
|
||||
forEach(iterator: IteratorCallback<T>, callback: EndCallback): void;
|
||||
forEach(iterator: IteratorCallback<T>): Promise<void>;
|
||||
/** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#hasNext */
|
||||
hasNext(): Promise<boolean>;
|
||||
hasNext(callback: MongoCallback<boolean>): void;
|
||||
|
||||
Reference in New Issue
Block a user