import type Middleware from '../Middleware.js'; import { BaseError } from './errors.js'; interface MiddlewareRawPage { data: T[]; next: string | null; prev: string | null; } export declare function isMiddlewareRawPage(maybePage: unknown): maybePage is MiddlewareRawPage; /** * @category exception */ export declare class MiddlewarePageMissed extends BaseError { constructor(isNext: boolean); } /** * A wrapper around the middleware's page allowing to get the next/previous pages. */ export declare class MiddlewarePage { #private; readonly data: Item[]; readonly nextPath: null | string; readonly prevPath: null | string; constructor(rawPage: MiddlewareRawPage, middleware: Middleware); /** * Get the next page. * Check the presence of `nextPath` to not fall outside existing pages. * @throws MiddlewarePageMissed */ next(): Promise>; /** * Get the previous page. * Check the presence of `prevPath` to not fall outside existing pages. * @throws MiddlewarePageMissed */ prev(): Promise>; } export {};