import type { IncomingMessage } from 'http';
import { SerializableError } from '../../../models/SerializableError.js';
/**
 * Base class for all HTTP engine errors
 */
export declare class HttpEngineError extends SerializableError {
    readonly category: string;
    constructor(message: string, code?: number | string, category?: string);
}
/**
 * Connection-related errors
 */
export declare class ConnectionError extends HttpEngineError {
    readonly connectionType: 'direct' | 'proxy' | 'tunnel';
    constructor(message: string, code?: number | string, connectionType?: 'direct' | 'proxy' | 'tunnel');
}
/**
 * Authentication-related errors
 */
export declare class AuthenticationError extends HttpEngineError {
    readonly authType: 'request' | 'proxy' | 'digest' | 'basic' | 'ntlm';
    constructor(message: string, code?: number | string, authType?: 'request' | 'proxy' | 'digest' | 'basic' | 'ntlm');
}
/**
 * Message building errors
 */
export declare class MessageBuilderError extends HttpEngineError {
    readonly component: 'status' | 'headers' | 'body' | 'host';
    constructor(message: string, code?: number | string, component?: 'status' | 'headers' | 'body' | 'host');
}
/**
 * Response parsing errors
 */
export declare class ResponseParsingError extends HttpEngineError {
    readonly parsingStage: 'status' | 'headers' | 'body' | 'chunked';
    constructor(message: string, code?: number | string, parsingStage?: 'status' | 'headers' | 'body' | 'chunked');
}
/**
 * Timeout errors
 */
export declare class TimeoutError extends HttpEngineError {
    readonly timeoutType: 'connection' | 'request' | 'response';
    constructor(message: string, code?: number | string, timeoutType?: 'connection' | 'request' | 'response');
}
/**
 * Proxy-related errors
 */
export declare class ProxyError extends HttpEngineError {
    readonly proxyStage: 'connection' | 'authentication' | 'tunneling' | 'configuration';
    name: string;
    constructor(message: string, code?: number | string, proxyStage?: 'connection' | 'authentication' | 'tunneling' | 'configuration');
}
/**
 * Proxy authentication error
 */
export declare class ProxyAuthenticationError extends HttpEngineError {
    readonly response: IncomingMessage;
    readonly head: Buffer;
    name: string;
    constructor(message: string, code: number | string, response: IncomingMessage, head: Buffer);
}
/**
 * Payload-related errors
 */
export declare class PayloadError extends HttpEngineError {
    readonly payloadType: 'serialization' | 'validation' | 'unsupported';
    constructor(message: string, code?: number | string, payloadType?: 'serialization' | 'validation' | 'unsupported');
}
/**
 * URL parsing errors
 */
export declare class UrlParsingError extends HttpEngineError {
    readonly url: string;
    constructor(message: string, url: string, code?: number | string);
}
/**
 * Configuration errors
 */
export declare class ConfigurationError extends HttpEngineError {
    readonly configType: 'request' | 'proxy' | 'auth' | 'timeout';
    constructor(message: string, code?: number | string, configType?: 'request' | 'proxy' | 'auth' | 'timeout');
}
/**
 * Error factory for creating specific error types
 */
export declare class HttpEngineErrorFactory {
    /**
     * Create a connection error
     */
    static connectionError(message: string, code?: number | string, connectionType?: 'direct' | 'proxy' | 'tunnel'): ConnectionError;
    /**
     * Create an authentication error
     */
    static authenticationError(message: string, code?: number | string, authType?: 'request' | 'proxy' | 'digest' | 'basic' | 'ntlm'): AuthenticationError;
    /**
     * Create a message builder error
     */
    static messageBuilderError(message: string, code?: number | string, component?: 'status' | 'headers' | 'body' | 'host'): MessageBuilderError;
    /**
     * Create a response parsing error
     */
    static responseParsingError(message: string, code?: number | string, parsingStage?: 'status' | 'headers' | 'body' | 'chunked'): ResponseParsingError;
    /**
     * Create a timeout error
     */
    static timeoutError(message: string, code?: number | string, timeoutType?: 'connection' | 'request' | 'response'): TimeoutError;
    /**
     * Create a proxy error
     */
    static proxyError(message: string, code?: number | string, proxyStage?: 'connection' | 'authentication' | 'tunneling' | 'configuration'): ProxyError;
    /**
     * Create a payload error
     */
    static payloadError(message: string, code?: number | string, payloadType?: 'serialization' | 'validation' | 'unsupported'): PayloadError;
    /**
     * Create a URL parsing error
     */
    static urlParsingError(message: string, url: string, code?: number | string): UrlParsingError;
    /**
     * Create a configuration error
     */
    static configurationError(message: string, code?: number | string, configType?: 'request' | 'proxy' | 'auth' | 'timeout'): ConfigurationError;
    /**
     * Convert a generic error to an HTTP engine error
     */
    static fromError(error: Error, category?: string): HttpEngineError;
    /**
     * Create a connection timeout error
     */
    static connectionTimeout(timeoutMs: number): TimeoutError;
    /**
     * Create a request timeout error
     */
    static requestTimeout(timeoutMs: number): TimeoutError;
    /**
     * Create a proxy authentication error
     */
    static proxyAuthRequired(res: IncomingMessage, head: Buffer): ProxyAuthenticationError;
    /**
     * Create a proxy authentication failed error
     */
    static proxyAuthFailed(): AuthenticationError;
    /**
     * Create a proxy configuration error
     */
    static proxyConfigError(message: string): ProxyError;
    /**
     * Create a payload serialization error
     */
    static payloadSerializationError(message: string): PayloadError;
    /**
     * Create an unsupported payload error
     */
    static unsupportedPayload(payloadType: string): PayloadError;
}
//# sourceMappingURL=HttpEngineErrors.d.ts.map