/** * Generic pagination utilities for collecting results across multiple pages. * * Works with both Ably SDK PaginatedResult and Chat SDK PaginatedResult * (same interface: items, hasNext(), next()). */ export interface PaginationResult { items: T[]; hasMore: boolean; pagesConsumed: number; } export interface PaginationNext { hint: string; start?: string; } /** * Build a `next` object for JSON output when `hasMore` is true. * For history commands, pass `lastTimestamp` to include a `start` value * that users can pass to `--start` to continue from where they left off. */ export declare function buildPaginationNext(hasMore: boolean, lastTimestamp?: Date | number): PaginationNext | undefined; /** * Returns a pagination message when multiple pages were fetched, or empty string if only one page. * When isBillable is true, returns a warning with billing note; otherwise returns a plain info line. */ export declare function formatPaginationLog(pagesConsumed: number, itemCount: number, isBillable?: boolean): string; interface PaginatedPage { items: T[]; hasNext(): boolean; next(): Promise | null>; } /** * Collect items from a paginated result until the limit is reached or no more pages. * Truncates to `limit` items and reports whether more data exists. */ export declare function collectPaginatedResults(firstPage: PaginatedPage, limit: number): Promise>; /** * Collect filtered items from paginated results. Keeps fetching pages until enough * items matching the filter are found, with a max-pages safety cap. */ export declare function collectFilteredPaginatedResults(firstPage: PaginatedPage, limit: number, filter: (item: T) => boolean, maxPages?: number): Promise>; export {};