import React from 'react'; import PropTypes from 'prop-types'; import { ComponentProps } from '../utils/types'; /** @public */ type PaginatorCompactChangeHandler = (event: React.MouseEvent | React.KeyboardEvent, data: { direction: 'prev' | 'next'; page?: number; }) => void; /** @public */ type PaginatorCompactRenderLabelCallback = (data: { current?: number; totalPages?: number; }) => React.ReactNode; interface PaginatorCompactPropsBase { /** * The current page number. If not provided, the component will not keep track of the page number and will not provide it in the callback. */ current?: number; /** * A React ref which is set to the DOM element when the component mounts and null when it unmounts. */ elementRef?: React.Ref; /** * Callback to handle page change. */ onChange?: PaginatorCompactChangeHandler; /** * If true, renders the a label for the current and total pages. * Can be passed a function to render a custom label that receives an object with current and totalPages as an argument. */ renderLabel?: boolean | PaginatorCompactRenderLabelCallback; /** * The total number of pages. * If not provided, the component will operate in indeterminate mode and will not prevent the current page number from exceeding any values. */ totalPages?: number; } type PageButtonProps = ComponentProps; declare function Compact({ onChange, current, elementRef, renderLabel, totalPages, ...otherProps }: PageButtonProps): React.JSX.Element; declare namespace Compact { var propTypes: { current: PropTypes.Requireable; elementRef: PropTypes.Requireable; onChange: PropTypes.Requireable<(...args: any[]) => any>; renderLabel: PropTypes.Requireable any) | null | undefined>>; totalPages: PropTypes.Requireable; }; } export default Compact; export type { PaginatorCompactChangeHandler, PaginatorCompactRenderLabelCallback };