/// <reference types="react" />
import * as PropTypes from 'prop-types';
import { DocumentNode } from 'graphql';
import { ApolloLink, ApolloClient as Client, ApolloClientOptions as ClientOptions, ApolloCache, InMemoryCacheConfig, NormalizedCacheObject, Operation, DefaultContext, OperationVariables, TypedDocumentNode } from '@apollo/client/core';
import { MutationHookOptions } from '@apollo/client/react';
import { QueryComponentOptions } from '@apollo/client/react/components';
import { QueryHookOptions, OnSubscriptionDataOptions, ApolloError, FetchResult, MutationResult, MutationFunctionOptions, QueryResult, MutationTuple } from '@apollo/client';
import { TFunction } from 'i18next';
declare type TodoAny = any;
export declare type DataRow = {
    id: string;
};
export declare type DataRowPaginatedList = {
    rows: DataRow[];
    count: number;
};
export declare type ApolloState = {
    [k: string]: unknown;
};
export declare type ApolloClientOptions = ClientOptions<TodoAny> & {
    cacheOptions?: InMemoryCacheConfig;
};
export declare type ApolloClient = Client<TodoAny>;
export declare type ApolloUploadFetchOptions = RequestInit & {
    method: string;
    onProgress?: (this: XMLHttpRequest, ev: ProgressEvent<EventTarget>) => void | null;
    onAbortPossible: (abortHandler: () => void) => void;
    headers: Headers;
};
export declare const DEFAULT_DEBOUNCE_TIMEOUT = 300;
export declare function logger(message: string | Error, props?: {}): void;
export declare const errorLink: ApolloLink;
export declare function parseXHRHeaders(rawHeaders: string): Headers;
export declare const uploadFetch: (url: string, options: ApolloUploadFetchOptions) => Promise<Response>;
export declare function createClient(opts: ApolloClientOptions): ApolloClient;
export declare function serverClient<TContext>(ctx: TContext, o: ApolloClientOptions): ApolloClient;
export declare type BrowserClientMiddleware = (operation: Operation) => void;
export declare type BrowserClientParams = {
    url?: string;
    wsURL?: string;
    middlewares?: BrowserClientMiddleware[];
    initialState?: NormalizedCacheObject;
    cacheOptions?: InMemoryCacheConfig;
    ssrForceFetchDelay?: number;
};
export declare function browserClient(params?: BrowserClientParams): ApolloClient;
export declare type GetListKeyFromDataTypeOptions = {
    suffix?: string;
};
export declare function getListKeyFromDataType(dataType: string, options?: GetListKeyFromDataTypeOptions): string;
export declare function compareIds(id1: unknown, id2: unknown): boolean;
export declare function compareValues(a: unknown, b: unknown): boolean;
export declare type CachedObjectRef = {
    __ref: string;
};
export declare function updateAfterMutation(dataType: string, listFieldName?: string): (cache: ApolloCache<unknown>, { data }: FetchResult) => void;
export declare const Query: {
    ({ pollInterval, ...props }: QueryComponentOptions): JSX.Element;
    propTypes: {
        pollInterval: PropTypes.Requireable<number>;
    };
    defaultProps: {
        pollInterval: number;
    };
};
export declare function getDataFromResponse(dataType: string): (data: QueryResult) => DataRowPaginatedList;
export declare function getDataFromSubscriptionEvent(dataType: string): (prev: ApolloState, { subscriptionData }: OnSubscriptionDataOptions) => ApolloState;
export declare type UnsubscribeToMoreFn = () => void;
export declare type SubscribeToMoreProps = {
    subscriptionId: string;
    subscriptionQueries: Document[];
    variables: unknown;
    dataType: string;
    subscribeToMore: (params: {
        document: Document;
        variables: unknown;
        updateQuery: any;
    }) => UnsubscribeToMoreFn;
};
export declare function useSubscribeToMore(props: SubscribeToMoreProps): void;
export declare function onError(props: {
    t: TFunction;
}): (error: ApolloError) => void;
export declare type MutateFn = (options?: MutationFunctionOptions<TodoAny, Record<string, TodoAny>> | undefined) => Promise<FetchResult<TodoAny, Record<string, TodoAny>, Record<string, TodoAny>>>;
export declare type MutationProps = {
    children: (mutate: MutateFn, res: MutationResult) => void;
    autoCommitInterval?: number;
    mutation: DocumentNode;
};
export declare function useQuery(query: DocumentNode, options: QueryHookOptions): QueryResult;
export declare function useMutation<TData = TodoAny, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<TodoAny> = ApolloCache<TodoAny>>(mutation: DocumentNode | TypedDocumentNode<TData, TVariables>, options: MutationHookOptions<TData, TVariables, TContext> & {
    autoCommitInterval?: number;
}): MutationTuple<TData, TVariables, TContext, TCache>;
export declare const Mutation: ({ children, mutation, ...props }: MutationProps) => void;
export { MockedProvider } from '@apollo/client/testing';
export { useLazyQuery, useSubscription, useApolloClient, ApolloProvider, ApolloConsumer, ApolloCache, InMemoryCache, InMemoryCacheConfig, } from '@apollo/client';
export { graphql, withApollo } from '@apollo/client/react/hoc';
export { getDataFromTree, getMarkupFromTree, renderToStringWithData, } from '@apollo/client/react/ssr';
export { DocumentNode, OperationDefinitionNode } from 'graphql';
