Skip to content

Commit

Permalink
fix(types): fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
maddocnc committed Oct 23, 2023
1 parent 2e33df2 commit 8dbe776
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions src/paginated-model.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
import {PaginatedResult} from "./paginated-result";
import {PaginationOptions} from "./pagination-options";
import {Model} from "mongoose";
import {
type AggregateOptions,
type FilterQuery,
type Model,
type PipelineStage,
type ProjectionType,
type QueryOptions,
} from 'mongoose'

import { type PaginatedResult } from './paginated-result'
import { type PaginationOptions } from './pagination-options'

export interface PaginatedModel<T> extends Model<T> {
paginate(
options?: PaginationOptions<T>,
onError?: Function
): Promise<PaginatedResult<T> | undefined>
findPaginated(
filter: FilterQuery<T>,
pagination: PaginationOptions<T>,
projection?: ProjectionType<T> | null,
options?: QueryOptions<T> | null
): Promise<PaginatedResult<T>>
aggregatePaginated(
pipeline: PipelineStage[],
paginate: PaginationOptions<T>,
options?: AggregateOptions
): Promise<PaginatedResult<T>>
}

0 comments on commit 8dbe776

Please sign in to comment.