/** * Universal pagination model generation algorithm. * * Ported from an upstream pagination algorithm: * packages/components/src/components/pagination/pagination-utils.ts * (which was itself adapted from ultimate-pagination) * * Kept: ItemType, PaginationItem, PaginationOptions, createRange, * createPaginationItems, getTotalPages, getCurrentActivePage. * Dropped: deprecated allyLabel* types, maxNumberOfPageLinks. */ export type PaginationOptions = { activePage: number; pageTotal: number; showLastPage: boolean; }; export type PaginationItem = { /** Page number — relevant for clickable PAGE items; undefined for ELLIPSIS. */ value?: number; /** True for the active page, and true for prev/next when they are actionable. */ isActive: boolean; /** Positional flags used for responsive class names (future use). */ isBeforeCurrent?: boolean; isBeforeBeforeCurrent?: boolean; isAfterCurrent?: boolean; isAfterAfterCurrent?: boolean; type: ItemType; }; export declare enum ItemType { PAGE = 0, ELLIPSIS = 1, PREVIOUS = 2, NEXT = 3 } export declare const createRange: (start: number, end: number) => number[]; /** * Builds the ordered list of pagination items (PREVIOUS, PAGE, ELLIPSIS, NEXT) * for the given options. The caller is responsible for clamping `activePage` * before passing it in — use `getCurrentActivePage()`. */ export declare const createPaginationItems: (options: PaginationOptions) => PaginationItem[]; /** Clamps activePage to a valid range [1, totalPages]. */ export declare const getCurrentActivePage: (activePage: number, totalPages: number) => number; /** Derives total page count, guarding against zero/negative inputs. */ export declare const getTotalPages: (totalItemsCount: number, itemsPerPage: number) => number; //# sourceMappingURL=diwa-pagination-utils.d.ts.map