mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 05:20:25 +00:00
fixes return types of some promises that were missed
This commit is contained in:
@@ -1024,6 +1024,31 @@ mongoose.model('')
|
||||
arg.b.toFixed;
|
||||
});
|
||||
|
||||
mongoose.model('').findOne({})
|
||||
.then(function (arg) {
|
||||
arg.save;
|
||||
return 2;
|
||||
}).then(function (num) {
|
||||
num.toFixed;
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
resolve('str');
|
||||
});
|
||||
}).then(function (str) {
|
||||
str.toLowerCase;
|
||||
});
|
||||
|
||||
mongoose.model('').aggregate()
|
||||
.then(function (arg) {
|
||||
return 2;
|
||||
}).then(function (num) {
|
||||
num.toFixed;
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
resolve('str');
|
||||
});
|
||||
}).then(function (str) {
|
||||
str.toLowerCase;
|
||||
});
|
||||
|
||||
/* pluggable promise */
|
||||
mongoose.Promise = Promise;
|
||||
mongoose.Promise.race;
|
||||
|
||||
Vendored
+5
-3
@@ -1307,7 +1307,7 @@ declare module "mongoose" {
|
||||
* resolved with either the doc(s) or rejected with the error.
|
||||
* Like .then(), but only takes a rejection handler.
|
||||
*/
|
||||
catch(reject?: (err: any) => void): Promise<T>;
|
||||
catch<TRes>(reject?: (err: any) => void | TRes | PromiseLike<TRes>): Promise<TRes>;
|
||||
|
||||
/**
|
||||
* DEPRECATED Alias for circle
|
||||
@@ -1651,7 +1651,8 @@ declare module "mongoose" {
|
||||
}): this;
|
||||
|
||||
/** Executes this query and returns a promise */
|
||||
then(resolve?: (res: T) => void, reject?: (err: any) => void): Promise<T>;
|
||||
then<TRes>(resolve?: (res: T) => void | TRes | PromiseLike<TRes>,
|
||||
reject?: (err: any) => void | TRes | PromiseLike<TRes>): Promise<TRes>;
|
||||
|
||||
/**
|
||||
* Converts this query to a customized, reusable query
|
||||
@@ -2071,7 +2072,8 @@ declare module "mongoose" {
|
||||
sort(arg: string | Object): this;
|
||||
|
||||
/** Provides promise for aggregate. */
|
||||
then(resolve?: (val: T) => void, reject?: (err: any) => void): Promise<T>
|
||||
then<TRes>(resolve?: (val: T) => void | TRes | PromiseLike<TRes>,
|
||||
reject?: (err: any) => void | TRes | PromiseLike<TRes>): Promise<TRes>
|
||||
|
||||
/**
|
||||
* Appends new custom $unwind operator(s) to this aggregate pipeline.
|
||||
|
||||
Reference in New Issue
Block a user