import { DynamicTextContent } from '@odx/angular/cdk/dynamic-view'; import * as i0 from '@angular/core'; import { EventEmitter } from '@angular/core'; import * as _odx_angular_utils from '@odx/angular/utils'; interface PageChangeEvent { length: number; pageIndex: number; pageSize: number; } type GetRangeContentFn = (pageIndex: number, totalPages: number) => DynamicTextContent; type GetSummaryContentFn = (startItemIndex: number, endItemIndex: number, length: number) => DynamicTextContent; /** * Paginator component for navigating between pages of content in a dataset. * It provides configurable options for page size, total content length, and navigational controls, * and emits an event when the page is changed. */ declare class PaginatorComponent { private readonly disabledController; private readonly config; private _pageIndex; private _pageSize; private _length; protected buttonSize: "small"; readonly element: i0.ElementRef; /** * Function to generate summary content for display, such as "Items 1-10 of 100". * * @type {GetSummaryContentFn | null} * @default null */ getSummaryContentFn?: GetSummaryContentFn | null; /** * Function to generate range content for display, such as "Page 1 of 10". * * @type {GetRangeContentFn | null} * @default null */ getRangeContentFn?: GetRangeContentFn | null; /** * Determines whether the summary content is displayed. * * @type {boolean} * @default true */ showSummary: boolean; /** * Determines whether buttons for navigating to the first and last pages are displayed. * * @type {boolean} * @default true */ showFirstLastButtons: boolean; /** * The current page index. Setter ensures the page index is non-negative. * * @param {number} value - The new page index. */ set pageIndex(value: number); /** * Gets the current page index, returns -1 if length is zero. * * @returns {number} */ get pageIndex(): number; /** * The number of items per page. Setter ensures the page size is positive. * * @param {number} value - The new page size. */ set pageSize(value: number); /** * Gets the number of items per page. * * @returns {number} */ get pageSize(): number; /** * The total number of items. Setter ensures the length is non-negative. * * @param {number} value - The new total number of items. */ set length(value: number); /** * Gets the total number of items. * * @returns {number} */ get length(): number; /** * Event emitted when the page index changes, providing details of the new page context. * * @emits {PageChangeEvent} */ pageChanged: EventEmitter; /** * Determines whether pagination controls are disabled. * * @returns {boolean} */ get isDisabled(): boolean; /** * Default function to generate summary content if no function is provided. * * @returns {GetSummaryContentFn} */ get defaultGetSummaryContentFn(): GetSummaryContentFn; /** * Default function to generate range content if no function is provided. * * @returns {GetRangeContentFn} */ get defaultGetRangeContentFn(): GetRangeContentFn; /** * Computes and returns the dynamic summary content. * * @returns {DynamicTextContent} */ get summaryContent(): DynamicTextContent; /** * Computes and returns the dynamic range content. * * @returns {DynamicTextContent} */ get rangeContent(): DynamicTextContent; /** * Navigates to the first page. */ firstPage(): void; /** * Navigates to the previous page. */ previousPage(): void; /** * Navigates to the next page. */ nextPage(): void; /** * Navigates to the last page. */ lastPage(): void; /** * Determines whether the current page is the first page. * * @returns {boolean} */ get isFirstPage(): boolean; /** * Determines whether the current page is the last page. * * @returns {boolean} */ get isLastPage(): boolean; /** * Determines whether the previous button is disabled. * * @returns {boolean} */ get isPreviousDisabled(): boolean; /** * Determines whether the next button is disabled. * * @returns {boolean} */ get isNextDisabled(): boolean; /** * Gets the total number of pages. * * @returns {number} */ get totalPages(): number; /** * Gets the index of the first item on the current page. * * @returns {number} */ get startItemIndex(): number; /** * Gets the index of the last item on the current page. * * @returns {number} */ get endItemIndex(): number; /** * Navigates to the specified page index. */ pageChange(pageIndex: number): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } interface PaginatorConfig { /** * Function to generate summary content for paginator, displaying indices and total length. * @param startItemIndex The starting index of the current page. * @param endItemIndex The ending index of the current page. * @param length Total number of items in the dataset. * @returns DynamicTextContent for summary display. */ getSummaryContent: GetSummaryContentFn; /** * Function to generate range content for paginator, displaying the current page index and total pages. * @param pageIndex The index of the current page. * @param totalPages Total number of pages. * @returns DynamicTextContent for range display. */ getRangeContent: GetRangeContentFn; /** * Default paginator page size * @default 10 */ pageSize: number; } /** * Utility for creating and retrieving configuration tokens for the Paginator. * This facilitates dependency injection of configuration in Angular applications. * * @example * ```ts * // In module providers: * providers: [ * providePaginatorConfig({ * pageSize: 20, * getSummaryContent: (startItemIndex: number, endItemIndex: number, length: number) => `...` * }), * ] * ``` */ declare const PaginatorConfig: i0.InjectionToken>; declare const PaginatorDefaultConfig: { getSummaryContent: GetSummaryContentFn; getRangeContent: GetRangeContentFn; pageSize: number; }; declare const injectPaginatorConfig: () => { getSummaryContent: GetSummaryContentFn; getRangeContent: GetRangeContentFn; pageSize: number; }; declare const providePaginatorConfig: >>(config: _odx_angular_utils.ConfigProvider, D>) => i0.FactoryProvider | i0.ValueProvider; declare class PaginatorModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { PaginatorComponent, PaginatorConfig, PaginatorDefaultConfig, PaginatorModule, injectPaginatorConfig, providePaginatorConfig }; export type { GetRangeContentFn, GetSummaryContentFn, PageChangeEvent };