import type { PageSettings, PagedAsyncIterableIterator } from "@azure/core-paging"; import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; import type { KnownApiVersions } from "../models/models.js"; /** * An interface that describes a page of results. */ export type ContinuablePage = TPage & { /** * The token that keeps track of where to continue the iterator */ continuationToken?: string; }; /** * An interface that describes how to communicate with the service. */ export interface PagedResult { /** * Link to the first page of results. */ firstPageLink?: string; /** * A method that returns a page of results. */ getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string; } | undefined>; /** * a function to implement the `byPage` method on the paged async iterator. */ byPage?: (settings?: TPageSettings) => AsyncIterableIterator>; /** * A function to extract elements from a page. */ toElements?: (page: TPage) => TElement[]; } /** * Options for the paging helper */ export interface BuildPagedAsyncIteratorOptions { itemName?: string; nextLinkName?: string; nextLinkMethod?: "GET" | "POST"; apiVersion?: KnownApiVersions; nextPageRequestOptions?: Record; } /** * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator */ export declare function buildPagedAsyncIterator(client: Client, getInitialResponse: () => PromiseLike, processResponseBody: (result: TResponse) => PromiseLike, expectedStatuses: string[], options?: BuildPagedAsyncIteratorOptions): PagedAsyncIterableIterator; //# sourceMappingURL=pagingHelpers.d.ts.map