import '../assert_dev_env.js';
/**
 * SSE frame reader over a `ReadableStreamDefaultReader<Uint8Array>`.
 *
 * Transport-agnostic core shared by the in-process SSE route suite
 * (`testing/sse_round_trip.ts`, reading a Hono `Response.body`) and the
 * cross-process `transports/sse_transport.ts` (reading a streaming `fetch`
 * body): `\n\n`-delimited framing, a per-read timeout (so vitest can't hang
 * on a stalled stream), and `wait_for_close` for server-initiated close
 * detection (the auth-guard revocation seam).
 *
 * @module
 */
/** Default per-read / wait-for-close timeout. */
export declare const SSE_FRAME_READ_TIMEOUT_MS = 2000;
/** Frame-level reader returned by `create_sse_frame_reader`. */
export interface SseFrameReader {
    /**
     * Read one complete SSE frame (up to the next `\n\n`), without the
     * trailing terminator. Throws if the per-read timeout elapses or the
     * stream ends before a frame arrives.
     */
    read_frame: (timeout_ms?: number) => Promise<string>;
    /**
     * Drain until the server closes the stream. Resolves `true` if the
     * stream closes within `timeout_ms`, `false` on timeout.
     */
    wait_for_close: (timeout_ms?: number) => Promise<boolean>;
    /** Cancel the underlying reader. Safe to call when already closed. */
    cancel: () => Promise<void>;
}
/**
 * Wrap a byte-stream reader in `\n\n`-delimited SSE frame parsing.
 *
 * Preserves bytes past a frame terminator in an internal buffer for the next
 * `read_frame`. `read_frame` and `wait_for_close` both race each underlying
 * read against `timeout_ms` so a misbehaving stream surfaces as a failure
 * rather than a vitest hang.
 */
export declare const create_sse_frame_reader: (reader: ReadableStreamDefaultReader<Uint8Array>, default_timeout_ms?: number) => SseFrameReader;
//# sourceMappingURL=sse_frame_reader.d.ts.map