Skip to content

Commit 01ffe2f

Browse files
authored
Merge pull request #9968 from emiljanitzek/feature/plugin-schema-type
fix: Add generic to plugin schema definition
2 parents 8605e1e + b24b917 commit 01ffe2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ declare module 'mongoose' {
11231123
pathType(path: string): string;
11241124

11251125
/** Registers a plugin for this schema. */
1126-
plugin(fn: (schema: Schema, opts?: any) => void, opts?: any): this;
1126+
plugin(fn: (schema: Schema<DocType, Model<DocType>, SchemaDefinitionType>, opts?: any) => void, opts?: any): this;
11271127

11281128
/** Defines a post hook for the model. */
11291129
post<T extends Document = DocType>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: (this: T, res: any, next: (err?: CallbackError) => void) => void): this;

0 commit comments

Comments
 (0)