Skip to content

Commit

Permalink
Merge pull request #66 from NishargShah/patch-2
Browse files Browse the repository at this point in the history
Added prepaginate string type support for TypeScript
  • Loading branch information
aravindnc authored Dec 3, 2024
2 parents 0c290fb + c6b1dc5 commit e4caa5c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// and LiRen Tu <https://github.com/tuliren> for their contribution

declare module "mongoose" {
type PrePaginatePipelineStage = PipelineStage | '__PREPAGINATE__';

interface CustomLabels<T = string | undefined | boolean> {
totalDocs?: T | undefined;
docs?: T | undefined;
Expand Down Expand Up @@ -64,7 +66,7 @@ declare module "mongoose" {

interface AggregatePaginateModel<D> extends Model<D> {
aggregatePaginate<T>(
query?: Aggregate<T[]>,
query?: Aggregate<T[]> | PrePaginatePipelineStage[],
options?: PaginateOptions,
callback?: (err: any, result: AggregatePaginateResult<T>) => void,
): Promise<AggregatePaginateResult<T>>;
Expand All @@ -85,4 +87,4 @@ declare namespace mongooseAggregatePaginate {

declare namespace _ {
const aggregatePaginate: { options: mongoose.PaginateOptions };
}
}

0 comments on commit e4caa5c

Please sign in to comment.