/**
 * useStreamingSSE Hook
 * Handles Server-Sent Events (SSE) streaming for AI/LLM responses
 * Supports OpenAI, Anthropic (Claude), and Google Gemini formats
 */
import { type SSEFormat, type SSEParser } from '../utils/sseFormatParsers';
import { type StreamingError } from '../utils/streamingErrors';
import { type RetryConfig } from '../utils/retryUtils';
/**
 * Options for useStreamingSSE hook
 */
export interface UseStreamingSSEOptions {
    /** The SSE endpoint URL */
    url: string;
    /** HTTP method (default: 'POST') */
    method?: 'GET' | 'POST';
    /** Request headers */
    headers?: Record<string, string>;
    /** Request body (for POST requests) */
    body?: Record<string, unknown> | string;
    /** Stream format parser (default: 'openai') */
    format?: SSEFormat | SSEParser;
    /** Whether to auto-start streaming on mount (default: true) */
    autoStart?: boolean;
    /** Timeout in milliseconds (default: 30000) */
    timeout?: number;
    /** Retry configuration */
    retry?: RetryConfig;
    /** Called when a new token arrives */
    onToken?: (token: string, accumulatedText: string) => void;
    /** Called when streaming completes successfully */
    onComplete?: (fullText: string) => void;
    /** Called when an error occurs */
    onError?: (error: StreamingError) => void;
    /** Called when streaming starts */
    onStart?: () => void;
    /** Called when streaming is aborted */
    onAbort?: () => void;
}
/**
 * Return value from useStreamingSSE hook
 */
export interface UseStreamingSSEReturn {
    /** Current accumulated text */
    accumulatedText: string;
    /** Whether actively streaming */
    isStreaming: boolean;
    /** Current error state */
    error: StreamingError | null;
    /** Whether streaming completed successfully */
    isComplete: boolean;
    /** Current retry attempt (0-indexed) */
    retryAttempt: number;
    /** Start streaming */
    start: () => void;
    /** Stop streaming (abort) */
    stop: () => void;
    /** Retry streaming */
    retry: () => void;
    /** Reset to initial state */
    reset: () => void;
}
/**
 * Hook for handling SSE streaming from AI/LLM APIs
 *
 * @example
 * const {
 *   accumulatedText,
 *   isStreaming,
 *   error,
 *   start,
 *   stop
 * } = useStreamingSSE({
 *   url: '/api/chat',
 *   format: 'openai',
 *   onToken: (token) => console.log('New token:', token),
 *   onComplete: (text) => console.log('Complete:', text),
 * });
 */
export declare const useStreamingSSE: (options: UseStreamingSSEOptions) => UseStreamingSSEReturn;
