Skip to content

Commit 48907ea

Browse files
authoredDec 8, 2020
fix(index.d.ts): allow 2 generic types in mongoose.model function
1 parent a17a2c3 commit 48907ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎index.d.ts

+6
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ declare module "mongoose" {
9999
export function isValidObjectId(v: any): boolean;
100100

101101
export function model<T extends Document>(name: string, schema?: Schema, collection?: string, skipInit?: boolean): Model<T>;
102+
export function model<T extends Document, U extends Model<T>>(
103+
name: string,
104+
schema?: Schema,
105+
collection?: string,
106+
skipInit?: boolean
107+
): U;
102108

103109
/** Returns an array of model names created on this instance of Mongoose. */
104110
export function modelNames(): Array<string>;

0 commit comments

Comments
 (0)
Please sign in to comment.