import type { LspTransport } from "./types.js"; /** The slice of `ws`'s WebSocket the transport uses (so tests can supply a fake). */ export interface WsLike { send(data: string): void; close(): void; on(event: "message" | "close" | "error" | "pong", listener: (arg?: unknown) => void): void; /** WS ping frame (keepalive + liveness probe). Optional — fakes without it get no ping-liveness. */ ping?(): void; /** Hard-kill the socket (skip the close handshake) — used when a ping goes unanswered (half-open). */ terminate?(): void; } export declare class WsLspTransport implements LspTransport { private readonly ws; private readonly requestTimeoutMs; private nextId; private readonly pending; private isClosed; private keepalive; private awaitingPong; /** [ref]: server→client NOTIFICATION subscribers (publishDiagnostics etc.). */ private readonly notificationHandlers; constructor(ws: WsLike, requestTimeoutMs?: number, keepaliveMs?: number); /** Manager-visible liveness (LspTransport.closed): evict + reopen instead of reusing a dead connection. */ get closed(): boolean; private onMessage; private failAll; request(method: string, params: unknown, signal?: AbortSignal): Promise; notify(method: string, params: unknown): void; /** [ref] (core 1.220): subscribe to server→client notifications; returns unsubscribe. Additive — * core's diagnostics registry is the intended consumer; with no subscriber, behavior is byte-identical. */ onNotification(handler: (method: string, params: unknown) => void): () => void; close(): Promise; } /** * Connect to a language server's WS bridge inside E2B and run the LSP `initialize`/`initialized` handshake. * Returns `undefined` on any failure (→ the manager degrades that language gracefully). `wsUrl` is the * `wss://…e2b.dev` URL from `sandbox.getHost(port)`; `rootPath` is the in-sandbox workspace root. */ export declare function connectWsLspTransport(wsUrl: string, rootPath: string, signal?: AbortSignal, initializationOptions?: unknown): Promise; //# sourceMappingURL=ws-transport.d.ts.map