API/PaginatedResult
PaginatedResult
src/types/paginated-result.type.tstype
One page of rows as a plain object — what PaginatedCollection.toPlain()
returns.
Carries the same fields as PaginatedCollection, in a shape that can cross
a serialisation boundary such as a React Server Component handing props to
a Client Component:
- it is an object literal, not a class instance;
- a field the backend did not report is
nullrather thanundefined, soJSON.stringifykeeps every key.
Rows are passed through as the response held them, so the whole object is JSON-safe exactly when they are — as rows parsed from a JSON body always are.
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
data |
T[] |
The rows on this page |
firstPageUrl |
string | null |
URL of the first page, when the backend reports links |
from |
number | null |
Position of the first row on this page within the whole result set, 1-based |
lastPage |
number | null |
Number of the last page |
lastPageUrl |
string | null |
URL of the last page, when the backend reports links |
nextPageUrl |
string | null |
URL of the next page, when the backend reports links |
page |
number |
The current page number, 1-based |
perPage |
number | null |
Number of rows per page |
prevPageUrl |
string | null |
URL of the previous page, when the backend reports links |
to |
number | null |
Position of the last row on this page within the whole result set, 1-based |
total |
number | null |
Number of rows in the whole result set |
