import { Ref } from 'vue'; export type EventStreamTransport = (input: RequestInfo | URL, init?: RequestInit) => Promise; export interface EventStreamMessage { event: string; data: TData; id?: string; retry?: number; raw: string; } export interface EventStreamOptions { transport?: EventStreamTransport; headers?: HeadersInit; credentials?: RequestCredentials; immediate?: boolean; /** * Reconnect after a dropped stream. Left unset, it follows the platform's * `wsAutoReconnect` setting, defaulting to `true` without a settings store. */ reconnect?: boolean; /** * Delay before the first reconnect attempt. Left unset, it follows the * platform's `wsReconnectInterval` setting, defaulting to 2000 ms without a * settings store. A server-sent `retry:` field still overrides it. */ reconnectDelayMs?: number; parseJson?: boolean; shouldReconnect?: (cause?: unknown) => boolean; onOpen?: () => void; onMessage?: (message: EventStreamMessage) => void; onError?: (cause: unknown) => void; onClose?: (cause?: unknown) => void; errorLabel?: string; } export interface UseEventStreamReturn { isConnected: Ref; isConnecting: Ref; error: Ref; lastMessage: Ref | null>; lastEventId: Ref; start: () => void; stop: () => void; } interface ParsedEventStreamBlock { message?: EventStreamMessage; id?: string; retry?: number; } /** Parse one complete SSE block without owning connection policy. */ export declare function parseEventStreamBlock(block: string, parseJson: boolean): ParsedEventStreamBlock | null; /** Shared fetch-based SSE lifecycle with cancellation and reconnect safety. */ export declare function useEventStream(url: string | (() => string), options?: EventStreamOptions): UseEventStreamReturn; export {};