import React from 'react'; import { CommonProps } from '@contentful/f36-core'; type NavigationButtonsProps = { /** * Label for the next button * @default "Next" */ nextLabel?: string; /** * Label for the previous button * @default "Previous" */ previousLabel?: string; /** * Aria label for the next button * @default "To next page" */ nextAriaLabel?: string; /** * Aria label for the previous button * @default "To previous page" */ previousAriaLabel?: string; }; interface BasePaginationProps extends CommonProps { /** * Sets which page is active on the Pagination * @default 0 */ activePage?: number; /** * Sets if the user is on the last page of navigation * @default false */ isLastPage?: boolean; /** * Number of items are actually on the page. * If no value is set it defaults to viewPerPage value * @default 20 */ pageLength?: number; /** * Sets if the View per page selector is shown * @default false */ showViewPerPage?: boolean; /** * Label for the View per page selector * @default "View" */ viewPerPageLabel?: string; /** * Sets how many items are displayed per page. * Must be one of the values passed on viewPerPageOptions prop. * @default 20 */ itemsPerPage?: number; /** * Array of options to show on the View select * @default [20, 100] */ viewPerPageOptions?: number[]; /** * Handler function called when user changes the view per page selector. */ onViewPerPageChange?: (items: number) => void; /** * Handler function called when user navigates to another page on the pagination. */ onPageChange: (page: number) => void; /** * Labels for previous and next buttons * @default { labelNext: "Next", labelPrevious: "Previous", ariaLabelNext: "To next page", ariaLabelPrevious: "To previous page" } */ navigationButtonsProps?: NavigationButtonsProps; } type WithTotalItemsAndLabelOrNot = { /** * Total amount of items the pagination is applied to. */ totalItems: number; /** * Label shown when the `totalItems` is provided. * @default `of ${totalItems} items` */ totalItemsLabel?: (totalItems: number) => string; } | { totalItems?: never; totalItemsLabel?: never; }; type PaginationProps = BasePaginationProps & WithTotalItemsAndLabelOrNot; declare const Pagination: React.ForwardRefExoticComponent>; declare function getRangeText({ activePage, itemsPerPage, totalItems, pageLength, isLastPage, totalItemsLabel, }: { activePage: number; itemsPerPage: number; totalItems?: number; pageLength?: number; isLastPage?: boolean; totalItemsLabel?: (totalItems: number) => string; }): string; export { Pagination, type PaginationProps, getRangeText };