import type { UmbDataSourceResponse } from '../data-source-response.interface.js'; import type { UmbPagedModel } from '../types.js'; /** * A function that returns a single page of an offset-paginated collection. * @template T - The type of items in the page. */ export type UmbOffsetPageFetcher = (skip: number, take: number) => Promise>>; /** * Pages through an offset-paginated data source, accumulating every item until `total` has been reached. * Use when a caller genuinely needs the full set rather than a single page — for example, populating a * dropdown of every configured language. Returns the same `{ data: { items, total } }` shape as a * single-page fetch, or `{ error }` if any page fails. * * If the server reports a higher `total` than it actually delivers — i.e. an empty page is returned * before `allItems.length` reaches `total` — the function fails with an error rather than silently * truncating, since a partial "fetch all" result would mislead the caller. * @param {UmbOffsetPageFetcher} fetchPage - Called once per page with the current `skip` and `take`. * @param {number} take - Page size used for every request. Must be a positive finite number. * @returns {Promise} A promise resolving to all items, or the first error encountered. * @throws {RangeError} If `take` is not a positive finite number. */ export declare function fetchAllPages(fetchPage: UmbOffsetPageFetcher, take: number): Promise>>;