import { c as VElement, d as VNode, f as VNodeQuery, o as VDocument, s as VDocumentFragment, u as VHTMLDocument } from "./html-CCEfgn9l.cjs"; import "./html-strict-4yHTxx5U.cjs"; import "./jsx-runtime.cjs"; declare function escapeHTML(text: string): string; declare const unescapeHTML: (html: string) => string; interface Context { h?: any; document: VDocument | VDocumentFragment; } declare function hArgumentParser(tag: string | ((props: any) => VDocumentFragment | VElement), attrs?: Record | unknown[] | null, ...childrenInput: unknown[]): { tag: string | ((props: any) => VDocumentFragment | VElement); attrs: Record; children: unknown[]; }; declare function hFactory(context: Context): any; declare function handleHTML(html: string, handler: (document: VHTMLDocument | VDocumentFragment) => void): string; interface SerializeMarkdownOptions { /** Wrap column for soft-wrapping long lines. `0` or omitted disables wrapping. */ wrap?: number; /** * How `…` and `…` are rendered. * - `'inline'` (default): `[text](url)` / `![alt](src)` — standard inline syntax * - `'autolink'`: `text ` / `alt ` — label followed by an autolink * (or just `` / `` if the label is empty or equals the URL) */ linkStyle?: 'inline' | 'autolink'; /** * When `false`, inline text-styling tags (`b`, `strong`, `i`, `em`, `u`, `mark`, * `tt`, `code`, `strike`, `del`, `ins`, `sub`, `sup`) are unwrapped and rendered * as plain text. Default `true` (styles preserved). */ inlineStyles?: boolean; /** * How `…` is rendered. * - `'full'` (default): `![alt](src)` (or autolink form when `linkStyle: 'autolink'`) * - `'alt'`: only the alt text in brackets (`[alt]`), no URL; empty alt → omitted * - `'none'`: image is stripped entirely */ imageStyle?: 'full' | 'alt' | 'none'; /** * Append the `id` of a heading as ` {#id}` (Pandoc / kramdown style anchor). * Not part of CommonMark or GFM, there it shows up as literal text. * Default `false`. */ headingAnchors?: boolean; } declare function serializeMarkdown(node: VNode, options?: SerializeMarkdownOptions): string; declare function serializePlaintext(node: VNode): string; /** * Tags kept by default: block, inline and table elements, links, images and * line breaks. Other tags are unwrapped, their content stays. `form` is * unwrapped as well: the element is useless without its attributes and * controls, and its content (often a whole mail body) has to survive. */ declare const DEFAULT_ALLOWED_TAGS: readonly string[]; /** Attributes kept by default, per tag. The key `'*'` applies to every tag. */ declare const DEFAULT_ALLOWED_ATTRS: Readonly>; /** * Schemes for `allowedUrlSchemes` when only well known links should pass. * Not the default: without `allowedUrlSchemes` every scheme passes except * the ones that run script. */ declare const DEFAULT_ALLOWED_URL_SCHEMES: readonly string[]; interface SafeHTMLOptions { /** Tag names to keep, others are unwrapped. Default {@link DEFAULT_ALLOWED_TAGS}. */ allowedTags?: readonly string[]; /** Attribute names to keep, per tag. The key `'*'` applies to every tag. Default {@link DEFAULT_ALLOWED_ATTRS}. */ allowedAttrs?: Readonly>; /** * Schemes allowed in `href` and `src`, like `'https:'`. Default: every * scheme except `javascript:`, `vbscript:` and `data:`, which keeps `cid:` * images in mails and custom app schemes. See {@link DEFAULT_ALLOWED_URL_SCHEMES}. */ allowedUrlSchemes?: readonly string[]; /** Allow URLs without scheme: relative paths, fragments, protocol relative. Default `true`. */ allowRelativeUrls?: boolean; /** Allow `data:image/…` in the `src` of an image. Default `true`. */ allowDataImages?: boolean; /** `rel` added to every link. Default `'noopener noreferrer'`, `''` keeps the allowed `rel` of the source. */ linkRel?: string; /** `target` added to every link. Default `'_blank'`, `''` keeps the allowed `target` of the source. */ linkTarget?: string; } /** * HTML of untrusted origin reduced to the allowed tags and attributes, see * {@link SafeHTMLOptions}. Scripts, styles, embedded documents and event * handlers never pass, links get `rel="noopener noreferrer" target="_blank"`. */ declare function serializeSafeHTML(node: VNode, options?: SafeHTMLOptions): string; declare function safeHTML(html: string, options?: SafeHTMLOptions): string; /** * Tags whose whole subtree is dropped by the Markdown and safe HTML * serializers: active content, metadata and embedded foreign documents. * `form` is deliberately missing, mail and newsletter HTML often wraps the * entire body in one and its content has to survive. */ declare const SERIALIZE_DROP_TAGS: ReadonlySet; declare function tidyDOM(document: VDocument): void; declare function removeBodyContainer(body: VNodeQuery): VNodeQuery; /** Fallback for Object.hasOwn */ declare function hasOwn(object: any, propertyName: string): boolean; interface NodeBufferLike { toString: (encoding?: any) => string; } declare function vdom(obj?: VNode | NodeBufferLike | string | null): VNode; declare function parseHTML(html: string): VDocumentFragment | VHTMLDocument; declare function xml(itag: string | ((props: any) => VElement | VDocumentFragment), iattrs?: Record | unknown[] | null, ...ichildren: any[]): string; declare namespace xml { var firstLine: string; var xml: boolean; } export { handleHTML as _, removeBodyContainer as a, escapeHTML as b, DEFAULT_ALLOWED_ATTRS as c, SafeHTMLOptions as d, safeHTML as f, serializeMarkdown as g, SerializeMarkdownOptions as h, hasOwn as i, DEFAULT_ALLOWED_TAGS as l, serializePlaintext as m, parseHTML as n, SERIALIZE_DROP_TAGS as o, serializeSafeHTML as p, vdom as r, tidyDOM as s, xml as t, DEFAULT_ALLOWED_URL_SCHEMES as u, hArgumentParser as v, unescapeHTML as x, hFactory as y };