mongoose-paginate-v2
Advanced tools
Comparing version 1.8.4 to 1.8.5
# Changelog | ||
## v1.8.5 | ||
[2024-09-29] | ||
* Fix: correct PaginateDocument type parameters and merge PaginateModel interface | ||
## v1.8.4 | ||
@@ -4,0 +8,0 @@ [2024-09-26] |
@@ -94,3 +94,3 @@ declare module 'mongoose' { | ||
TMethods, | ||
TVirtuals, | ||
TQueryHelpers, | ||
O extends PaginateOptions = {} | ||
@@ -101,3 +101,3 @@ > = O['lean'] extends true | ||
: T | ||
: HydratedDocument<T, TMethods, TVirtuals>; | ||
: HydratedDocument<T, TMethods, TQueryHelpers>; | ||
@@ -111,10 +111,7 @@ interface PaginateModel<T, TQueryHelpers = {}, TMethods = {}> | ||
err: any, | ||
result: PaginateResult<PaginateDocument<T, TMethods, O>> | ||
result: PaginateResult<PaginateDocument<T, TMethods, TQueryHelpers, O>> | ||
) => void | ||
): Promise<PaginateResult<PaginateDocument<T, TMethods, O>>>; | ||
} | ||
): Promise<PaginateResult<PaginateDocument<T, TMethods, TQueryHelpers, O>>>; | ||
interface PaginateModel<T, TQueryHelpers = {}, TMethods = {}> | ||
extends Model<T, TQueryHelpers, TMethods> { | ||
paginate<UserType = T, O extends PaginateOptions = PaginateOptions >( | ||
paginate<UserType = T, O extends PaginateOptions = PaginateOptions>( | ||
query?: FilterQuery<T>, | ||
@@ -124,9 +121,6 @@ options?: O, | ||
err: any, | ||
result: PaginateResult<PaginateDocument<UserType, TMethods, O>> | ||
result: PaginateResult<PaginateDocument<UserType, TMethods, TQueryHelpers, O>> | ||
) => void | ||
): Promise<PaginateResult<PaginateDocument<UserType, TMethods, O>>>; | ||
} | ||
): Promise<PaginateResult<PaginateDocument<UserType, TMethods, TQueryHelpers, O>>>; | ||
interface PaginateModel<T, TQueryHelpers = {}, TMethods = {}> | ||
extends Model<T, TQueryHelpers, TMethods> { | ||
paginate<UserType = T>( | ||
@@ -137,8 +131,7 @@ query?: FilterQuery<T>, | ||
err: any, | ||
result: PaginateResult<PaginateDocument<UserType, TMethods, PaginateOptions>> | ||
result: PaginateResult<PaginateDocument<UserType, TMethods, TQueryHelpers, PaginateOptions>> | ||
) => void | ||
): Promise<PaginateResult<PaginateDocument<UserType, TMethods, PaginateOptions>>>; | ||
): Promise<PaginateResult<PaginateDocument<UserType, TMethods, TQueryHelpers, PaginateOptions>>>; | ||
} | ||
// @ts-expect-error overwriting of mongoose Query interface | ||
interface Query< | ||
@@ -154,9 +147,9 @@ ResultType, | ||
options?: O | ||
): Promise<PaginateResult<PaginateDocument<RawDocType, TInstanceMethods, O>>> | ||
): Promise<PaginateResult<PaginateDocument<RawDocType, TInstanceMethods, THelpers, O>>> | ||
paginate<UserType = ResultType, O extends PaginateOptions = PaginateOptions>( | ||
options?: O | ||
): Promise<PaginateResult<PaginateDocument<UserType, TInstanceMethods, O>>> | ||
): Promise<PaginateResult<PaginateDocument<UserType, TInstanceMethods, THelpers, O>>> | ||
paginate<UserType = ResultType>( | ||
options?: PaginateOptions | ||
): Promise<PaginateResult<PaginateDocument<UserType, TInstanceMethods, PaginateOptions>>> | ||
): Promise<PaginateResult<PaginateDocument<UserType, TInstanceMethods, THelpers, PaginateOptions>>> | ||
} | ||
@@ -163,0 +156,0 @@ } |
{ | ||
"name": "mongoose-paginate-v2", | ||
"version": "1.8.4", | ||
"version": "1.8.5", | ||
"description": "A custom pagination library for Mongoose with customizable labels.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
274819
2046