Skip to content

Commit

Permalink
fix(types::QueryHelperThis): provide generic "RawDocType"
Browse files Browse the repository at this point in the history
this does not fix #870, but will in the future if mongoose fixes it in types

re #870
  • Loading branch information
hasezoey committed Nov 12, 2023
1 parent 29a7166 commit 74cdf28
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/types.ts
Expand Up @@ -604,11 +604,10 @@ export type AsQueryMethod<T extends (...args: any) => any> = (...args: Parameter
* }
*/
export type QueryHelperThis<
// TODO: consider replacing T directly with S
T extends AnyParamConstructor<any>,
QueryHelpers,
S = DocumentType<InstanceType<T>, QueryHelpers>,
> = mongoose.QueryWithHelpers<S | null, S, QueryHelpers>;
> = mongoose.QueryWithHelpers<S | null, S, QueryHelpers, InstanceType<T>>;

/**
* Type for the Values stored in the Reflection for Query Methods
Expand Down

0 comments on commit 74cdf28

Please sign in to comment.