import { PaginationState } from '../contracts/dataGridContract'; import { default as GridModel } from './gridModel'; /** * Pagination concern: navigation state + derived row range for the bottom bar / pager. * The coupled mutations (page-reset on filter/sort, server-state events) live on GridModel; * this model owns the navigation behavior and derivations the UI needs. */ export default class PaginationModel { readonly grid: GridModel; constructor(grid: GridModel); get isPaginated(): boolean; get state(): PaginationState | undefined; get pageSizeOptions(): number[] | undefined; get page(): number; get pageSize(): number; get totalPages(): number; get totalItems(): number; get canGoPrev(): boolean; get canGoNext(): boolean; /** 1-based index of the first row on the current page. */ get startItem(): number; /** 1-based index of the last row on the current page (clamped to totalItems). */ get endItem(): number; changePage: (page: number) => void; changePageSize: (size: number) => void; firstPage: () => void; prevPage: () => void; nextPage: () => void; lastPage: () => void; /** Parse a raw page-jump input and navigate (clamped to [1, totalPages]); ignores non-numeric input. */ jumpToPage: (raw: string) => void; }