import useSWR, { useSWRConfig } from 'swr'; import type { EndpointParams, FetchResponse } from '../../data/index.js'; import { AbstractFetchStrategy } from '../../data/index.js'; import { FetchHookOptions } from './types.js'; export interface useFetchOptions { shouldFetch?: () => boolean; } export { useSWR, useSWRConfig }; /** * The use Fetch Hook is the foundation for most hooks in the headless framework. It is a wrapper around * `useSWR` and provides a consistent API for fetching data from the API. It requires a fetch strategy which implements * the actual data fetching logic * * @param params The list of params to pass to the fetch strategy. It overrides the ones in the URL. * @param fetchStrategy The fetch strategy. * @param options The options to pass to the swr hook. * @param path The path of the url to get url params from. * * @category Data Fetching Hooks * */ export declare function useFetch(params: Params | {}, fetchStrategy: AbstractFetchStrategy, options?: FetchHookOptions>, path?: string): { params: Partial; isMainQuery: boolean; data: FetchResponse | undefined; error: any; mutate: import("swr").KeyedMutator>; isValidating: boolean; isLoading: boolean; };