import { RequestInit, Response } from "node-fetch";
import EnvoyHttpRequestParams from "./envoy-http-request-params";
/**
 * EnvoyResponse is a little enhanced from the original Response of node-fetch
 */
export interface EnvoyResponse extends Response {
    /**
     * Envoy will set this header on the downstream response if a request was dropped due
     * to either maintenance mode or upstream circuit breaking.
     */
    overloaded: boolean;
    /**
     * Contains the time in milliseconds spent by the upstream host processing the request.
     * This is useful if the client wants to determine service time compared to network latency.
     * This header is set on responses.
     */
    upstreamServiceTime: number;
}
/**
 * the fetch function share most of the signature of the original node-fetch
 * but helps you on setting up the request being send to envoy egress port
 * @param envoyParams the params of envoy context as well as request control params (timeout / retry, etc)
 * @param url the target url, the same as node-fetch's first param
 * @param init the init, the same as node-fetch's second param
 */
export default function envoyFetch(envoyParams: EnvoyHttpRequestParams, url: string, init?: RequestInit): Promise<EnvoyResponse>;
