export type UsePaginationOpts = { pagesCount: number; pagesToDisplay?: number; onPageChange?: (page: number) => void; initialState?: { currentPage?: number; }; }; /** * Hook to used inside the component to handle paginatioMachie logic. * @param pagesCount The total number of pages. * @param pagesToDisplay The total number of pages to display. * @param onPageChange The callback to call when the page changes. * @param initialState The initial state. * @returns UsePaginationReturn * - pages: The pages to display. * - currentPage: The current page. * - next: The function to go to the next page. * - prev: The function to go to the previous page. * - goTo: The function to go to a specific page. * * @example * const { pages, currentPage, next, prev, goTo } = usePagination({ * pagesCount: 10, * pagesToDisplay: 5, * onPageChange: (page) => console.log(page), * initialState: { * currentPage: 1, * }, * }); * @example */ export declare function usePagination(opts: UsePaginationOpts): { next: () => void; prev: () => void; goTo: (page: number) => void; pagesCount: number; currentPage?: number | undefined; pagesToDisplay?: number | undefined; pages?: number[] | undefined; }; export type UsePaginationReturn = ReturnType;