import type { FormattedExecutionResult } from "graphql";
import { Observable } from "rxjs";
import type { ErrorLike } from "@apollo/client";
import type { FetchResult, NextLink, Operation } from "@apollo/client/link/core";
import { ApolloLink } from "@apollo/client/link/core";
export interface ErrorResponse {
    /**
     * Error that caused the callback to be triggered.
     */
    error: ErrorLike;
    response?: FormattedExecutionResult;
    operation: Operation;
    forward: NextLink;
}
export declare namespace ErrorLink {
    /**
     * Callback to be triggered when an error occurs within the link stack.
     */
    interface ErrorHandler {
        (error: ErrorResponse): Observable<FetchResult> | void;
    }
}
export import ErrorHandler = ErrorLink.ErrorHandler;
export declare function onError(errorHandler: ErrorHandler): ApolloLink;
export declare class ErrorLink extends ApolloLink {
    private link;
    constructor(errorHandler: ErrorLink.ErrorHandler);
    request(operation: Operation, forward: NextLink): Observable<FetchResult> | null;
}
//# sourceMappingURL=index.d.ts.map
