import { Entity, FetchResponse } from '@10up/headless-core'; import type { Redirect } from 'next'; export type HookState = { key: string; data: T; isMainQuery: boolean; }; export type NextJSProps

= { props?: P; redirect?: Redirect; revalidate?: number | boolean; notFound?: boolean; }; /** * The `addHookData` function is responsible for collecting all of the results from the `fetchHookData` function calls * and prepares the shape of the data to match what the frameworks expects (such as setting initial values for SWR and collecting SEO data). * * ## Usage * * ```ts * export async function getServerSideProps(context) { * try { * const usePostsHook = await fetchHookData(usePosts.fetcher(),context); * const useAppSettingsHook = await fetchHookData(useAppSettings.fetcher(),context); * return addHookData([usePostsHook, useAppSettingsHook], {}); * } catch (e) { * return handleError(e, context); * } * } * ``` * * @param hookStates An array of resolved promises from {@link fetchHookData} * @param nextProps Any additional props to pass to Next.js page routes. * * @category Next.js Data Fetching Utilities */ export declare function addHookData

(hookStates: HookState>[], nextProps: NextJSProps

): { props: { seo: { yoast_head_json: {}; yoast_head: string; }; themeJSON: {}; fallback: {}; }; redirect?: Redirect | undefined; revalidate?: number | boolean | undefined; notFound?: boolean | undefined; };