import type { ServerResponse } from 'node:http';
import type { BaseAppConfig } from '../app/config';
import { type ScopedLogger } from '../services/logger';
import type { HttpRequest } from './request';
type RequestLoggingMode = BaseAppConfig['HTTP_REQUEST_LOGGING_MODE'];
export interface HttpRequestLoggingOptions {
    excludePaths?: (string | RegExp)[];
}
interface RequestLoggingState {
    request: HttpRequest;
    logger: ScopedLogger;
    mode: RequestLoggingMode;
    startedAt: number;
    skipped: boolean;
    aborted: boolean;
    finished: boolean;
    hooked: boolean;
    onClose?: () => void;
    onFinish?: () => void;
}
interface ResponseLoggingTarget {
    statusCode: number;
    writableEnded: boolean;
}
export declare class HttpRequestLogger {
    private readonly config;
    private readonly logger;
    private readonly options;
    constructor(config: BaseAppConfig, logger: ScopedLogger, options?: HttpRequestLoggingOptions);
    createState(request: HttpRequest, outgoing: ServerResponse): RequestLoggingState;
    start(state: RequestLoggingState): void;
    finish(state: RequestLoggingState, response: ResponseLoggingTarget): void;
    hook(state: RequestLoggingState, response: ResponseLoggingTarget): void;
    error(state: RequestLoggingState, error: unknown, response: ResponseLoggingTarget): void;
    errorForRequest(request: HttpRequest, response: ResponseLoggingTarget, startedAt: number, error: unknown): void;
    private loggerFor;
    dispose(state: RequestLoggingState, outgoing: ServerResponse): void;
    shouldSkip(request: HttpRequest): boolean;
    shouldLogFinish(state: Pick<RequestLoggingState, 'mode' | 'skipped'>, _statusCode: number): boolean;
    shouldLogAbort(state: Pick<RequestLoggingState, 'mode' | 'skipped'>): boolean;
}
export {};
//# sourceMappingURL=request-logging.d.ts.map