/** * Nexus Connect — Server-Sent Events handler. * * Returns a streaming Response that stays open until the client disconnects. * Works with any Web-standard Request/Response environment (Node 18+, Bun, Deno, Cloudflare Workers). * * SSE wire format: * id: \n * event: message\n * data: \n\n * * : heartbeat\n\n ← keep-alive comment (every 15s) */ export declare const CONNECT_PATH = "/_nexus/connect/"; export interface ConnectSseOptions { cors?: { allowOrigin?: string; }; } /** Extract the topic name from a /_nexus/connect/:topic URL. */ export declare function topicFromUrl(url: URL): string; /** Returns true if this request should be handled by Nexus Connect. */ export declare function isConnectRequest(url: URL): boolean; /** * Creates a streaming SSE Response for the given topic. * The response stays open until the client disconnects (request.signal aborts). */ export declare function handleSSERequest(request: Request, topic: string, opts?: ConnectSseOptions): Response; /** * Node.js adapter — writes SSE directly to a ServerResponse. * Use this when you cannot return a Web Response (e.g. in http.createServer callbacks). */ export declare function handleSSERequestNode(req: { signal?: AbortSignal; on?: (event: string, fn: () => void) => void; }, res: { writeHead: (s: number, h: Record) => void; write: (s: string) => boolean; end: () => void; }, topic: string, opts?: ConnectSseOptions): void; //# sourceMappingURL=sse.d.ts.map