import * as i0 from '@angular/core'; import { OnInit, OnDestroy, EventEmitter, PipeTransform } from '@angular/core'; /** * structure for each page item */ interface Page { /** number of the page */ number: number; /** text to be displayed for the page numeber */ text: string; /** whether the page is active or not */ active: boolean; } interface PaginatorPipeArgs { /** id of the pagination instance */ id?: string; /** current page number, defaults to 1 */ currentPage?: number; /** total items to be shown per page, defaults to 10 */ itemsPerPage?: number; } /** * This is the directive where the actual pagination takes place, it provides a sync between the * pipes and the pagination component */ declare class AngularPaginatorDirective implements OnInit, OnDestroy { private angularPaginatorService; /** * Use unique id when multiple paginations are being used on the same page. * By Default Paginator uses id `ANGULAR_PAGINATOR_DEFAULT` */ id: string; /** * Limit number for pagination size, i.e., the maximum page numbers to be displayed */ maxSize?: number; /** * Whether to keep current page in the middle of the visible ones */ rotate: boolean; /** * Whether to always display the first and last page numbers. * If max-size is smaller than the number of pages, then the first and last page numbers are still shown with ellipses * in-between as necessary. NOTE: max-size refers to the center of the range. * This option may add up to 2 more numbers on each side of the displayed range for the end value and * what would be an ellipsis but is replaced by a number because it is sequential */ boundaryLinkNumbers: boolean; /** * Also displays ellipses when rotate is true and maxSize is smaller than the number of pages forceEllipses */ forceEllipses: boolean; currentPage: number; firstPage: number; lastPage: number; pages: Page[]; private subscription; /** * Emits an event whenever the current page is changed, It emits the current page number */ pageChange: EventEmitter; /** * * @param angularPaginatorService serivce for angular paginator */ constructor(); /** * Navigate to prevoius page */ toPreviousPage(): void; /** * Navigate to next page */ toNextPage(): void; /** * Navigate to first page */ toFirstPage(): void; /** * Navigate to last page */ toLastPage(): void; /** * Sets current page * * @param page page number to set as currentPage */ setCurrentPage(page: number): void; /** * * @param page page number to set */ private setPage; /** * create page object used for template * * @param pageNumber page number * @param text page number, text to be displayed * @param isActive whether the page is active or not, true for currentPage */ private makePage; /** * computes the page limit * * @param currentPage current page number * @param itemsPerPage total items per page * @param totalItems no of items for pagination, usually array length */ private computePageLimits; /** * create page array * * @param currentPage current page number * @param itemsPerPage total items per page * @param totalItems no of items for pagination, usually array length */ private getPages; /** * Updates the pagination component */ private updatePages; /** * Check if currentPage is out of bound with totalPages * * @param instance instance for which the range is to be corrected */ private outOfBoundCorrection; /** * check if there is any instance registered with the id */ isValidId(): void; ngOnInit(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Pagination Pipe which paginates the array for the provided arguments such as `itemsPerPage` and `currentPage` */ declare class AngularPaginatorPipe implements PipeTransform { private angularPaginatorService; /** * this pipes paginates the array for the provided arguments such as `itemsPerPage` and `currentPage` * * @param array input array for which the manipulation happens * @param args input arguments for the paginator pipe */ transform(array: T[], args?: PaginatorPipeArgs): T[]; /** * create an instance for each pipe * * @param array input array for which the manipulation happens * @param args input arguments for the paginator pipe */ private createInstance; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class AngularPaginatorModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { AngularPaginatorDirective, AngularPaginatorModule, AngularPaginatorPipe };