import { HttpResponse } from '../client/HttpResponse'; /** * Handlers are executed by {@link fetchClient} after a successful HTTP response is available: * this means an HTTP response has been received (whichever the response statut, 200, 400 or 500...). * These handlers will: * - Validate some preconditions and if necessary return an error result * - Return a result * * So a handler can: * - Either return a result (which can be a successful result or an error), * in that case following handlers **will not be executed** * - Either return `undefined`, in that case following handlers **will be executed** * * Expected results should be of type {@link Promise} of {@link HttpResponse}. */ export interface FetchResponseHandler { (response: Response): Promise> | undefined; } /** * If an {@link FetchResponseHandler handler} raises an error, a {@link genericError} will be returned */ export declare const processHandlers: (response: Response, handlers: FetchResponseHandler[]) => Promise> | undefined; /** * Map {@link fetchClientExecutor} Promise errors to {@link HttpError}. * See {@link fetchClient} for reasons why these errors may occur. * * For now `AbortError` are mapped to {@link timeoutError} whereas all the other errors are mapped * to the generic {@link networkError}. * * @param error The raw {@link fetch} Promise {@link Error} */ export declare const networkErrorCatcher: (error: Error) => HttpResponse;