UNPKG

mdx-render

Version:

A modern, SSR-friendly React Markdown renderer that preserves the MDAST tree for reuse (e.g., mdast2docx), supports full JSX children, unified plugins, and component overrides.

15 lines (14 loc) 639 B
import type { Root as MdastRoot, Node as MdastNode } from "mdast"; import type { Root as HastRoot } from "hast"; /** * Expect MDAST tree to contain a specific node type. */ export declare function expectMdastToContain(mdast: MdastRoot, type: MdastNode["type"], expect?: Function): boolean; /** * Expect HAST tree to NOT contain a specific tag. */ export declare function expectHastToExclude(hast: HastRoot, tagName: string, expect?: Function): boolean; /** * Expect exactly one instance of a node type in MDAST. */ export declare function expectSingleMdastNode(mdast: MdastRoot, type: MdastNode["type"], expect?: Function): boolean;