| 1 | import type { HTMLAttributes, ReactNode } from "react"; |
| 2 | |
| 3 | export interface StreamHtmlProps extends HTMLAttributes<HTMLDivElement> { |
| 4 | /** Raw HTML string — typically streamed from an AI model */ |
| 5 | children?: string; |
| 6 | /** Plain-text reasoning / thinking tokens (streamed separately from HTML content) */ |
| 7 | reasoning?: string; |
| 8 | /** Whether content is still streaming (shows caret, skips final polish) */ |
| 9 | isStreaming?: boolean; |
| 10 | /** Show blinking caret at end while streaming (default: true when isStreaming) */ |
| 11 | caret?: boolean; |
| 12 | /** Repair incomplete HTML before render (default: true) */ |
| 13 | repair?: boolean; |
| 14 | /** Sanitize HTML with DOMPurify (default: true) */ |
| 15 | sanitize?: boolean; |
| 16 | /** Memoize completed blocks for performance (default: true) */ |
| 17 | memoizeBlocks?: boolean; |
| 18 | /** Custom caret element HTML (default: span.sh-caret) */ |
| 19 | caretHtml?: string; |
| 20 | /** DOMPurify config override */ |
| 21 | sanitizeConfig?: import("dompurify").Config; |
| 22 | /** Wrapper className */ |
| 23 | className?: string; |
| 24 | /** Fallback when empty and not streaming */ |
| 25 | fallback?: ReactNode; |
| 26 | /** Label for the reasoning block (default: "Thinking") */ |
| 27 | thinkingLabel?: string; |
| 28 | /** Force reasoning panel open/closed; default opens while streaming before HTML arrives */ |
| 29 | thinkingOpen?: boolean; |
| 30 | /** Shown while streaming reasoning but HTML content has not started yet */ |
| 31 | reasoningPendingLabel?: string; |
| 32 | } |
| 33 | |
| 34 | export interface StreamHtmlBlockProps { |
| 35 | html: string; |
nothing calls this directly
no outgoing calls
no test coverage detected