/** * `Content-Length` message framing, shared by the DAP and LSP clients. * * Godot serves BOTH its Debug Adapter (port 6006, DAP envelopes) and its * GDScript language server (port 6005, JSON-RPC 2.0) over raw TCP using the * same header format: * * Content-Length: \r\n\r\n * * so the transport is written once here rather than twice. */ import net from 'node:net'; export type FramedMessage = Record; /** Serialize a JSON message as a Content-Length frame. */ export declare function encodeFrame(msg: FramedMessage): Buffer; /** * Incremental frame decoder. TCP hands us arbitrary chunk boundaries, so one * frame can arrive split across reads and several frames can land in a single * read. Invalid or oversized frames fail explicitly so the connection can close * and pending protocol requests fail instead of hanging until their timeouts. */ export declare const MAX_FRAME_BYTES: number; export declare class FrameDecoder { private readonly onMessage; private header; private body; private received; private readonly utf8; constructor(onMessage: (msg: FramedMessage) => void); push(chunk: Buffer): void; reset(): void; } /** * Lazily-connected TCP transport with the framing above. Both protocol clients * connect on first send and reconnect after a drop. */ export declare class FramedConnection { private readonly host; private readonly port; /** Shown when the port isn't listening, to point at the right editor setting. */ private readonly unavailableHint; private socket; private connecting; private decoder; private onMessageCb; private onCloseCb; constructor(host: string, port: number, /** Shown when the port isn't listening, to point at the right editor setting. */ unavailableHint: string); onMessage(cb: (msg: FramedMessage) => void): void; onClose(cb: (error?: Error) => void): void; isConnected(): boolean; connect(): Promise; send(msg: FramedMessage): Promise; close(): void; } //# sourceMappingURL=framing.d.ts.map