Creates a new Pagination instance.
Optionaldata: Partial<PaginationParams>Optional partial pagination parameters. Defaults to static page (1) and perPage (10).
The 1-based index of the current page.
The maximum number of items to return per page.
StaticpageDefault page index (1).
StaticperDefault page size (10).
The maximum number of items to return (alias for perPage).
The number of items to skip/offset for database or API queries.
Implements the JSON.stringify() behavior.
It uses toStruct to get the plain object structure under the hood.
It is encouraged to use toStruct instead of this method because it provides better
clarity and expressiveness about the data structure being serialized. This method is provided
only to support the JSON.stringify() serialization.
A plain object structure containing the model's serializable properties.
Converts the model instance into a plain data structure (struct).
This method extracts the model's property data, removing functions, methods, or class-specific instance details, returning a clean structural representation.
A plain object structure containing the model's serializable properties.
Helper class for calculating pagination offsets and limits.
Example
Basic pagination usage