// This file is auto-generated by alef — DO NOT EDIT. // alef:hash:c61d1f01ce8d4812fce32d8d7f4ce0feee786063fdba0ea0c26935a45ce8305e // To regenerate: alef generate // To verify freshness: alef verify /* eslint-disable */ export type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue }; /** * Convert HTML to Markdown, Djot, or plain text. * * Returns a `ConversionResult` with converted content plus optional metadata, * document structure, table data, inline images, and warnings depending on the * enabled features and conversion options. * @param html - — the HTML string to convert. * * @param options - — conversion options. Rust accepts bare `ConversionOptions`, `Some(options)`, or `None`. Language bindings expose the same option fields through native constructors or optional parameters. * * @throws Returns an error if HTML parsing fails or if the input contains invalid UTF-8. * * # Observability * * Emits an `html_to_markdown.convert` span at `INFO` level with fields `input_len`, * `output_format`, `wrap`, `extract_metadata`, `extract_images`, and `tier_strategy`. These * field names are part of the public observability contract and are kept stable across * releases. This crate never installs a `tracing` subscriber — attach one in the consuming * application to observe these spans and events. */ export declare function convert(html: string, options?: ConversionOptions | undefined | null): ConversionResult; /** * The type of an inline text annotation. * * Uses internally tagged representation (`"annotation_type": "bold"`) for JSON serialization. */ export type AnnotationKind = | { annotation_type: "bold" } | { annotation_type: "italic" } | { annotation_type: "underline" } | { annotation_type: "strikethrough" } | { annotation_type: "code" } | { annotation_type: "subscript" } | { annotation_type: "superscript" } | { annotation_type: "highlight" } | { annotation_type: "link"; url: string; title: string }; /** * Code block fence style in Markdown output. * * Determines how code blocks (`
`) are rendered in Markdown.
*/
export declare enum CodeBlockStyle {
/** Indented code blocks (4 spaces). `CommonMark` standard. */
Indented = "Indented",
/** Fenced code blocks with triple backticks. Default (GFM). Supports language hints. */
Backticks = "Backticks",
/** Fenced code blocks with tildes (~~~). Supports language hints. */
Tildes = "Tildes",
}
/**
* Main conversion options for HTML to Markdown conversion.
*
* Use `ConversionOptions.builder()` to construct, or `Default.default()` for defaults.
*/
export interface ConversionOptions {
/** Heading style to use in Markdown output (ATX `#` or Setext underline). */
readonly headingStyle?: HeadingStyle;
/** How to indent nested list items (spaces or tab). */
readonly listIndentType?: ListIndentType;
/** Number of spaces (or tabs) to use for each level of list indentation. */
readonly listIndentWidth?: number;
/** Bullet character(s) to use for unordered list items (e.g. `"-"`, `"*"`). */
readonly bullets?: string;
/** Character used for bold/italic emphasis markers (`*` or `_`). */
readonly strongEmSymbol?: string;
/** Escape `*` characters in plain text to avoid unintended bold/italic. */
readonly escapeAsterisks?: boolean;
/** Escape `_` characters in plain text to avoid unintended bold/italic. */
readonly escapeUnderscores?: boolean;
/** Escape miscellaneous Markdown metacharacters (`[]()#` etc.) in plain text. */
readonly escapeMisc?: boolean;
/** Escape ASCII characters that have special meaning in certain Markdown dialects. */
readonly escapeAscii?: boolean;
/** Default language annotation for fenced code blocks that have no language hint. */
readonly codeLanguage?: string;
/** Automatically convert bare URLs into Markdown autolinks. */
readonly autolinks?: boolean;
/** Emit a default title when no `` tag is present. */
readonly defaultTitle?: boolean;
/** Render `
` elements inside table cells as literal line breaks. */
readonly brInTables?: boolean;
/**
* Emit tables without column padding (compact GFM format).
*
* When `true`, column widths are not computed and cells are emitted with
* no trailing spaces. Separator rows use exactly `---` per column.
* Produces token-efficient output suitable for RAG / LLM contexts.
*
* Default `false` (aligned padding preserved).
*/
readonly compactTables?: boolean;
/** Style used for `` / highlighted text (e.g. `==text==`). */
readonly highlightStyle?: HighlightStyle;
/**
* Populate `result.metadata` with `` / `` extraction
* (title, description, Open Graph, Twitter Card, JSON-LD, …).
*
* Default `true`. Disabling skips the metadata pass only — table
* extraction into `result.tables` runs unconditionally.
*/
readonly extractMetadata?: boolean;
/**
* Controls how whitespace sequences are normalised in the converted output.
*
* - `WhitespaceMode.Normalized` (default) — collapses consecutive whitespace characters
* (spaces, tabs, newlines) to a single space, matching browser rendering behaviour.
* - `WhitespaceMode.Strict` — preserves all whitespace exactly as it appears in the
* source HTML, including runs of spaces and embedded newlines.
*
* Choose `Strict` only when the source HTML uses deliberate whitespace (e.g. pre-formatted
* content outside `` tags). For most documents `Normalized` produces cleaner output.
*/
readonly whitespaceMode?: WhitespaceMode;
/** Strip all newlines from the output, producing a single-line result. */
readonly stripNewlines?: boolean;
/** Wrap long lines at `wrap_width` characters. */
readonly wrap?: boolean;
/**
* Maximum output line width in characters when `wrap` is `true` (default `80`).
*
* Lines are broken at word boundaries so that no line exceeds this length. A value of `0`
* is treated as "no limit" — equivalent to leaving `wrap` disabled. Has no
* effect when `wrap` is `false`.
*/
readonly wrapWidth?: number;
/** Treat the entire document as inline content (no block-level wrappers). */
readonly convertAsInline?: boolean;
/** Markdown notation for subscript text (e.g. `"~"`). */
readonly subSymbol?: string;
/** Markdown notation for superscript text (e.g. `"^"`). */
readonly supSymbol?: string;
/** How to encode hard line breaks (`
`) in Markdown. */
readonly newlineStyle?: NewlineStyle;
/** Style used for fenced code blocks (backticks or tilde). */
readonly codeBlockStyle?: CodeBlockStyle;
/** HTML tag names whose `
` children are kept inline instead of block. */
readonly keepInlineImagesIn?: Array;
/**
* Options for the HTML pre-processing pass applied before conversion begins.
*
* Pre-processing runs before the HTML is handed to the converter and can perform operations
* such as unwrapping redundant wrapper elements, removing tracking pixels, and normalising
* vendor-specific markup. See `PreprocessingOptions` for the full set of knobs.
*
* Defaults to `PreprocessingOptions.default()`, which enables the standard cleaning
* passes. Set individual fields on `PreprocessingOptions` (or construct via
* `ConversionOptions.builder`) to opt in or out of specific passes.
*/
readonly preprocessing?: PreprocessingOptions;
/** Expected character encoding of the input HTML (default `"utf-8"`). */
readonly encoding?: string;
/** Emit debug information during conversion. */
readonly debug?: boolean;
/** HTML tag names whose content is stripped from the output entirely. */
readonly stripTags?: Array;
/** HTML tag names that are preserved verbatim in the output. */
readonly preserveTags?: Array;
/** Skip conversion of `
` elements (omit images from output). */
readonly skipImages?: boolean;
/**
* URL encoding strategy for link and image destinations.
*
* Controls how special characters in URL destinations are escaped:
* - `UrlEscapeStyle.Angle` (default) — wraps the destination in angle brackets when it
* contains spaces or newlines. parsers misinterpret `>` inside such a destination.
* - `UrlEscapeStyle.Percent` — percent-encodes every character that is not an RFC 3986
* unreserved character or `/`, producing a destination that all Markdown parsers handle
* correctly even when the URL contains `<`, `>`, spaces, or parentheses.
*/
readonly urlEscapeStyle?: UrlEscapeStyle;
/** Link rendering style (inline or reference). */
readonly linkStyle?: LinkStyle;
/** Target output format (Markdown, plain text, etc.). */
readonly outputFormat?: OutputFormat;
/** Include structured document tree in result. */
readonly includeDocumentStructure?: boolean;
/** Extract inline images from data URIs and SVGs. */
readonly extractImages?: boolean;
/** Maximum decoded image size in bytes (default 5MB). */
readonly maxImageSize?: number;
/** Capture SVG elements as images. */
readonly captureSvg?: boolean;
/** Infer image dimensions from data. */
readonly inferDimensions?: boolean;
/**
* Maximum DOM traversal depth.
*
* `None` uses the library's internal native-stack safety limit. Explicit
* values above that safety limit are clamped to prevent process-aborting
* stack overflows on pathologically deep DOM trees.
*/
readonly maxDepth?: number;
/**
* CSS selectors for elements to exclude entirely (element + all content).
*
* Unlike `strip_tags` (which removes the tag wrapper but keeps children),
* excluded elements and all their descendants are dropped from the output.
* Supports any CSS selector that `tl` supports: tag names, `.class`,
* `#id`, `[attribute]`, etc.
*
* Invalid selectors are silently skipped at conversion time.
*
* Example: `vec![".cookie-banner".into(), "#ad-container".into(), "[role='complementary']".into()]`
*/
readonly excludeSelectors?: Array;
/**
* Which conversion tier to use.
*
* - `TierStrategy.Auto` (default) — automatically choose the best path.
* - `TierStrategy.Tier2` — always use the Tier-2 DOM-walk path.
* - `TierStrategy.Tier1` — always attempt Tier-1 (testkit only).
*/
readonly tierStrategy?: TierStrategy;
/**
* Optional visitor for custom traversal logic.
*
* When set, the visitor's callbacks are invoked for matching HTML elements
* during conversion, allowing custom output, skipping, or HTML preservation.
* See `HtmlVisitor`.
*/
readonly visitor?: VisitorHandle;
}
/**
* Partial update for `ConversionOptions`.
*
* Uses `Option` fields for selective updates. Bindings use this to construct
* options from language-native types. Prefer `ConversionOptionsBuilder` for Rust code.
*/
export interface ConversionOptionsUpdate {
/** Optional override for `ConversionOptions.heading_style`. */
readonly headingStyle?: HeadingStyle;
/** Optional override for `ConversionOptions.list_indent_type`. */
readonly listIndentType?: ListIndentType;
/** Optional override for `ConversionOptions.list_indent_width`. */
readonly listIndentWidth?: number;
/** Optional override for `ConversionOptions.bullets`. */
readonly bullets?: string;
/** Optional override for `ConversionOptions.strong_em_symbol`. */
readonly strongEmSymbol?: string;
/** Optional override for `ConversionOptions.escape_asterisks`. */
readonly escapeAsterisks?: boolean;
/** Optional override for `ConversionOptions.escape_underscores`. */
readonly escapeUnderscores?: boolean;
/** Optional override for `ConversionOptions.escape_misc`. */
readonly escapeMisc?: boolean;
/** Optional override for `ConversionOptions.escape_ascii`. */
readonly escapeAscii?: boolean;
/** Optional override for `ConversionOptions.code_language`. */
readonly codeLanguage?: string;
/** Optional override for `ConversionOptions.autolinks`. */
readonly autolinks?: boolean;
/** Optional override for `ConversionOptions.default_title`. */
readonly defaultTitle?: boolean;
/** Optional override for `ConversionOptions.br_in_tables`. */
readonly brInTables?: boolean;
/** Optional override for `ConversionOptions.compact_tables`. */
readonly compactTables?: boolean;
/** Optional override for `ConversionOptions.highlight_style`. */
readonly highlightStyle?: HighlightStyle;
/** Optional override for `ConversionOptions.extract_metadata`. */
readonly extractMetadata?: boolean;
/** Optional override for `ConversionOptions.whitespace_mode`. */
readonly whitespaceMode?: WhitespaceMode;
/** Optional override for `ConversionOptions.strip_newlines`. */
readonly stripNewlines?: boolean;
/** Optional override for `ConversionOptions.wrap`. */
readonly wrap?: boolean;
/** Optional override for `ConversionOptions.wrap_width`. */
readonly wrapWidth?: number;
/** Optional override for `ConversionOptions.convert_as_inline`. */
readonly convertAsInline?: boolean;
/** Optional override for `ConversionOptions.sub_symbol`. */
readonly subSymbol?: string;
/** Optional override for `ConversionOptions.sup_symbol`. */
readonly supSymbol?: string;
/** Optional override for `ConversionOptions.newline_style`. */
readonly newlineStyle?: NewlineStyle;
/** Optional override for `ConversionOptions.code_block_style`. */
readonly codeBlockStyle?: CodeBlockStyle;
/** Optional override for `ConversionOptions.keep_inline_images_in`. */
readonly keepInlineImagesIn?: Array;
/** Optional override for `ConversionOptions.preprocessing`. */
readonly preprocessing?: PreprocessingOptionsUpdate;
/** Optional override for `ConversionOptions.encoding`. */
readonly encoding?: string;
/** Optional override for `ConversionOptions.debug`. */
readonly debug?: boolean;
/** Optional override for `ConversionOptions.strip_tags`. */
readonly stripTags?: Array;
/** Optional override for `ConversionOptions.preserve_tags`. */
readonly preserveTags?: Array;
/** Optional override for `ConversionOptions.skip_images`. */
readonly skipImages?: boolean;
/** Optional override for `ConversionOptions.url_escape_style`. */
readonly urlEscapeStyle?: UrlEscapeStyle;
/** Optional override for `ConversionOptions.link_style`. */
readonly linkStyle?: LinkStyle;
/** Optional override for `ConversionOptions.output_format`. */
readonly outputFormat?: OutputFormat;
/** Optional override for `ConversionOptions.include_document_structure`. */
readonly includeDocumentStructure?: boolean;
/** Optional override for `ConversionOptions.extract_images`. */
readonly extractImages?: boolean;
/** Optional override for `ConversionOptions.max_image_size`. */
readonly maxImageSize?: number;
/** Optional override for `ConversionOptions.capture_svg`. */
readonly captureSvg?: boolean;
/** Optional override for `ConversionOptions.infer_dimensions`. */
readonly inferDimensions?: boolean;
/** Optional override for `ConversionOptions.max_depth`. */
readonly maxDepth?: number | null;
/** Optional override for `ConversionOptions.exclude_selectors`. */
readonly excludeSelectors?: Array;
/** Optional override for `ConversionOptions.tier_strategy`. */
readonly tierStrategy?: TierStrategy;
/** Optional override for `ConversionOptions.visitor`. */
readonly visitor?: VisitorHandle;
}
/**
* The primary result of HTML conversion and extraction.
*
* Contains the converted text output, optional structured document tree,
* metadata, extracted tables, images, and processing warnings.
* @example
* ```typescript
* use html_to_markdown_rs::{convert, ConversionOptions};
*
* let result = convert("Hello
World
", None)?;
* assert!(result.content.is_some());
* assert!(result.warnings.is_empty());
* ```
*/
export interface ConversionResult {
/** Converted text output in the selected format: Markdown, Djot, or plain text. */
readonly content?: string;
/**
* Structured document tree with semantic elements.
*
* Populated when `ConversionOptions.include_document_structure` is `true`. `None`
* otherwise (the default), which avoids the overhead of building the tree.
*
* When present, the tree mirrors the converted document: headings open
* `Group` sections, paragraphs and list items carry
* inline `TextAnnotation`s, and tables reference the same
* `TableGrid` data exposed in `Self.tables`.
*
* Note: this field is independent of the `metadata` feature flag. Document structure
* collection is always available at runtime; it is gated only by the runtime option, not
* by a compile-time feature.
*/
readonly document?: DocumentStructure;
/** Extracted HTML metadata (title, OG, links, images, structured data). */
readonly metadata?: HtmlMetadata;
/**
* Extracted tables with structured cell data and markdown representation.
*
* Table data is collected by the same pass that builds `Self.document`, so it is
* populated only when `ConversionOptions.include_document_structure` is `true`. With the
* default options this is an empty vec even for input that contains tables — the tables
* still appear in `Self.content` as rendered Markdown.
*/
readonly tables?: Array;
/** Non-fatal processing warnings. */
readonly warnings?: Array;
}
/**
* Document-level metadata extracted from `` and top-level elements.
*
* Contains all metadata typically used by search engines, social media platforms,
* and browsers for document indexing and presentation.
*/
export interface DocumentMetadata {
/** Document title from `` tag */
readonly title?: string;
/** Document description from `` tag */
readonly description?: string;
/** Document keywords from `` tag, split on commas */
readonly keywords?: Array;
/** Document author from `` tag */
readonly author?: string;
/** Canonical URL from `` tag */
readonly canonicalUrl?: string;
/** Base URL from ` ` tag for resolving relative URLs */
readonly baseHref?: string;
/** Document language from `lang` attribute */
readonly language?: string;
/** Document text direction from `dir` attribute */
readonly textDirection?: TextDirection;
/**
* Open Graph metadata (og:* properties) for social media
* Keys like "title", "description", "image", "url", etc.
*/
readonly openGraph?: Record;
/**
* Twitter Card metadata (twitter:* properties)
* Keys like "card", "site", "creator", "title", "description", "image", etc.
*/
readonly twitterCard?: Record;
/**
* Additional meta tags not covered by specific fields
* Keys are meta name/property attributes, values are content
*/
readonly metaTags?: Record;
}
/** A single node in the document tree. */
export interface DocumentNode {
/** Deterministic node identifier. */
readonly id: string;
/** The semantic content of this node. */
readonly content: NodeContent;
/** Index of the parent node (undefined for root nodes). */
readonly parent?: number;
/** Indices of child nodes in reading order. */
readonly children: Array;
/** Inline formatting annotations (bold, italic, links, etc.) with byte offsets into the text. */
readonly annotations: Array;
/**
* Format-specific attributes preserved from the source HTML element.
*
* Keys are lowercased attribute names as they appear in the HTML (e.g. `"class"`, `"id"`,
* `"data-foo"`). Values are the raw attribute strings, copied verbatim from the source —
* no HTML entity decoding is applied here.
*
* The map is `None` when no attributes are present (omitted entirely in serialized output).
* Not every HTML attribute is preserved: only attributes that carry semantic or structural
* significance for the node type are collected. For example, heading nodes capture the `"id"`
* attribute for anchor linking; other element-level attributes may be silently dropped.
*/
readonly attributes?: Record;
}
/**
* A structured document tree representing the semantic content of an HTML document.
*
* Uses a flat node array with index-based parent/child references for efficient traversal.
*/
export interface DocumentStructure {
/** All nodes in document reading order. */
readonly nodes: Array;
/** The source format (always "html" for this crate). */
readonly sourceFormat?: string;
}
/** A single cell in a table grid. */
export interface GridCell {
/** The text content of the cell. */
readonly content: string;
/** 0-indexed row position. */
readonly row: number;
/** 0-indexed column position. */
readonly col: number;
/** Number of rows this cell spans (default 1). */
readonly rowSpan: number;
/** Number of columns this cell spans (default 1). */
readonly colSpan: number;
/** Whether this is a header cell (``). */
readonly isHeader: boolean;
}
/**
* Header element metadata with hierarchy tracking.
*
* Captures heading elements (h1-h6) with their text content, identifiers,
* and position in the document structure.
*/
export interface HeaderMetadata {
/** Header level: 1 (h1) through 6 (h6) */
readonly level: number;
/** Normalized text content of the header */
readonly text: string;
/** HTML id attribute if present */
readonly id?: string;
/** Document tree depth at the header element */
readonly depth: number;
/** Byte offset in original HTML document */
readonly htmlOffset: number;
}
/**
* Heading style options for Markdown output.
*
* Controls how headings (h1-h6) are rendered in the output Markdown.
*/
export declare enum HeadingStyle {
/** Underlined style (=== for h1, --- for h2). */
Underlined = "Underlined",
/** ATX style (# for h1, ## for h2, etc.). Default. */
Atx = "Atx",
/** ATX closed style (# title #, with closing hashes). */
AtxClosed = "AtxClosed",
}
/**
* Highlight rendering style for `` elements.
*
* Controls how highlighted text is rendered in Markdown output.
*/
export declare enum HighlightStyle {
/** Double equals syntax (==text==). Default. Pandoc-compatible. */
DoubleEqual = "DoubleEqual",
/** Preserve as HTML (==text==). Original HTML tag. */
Html = "Html",
/** Render as bold (**text**). Uses strong emphasis. */
Bold = "Bold",
/** Strip formatting, render as plain text. No markup. */
None = "None",
}
/**
* Comprehensive metadata extraction result from HTML document.
*
* Contains all extracted metadata types in a single structure,
* suitable for serialization and transmission across language boundaries.
*/
export interface HtmlMetadata {
/** Document-level metadata (title, description, canonical, etc.) */
readonly document?: DocumentMetadata;
/** Extracted header elements with hierarchy */
readonly headers?: Array;
/** Extracted hyperlinks with type classification */
readonly links?: Array;
/** Extracted images with source and dimensions */
readonly images?: Array;
/** Extracted structured data blocks */
readonly structuredData?: Array;
}
/**
* Visitor for HTML→Markdown conversion.
*
* Provide a visitor object whose methods customize the conversion behavior for any
* HTML element type. Override only the methods you care about; unimplemented methods
* default to `Continue` (emit the standard rendering).
*
* Each callback returns one of:
*
* - `Continue` (the default) — keep the standard rendering.
* - `Skip` — drop the element from the output entirely.
* - `PreserveHtml` — pass the original HTML through verbatim.
* - `Custom(text)` — replace the rendering with `text`.
* - `Error(message)` — abort conversion with `message`.
*
* **Language idioms.** In Rust, return one of the `VisitResult` variants directly.
* In Python, Ruby, JavaScript/TypeScript, and other duck-typed bindings, define a
* plain class (no base class required) and return either a string (`"continue"`,
* `"skip"`, `"preserve_html"`) or a tagged map (`{"custom": "..."}`,
* `{"error": "..."}`) — the binding converts the return value to the corresponding
* `VisitResult` variant automatically.
*
* # Method Naming Convention
*
* - `visit_*_start`: Called before entering an element (pre-order traversal)
* - `visit_*_end`: Called after exiting an element (post-order traversal)
* - `visit_*`: Called for specific element types (e.g., `visit_link`, `visit_image`)
*
* # Execution Order
*
* For a typical element like `text
`:
* 1. `visit_element_start` for ``
* 2. `visit_element_start` for ``
* 3. `visit_text` for "text"
* 4. `visit_element_end` for `
`
* 5. `visit_element_end` for `
`
*
* # Performance Notes
*
* - `visit_text` is the most frequently called method (~100+ times per document)
* - Return `Continue` quickly for elements you don't need to customize
* - Avoid heavy computation in visitor methods; consider caching if needed
*/
export interface HtmlVisitor {
/**
* Visit text nodes (most frequent callback - ~100+ per document).
* @param ctx - Node context (will have `node_type: NodeType.Text`)
*
* @param text - The raw text content (HTML entities already decoded)
*/
visitText?(ctx: NodeContext, text: string): VisitResult;
/**
* Called before entering any element.
*
* This is the first callback invoked for every HTML element, allowing
* visitors to implement generic element handling before tag-specific logic.
*/
visitElementStart?(ctx: NodeContext): VisitResult;
/**
* Called after exiting any element.
*
* Receives the default markdown output that would be generated.
* Visitors can inspect or replace this output.
*/
visitElementEnd?(ctx: NodeContext, output: string): VisitResult;
/**
* Visit anchor links ``.
* @param ctx - Node context with link element metadata
*
* @param href - The link URL (from `href` attribute)
*
* @param text - The link text content (already converted to markdown)
*
* @param title - Optional title attribute
*/
visitLink?(ctx: NodeContext, href: string, text: string, title?: string | undefined | null): VisitResult;
/**
* Visit images `
`.
* @param ctx - Node context with image element metadata
*
* @param src - The image source URL
*
* @param alt - The alt text
*
* @param title - Optional title attribute
*/
visitImage?(ctx: NodeContext, src: string, alt: string, title?: string | undefined | null): VisitResult;
/**
* Visit heading elements `` through ``.
* @param ctx - Node context with heading metadata
*
* @param level - Heading level (1-6)
*
* @param text - The heading text content
*
* @param id - Optional id attribute (for anchor links)
*/
visitHeading?(ctx: NodeContext, level: number, text: string, id?: string | undefined | null): VisitResult;
/**
* Visit code blocks ``.
* @param ctx - Node context
*
* @param lang - Optional language specifier (from class attribute)
*
* @param code - The code content
*/
visitCodeBlock?(ctx: NodeContext, code: string, lang?: string | undefined | null): VisitResult;
/**
* Visit inline code ``.
* @param ctx - Node context
*
* @param code - The code content
*/
visitCodeInline?(ctx: NodeContext, code: string): VisitResult;
/**
* Visit list items ``.
* @param ctx - Node context
*
* @param ordered - Whether this is an ordered list item
*
* @param marker - The list marker (e.g., "-", "1.", "a)")
*
* @param text - The list item content (already converted)
*/
visitListItem?(ctx: NodeContext, ordered: boolean, marker: string, text: string): VisitResult;
/** Called before processing a list `` or ``. */
visitListStart?(ctx: NodeContext, ordered: boolean): VisitResult;
/** Called after processing a list `
` or ``. */
visitListEnd?(ctx: NodeContext, ordered: boolean, output: string): VisitResult;
/** Called before processing a table ``. */
visitTableStart?(ctx: NodeContext): VisitResult;
/**
* Visit table rows ``.
* @param ctx - Node context
*
* @param cells - Cell contents (already converted to markdown)
*
* @param is_header - Whether this row is in ``
*/
visitTableRow?(ctx: NodeContext, cells: Array, isHeader: boolean): VisitResult;
/** Called after processing a table `
`. */
visitTableEnd?(ctx: NodeContext, output: string): VisitResult;
/**
* Visit blockquote elements ``.
* @param ctx - Node context
*
* @param content - The blockquote content (already converted)
*
* @param depth - Nesting depth (for nested blockquotes)
*/
visitBlockquote?(ctx: NodeContext, content: string, depth: number): VisitResult;
/** Visit strong/bold elements ``, ``. */
visitStrong?(ctx: NodeContext, text: string): VisitResult;
/** Visit emphasis/italic elements ``, ``. */
visitEmphasis?(ctx: NodeContext, text: string): VisitResult;
/** Visit strikethrough elements ``, ``, ``. */
visitStrikethrough?(ctx: NodeContext, text: string): VisitResult;
/** Visit underline elements ``, ``. */
visitUnderline?(ctx: NodeContext, text: string): VisitResult;
/** Visit subscript elements ``. */
visitSubscript?(ctx: NodeContext, text: string): VisitResult;
/** Visit superscript elements ``. */
visitSuperscript?(ctx: NodeContext, text: string): VisitResult;
/** Visit mark/highlight elements ``. */
visitMark?(ctx: NodeContext, text: string): VisitResult;
/** Visit line break elements `
`. */
visitLineBreak?(ctx: NodeContext): VisitResult;
/** Visit horizontal rule elements `
`. */
visitHorizontalRule?(ctx: NodeContext): VisitResult;
/**
* Visit custom elements (web components) or unknown tags.
* @param ctx - Node context
*
* @param tag_name - The custom element's tag name
*
* @param html - The raw HTML of this element
*/
visitCustomElement?(ctx: NodeContext, tagName: string, html: string): VisitResult;
/** Visit definition list ``. */
visitDefinitionListStart?(ctx: NodeContext): VisitResult;
/** Visit definition term `- `. */
visitDefinitionTerm?(ctx: NodeContext, text: string): VisitResult;
/** Visit definition description `
- `. */
visitDefinitionDescription?(ctx: NodeContext, text: string): VisitResult;
/** Called after processing a definition list `
`. */
visitDefinitionListEnd?(ctx: NodeContext, output: string): VisitResult;
/** Visit form elements `