/** * Minimal STOMP 1.x frame codec used by the DingTalk stream-mode gateway. * Pure string logic (no sockets) so it can be unit-tested without a network: * DingTalk's stream gateway speaks STOMP over WebSocket with JSON bodies — * CONNECT / CONNECTED / SUBSCRIBE / MESSAGE / SEND / ERROR frames and bare * newline heartbeats. * @module dsh-connect/channels/dingtalk/stomp */ /** One decoded STOMP frame. */ export interface StompFrame { command: string; headers: Record; body: string; } /** * Escape a header value per STOMP rules: backslash, newline, carriage * return and colon become \\, \n, \r, \c. */ export declare function escapeHeader(value: string): string; /** Reverse of {@link escapeHeader}. */ export declare function unescapeHeader(value: string): string; /** Serialize one frame (command, header block, blank line, body, NUL). */ export declare function encodeFrame(command: string, headers: Record, body?: string): string; /** Result of feeding a chunk into the incremental decoder. */ export interface StompDecodeResult { frames: StompFrame[]; /** Unconsumed tail (partial frame) to carry into the next feed. */ rest: string; } /** * Incrementally decode STOMP frames from a string buffer. Frames are * NUL-terminated; heartbeats (bare newlines) and other whitespace-only * segments are skipped. Returns the decoded frames plus the leftover tail. */ export declare function decodeFrames(buffer: string): StompDecodeResult; //# sourceMappingURL=stomp.d.ts.map