/** One server-sent event: its `event` field, its `data` lines joined by "\n", and its raw lines for diagnostics. */ export interface ServerSentEvent { event: string | null; data: string; raw: string[]; } /** * Decodes server-sent events from a UTF-8 byte stream. Lines end with LF, CRLF or CR, and a blank line ends an * event. Only new text is scanned, and an incomplete line is read once when it ends, so a large event arriving in * many chunks costs time linear in its size. */ export declare class SseDecoder { private readonly decoder; /** The incomplete last line. */ private pendingLine; /** The last text ended with CR, so a leading LF of the next text completes that CRLF. */ private skipLeadingLf; private event; private data; private raw; /** Takes the next bytes and returns the events they complete. */ push(bytes: Uint8Array): ServerSentEvent[]; /** Ends the stream and returns the remaining events, including a last one the stream ended without a blank line. */ end(): ServerSentEvent[]; private decodeText; private decodeLine; private flush; } //# sourceMappingURL=sse.d.ts.map