// Type definitions for mongoose-paginate 5.0.0 // Project: https://github.com/edwardhotchkiss/mongoose-paginate // Definitions by: Linus Brolin , simonxca // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// declare module 'mongoose' { export interface PaginateOptions { select?: Object | string; sort?: Object | string; populate?: Array | Array | Object | string; lean?: boolean; leanWithId?: boolean; offset?: number; page?: number; limit?: number; } export interface PaginateResult { docs: Array; total: number; limit: number; page?: number; pages?: number; offset?: number; } export type PaginateModel = _PaginateModel & Model; interface _PaginateModel { paginate(query?: Object, options?: PaginateOptions, callback?: (err: any, result: PaginateResult) => void): Promise>; } export function model( name: string, schema?: Schema, collection?: string, skipInit?: boolean): Statics & PaginateModel; } declare module 'mongoose-paginate' { import mongoose = require('mongoose'); var _: (schema: mongoose.Schema) => void; export = _; }