@oneplatform/sdk / PaginatedIterable
Interface: PaginatedIterable\<T>¶
Defined in: packages/sdk/src/pagination/paginator.ts:24
PaginatedIterable extends AsyncIterable
Extends¶
AsyncIterable\<Page\<T>>
Type Parameters¶
T¶
T
Methods¶
[asyncIterator]()¶
[asyncIterator]():
AsyncIterator\<Page\<T>,any,any>
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts:38
Returns¶
AsyncIterator\<Page\<T>, any, any>
Inherited from¶
AsyncIterable.[asyncIterator]
collect()¶
collect(
maxItems?):Promise\<T[]>
Defined in: packages/sdk/src/pagination/paginator.ts:32
Collect all items across all pages into a flat array. Throws PaginationLimitError if more than maxItems items exist and there are still pages remaining, preventing unbounded memory use.
Parameters¶
maxItems?¶
number
Hard cap. Default: 10000.
Returns¶
Promise\<T[]>
firstPage()¶
firstPage():
Promise\<Page\<T>>
Defined in: packages/sdk/src/pagination/paginator.ts:41
Return the first page without continuing iteration.
Returns¶
Promise\<Page\<T>>
take()¶
take(
n):Promise\<T[]>
Defined in: packages/sdk/src/pagination/paginator.ts:38
Collect exactly n items, stopping pagination early once collected. Returns fewer items when the total collection is smaller than n.
Parameters¶
n¶
number
Returns¶
Promise\<T[]>