Skip to content

Commit

Permalink
Merge pull request #12712 from Automattic/vkarpov15/gh-12688
Browse files Browse the repository at this point in the history
fix(types): avoid typeof Query with generics for TypeScript 4.6 support
  • Loading branch information
vkarpov15 authored Nov 23, 2022
2 parents e6bd823 + cfb2785 commit d909525
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/query.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ declare module 'mongoose' {
then: Promise<ResultType>['then'];

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

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

0 comments on commit d909525

Please sign in to comment.