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.

35 lines (34 loc) 1.15 kB
/** * Canonical key lists for markdown renderers and HTML tag renderers. * * These arrays and types drive the allow/deny filter utilities and serve as * the single source of truth for which renderer and HTML tag names the * library recognizes. * * @module */ import Html from '../renderers/html/index.js'; import { type Renderers } from './markdown-parser.js'; /** * Union type of every valid markdown renderer key (excludes `'html'`). * * Derived from the {@link Renderers} interface at the type level. */ export type RendererKey = Exclude<keyof Renderers, 'html'>; /** * Canonical array of every markdown renderer key. * * Re-exported publicly as `rendererKeys`. Built at runtime from * `defaultRenderers` (filtering out the special `html` key). */ export declare const rendererKeysInternal: RendererKey[]; /** * Union type of every supported HTML tag name that has a dedicated renderer. */ export type HtmlKey = keyof typeof Html & string; /** * Canonical array of every HTML tag name with a built-in renderer. * * Re-exported publicly as `htmlRendererKeys`. */ export declare const htmlRendererKeysInternal: HtmlKey[];