#!/usr/bin/env node
/**
 * SSEParser - Parse Server-Sent Events (SSE) stream
 *
 * Handles:
 * - Incomplete events across chunks
 * - Multiple events in single chunk
 * - Malformed data (skip gracefully)
 * - [DONE] marker
 *
 * Usage:
 *   const parser = new SSEParser();
 *   stream.on('data', chunk => {
 *     const events = parser.parse(chunk);
 *     events.forEach(event => { ... });
 *   });
 */
/// <reference types="node" />
/// <reference types="node" />
interface SSEParserOptions {
    maxBufferSize?: number;
    throwOnMalformedJson?: boolean;
}
interface SSEEvent {
    event: string;
    data: unknown;
    index?: number;
    id?: string;
    retry?: number;
}
export declare class SSEParser {
    private buffer;
    private eventCount;
    private maxBufferSize;
    private throwOnMalformedJson;
    constructor(options?: SSEParserOptions);
    /**
     * Parse chunk and extract SSE events
     * @param chunk - Data chunk from stream
     * @returns Array of parsed events
     */
    parse(chunk: Buffer | string): SSEEvent[];
    /**
     * Reset parser state (for reuse)
     */
    reset(): void;
}
export {};
//# sourceMappingURL=sse-parser.d.ts.map