Paginator
The Paginator class provides pagination options with automatic safety clamping.
Paginator
This documentation provides complete coverage of all methods in the Paginator class, organized into logical categories with detailed sections for each method.
Table of Contents
- Constructor
- Instance Creation Methods
- Pagination Calculation Methods
- Page Navigation Methods
- Utility Methods
- Static Methods
Constructor
Signature
constructor(options: PaginatorOptions)Parameters
| Parameter | Type | Description |
|---|---|---|
options | PaginatorOptions | Pagination configuration. |
interface PaginatorOptions {
totalItems: Numeric;
itemsPerPage?: Numeric; // default: 10
currentPage?: Numeric; // default: 1
}Behavior
- Initializes paginator with provided values.
- Applies safety clamping:
totalItems≥ 0itemsPerPage≥ 1currentPage≥ 1
Example
playground.ts
Type Definitions
Numeric
type Numeric = number | `${number}`;Union type accepting numbers or numeric strings.
PaginatorOptions
interface PaginatorOptions {
totalItems: Numeric;
itemsPerPage?: Numeric;
currentPage?: Numeric;
}Initialization options with defaults.
PaginatorMeta
interface PaginatorMeta {
totalItems: number;
currentPage: number;
itemsPerPage: number;
totalPages: number;
hasPrev: boolean;
hasNext: boolean;
isFirst: boolean;
isLast: boolean;
offset: number;
}Complete pagination metadata.
PageListOptions
interface PageListOptions {
edgeCount?: number;
siblingCount?: number;
}Page list generation options.
FromMetaOptions
type FromMetaOptions = Pick<PaginatorMeta, 'totalItems' | 'itemsPerPage' | 'currentPage'>;Last updated: Sun, Jun 14, 2026 08:22:19PM (UTC)
