import type { PaginatedResult } from '../types/twitter.js'; export interface PaginationOptions { all?: boolean; maxPages?: number; resume?: string; delay?: number; silent?: boolean; } export interface CursorState { cursor?: string; pagesFetched: number; totalItems: number; lastUpdated: string; query?: string; } export interface PaginationProgress { page: number; items: number; total: number; cursor?: string; } type FetchPage = (cursor?: string) => Promise>; export declare class Paginator { private options; private spinner; private state; constructor(options?: PaginationOptions); /** * Load cursor state from resume file */ loadState(resumeFile?: string): CursorState | null; /** * Save cursor state to resume file */ saveState(cursor?: string, additionalData?: Record): void; /** * Clear resume file on successful completion */ clearState(): void; /** * Fetch all pages with progress tracking */ fetchAll(fetchFn: FetchPage, onProgress?: (progress: PaginationProgress) => void): Promise<{ items: T[]; pagesLoaded: number; complete: boolean; }>; /** * Stream pages one at a time (generator pattern) */ stream(fetchFn: FetchPage): AsyncGenerator<{ items: T[]; page: number; cursor?: string; hasMore: boolean; }>; private getSpinnerText; private isRateLimitError; private extractRateLimitWait; private sleep; } /** * Convenience function for simple pagination */ export declare function fetchAllPages(fetchFn: FetchPage, options?: PaginationOptions): Promise; /** * Create pagination options from CLI flags */ export declare function createPaginationOptions(cliOptions: { all?: boolean; maxPages?: string; resume?: string; delay?: string; }): PaginationOptions; export {}; //# sourceMappingURL=pagination.d.ts.map