/** * An interface that tracks the settings for paged iteration */ export interface PageSettings { /** * The token that keeps track of where to continue the iterator */ continuationToken?: string; /** * The size of the page during paged iteration */ maxPageSize?: number; } /** * An interface that allows async iterable iteration both to completion and by page. */ export interface PagedAsyncIterableIterator { /** * The next method, part of the iteration protocol */ next(): Promise>; /** * The connection to the async iterator, part of the iteration protocol */ [Symbol.asyncIterator](): PagedAsyncIterableIterator; /** * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings?: TPageSettings) => AsyncIterableIterator; } /** * An interface that describes how to communicate with the service. */ export interface PagedResult { /** * Link to the first page of results. */ firstPageLink: TLink; /** * A method that returns a page of results. */ getPage: (pageLink: TLink, maxPageSize?: number) => Promise<{ page: TPage; nextPageLink?: TLink; } | undefined>; /** * a function to implement the `byPage` method on the paged async iterator. The default is * one that sets the `maxPageSizeParam` from `settings.maxPageSize`. */ byPage?: (settings?: TPageSettings) => AsyncIterableIterator; /** * A function to extract elements from a page. */ toElements?: (page: TPage) => unknown[]; } /** * Paged collection of T items */ export type Paged = { /** * The T items on this page */ value: T[]; /** * The link to the next page of items */ nextLink?: string; }; //# sourceMappingURL=models.d.ts.map