import type { Server as HttpServer } from 'http';
import { WebSocketServer, WebSocket } from 'ws';
export interface HarnessWsServer {
    wss: WebSocketServer;
    /** Number of currently connected clients. */
    clientCount(): number;
    /** Number of clients that were dropped because their buffer overflowed. */
    overflowCount(): number;
    /** Broadcast an arbitrary message to every connected client. */
    broadcast(message: unknown): void;
    /** Stop the server and close all connections. */
    close(): Promise<void>;
}
export interface WsServerOptions {
    /** Maximum buffered messages per client before overflow drop. Defaults to 256. */
    bufferSize?: number;
    /**
     * Optional override of the test-only "is the socket buffer full" predicate.
     * In production we use ws's own bufferedAmount; tests can inject a stub.
     */
    isBackpressuredFn?: (ws: WebSocket) => boolean;
    /**
     * Coalesce window for harness events (ms). When > 0, events emitted
     * within the window are batched into a single `event_batch` message
     * sent to every client. 0 disables batching (default — preserves
     * original single-event semantics).
     */
    coalesceWindowMs?: number;
}
export declare function attachWsServer(httpServer: HttpServer, options?: WsServerOptions): HarnessWsServer;
//# sourceMappingURL=wsServer.d.ts.map