mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
changed types of document.save() and remove() to this
This commit is contained in:
Vendored
+3
-3
@@ -2303,13 +2303,13 @@ declare module "mongoose" {
|
||||
* Returns another Model instance.
|
||||
* @param name model name
|
||||
*/
|
||||
model<T extends Document>(name: string): Model<T>;
|
||||
model(name: string): Model<this>;
|
||||
|
||||
/**
|
||||
* Removes this document from the db.
|
||||
* @param fn optional callback
|
||||
*/
|
||||
remove<T extends Document>(fn?: (err: any, product: T) => void): _MongoosePromise<T>;
|
||||
remove(fn?: (err: any, product: this) => void): _MongoosePromise<this>;
|
||||
|
||||
/**
|
||||
* Saves this document.
|
||||
@@ -2318,7 +2318,7 @@ declare module "mongoose" {
|
||||
* @param options.validateBeforeSave set to false to save without validating.
|
||||
* @param fn optional callback
|
||||
*/
|
||||
save<T extends Document>(fn?: (err: any, product: T, numAffected: number) => void): _MongoosePromise<T>;
|
||||
save(fn?: (err: any, product: this, numAffected: number) => void): _MongoosePromise<this>;
|
||||
|
||||
/** Base Mongoose instance the model uses. */
|
||||
base: typeof mongoose;
|
||||
|
||||
Reference in New Issue
Block a user