orb-billing
Version:
The official TypeScript library for the Orb API
31 lines • 1.09 kB
TypeScript
import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from "./core.js";
export interface PageResponse<Item> {
data: Array<Item>;
pagination_metadata: PageResponse.PaginationMetadata;
}
export declare namespace PageResponse {
interface PaginationMetadata {
has_more: boolean;
next_cursor: string | null;
}
}
export interface PageParams {
/**
* Cursor for pagination. This can be populated by the `next_cursor` value returned
* from the initial request.
*/
cursor?: string | null;
/**
* The number of items to fetch. Defaults to 20.
*/
limit?: number;
}
export declare class Page<Item> extends AbstractPage<Item> implements PageResponse<Item> {
data: Array<Item>;
pagination_metadata: PageResponse.PaginationMetadata;
constructor(client: APIClient, response: Response, body: PageResponse<Item>, options: FinalRequestOptions);
getPaginatedItems(): Item[];
nextPageParams(): Partial<PageParams> | null;
nextPageInfo(): PageInfo | null;
}
//# sourceMappingURL=pagination.d.ts.map