/** * react-fetch v1.49.0 * * Copyright (c) resourge. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */ import { type FilterParamsReturn, type Pagination } from '../types/FilterParamsTypes'; import { type PaginationConfig } from '../types/PaginationConfig'; import { type PaginationFunctionsType, type PaginationMethod } from '../types/PaginationFunctionsType'; export type PaginationReturn = Record> = Omit, 'setParams'> & PaginationFunctionsType & { /** * Changes current page */ changePage: (page: number, totalItems?: number) => void; /** * Changes both current page and items per page */ changePagination: (page: number, perPage: number) => void; /** * Changes total number of pages using total number of items * * Note: It doesn't trigger render. */ changeTotalPages: (totalItems: number) => void; /** * Builds href for use on navigation. (usually used with pagination component) */ getPaginationHref: (page: number) => string; pagination: Pagination; /** * Resets pagination to initial/default values */ resetPagination: () => void; }; export declare const usePagination: = Record>(method: PaginationMethod, { deps, enable, fId, filter: defaultFilter, hash, initialPage, initialPerPage, initialState, paramsMode, preload, sort: defaultSort, ...config }: PaginationConfig) => PaginationReturn;