import * as i0 from "@angular/core"; import { EventEmitter, OnChanges } from "@angular/core"; export declare class MojPaginationComponent implements OnChanges { private readonly pages; id: string; currentPage: number; total: number; limit: number; changePage: EventEmitter; readonly elipsedPages: import("@angular/core").WritableSignal<(string | number)[]>; readonly ELIPSIS = "…"; /** * Gets the total number of pages available. * * @returns The total count of pages as a number. */ get totalPages(): number; /** * Gets the starting item index for the current page in a paginated list. * * @returns {number} The index of the first item on the current page, or 0 if there are no items. * * If `total` is 0, returns 0. Otherwise, calculates the starting index based on the current page and the limit per page. */ get pageStart(): number; /** * Gets the index of the last item on the current page. * * @returns {number} The index of the last item displayed on the current page. * Returns 0 if there are no items (`total` is 0). Otherwise, returns the lesser of * `currentPage * limit` and `total`, ensuring the end index does not exceed the total number of items. */ get pageEnd(): number; /** * Calculates and updates the pagination pages and elided (skipped) pages based on the current limit and total items. * * - If either `limit` or `total` is less than or equal to zero, clears the pages and elided pages. * - Otherwise, computes the total number of pages, updates the `pages` observable with the full range, * and updates the `elipsedPages` observable with the result of skipping pages for ellipsis display. * * @private */ private calculatePages; /** * Generates an array of numbers starting from `start` up to, but not including, `end`. * * @param start - The starting number of the range (inclusive). * @param end - The ending number of the range (exclusive). * @returns An array of numbers from `start` to `end - 1`. */ private range; /** * Generates a pagination array with ellipses ("...") to represent skipped page ranges. * * The resulting array always includes the first and last page numbers, the current page, * and up to one page before and after the current page. Ellipses are inserted where * there are skipped ranges between the displayed pages. * * @param pages - An array of page numbers representing all available pages. * @param currentPage - The currently active page number. * @returns An array containing page numbers and ellipsis strings ("...") to indicate skipped pages. */ private elipseSkippedPages; /** * Handles the page change event for the pagination component. * * Prevents the default action of the event (if provided) and emits the selected page number. * * @param event - The event triggered by the page change action. If provided, its default behavior will be prevented. * @param page - The page number to navigate to. */ onPageChanged(event: Event, page: number): void; /** * Lifecycle hook that is called when any data-bound property of the component changes. * Invokes the `calculatePages` method to update the pagination state based on the new input values. */ ngOnChanges(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }