import net from 'net';
import { type Logger, type ILogObj } from '../../../lib/logging/index.js';
import type { RequestStats, HttpEngineOptions } from '../CoreEngine.js';
import { DirectConnection } from './DirectConnection.js';
import { ProxyConnection } from './ProxyConnection.js';
import { TunnelConnection } from './TunnelConnection.js';
import { HttpCertificate } from '../../../models/ClientCertificate.js';
export interface ConnectionOptions {
    host: string;
    port: number;
    protocol?: string;
    timeout?: number;
    validateCertificates?: boolean;
    certificates?: HttpCertificate[];
    logger: Logger<ILogObj>;
    stats: RequestStats;
}
export interface ProxyConnectionOptions extends ConnectionOptions {
    proxy: string;
    proxyIsSsl: boolean;
    targetUrl: string;
    proxyUsername?: string;
    proxyPassword?: string;
    /**
     * The type of proxy authentication to use.
     */
    proxyAuthorization?: 'Basic';
}
export interface TunnelConnectionOptions extends ProxyConnectionOptions {
    targetHost: string;
    targetPort: number;
}
/**
 * Manages different types of HTTP connections
 */
export declare class ConnectionManager {
    private logger;
    private stats;
    constructor(logger: Logger<ILogObj>, stats: RequestStats);
    /**
     * Create a direct connection (HTTP or HTTPS)
     */
    createDirectConnection(options: ConnectionOptions): DirectConnection;
    /**
     * Create a proxy connection for HTTP requests
     */
    createProxyConnection(options: ProxyConnectionOptions): ProxyConnection;
    /**
     * Create a tunnel connection for HTTPS requests through proxy
     */
    createTunnelConnection(options: TunnelConnectionOptions): TunnelConnection;
    /**
     * Determine the appropriate connection type and create it
     */
    createConnection(host: string, port: number, protocol: string, engineOptions: HttpEngineOptions): Promise<net.Socket>;
}
//# sourceMappingURL=ConnectionManager.d.ts.map