import type { BlockObjectResponse, Client } from '@notionhq/client'; type RecursiveBlock = BlockObjectResponse & { [key: string]: any; }; export interface PaginatedResponse { results: T[]; next_cursor: string | null; has_more: boolean; } export interface PaginationOptions { maxPages?: number; pageSize?: number; limit?: number; } /** * Fetch all pages automatically */ export declare function autoPaginate(fetchFn: (cursor?: string, pageSize?: number) => Promise>, options?: PaginationOptions): Promise; /** * Simple concurrency queue to manage parallel tasks with a limit. * Supports fail-fast (stops starting new tasks if one fails). */ export declare class ConcurrencyQueue { private readonly limit; private activeCount; private queue; private hasError; constructor(limit: number); run(task: () => Promise): Promise; } /** * Recursively fetch children for blocks that need them (tables, toggles, columns, etc.) * Mutates blocks in-place by attaching children arrays. */ export declare function fetchChildrenRecursive(blocks: RecursiveBlock[], fetchChildren: (blockId: string) => Promise, depth?: number, queue?: ConcurrencyQueue): Promise; /** * Process items in batches with concurrency limit using ConcurrencyQueue */ export declare function processBatches(items: T[], processFn: (item: T) => Promise, options?: { batchSize?: number; concurrency?: number; }): Promise; /** * Recursively fetch and populate children for blocks using auto-pagination */ export declare function populateDeepChildren(notion: Client, blocks: RecursiveBlock[]): Promise; export {}; //# sourceMappingURL=pagination.d.ts.map