import { Agent as Agent$1 } from "./agent.cjs";
import { AgentOptions, ClientRequest, OutgoingHttpHeaders } from "node:http";
import * as net from "node:net";
import * as tls from "node:tls";
import { AgentConnectOpts } from "agent-base";
import { URL } from "node:url";

//#region src/http-proxy.d.ts
type Protocol<T> = T extends `${infer Protocol}:${infer _}` ? Protocol : never;
interface ConnectOptsMap {
  http: Omit<net.TcpNetConnectOpts, "host" | "port">;
  https: Omit<tls.ConnectionOptions, "host" | "port">;
}
type ConnectOpts<T> = { [P in keyof ConnectOptsMap]: Protocol<T> extends P ? ConnectOptsMap[P] : never }[keyof ConnectOptsMap];
type HttpProxyAgentOptions<T> = ConnectOpts<T> & AgentOptions & {
  headers?: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
};
interface HttpProxyAgentClientRequest extends ClientRequest {
  outputData?: {
    data: string;
  }[];
  _header?: string | null;
  _implicitHeader: () => void;
}
/**
 * The `HttpProxyAgent` implements an HTTP Agent subclass that connects to the specified "HTTP proxy server" in order to proxy HTTP requests.
 */
declare class HttpProxyAgent<Uri extends string> extends Agent$1 {
  static protocols: readonly ["http", "https"];
  readonly proxy: URL;
  proxyHeaders: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
  connectOpts: net.TcpNetConnectOpts & tls.ConnectionOptions;
  constructor(proxy: Uri | URL, opts?: HttpProxyAgentOptions<Uri>);
  addRequest(req: HttpProxyAgentClientRequest, opts: AgentConnectOpts): void;
  setRequestProps(req: HttpProxyAgentClientRequest, opts: AgentConnectOpts): void;
  connect(req: HttpProxyAgentClientRequest, opts: AgentConnectOpts): Promise<net.Socket>;
}
//#endregion
export { HttpProxyAgent, HttpProxyAgentOptions };
//# sourceMappingURL=http-proxy.d.cts.map