/**
 * Port for HTTP server creation.
 *
 * Abstracts platform-specific HTTP server APIs so domain code
 * doesn't depend on node:http directly.
 */
import WarpError from '../domain/errors/WarpError.ts';
interface HttpRequestOptions {
    readonly method: string;
    readonly url: string;
    readonly headers: Record<string, string>;
    readonly body?: Uint8Array | undefined;
}
interface HttpResponseOptions {
    readonly status?: number | undefined;
    readonly headers?: Record<string, string> | undefined;
    readonly body?: string | Uint8Array | null | undefined;
}
export declare class HttpBoundaryError extends WarpError {
    constructor(message: string, field: string);
}
export declare class HttpRequest {
    /** HTTP method (GET, POST, etc.) */
    readonly method: string;
    /** Request URL path + query string */
    readonly url: string;
    /** Lowercased header map */
    readonly headers: Record<string, string>;
    /** Raw body bytes (undefined for bodiless requests) */
    readonly body: Uint8Array | undefined;
    constructor(options: HttpRequestOptions);
    static from(request: HttpRequest | HttpRequestOptions): HttpRequest;
}
export declare class HttpResponse {
    /** HTTP status code (defaults to 200) */
    readonly status?: number | undefined;
    /** Response headers */
    readonly headers?: Record<string, string> | undefined;
    /** Response body */
    readonly body?: string | Uint8Array | null | undefined;
    constructor(options?: HttpResponseOptions);
    static from(response: HttpResponse | HttpResponseOptions): HttpResponse;
}
export interface HttpServerHandle {
    listen(port: number, host?: string | ((err?: Error | null) => void), callback?: (err?: Error | null) => void): void;
    close(callback?: (err?: Error) => void): void;
    address(): {
        address: string;
        port: number;
        family: string;
    } | null;
}
/** Port for HTTP server creation. */
export default abstract class HttpServerPort {
    /**
     * Creates an HTTP server with a platform-agnostic request handler.
     *
     * The request handler receives an HttpRequest and must return an HttpResponse
     * shape `{ status, headers, body }`. No raw req/res objects
     * are exposed to the domain.
     */
    abstract createServer(_requestHandler: (request: HttpRequest) => Promise<HttpResponse>): HttpServerHandle;
}
export {};
