import type { ChildProcessWithoutNullStreams } from "node:child_process"; import type { LspNotificationMessage } from "./types.js"; export interface JsonRpcOptions { child: ChildProcessWithoutNullStreams; onNotification?: (notification: LspNotificationMessage) => void; requestTimeoutMs?: number; } export declare class JsonRpcClient { private nextId; private pending; private buffer; private child; private onNotification?; private requestTimeoutMs; private disposed; constructor(opts: JsonRpcOptions); private stderrTail; /** Set/replace the notification handler (e.g. LSP diagnostics routing). */ setNotificationHandler(handler: ((n: LspNotificationMessage) => void) | undefined): void; private captureStderr; getDiagnosticStderr(): string; /** Send a request. Returns a promise resolved/rejected by the response. */ request(method: string, params: unknown, timeoutMs?: number): Promise; /** Send a notification (no response expected). */ notify(method: string, params: unknown): void; /** Send a server-cancellation $/cancelRequest notification. */ cancelRequest(id: number): void; /** Reject all pending requests (used on shutdown/crash). */ rejectAllPending(reason: string): void; private send; private onData; private tryParse; private dispatch; dispose(): void; } //# sourceMappingURL=jsonrpc.d.ts.map