auth0
Version:
Auth0 Node.js SDK for the Management API v2.
34 lines (33 loc) • 1.01 kB
text/typescript
import type { HttpResponsePromise, RawResponse } from "../fetcher/index.mjs";
/**
* A page of results from a paginated API.
*
* @template T The type of the items in the page.
* @template R The type of the API response.
*/
export declare class Page<T, R = unknown> implements AsyncIterable<T> {
data: T[];
rawResponse: RawResponse;
response: R;
private _hasNextPage;
private getItems;
private loadNextPage;
constructor({ response, rawResponse, hasNextPage, getItems, loadPage, }: {
response: R;
rawResponse: RawResponse;
hasNextPage: (response: R) => boolean;
getItems: (response: R) => T[];
loadPage: (response: R) => HttpResponsePromise<R>;
});
/**
* Retrieves the next page
* @returns this
*/
getNextPage(): Promise<this>;
/**
* @returns whether there is a next page to load
*/
hasNextPage(): boolean;
private iterMessages;
[Symbol.asyncIterator](): AsyncIterator<T, void, any>;
}