mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Merge pull request #30754 from wosevision/mongoose-posthook-overload
Mongoose posthook overload
This commit is contained in:
Vendored
+2
-2
@@ -811,11 +811,11 @@ declare module "mongoose" {
|
||||
* @param fn callback
|
||||
*/
|
||||
post<T extends Document>(method: string, fn: (
|
||||
error: mongodb.MongoError, doc: T, next: (err?: NativeError) => void
|
||||
doc: T, next: (err?: NativeError) => void
|
||||
) => void): this;
|
||||
|
||||
post<T extends Document>(method: string, fn: (
|
||||
doc: T, next: (err?: NativeError) => void
|
||||
error: mongodb.MongoError, doc: T, next: (err?: NativeError) => void
|
||||
) => void): this;
|
||||
|
||||
/**
|
||||
|
||||
@@ -491,12 +491,12 @@ preHookTestSchemaArr.push(
|
||||
);
|
||||
|
||||
schema
|
||||
.post('save', function (error, doc, next) {
|
||||
.post('save', function (error: mongoose.Error, doc: mongoose.Document, next: (err?: mongoose.NativeError) => void) {
|
||||
error.stack;
|
||||
doc.model;
|
||||
next.apply;
|
||||
})
|
||||
.post('save', function (doc: mongoose.Document, next: Function) {
|
||||
.post('save', function (doc: mongoose.Document, next: (err?: mongoose.NativeError) => void) {
|
||||
doc.model;
|
||||
next(new Error());
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user