Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #9685 from sahasayan/patch-3
Browse files Browse the repository at this point in the history
fix(index.d.ts): allow 2 generic types in mongoose.model function
  • Loading branch information
vkarpov15 committed Dec 9, 2020
2 parents a17a2c3 + 48907ea commit 7a52e45
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.d.ts
Expand Up @@ -99,6 +99,12 @@ declare module "mongoose" {
export function isValidObjectId(v: any): boolean;

export function model<T extends Document>(name: string, schema?: Schema, collection?: string, skipInit?: boolean): Model<T>;
export function model<T extends Document, U extends Model<T>>(
name: string,
schema?: Schema,
collection?: string,
skipInit?: boolean
): U;

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

0 comments on commit 7a52e45

Please sign in to comment.