Pagination
Use paginated() when returning a page of data plus pagination metadata.
const payload = UserResource.paginated({ data: users, page: 1, perPage: 10, total: 100,});Output:
{ "data": [], "meta": { "page": 1, "perPage": 10, "total": 100 }}Input Shape
Section titled “Input Shape”interface PaginationInput<TData> { data: readonly TData[]; page: number; perPage: number; total: number;}paginated() uses the same serialization and validation rules as
collection().