Skip to content

Commit 0015765

Browse files
committed
fix(index.d.ts): work around #9969 for #9850
1 parent 964dfd5 commit 0015765

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ declare module 'mongoose' {
9999
*/
100100
export function isValidObjectId(v: any): boolean;
101101

102-
export function model<T extends Document, TQueryHelpers = {}>(name: string, schema?: Schema<any>, collection?: string, skipInit?: boolean): Model<T, TQueryHelpers>;
102+
export function model<T extends Document>(name: string, schema?: Schema<any>, collection?: string, skipInit?: boolean): Model<T>;
103103
export function model<T extends Document, U extends Model<T, TQueryHelpers>, TQueryHelpers = {}>(
104104
name: string,
105105
schema?: Schema<T, U>,

test/typescript/queries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface ITest extends Document {
1717
tags?: string[];
1818
}
1919

20-
const Test = model<ITest, QueryHelpers>('Test', schema);
20+
const Test = model<ITest, Model<ITest, QueryHelpers>>('Test', schema);
2121

2222
Test.find().byName('test').orFail().exec().then(console.log);
2323

0 commit comments

Comments
 (0)