/** * Auto-pagination utility for WHOOP API collection endpoints. * * Follows `next_token` across multiple pages with rate-limit safety guards: * - Hard cap on total records (ABSOLUTE_MAX_RECORDS = 500) * - Configurable max pages (default 20) * - Inter-page delay to respect rate limits (default 200ms) * - AbortSignal support for cancellation */ import type { WhoopClient } from "./client.js"; /** Absolute maximum records — cannot be overridden by caller */ export declare const ABSOLUTE_MAX_RECORDS = 500; /** Options for fetchAllPages */ export interface FetchAllPagesOptions { /** Maximum number of records to return (capped at ABSOLUTE_MAX_RECORDS). Default: 100 */ maxRecords?: number; /** Maximum number of pages to fetch. Default: 20 */ maxPages?: number; /** Delay between page fetches in milliseconds. Default: 200 */ interPageDelayMs?: number; /** AbortSignal for cancellation */ signal?: AbortSignal; } /** Result from fetchAllPages */ export interface FetchAllPagesResult { /** Collected records from all pages */ records: T[]; /** True if pagination was stopped before exhausting all pages */ truncated: boolean; } /** * Fetch all pages from a paginated WHOOP API endpoint. * * Follows `next_token` until exhausted or a safety cap is hit. * Returns collected records and whether pagination was truncated. * * @param client - WHOOP API client * @param path - Endpoint path (may include query params) * @param options - Pagination options */ export declare function fetchAllPages(client: WhoopClient, path: string, options?: FetchAllPagesOptions): Promise>; //# sourceMappingURL=pagination.d.ts.map