import type { EventSource, EventSourcePayload } from '../event-source-registry';
import type { ExecutionContext } from '../../types/core';
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
export interface ServerRequest {
    method: HttpMethod;
    url: string;
    path: string;
    query: Record<string, string | string[]>;
    params: Record<string, string>;
    headers: Record<string, string | string[]>;
    body: unknown;
}
export interface ServerResponse {
    status(code: number): ServerResponse;
    header(name: string, value: string): ServerResponse;
    json(data: unknown): void;
    html(content: string): void;
    text(content: string): void;
    redirect(url: string, code?: number): void;
    send(data: unknown): void;
}
export interface RequestHandler {
    method: HttpMethod | '*';
    pattern: string | RegExp;
    handler: (payload: EventSourcePayload, context: ExecutionContext) => void;
}
export declare function createRequestEventSource(): EventSource & {
    handleRequest(request: ServerRequest, response: ServerResponse): boolean;
};
export declare function createWebSocketEventSource(): EventSource;
export declare function createSSEEventSource(): EventSource;
//# sourceMappingURL=server-event-source.d.ts.map