/**
 * StreamingResponse Component Types
 * Type definitions for the StreamingResponse component
 */
import type { ReactNode } from "react";
import type { SSEFormat, SSEParser } from "../../../utils/sseFormatParsers";
import type { StreamingError, RetryConfig } from "../../../utils";
import type { MessageRole } from "../../core/Message";
/**
 * Avatar configuration for Message component
 */
export interface MessageAvatarProps {
    src?: string;
    name: string;
    fallback?: ReactNode;
}
/**
 * Markdown rendering options
 */
export interface MarkdownOptions {
    /** Allow HTML in markdown (default: false) */
    allowHtml?: boolean;
    /** Syntax highlighting theme (default: 'light') */
    syntaxTheme?: "light" | "dark";
    /** Custom code block renderer */
    renderCodeBlock?: (code: string, language: string) => ReactNode;
}
/**
 * Props for StreamingResponse component
 */
export interface StreamingResponseProps {
    /** 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;
    /** 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;
    /** Typewriter animation speed in ms per word (default: 100) */
    typingSpeed?: number;
    /** Enable typewriter animation after streaming completes (default: true) */
    enableTypewriter?: boolean;
    /** Enable markdown rendering (default: true) */
    enableMarkdown?: boolean;
    /** Markdown rendering options */
    markdownOptions?: MarkdownOptions;
    /** Enable smooth streaming animations (default: true) */
    animated?: boolean;
    /** Show blinking cursor while streaming (default: true) */
    showCursor?: boolean;
    /** Number of recent words to animate during streaming (default: 6) */
    animateLastN?: number;
    /** Message role (default: 'assistant') */
    role?: MessageRole;
    /** Avatar configuration */
    avatar?: MessageAvatarProps;
    /** Show timestamp (default: true) */
    showTimestamp?: boolean;
    /** Show action buttons (copy, regenerate) (default: true) */
    showActions?: boolean;
    /** Copy button handler */
    onCopy?: () => void;
    /** Regenerate button handler */
    onRegenerate?: () => void;
    /** Retry configuration */
    retry?: RetryConfig;
    /** Timeout in milliseconds (default: 30000) */
    timeout?: number;
    /** Show error UI (default: true) */
    showError?: boolean;
    /** Custom error render function */
    renderError?: (error: StreamingError, retry: () => void) => ReactNode;
    /** Custom className for Message container */
    className?: string;
}
/**
 * Theme overrides for StreamingResponse component
 */
export interface StreamingResponseTheme {
    /** Error container style */
    errorContainerStyle?: string;
    /** Error title style */
    errorTitleStyle?: string;
    /** Error message style */
    errorMessageStyle?: string;
    /** Error retry button style */
    errorRetryButtonStyle?: string;
    /** Loading indicator container style */
    loadingContainerStyle?: string;
    /** Loading dot style */
    loadingDotStyle?: string;
}
