/**
 * Lightweight SSE event parser used by the streaming AI test panel (R5).
 *
 * EventSource doesn't support POST + body, so the panel hand-parses SSE from a fetch
 * `ReadableStream`. This helper isolates the parsing so it can be unit-tested without
 * spinning up an HTTP roundtrip.
 *
 * Contract: each SSE event ends with a blank line (`\n\n`); inside an event, lines starting
 * with `data:` carry the payload. We deliberately ignore `event:`/`id:`/`retry:` lines because
 * the AI streaming endpoint doesn't use them — adding support there would be over-engineering
 * for the current contract.
 */
/** Result of consuming a chunk from the SSE stream. */
export interface SseParseResult<TPayload> {
    /** Parsed payloads from complete events found in the buffer. */
    readonly events: readonly TPayload[];
    /** Trailing fragment of the buffer (incomplete event, kept for the next call). */
    readonly remainder: string;
}
/**
 * Drains complete SSE events from a buffer. The leftover (an event in flight) is returned in
 * `remainder`; the caller appends the next network chunk to it before calling again.
 *
 * Lines that fail to JSON-parse are silently dropped — defensive design: a malformed event
 * shouldn't tear down the stream. Callers wanting strict behaviour can validate the parsed
 * payload shape downstream.
 */
export declare function parseSseEvents<TPayload = unknown>(buffer: string): SseParseResult<TPayload>;
//# sourceMappingURL=sseStreamParser.d.ts.map