@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.
25 lines (24 loc) • 925 B
TypeScript
interface Props {
href?: string;
title?: string;
text?: string;
lazy?: boolean;
fadeIn?: boolean;
}
/**
* Renders a markdown image (``) as an `<img>` element with
* optional lazy loading and fade-in animation.
*
* Uses `IntersectionObserver` to defer loading until the image scrolls near the
* viewport (configurable via `lazy`). On load the image fades in; on error it
* is displayed with reduced opacity and a grayscale filter.
*
* @prop {string} [href=''] - Image source URL.
* @prop {string} [title] - Tooltip text for the image.
* @prop {string} [text=''] - Alt text for accessibility.
* @prop {boolean} [lazy=true] - Enable lazy loading via IntersectionObserver.
* @prop {boolean} [fadeIn=true] - Enable a CSS fade-in transition on load.
*/
declare const Image: import("svelte").Component<Props, {}, "">;
type Image = ReturnType<typeof Image>;
export default Image;