import type { KeyedMutator } from 'swr'; import type { FetchHookOptions, HookResponse } from './types'; import { FetchResponse, PageInfo, PostEntity, PostsArchiveFetchStrategy, PostsArchiveParams, QueriedObject } from '../../data'; import { PageType } from '../../data/fetchFn/fetchPosts'; export interface usePostsResponse extends HookResponse { data: { posts: T[]; pageInfo: PageInfo; queriedObject: QueriedObject; }; pageType: PageType; mutate: KeyedMutator>; } /** * The useFetchPosts hook. Returns a collection of post entities * * See {@link usePosts} for usage instructions. * * @param params The list of params to pass to the fetch strategy. It overrides the ones in the URL. * @param options The options to pass to the swr hook. * @param path The path of the url to get url params from. * @param fetcher The fetch strategy to use. If none is passed, the default one is used * * @category Data Fetching Hooks */ export declare function useFetchPosts(params?: P | {}, options?: FetchHookOptions>, path?: string, fetcher?: PostsArchiveFetchStrategy | undefined): usePostsResponse; /** * @internal */ export declare namespace useFetchPosts { const fetcher: (sourceUrl?: string, defaultParams?: P) => PostsArchiveFetchStrategy; }