import { Patch } from 'mini-rfc6902'; /** * Defines the structure of an emitted SSE event. */ interface EmittedEvent { /** Optional ID of the chunk/status event */ id?: string; /** Unique event ID relevant for chunk tracking */ event_id: string; /** Correlation ID to associate events */ correlation_id: string; /** Type of event being emitted */ kind: string; /** List of patch operations applied to the event */ patches: Patch; /** Optional payload containing event-specific data */ data?: { [key: string]: unknown; }; /** Optional metadata related to the event */ metadata?: { [key: string]: unknown; } | null; } type StreamOptions = { serverUrl: string; }; /** * A custom hook that encapsulates SSE events streaming. */ declare function useStream(options?: StreamOptions): { events: EmittedEvent[]; streaming: boolean; error: Error | null; startStreaming: (sessionId: string, input: string) => void; stopStreaming: () => void; }; export { type EmittedEvent, type StreamOptions, useStream };