@leopiccionia/numista-sdk / Exports / PaginatedResult
Class: PaginatedResult<Req, Res>
A paginated response
Type parameters
Name | Type |
---|---|
Req |
extends PaginatedRequest |
Res |
extends PaginatedResponse |
Table of contents
Accessors
Methods
Accessors
count
• get
count(): number
Total number of items
Returns
number
data
• get
data(): Omit
<Res
, "count"
>
All items already fetched
Returns
Omit
<Res
, "count"
>
page
• get
page(): number
Last fetched page
Returns
number
Methods
[Symbol.asyncIterator]
▸ [asyncIterator](): AsyncGenerator
<Omit
<Res
, "count"
>, any
, unknown
>
Fetch and iterate through all missing pages
Returns
AsyncGenerator
<Omit
<Res
, "count"
>, any
, unknown
>
The async iterator
collect
▸ collect(): Promise
<Omit
<Res
, "count"
>>
Fetch all missing pages
Returns
Promise
<Omit
<Res
, "count"
>>
All items
hasNext
▸ hasNext(): boolean
If there are items still unfetched
Returns
boolean
next
▸ next(): Promise
<Res
>
Fetch next page
Returns
Promise
<Res
>
The next page