UNPKG

@humanspeak/svelte-markdown

Version:

Markdown and HTML renderer for Svelte 5 — built for rendering streaming AI agent output from Claude Code, ChatGPT, and agentic workflows. XSS-safe defaults, streaming-aware sanitization, token caching, TypeScript types, and Svelte 5 runes.

14 lines (13 loc) 613 B
import type { Token } from './markdown-parser.js'; export type ReusableStreamingNode = { raw?: string; text?: string; type?: string; }; /** Returns whether two nodes and every nested token array have one stable identity. */ export declare const isSameStableNode: (previousNode: ReusableStreamingNode, nextNode: ReusableStreamingNode) => boolean; /** * Reuses stable token objects from a previous streaming parse to preserve * component identity across incremental updates. */ export declare const reuseStableTokenArray: (previousTokens: Token[], nextTokens: Token[], divergeAt: number) => Token[];