export interface PageInfo { endCursor?: string | null; hasNextPage: boolean; } export interface Connection { edges?: Array<{ node: TNode; cursor?: string | null; }> | null; nodes?: TNode[] | null; pageInfo: PageInfo; } export type CursoredOperation = (args: TArgs & { after?: string | null; first?: number | null; }) => Promise; export interface PaginateOptions { pageSize?: number; maxPages?: number; connectionPath?: string[]; } export declare function paginate(operation: CursoredOperation, args: TArgs, options?: PaginateOptions): AsyncGenerator; export declare function collect(operation: CursoredOperation, args: TArgs, options?: PaginateOptions): Promise; /** * Walks cursored pages and yields the full operation result per page. * * Compared to `paginate` (which yields a flat array of nodes), this preserves * the full response shape — `pageInfo`, `totalCount`, custom fields — and * infers types directly from the operation, no generics required at the call * site. * * ```typescript * for await (const page of paginatePages(sdk.SearchCounterparty, { query: "evolve" })) { * console.log(page.searchCounterparty.totalCount); * for (const edge of page.searchCounterparty.edges) { * console.log(edge.node.counterpartyId); * } * } * ``` */ export declare function paginatePages(operation: CursoredOperation, args: TArgs, options?: PaginateOptions): AsyncGenerator; //# sourceMappingURL=paginate.d.ts.map