/** * Generic GraphQL cursor-based paginator for shepherd. * * Both paginators accept a `fetchFn` instead of calling `graphql` directly, * which makes them testable without any mocking — tests supply a pure function * that returns pages of fake data. * * GitHub's GraphQL connections support two cursor directions: * - Forward (`after` + `first`) — used by check contexts and nested thread comments. * - Backward (`before` + `last`) — used by reviewThreads/comments/reviews extra pages * (combined in `batch-page.mts`; `paginateBackward` remains the generic primitive). */ interface PageInfo { hasNextPage?: boolean; hasPreviousPage?: boolean; endCursor?: string | null; startCursor?: string | null; } export interface Connection { pageInfo: PageInfo; nodes: T[]; } /** * Paginate forward through a GraphQL connection (`first` / `after` cursors). * * @param fetchFn Called once per page. Receives the cursor (or null for * the very first page) and returns a Connection. * @param initialCursor Start from this cursor instead of null. Pass the * `endCursor` of an already-fetched page to fetch only * the pages *after* it, avoiding a duplicate re-fetch. */ export declare function paginateForward(fetchFn: (cursor: string | null) => Promise>, initialCursor?: string | null): Promise; /** * Paginate backward through a GraphQL connection (`last` / `before` cursors). * * Used for `reviewThreads(last: 100, before: $before)`. * * @param fetchFn Called once per page. Receives the cursor (or null for * the very first page). Returns a Connection with * `hasPreviousPage` and `startCursor` in pageInfo. * @param initialCursor Start from this cursor instead of null. Pass the * `startCursor` of an already-fetched page to avoid * re-fetching it (fetch only the pages *before* it). */ export declare function paginateBackward(fetchFn: (cursor: string | null) => Promise>, initialCursor?: string | null): Promise; export {};