Skip to content

Commit

Permalink
fix(types): make PluginFunction slightly more strict re: comments on #…
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Sep 30, 2022
1 parent 8a51439 commit 2b0d429
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ declare module 'mongoose' {
pathType(path: string): string;

/** Registers a plugin for this schema. */
plugin<PFunc extends PluginFunction<any, any, any, any, any, any>, POptions extends Parameters<PFunc>[1] = Parameters<PFunc>[1]>(fn: PFunc, opts?: POptions): this;
plugin<PFunc extends PluginFunction<DocType, M, any, any, any, any>, POptions extends Parameters<PFunc>[1] = Parameters<PFunc>[1]>(fn: PFunc, opts?: POptions): this;

/** Defines a post hook for the model. */
post<T = HydratedDocument<DocType, TInstanceMethods>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T, T>): this;
Expand Down

0 comments on commit 2b0d429

Please sign in to comment.