import { ClientOptions, Client, SSRExchange, SSRData } from 'urql'; export * from 'urql'; import { NextPage, NextComponentType, NextPageContext } from 'next'; import NextApp, { AppContext } from 'next/app'; import { Exchange } from '@urql/core'; declare const cacheExchange: Exchange; declare function initGraphQLClient(clientOptions: ClientOptions): Client; declare function withGraphQLClient(getClientConfig: NextGraphQLClientConfig): | typeof NextApp>(AppOrPage: C) => NextComponentType; type Optional = Pick, K> & Omit; type NextGraphQLClientConfig = (ssrExchange: SSRExchange, ctx?: NextPageContext) => Optional; interface WithGraphQLClientProps { urqlClient?: Client; pageProps: any; graphqlState?: SSRData; [key: string]: any; } interface NextGraphQLPageContext extends NextPageContext { urqlClient: Client; } interface NextGraphQLAppContext extends AppContext { urqlClient: Client; } type NextUrqlContext = NextGraphQLAppContext | NextGraphQLPageContext; export { NextGraphQLAppContext, NextGraphQLClientConfig, NextGraphQLPageContext, NextUrqlContext, WithGraphQLClientProps, cacheExchange, initGraphQLClient, withGraphQLClient };