import type { IncomingMessage, ServerResponse } from '../node-singletons/http';
type Tbody = string | Buffer | ReadableStream<Uint8Array> | null;
/**
 * Request body type for handlers
 */
export type IRequestBody = Buffer;
/**
 * HTTP request/response for serverless and edge platforms
 */
export interface PlatformRequest {
    method: string;
    path: string;
    headers: Record<string, string | string[]>;
    body?: Tbody;
    query?: Record<string, string | string[]>;
    remoteAddr?: string;
    signal?: AbortSignal;
}
export interface PlatformResponse {
    statusCode: number;
    headers: Record<string, string | string[]>;
    body?: Tbody;
    isBase64Encoded?: boolean;
}
/**
 * RuntimeAdapter interface for platform-agnostic HTTP handling
 * Allows single codebase deployment to Lambda, Fargate, Cloudflare, Deno
 */
export interface RuntimeAdapter {
    /**
     * Platform identifier
     */
    platform: 'nodejs' | 'lambda' | 'fargate' | 'cloudflare' | 'deno';
    /**
     * Handle platform-specific request event
     * Convert to standard HTTP format, process, and normalize response
     */
    handle(event: unknown, context?: unknown): Promise<PlatformResponse>;
    /**
     * Convert platform event to standard PlatformRequest
     */
    parseRequest(event: unknown): PlatformRequest;
    /**
     * Convert ZinTrust response to platform-specific format
     */
    formatResponse(response: PlatformResponse): unknown;
    /**
     * Get platform-specific logger for debugging
     */
    getLogger(): {
        debug(msg: string, data?: unknown): void;
        info(msg: string, data?: unknown): void;
        warn(msg: string, data?: unknown): void;
        error(msg: string, err?: Error): void;
    };
    /**
     * Check if platform supports persistent connections
     */
    supportsPersistentConnections(): boolean;
    /**
     * Get environment configuration object
     */
    getEnvironment(): {
        nodeEnv: NodeJS.ProcessEnv['NODE_ENV'];
        runtime: string;
        dbConnection: string;
        dbHost?: string;
        dbPort?: number;
        [key: string]: unknown;
    };
}
/**
 * Request handler that processes HTTP requests through ZinTrust framework
 */
export type ZintrustHandler = (req: IncomingMessage, res: ServerResponse, body: Tbody) => Promise<void>;
/**
 * Adapter configuration options
 */
export interface AdapterConfig {
    handler: ZintrustHandler;
    logger?: {
        debug(msg: string, data?: unknown): void;
        info(msg: string, data?: unknown): void;
        warn(msg: string, data?: unknown): void;
        error(msg: string, err?: Error): void;
    };
    timeout?: number;
    maxBodySize?: number;
}
/**
 * Response wrapper for normalizing HTTP responses across platforms
 */
export interface IHttpResponse {
    statusCode: number;
    headers: Record<string, string | string[]>;
    body: Tbody;
    isBase64Encoded: boolean;
    setStatus(code: number): IHttpResponse;
    setHeader(key: string, value: string | string[]): IHttpResponse;
    setHeaders(headers: Record<string, string | string[]>): IHttpResponse;
    setBody(body: Tbody, isBase64?: boolean): IHttpResponse;
    setJSON(data: unknown): IHttpResponse;
    toResponse(): PlatformResponse;
}
export declare const HttpResponse: Readonly<{
    create(): IHttpResponse;
}>;
/**
 * Error response helper
 */
export declare const ErrorResponse: Readonly<{
    create(statusCode: number, message: string, details?: unknown): IHttpResponse;
}>;
type ResData = {
    statusCode: number;
    headers: Record<string, string | string[]>;
    body: Tbody;
};
export declare function createMockHttpObjects(request: PlatformRequest): {
    req: Record<string, unknown>;
    res: Record<string, unknown>;
    responseData: ResData;
};
export {};
//# sourceMappingURL=RuntimeAdapter.d.ts.map