import type { MessageWriterOptions } from "vscode-jsonrpc/node"; /** * The content-type encoder shape vscode-jsonrpc's {@link MessageWriterOptions} accepts. Derived * from the writer options rather than deep-imported, because the concrete `ContentTypeEncoder` * type is not re-exported from the package entrypoint. */ export type JsonRpcContentTypeEncoder = NonNullable; /** * Yields a value as the sequence of JSON text fragments that concatenate to exactly * {@code JSON.stringify(value)}, without ever building the whole document as one string. Every * scalar and every object key is serialized by the engine's {@code JSON.stringify} — so escaping, * number formatting, {@code undefined}/function/symbol handling, and {@code toJSON} all match it * exactly — and only the structural punctuation is emitted here. */ export declare function jsonFragments(value: unknown): Generator; /** * A drop-in replacement for vscode-jsonrpc's default `application/json` content-type encoder that * serializes a message to UTF-8 bytes without ever materializing the whole document as a single JS * string. The default encoder does {@code Buffer.from(JSON.stringify(msg))}; a large enough * PrepareRecipe response (a deep recipe tree) overflows V8's single-string limit and throws * "RangeError: Invalid string length", hanging the RPC call. Streaming the * fragments into a Buffer raises the ceiling to Node's Buffer.MAX_LENGTH (multiple GB) while * producing byte-identical output. (True unbounded streaming needs chunked framing — Content-Length * still requires the whole body up front — so this is a ceiling raise, not a removal.) */ export declare const chunkedJsonEncoder: JsonRpcContentTypeEncoder; //# sourceMappingURL=message-encoder.d.ts.map