import * as next from 'next'; import { NextComponentType } from 'next'; import * as _wundergraph_sdk_client from '@wundergraph/sdk/client'; import { Client, User, OperationsDefinition } from '@wundergraph/sdk/client'; import { Middleware, SWRHook } from 'swr'; import * as _wundergraph_swr from '@wundergraph/swr'; import { UseQueryHook, UseSubscriptionHook } from '@wundergraph/swr'; export { createHooks } from '@wundergraph/swr'; import React$1 from 'react'; type SSRCache = Record; interface WunderGraphContextValue { ssrCache: SSRCache; ssr: boolean; client: Client; user?: User; } interface WithWunderGraphOptions { /** * The WunderGraph client. */ client: WunderGraphClient; /** * The cache key used for user data. * @default wg_user */ userCacheKey?: string; /** * SSR enabled. * @default true */ ssr?: boolean; /** * Fetch user server side, disable this when authenticated is disabled. * @default true */ fetchUserSSR?: boolean; /** * Log the render to time to console. */ logPrerenderTime?: boolean; /** * Log fetch errors to console. */ logFetchErrors?: boolean; /** * Custom WunderGraph cache context. */ context?: React.Context; /** * Custom SWR middleware. */ use?: Middleware[]; } declare const withWunderGraph: (options: WithWunderGraphOptions) => (AppOrPage: NextComponentType, overrideOptions?: Partial) => NextComponentType; declare const createWunderGraphNext: , WunderGraphClient extends Client = Client>(options: WithWunderGraphOptions) => { useQuery: UseQueryHook; useSubscription: UseSubscriptionHook; useAuth: () => { login: (authProviderID: Operations["authProvider"], redirectURI?: string | undefined) => void; loginWithQuery: (authProviderID: Operations["authProvider"], query: URLSearchParams, redirectURI?: string | undefined) => void; logout: (options?: _wundergraph_sdk_client.LogoutOptions | undefined) => Promise; }; useFileUpload: _wundergraph_swr.UseUploadHook; useUser: _wundergraph_swr.UseUserHook; useMutation: _wundergraph_swr.UseMutationHook; withWunderGraph: (AppOrPage: next.NextComponentType, overrideOptions?: Partial> | undefined) => next.NextComponentType; client: WunderGraphClient; }; declare const useWunderGraphContext: (context?: React$1.Context) => WunderGraphContextValue | null; type MiddlewareReturn = ReturnType; type AuthMiddleware = (useSWRNext: SWRHook, /** * A function that returns an authentication token. * Returning null will unset the authorization header. */ getToken: () => Promise) => MiddlewareReturn; declare const useAuthMiddleware: AuthMiddleware; export { AuthMiddleware, SSRCache, WithWunderGraphOptions, createWunderGraphNext, useAuthMiddleware, useWunderGraphContext, withWunderGraph };