import * as http2 from 'http2'; import { SyncPeerHttpReceiver_V1 } from './sync-peer-http-receiver-v1.mjs'; export interface SyncHttpNodeAdapterOpts { /** The receiver peer to route sync traffic to */ receiverPeer: SyncPeerHttpReceiver_V1; /** The port to listen on. Defaults to 8080. */ port?: number; /** * Base path for the sync routes. Defaults to '/sync'. * Will expose `/sync/frame` (POST) and `/sync/events` (GET). */ basePath?: string; /** TLS/SSL Private Key (needed for secure HTTP/2) */ key?: string | Buffer; /** TLS/SSL Certificate (needed for secure HTTP/2) */ cert?: string | Buffer; /** TLS/SSL PFX file (alternative to key/cert on Windows) */ pfx?: string | Buffer; /** * Password for TLS/SSL PFX file * * Called "passphrase", because {@link http2.SecureServerOptions} * */ passphrase?: string; } /** * A basic Node HTTP adapter for the Symmetric Sync Protocol. * * Handles establishing the SSE EventSource stream (GET /sync/events) * and receiving the Uplink (POST /sync/frame). * * NOTE: This is built using Node's standard `http` module. In a real * production app (e.g. `node-gib` or a consumer app), you might adapt this * to Express, Fastify, or directly to an HTTP/2 server. */ export declare class SyncHttpNodeAdapter_V1 { opts: SyncHttpNodeAdapterOpts; protected lc: string; protected server?: http2.Http2Server | http2.Http2SecureServer; protected receiverPeer: SyncPeerHttpReceiver_V1; protected port: number; protected basePath: string; /** * Map of clientId to their active Server-Sent Events HTTP Response streams. */ protected activeSseStreams: Map>; constructor(opts: SyncHttpNodeAdapterOpts); /** * Starts the HTTP Server listening on the configured port. */ start(): Promise; /** * Stops the HTTP Server and closes all active streams. */ stop(): Promise; protected handleRequest(req: http2.Http2ServerRequest, res: http2.Http2ServerResponse): Promise; protected handleSseStreamRequest(req: http2.Http2ServerRequest, res: http2.Http2ServerResponse, url: URL): Promise; protected handleSyncFrameRequest(req: http2.Http2ServerRequest, res: http2.Http2ServerResponse, url: URL): Promise; protected readRequestBody(req: http2.Http2ServerRequest): Promise; } //# sourceMappingURL=sync-http-node-adapter.d.mts.map