PagedResult interface

An interface that describes how to communicate with the service.

Properties

byPage

a function to implement the byPage method on the paged async iterator. The default is one that sets the maxPageSizeParam from settings.maxPageSize.

firstPageLink

Link to the first page of results.

getPage

A method that returns a page of results.

toElements

A function to extract elements from a page.

Property Details

byPage

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<TPage>

Property Value

(settings?: TPageSettings) => AsyncIterableIterator<TPage>

Link to the first page of results.

firstPageLink: TLink

Property Value

TLink

getPage

A method that returns a page of results.

getPage: (pageLink: TLink, maxPageSize?: number) => Promise<undefined | { nextPageLink?: TLink, page: TPage }>

Property Value

(pageLink: TLink, maxPageSize?: number) => Promise<undefined | { nextPageLink?: TLink, page: TPage }>

toElements

A function to extract elements from a page.

toElements?: (page: TPage) => unknown[]

Property Value

(page: TPage) => unknown[]