///
import EventEmitter from 'events';
import { Client as GraphQLWsClient } from 'graphql-ws';
import { SubscriptionClient } from 'subscriptions-transport-ws';
import Middleware from './Middleware';
import type { UseClientRequestOptions, Cache, ClientOptions, FetchFunction, GenerateResultOptions, OnErrorFunction, Operation, RequestOptions, Result } from './types/common-types';
declare class GraphQLClient {
url: string;
ssrPromises: Promise[];
FormData?: any;
fetch?: FetchFunction;
fetchOptions: RequestInit;
logErrors: boolean;
useGETForQueries: boolean;
middleware: Middleware;
mutationsEmitter: EventEmitter;
cache?: Cache;
headers: Headers | {
[key: string]: string;
};
ssrMode?: boolean;
subscriptionClient?: SubscriptionClient | GraphQLWsClient;
fullWsTransport?: boolean;
onError?: OnErrorFunction;
constructor(config: ClientOptions);
/** Checks that the given config has the correct required options */
verifyConfig(config: any): void;
setHeader(key: any, value: any): this;
setHeaders(headers: any): this;
removeHeader(key: any): this;
logErrorResult({ result, operation }: {
result: any;
operation: any;
}): void;
generateResult({ fetchError, httpError, graphQLErrors, data }: GenerateResultOptions): Result;
getCacheKey(operation: Operation, options?: UseClientRequestOptions): {
operation: Operation