Skip to content

Commit d909525

Browse files
authored
Merge pull request #12712 from Automattic/vkarpov15/gh-12688
fix(types): avoid typeof Query with generics for TypeScript 4.6 support
2 parents e6bd823 + cfb2785 commit d909525

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

types/query.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ declare module 'mongoose' {
616616
then: Promise<ResultType>['then'];
617617

618618
/** Converts this query to a customized, reusable query constructor with all arguments and options retained. */
619-
toConstructor(): typeof Query<ResultType, DocType, THelpers, RawDocType>;
619+
toConstructor<RetType = typeof Query>(): RetType;
620620

621621
/** Declare and/or execute this query as an update() operation. */
622622
update(filter?: FilterQuery<DocType>, update?: UpdateQuery<DocType> | UpdateWithAggregationPipeline, options?: QueryOptions<DocType> | null, callback?: Callback<UpdateWriteOpResult>): QueryWithHelpers<UpdateWriteOpResult, DocType, THelpers, RawDocType>;

0 commit comments

Comments
 (0)