import type { DocumentNode } from "graphql";
import { Observable } from "rxjs";
import type { FetchResult, Operation } from "@apollo/client/link";
import { ApolloLink } from "@apollo/client/link";
import type { Unmasked } from "@apollo/client/masking";
/**
* @internal
* 
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
*/
type CovariantUnaryFunction<out Arg, out Ret> = {
    fn(arg: Arg): Ret;
}["fn"];
type VariableMatcher<V = Record<string, any>> = CovariantUnaryFunction<V, boolean>;
export declare namespace MockLink {
    type DelayFunction = (operation: Operation) => number;
    type Delay = number | DelayFunction;
    interface DefaultOptions {
        delay?: MockLink.Delay;
    }
    interface MockedRequest<TVariables = Record<string, any>> {
        query: DocumentNode;
        variables?: TVariables | VariableMatcher<TVariables>;
    }
    interface MockedResponse<out TData = Record<string, any>, out TVariables = Record<string, any>> {
        request: MockedRequest<TVariables>;
        maxUsageCount?: number;
        result?: FetchResult<Unmasked<TData>> | ResultFunction<FetchResult<Unmasked<TData>>, TVariables>;
        error?: Error;
        delay?: number | MockLink.DelayFunction;
    }
    type ResultFunction<T, V = Record<string, any>> = CovariantUnaryFunction<V, T>;
    interface Options {
        showWarnings?: boolean;
        defaultOptions?: DefaultOptions;
    }
}
export declare function realisticDelay({ min, max, }?: {
    min?: number;
    max?: number;
}): MockLink.DelayFunction;
export declare class MockLink extends ApolloLink {
    operation: Operation;
    showWarnings: boolean;
    private defaultDelay;
    private mockedResponsesByKey;
    static defaultOptions: MockLink.DefaultOptions;
    constructor(mockedResponses: ReadonlyArray<MockLink.MockedResponse<Record<string, any>, Record<string, any>>>, options?: MockLink.Options);
    addMockedResponse(mockedResponse: MockLink.MockedResponse): void;
    request(operation: Operation): Observable<FetchResult> | null;
    private getMockedResponses;
    private normalizeMockedResponse;
}
/**
* @internal
* 
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
*/
export declare function stringifyMockedResponse(mockedResponse: MockLink.MockedResponse): string;
export interface MockApolloLink extends ApolloLink {
    operation?: Operation;
}
export {};
//# sourceMappingURL=mockLink.d.ts.map
