import { EventEmitter } from 'events';
import { Headers } from '../../../lib/headers/Headers.js';
import { type Logger, type ILogObj } from '../../../lib/logging/index.js';
export declare enum RequestState {
    Status = 0,
    Headers = 1,
    Body = 2,
    Done = 3
}
export interface ResponseInfo {
    status?: number;
    contentLength?: number;
    chunked: boolean;
    body?: Buffer;
    chunk?: Buffer;
    chunkSize?: number;
}
export interface ParserCallbacks {
    onStatusParsed: (status: number, statusText: string) => void;
    onHeadersParsed: (headers: Headers) => void;
    onBodyComplete: (body: Buffer) => void;
    onError: (error: Error) => void;
    onAbort: () => void;
    emit: (event: string, detail?: unknown) => void;
}
/**
 * HTTP Response Parser
 * Handles parsing of HTTP response data including status, headers, and body
 */
export declare class HttpResponseParser extends EventEmitter {
    private state;
    private rawHeaders?;
    private responseInfo;
    private logger;
    private callbacks;
    private aborted;
    private statusParser;
    private headersParser;
    private bodyParser;
    constructor(logger: Logger<ILogObj>, callbacks: ParserCallbacks);
    /**
     * Process incoming HTTP response data
     * @param data Buffer containing HTTP response data
     */
    processData(data: Buffer): void;
    /**
     * Process HTTP status line
     * @param data Buffer containing status line data
     * @returns Remaining data after status parsing
     */
    private processStatus;
    /**
     * Process HTTP headers
     * @param data Buffer containing header data
     * @returns Remaining data after header parsing
     */
    private processHeaders;
    /**
     * Parse headers and extract response information
     * @param buffer Raw headers buffer
     */
    private parseHeaders;
    /**
     * Check if response should end after headers
     * @param data Remaining data after headers
     * @returns Data to continue processing or undefined to end
     */
    private postHeaders;
    /**
     * Process HTTP body data
     * @param data Buffer containing body data
     */
    private processBody;
    /**
     * Abort the parser
     */
    abort(): void;
    /**
     * Reset parser state
     */
    reset(): void;
    /**
     * Get current parser state
     */
    getState(): RequestState;
    /**
     * Get response information
     */
    getResponseInfo(): ResponseInfo;
}
//# sourceMappingURL=HttpResponseParser.d.ts.map