/// import ApolloClient from 'apollo-client'; import { IncomingHttpHeaders } from 'http'; import { NextPage, NextPageContext } from 'next'; import { AppContext } from 'next/app'; import { ReactNode } from 'react'; export interface WithApolloOptions { getDataFromTree?: (tree: ReactNode, context?: { [key: string]: any; }) => Promise; render?: (props: { Page: NextPage; props: any; }) => any; } export interface WithApolloState { data?: TCache; } export interface WithApolloProps { apolloState: WithApolloState; apollo: ApolloClient; } export interface InitApolloOptions { ctx?: NextPageContext; headers?: IncomingHttpHeaders; initialState?: TCache; } export declare type InitApolloClient = (options: InitApolloOptions) => ApolloClient; export interface ApolloPageContext extends NextPageContext { apolloClient: ApolloClient; } export interface ApolloAppContext extends AppContext { ctx: ApolloPageContext; AppTree: any; } export declare type ApolloContext = ApolloPageContext | ApolloAppContext;