import type { Logger } from "@bluecadet/launchpad-utils/logger"; export type FetchPaginatedOptions = { /** * The number of items to fetch per page */ limit: number; /** * The maximum number of pages to fetch. If this is reached, the fetch will be terminated early. */ maxFetchCount?: number; /** * A function that takes a params object and returns a ResultAsync of an array of T. To indicate the end of pagination, return an empty array, or null. */ fetchPageFn: (params: { limit: number; offset: number; }) => Promise; /** * A logger instance */ logger: Logger; /** * Whether to merge pages into a single array. Defaults to false. */ mergePages?: Merge; }; /** * Handles paginated fetching. Returns an async iterable, unless mergePages is true in which case it returns a flattened array. */ export declare function fetchPaginated({ fetchPageFn, limit, logger, maxFetchCount, mergePages, }: FetchPaginatedOptions): Merge extends true ? Promise : AsyncGenerator; //# sourceMappingURL=fetch-paginated.d.ts.map