The per-page response shape.
The cursor type used to request the next page.
The item type the caller wants to iterate.
Function that fetches one page given the current cursor.
Pulls the iterable items out of a page.
Optional abort signal. Checked before each fetch.
An async iterable of individual items.
Async-iterates items by flattening pages. The
extractItemsfunction pulls the relevant array out of each page (e.g.page.files,page.keys,page.parts). Each item is yielded individually so the caller canfor await (const item of paginator)rather than nest loops.Aborts between pages, not between items: if
signalis aborted while the caller is processing the items of page N, the iterator will still yield all of page N's remaining items before checking the signal before fetching page N+1.