Skip to content

Commit 20f9b1a

Browse files
Update index.d.ts
Fixed #15780
1 parent 70b5a30 commit 20f9b1a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

types/index.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,8 @@ declare module 'mongoose' {
622622
set<K extends keyof SchemaOptions>(key: K, value: SchemaOptions<DocType>[K], _tags?: any): this;
623623

624624
/** Adds static "class" methods to Models compiled from this schema. */
625-
static<K extends keyof TStaticMethods>(name: K, fn: TStaticMethods[K]): this;
626-
static(obj: { [F in keyof TStaticMethods]: TStaticMethods[F] }): this;
627-
static(obj: { [F in keyof TStaticMethods]: TStaticMethods[F] } & { [name: string]: (this: TModelType, ...args: any[]) => any }): this;
625+
static<K extends keyof TStaticMethods>(name: K, fn: TStaticMethods[K] & ((this: TModelType, ...args: any[]) => any)): this;
626+
static(obj: Partial<TStaticMethods> & { [name: string]: (this: TModelType, ...args: any[]) => any }): this;
628627
static(name: string, fn: (this: TModelType, ...args: any[]) => any): this;
629628

630629
/** Object of currently defined statics on this schema. */

0 commit comments

Comments
 (0)