Skip to content

Commit

Permalink
fix(types): avoid typeof Query with generics for TypeScript 4.6 support
Browse files Browse the repository at this point in the history
Fix #12688
  • Loading branch information
vkarpov15 committed Nov 21, 2022
1 parent 15c0068 commit cfb2785
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/query.d.ts
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 cfb2785

Please sign in to comment.