Skip to content

Commit 7d72a9d

Browse files
authoredFeb 28, 2022
Merge pull request #161 from kerolloz/patch-1
Fix typescript types (adds support for Mongoose 6)
2 parents 08a9160 + baa717b commit 7d72a9d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎index.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ declare module 'mongoose' {
2020

2121
interface PaginateOptions {
2222
select?: object | string | undefined;
23-
collation?: import('mongodb').CollationDocument | undefined;
23+
collation?: import('mongodb').CollationOptions | undefined;
2424
sort?: object | string | undefined;
2525
populate?:
2626
| PopulateOptions[]
@@ -65,12 +65,13 @@ declare module 'mongoose' {
6565
type PaginateDocument<
6666
T,
6767
TMethods,
68+
TVirtuals,
6869
O extends PaginateOptions = {}
6970
> = O['lean'] extends true
7071
? O['leanWithId'] extends true
7172
? LeanDocument<T & { id: string }>
7273
: LeanDocument<T>
73-
: EnforceDocument<T, TMethods>;
74+
: HydratedDocument<T, TMethods, TVirtuals>;
7475

7576
interface PaginateModel<T, TQueryHelpers = {}, TMethods = {}>
7677
extends Model<T, TQueryHelpers, TMethods> {

0 commit comments

Comments
 (0)
Please sign in to comment.