/** * 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 FetchState } from '../hooks/useFetch'; import { type UseFetchError } from '../services/NotificationService'; import { type PaginationMetadata, type ResetPaginationMetadataType } from './PaginationConfig'; export type PaginationFunctionsType = Record> = { /** * Changes items per page */ changeItemsPerPage: (perPage: number) => void; data: Data; error: UseFetchError; /** * Fetch current pagination */ fetch: () => Promise; isLoading: boolean; /** * Resets the pagination, sort and/or filter. */ reset: (newSearchParams?: ResetPaginationMetadataType) => void; setPaginationState: FetchState['setFetchState']; }; export type PaginationMethod = Record> = (metadata: PaginationMetadata) => Promise<{ data: Data; totalItems?: number; }>;