Open
Description
Describe the bug
Property 'paginateSubDocs' does not exist while paginate works correctly when using mongoose-paginate-v2 in a typescript project
To Reproduce
Add mongoose-paginate-v2 to a typescript project
Add it as a plugin to one of the schema
Add PaginateModel as an extenion of your model
Call paginateSubDocs (For exemple User.paginateSubDocs(...))
Expected behavior
paginateSubDocs should be a recognized method of type PaginateModel
Additional context
I think the solution is to add the method declaration in the file index.d.ts inside of the interface paginateModel in line 102 because the only declared method here is paginate
interface PaginateModel<T, TQueryHelpers = {}, TMethods = {}>
extends Model<T, TQueryHelpers, TMethods> {
paginate<O extends PaginateOptions>(
query?: FilterQuery<T>,
options?: O,
callback?: (
err: any,
result: PaginateResult<PaginateDocument<T, TMethods, O>>
) => void
): Promise<PaginateResult<PaginateDocument<T, TMethods, O>>>;
}
Metadata
Metadata
Assignees
Labels
No labels