/* tslint:disable */
/* eslint-disable */

/**
 * The type of an inline text annotation.
 *
 * Uses internally tagged representation (`"annotation_type": "bold"`) for JSON serialization.
 */
export class WasmAnnotationKind {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmAnnotationKind;
    constructor();
    annotationType: string;
    get title(): string | undefined;
    set title(value: string | null | undefined);
    get url(): string | undefined;
    set url(value: string | null | undefined);
}

/**
 * Code block fence style in Markdown output.
 *
 * Determines how code blocks (`<pre><code>`) are rendered in Markdown.
 */
export enum WasmCodeBlockStyle {
    Indented = 0,
    Backticks = 1,
    Tildes = 2,
}

/**
 * Main conversion options for HTML to Markdown conversion.
 *
 * Use `ConversionOptions.builder()` to construct, or `Default.default()` for defaults.
 *
 * # Example
 */
export class WasmConversionOptions {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmConversionOptions;
    constructor(headingStyle?: WasmHeadingStyle | null, listIndentType?: WasmListIndentType | null, listIndentWidth?: number | null, bullets?: string | null, strongEmSymbol?: string | null, escapeAsterisks?: boolean | null, escapeUnderscores?: boolean | null, escapeMisc?: boolean | null, escapeAscii?: boolean | null, codeLanguage?: string | null, autolinks?: boolean | null, defaultTitle?: boolean | null, brInTables?: boolean | null, compactTables?: boolean | null, highlightStyle?: WasmHighlightStyle | null, extractMetadata?: boolean | null, whitespaceMode?: WasmWhitespaceMode | null, stripNewlines?: boolean | null, wrap?: boolean | null, wrapWidth?: number | null, convertAsInline?: boolean | null, subSymbol?: string | null, supSymbol?: string | null, newlineStyle?: WasmNewlineStyle | null, codeBlockStyle?: WasmCodeBlockStyle | null, keepInlineImagesIn?: string[] | null, preprocessing?: WasmPreprocessingOptions | null, encoding?: string | null, debug?: boolean | null, stripTags?: string[] | null, preserveTags?: string[] | null, skipImages?: boolean | null, urlEscapeStyle?: WasmUrlEscapeStyle | null, linkStyle?: WasmLinkStyle | null, outputFormat?: WasmOutputFormat | null, includeDocumentStructure?: boolean | null, extractImages?: boolean | null, maxImageSize?: bigint | null, captureSvg?: boolean | null, inferDimensions?: boolean | null, excludeSelectors?: string[] | null, tierStrategy?: WasmTierStrategy | null, maxDepth?: number | null);
    autolinks: boolean;
    brInTables: boolean;
    bullets: string;
    captureSvg: boolean;
    get codeBlockStyle(): string;
    set codeBlockStyle(value: WasmCodeBlockStyle);
    codeLanguage: string;
    compactTables: boolean;
    convertAsInline: boolean;
    debug: boolean;
    defaultTitle: boolean;
    encoding: string;
    escapeAscii: boolean;
    escapeAsterisks: boolean;
    escapeMisc: boolean;
    escapeUnderscores: boolean;
    excludeSelectors: string[];
    extractImages: boolean;
    extractMetadata: boolean;
    get headingStyle(): string;
    set headingStyle(value: WasmHeadingStyle);
    get highlightStyle(): string;
    set highlightStyle(value: WasmHighlightStyle);
    includeDocumentStructure: boolean;
    inferDimensions: boolean;
    keepInlineImagesIn: string[];
    get linkStyle(): string;
    set linkStyle(value: WasmLinkStyle);
    get listIndentType(): string;
    set listIndentType(value: WasmListIndentType);
    listIndentWidth: number;
    get maxDepth(): number | undefined;
    set maxDepth(value: number | null | undefined);
    maxImageSize: bigint;
    get newlineStyle(): string;
    set newlineStyle(value: WasmNewlineStyle);
    get outputFormat(): string;
    set outputFormat(value: WasmOutputFormat);
    preprocessing: WasmPreprocessingOptions;
    preserveTags: string[];
    skipImages: boolean;
    stripNewlines: boolean;
    stripTags: string[];
    strongEmSymbol: string;
    subSymbol: string;
    supSymbol: string;
    get tierStrategy(): string;
    set tierStrategy(value: WasmTierStrategy);
    get urlEscapeStyle(): string;
    set urlEscapeStyle(value: WasmUrlEscapeStyle);
    get visitor(): WasmVisitorHandle | undefined;
    set visitor(value: WasmVisitorHandle | null | undefined);
    get whitespaceMode(): string;
    set whitespaceMode(value: WasmWhitespaceMode);
    wrap: boolean;
    wrapWidth: number;
}

/**
 * Partial update for `ConversionOptions`.
 *
 * Uses `Option<T>` fields for selective updates. Bindings use this to construct
 * options from language-native types. Prefer `ConversionOptionsBuilder` for Rust code.
 */
export class WasmConversionOptionsUpdate {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmConversionOptionsUpdate;
    constructor(headingStyle?: WasmHeadingStyle | null, listIndentType?: WasmListIndentType | null, listIndentWidth?: number | null, bullets?: string | null, strongEmSymbol?: string | null, escapeAsterisks?: boolean | null, escapeUnderscores?: boolean | null, escapeMisc?: boolean | null, escapeAscii?: boolean | null, codeLanguage?: string | null, autolinks?: boolean | null, defaultTitle?: boolean | null, brInTables?: boolean | null, compactTables?: boolean | null, highlightStyle?: WasmHighlightStyle | null, extractMetadata?: boolean | null, whitespaceMode?: WasmWhitespaceMode | null, stripNewlines?: boolean | null, wrap?: boolean | null, wrapWidth?: number | null, convertAsInline?: boolean | null, subSymbol?: string | null, supSymbol?: string | null, newlineStyle?: WasmNewlineStyle | null, codeBlockStyle?: WasmCodeBlockStyle | null, keepInlineImagesIn?: string[] | null, preprocessing?: WasmPreprocessingOptionsUpdate | null, encoding?: string | null, debug?: boolean | null, stripTags?: string[] | null, preserveTags?: string[] | null, skipImages?: boolean | null, urlEscapeStyle?: WasmUrlEscapeStyle | null, linkStyle?: WasmLinkStyle | null, outputFormat?: WasmOutputFormat | null, includeDocumentStructure?: boolean | null, extractImages?: boolean | null, maxImageSize?: bigint | null, captureSvg?: boolean | null, inferDimensions?: boolean | null, maxDepth?: number | null, excludeSelectors?: string[] | null, tierStrategy?: WasmTierStrategy | null);
    get autolinks(): boolean | undefined;
    set autolinks(value: boolean | null | undefined);
    get brInTables(): boolean | undefined;
    set brInTables(value: boolean | null | undefined);
    get bullets(): string | undefined;
    set bullets(value: string | null | undefined);
    get captureSvg(): boolean | undefined;
    set captureSvg(value: boolean | null | undefined);
    get codeBlockStyle(): string | undefined;
    set codeBlockStyle(value: WasmCodeBlockStyle | null | undefined);
    get codeLanguage(): string | undefined;
    set codeLanguage(value: string | null | undefined);
    get compactTables(): boolean | undefined;
    set compactTables(value: boolean | null | undefined);
    get convertAsInline(): boolean | undefined;
    set convertAsInline(value: boolean | null | undefined);
    get debug(): boolean | undefined;
    set debug(value: boolean | null | undefined);
    get defaultTitle(): boolean | undefined;
    set defaultTitle(value: boolean | null | undefined);
    get encoding(): string | undefined;
    set encoding(value: string | null | undefined);
    get escapeAscii(): boolean | undefined;
    set escapeAscii(value: boolean | null | undefined);
    get escapeAsterisks(): boolean | undefined;
    set escapeAsterisks(value: boolean | null | undefined);
    get escapeMisc(): boolean | undefined;
    set escapeMisc(value: boolean | null | undefined);
    get escapeUnderscores(): boolean | undefined;
    set escapeUnderscores(value: boolean | null | undefined);
    get excludeSelectors(): string[] | undefined;
    set excludeSelectors(value: string[] | null | undefined);
    get extractImages(): boolean | undefined;
    set extractImages(value: boolean | null | undefined);
    get extractMetadata(): boolean | undefined;
    set extractMetadata(value: boolean | null | undefined);
    get headingStyle(): string | undefined;
    set headingStyle(value: WasmHeadingStyle | null | undefined);
    get highlightStyle(): string | undefined;
    set highlightStyle(value: WasmHighlightStyle | null | undefined);
    get includeDocumentStructure(): boolean | undefined;
    set includeDocumentStructure(value: boolean | null | undefined);
    get inferDimensions(): boolean | undefined;
    set inferDimensions(value: boolean | null | undefined);
    get keepInlineImagesIn(): string[] | undefined;
    set keepInlineImagesIn(value: string[] | null | undefined);
    get linkStyle(): string | undefined;
    set linkStyle(value: WasmLinkStyle | null | undefined);
    get listIndentType(): string | undefined;
    set listIndentType(value: WasmListIndentType | null | undefined);
    get listIndentWidth(): number | undefined;
    set listIndentWidth(value: number | null | undefined);
    get maxDepth(): number | undefined;
    set maxDepth(value: number | null | undefined);
    get maxImageSize(): bigint | undefined;
    set maxImageSize(value: bigint | null | undefined);
    get newlineStyle(): string | undefined;
    set newlineStyle(value: WasmNewlineStyle | null | undefined);
    get outputFormat(): string | undefined;
    set outputFormat(value: WasmOutputFormat | null | undefined);
    get preprocessing(): WasmPreprocessingOptionsUpdate | undefined;
    set preprocessing(value: WasmPreprocessingOptionsUpdate | null | undefined);
    get preserveTags(): string[] | undefined;
    set preserveTags(value: string[] | null | undefined);
    get skipImages(): boolean | undefined;
    set skipImages(value: boolean | null | undefined);
    get stripNewlines(): boolean | undefined;
    set stripNewlines(value: boolean | null | undefined);
    get stripTags(): string[] | undefined;
    set stripTags(value: string[] | null | undefined);
    get strongEmSymbol(): string | undefined;
    set strongEmSymbol(value: string | null | undefined);
    get subSymbol(): string | undefined;
    set subSymbol(value: string | null | undefined);
    get supSymbol(): string | undefined;
    set supSymbol(value: string | null | undefined);
    get tierStrategy(): string | undefined;
    set tierStrategy(value: WasmTierStrategy | null | undefined);
    get urlEscapeStyle(): string | undefined;
    set urlEscapeStyle(value: WasmUrlEscapeStyle | null | undefined);
    get visitor(): WasmVisitorHandle | undefined;
    set visitor(value: WasmVisitorHandle | null | undefined);
    get whitespaceMode(): string | undefined;
    set whitespaceMode(value: WasmWhitespaceMode | null | undefined);
    get wrap(): boolean | undefined;
    set wrap(value: boolean | null | undefined);
    get wrapWidth(): number | undefined;
    set wrapWidth(value: number | null | undefined);
}

/**
 * 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
 *
 * ```text
 * use html_to_markdown_rs::{convert, ConversionOptions};
 *
 * let result = convert("<h1>Hello</h1><p>World</p>", None)?;
 * assert!(result.content.is_some());
 * assert!(result.warnings.is_empty());
 * ```
 */
export class WasmConversionResult {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmConversionResult;
    constructor(tables?: WasmTableData[] | null, warnings?: WasmProcessingWarning[] | null, content?: string | null, document?: WasmDocumentStructure | null);
    get content(): string | undefined;
    set content(value: string | null | undefined);
    get document(): WasmDocumentStructure | undefined;
    set document(value: WasmDocumentStructure | null | undefined);
    metadata: WasmHtmlMetadata;
    tables: WasmTableData[];
    warnings: WasmProcessingWarning[];
}

/**
 * Document-level metadata extracted from `<head>` and top-level elements.
 *
 * Contains all metadata typically used by search engines, social media platforms,
 * and browsers for document indexing and presentation.
 *
 * # Examples
 */
export class WasmDocumentMetadata {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmDocumentMetadata;
    constructor(keywords?: string[] | null, openGraph?: any | null, twitterCard?: any | null, metaTags?: any | null, title?: string | null, description?: string | null, author?: string | null, canonicalUrl?: string | null, baseHref?: string | null, language?: string | null, textDirection?: WasmTextDirection | null);
    get author(): string | undefined;
    set author(value: string | null | undefined);
    get baseHref(): string | undefined;
    set baseHref(value: string | null | undefined);
    get canonicalUrl(): string | undefined;
    set canonicalUrl(value: string | null | undefined);
    get description(): string | undefined;
    set description(value: string | null | undefined);
    keywords: string[];
    get language(): string | undefined;
    set language(value: string | null | undefined);
    metaTags: any;
    openGraph: any;
    get textDirection(): string | undefined;
    set textDirection(value: WasmTextDirection | null | undefined);
    get title(): string | undefined;
    set title(value: string | null | undefined);
    twitterCard: any;
}

/**
 * A single node in the document tree.
 */
export class WasmDocumentNode {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmDocumentNode;
    constructor(id: string, content: any, children: Uint32Array, annotations: WasmTextAnnotation[], parent?: number | null, attributes?: any | null);
    annotations: WasmTextAnnotation[];
    get attributes(): any | undefined;
    set attributes(value: any | null | undefined);
    children: Uint32Array;
    content: any;
    id: string;
    get parent(): number | undefined;
    set parent(value: number | null | undefined);
}

/**
 * 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 class WasmDocumentStructure {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmDocumentStructure;
    constructor(nodes: WasmDocumentNode[], sourceFormat?: string | null);
    nodes: WasmDocumentNode[];
    get sourceFormat(): string | undefined;
    set sourceFormat(value: string | null | undefined);
}

/**
 * A single cell in a table grid.
 */
export class WasmGridCell {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmGridCell;
    constructor(content: string, row: number, col: number, rowSpan: number, colSpan: number, isHeader: boolean);
    col: number;
    colSpan: number;
    content: string;
    isHeader: boolean;
    row: number;
    rowSpan: number;
}

/**
 * Header element metadata with hierarchy tracking.
 *
 * Captures heading elements (h1-h6) with their text content, identifiers,
 * and position in the document structure.
 *
 * # Examples
 */
export class WasmHeaderMetadata {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmHeaderMetadata;
    /**
     * Validate that the header level is within valid range (1-6).
     *
     * # Returns
     *
     * `true` if level is 1-6, `false` otherwise.
     *
     * # Examples
     */
    isValid(): boolean;
    constructor(level: number, text: string, depth: number, htmlOffset: number, id?: string | null);
    depth: number;
    htmlOffset: number;
    get id(): string | undefined;
    set id(value: string | null | undefined);
    level: number;
    text: string;
}

/**
 * Heading style options for Markdown output.
 *
 * Controls how headings (h1-h6) are rendered in the output Markdown.
 */
export enum WasmHeadingStyle {
    Underlined = 0,
    Atx = 1,
    AtxClosed = 2,
}

/**
 * Highlight rendering style for `<mark>` elements.
 *
 * Controls how highlighted text is rendered in Markdown output.
 */
export enum WasmHighlightStyle {
    DoubleEqual = 0,
    Html = 1,
    Bold = 2,
    None = 3,
}

/**
 * Comprehensive metadata extraction result from HTML document.
 *
 * Contains all extracted metadata types in a single structure,
 * suitable for serialization and transmission across language boundaries.
 *
 * # Examples
 */
export class WasmHtmlMetadata {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmHtmlMetadata;
    constructor(document?: WasmDocumentMetadata | null, headers?: WasmHeaderMetadata[] | null, links?: WasmLinkMetadata[] | null, images?: WasmImageMetadata[] | null, structuredData?: WasmStructuredData[] | null);
    document: WasmDocumentMetadata;
    headers: WasmHeaderMetadata[];
    images: WasmImageMetadata[];
    links: WasmLinkMetadata[];
    structuredData: WasmStructuredData[];
}

/**
 * Image dimensions in pixels.
 *
 * Binding-safe replacement for `(u32, u32)` tuples, which degrade to
 * `Vec<Vec<String>>` when sanitized for cross-language binding generation.
 * Used by both `ImageMetadata` and
 * `InlineImage`.
 */
export class WasmImageDimensions {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmImageDimensions;
    constructor(width: number, height: number);
    height: number;
    width: number;
}

/**
 * Image metadata with source and dimensions.
 *
 * Captures `<img>` elements and inline `<svg>` elements with metadata
 * for image analysis and optimization.
 *
 * # Examples
 */
export class WasmImageMetadata {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmImageMetadata;
    constructor(src: string, imageType: WasmImageType, attributes: any, alt?: string | null, title?: string | null, dimensions?: WasmImageDimensions | null);
    get alt(): string | undefined;
    set alt(value: string | null | undefined);
    attributes: any;
    get dimensions(): WasmImageDimensions | undefined;
    set dimensions(value: WasmImageDimensions | null | undefined);
    get imageType(): string;
    set imageType(value: WasmImageType);
    src: string;
    get title(): string | undefined;
    set title(value: string | null | undefined);
}

/**
 * Image source classification for proper handling and processing.
 *
 * Determines whether an image is embedded (data URI), inline SVG, external, or relative.
 */
export enum WasmImageType {
    DataUri = 0,
    InlineSvg = 1,
    External = 2,
    Relative = 3,
}

/**
 * Hyperlink metadata with categorization and attributes.
 *
 * Represents `<a>` elements with parsed href values, text content, and link type classification.
 *
 * # Examples
 */
export class WasmLinkMetadata {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmLinkMetadata;
    constructor(href: string, text: string, linkType: WasmLinkType, rel: string[], attributes: any, title?: string | null);
    attributes: any;
    href: string;
    get linkType(): string;
    set linkType(value: WasmLinkType);
    rel: string[];
    text: string;
    get title(): string | undefined;
    set title(value: string | null | undefined);
}

/**
 * Link rendering style in Markdown output.
 *
 * Controls whether links and images use inline `[text](url)` syntax or
 * reference-style `[text][1]` syntax with definitions collected at the end.
 */
export enum WasmLinkStyle {
    Inline = 0,
    Reference = 1,
}

/**
 * Link classification based on href value and document context.
 *
 * Used to categorize links during extraction for filtering and analysis.
 */
export enum WasmLinkType {
    Anchor = 0,
    Internal = 1,
    External = 2,
    Email = 3,
    Phone = 4,
    Other = 5,
}

/**
 * List indentation character type.
 *
 * Controls whether list items are indented with spaces or tabs.
 */
export enum WasmListIndentType {
    Spaces = 0,
    Tabs = 1,
}

/**
 * A single key-value metadata entry from `<head>` meta tags.
 *
 * Binding-safe replacement for `(String, String)` tuples used in
 * `NodeContent.MetadataBlock`. Tuple pairs cannot be represented
 * across language boundaries without lossy degradation.
 */
export class WasmMetadataEntry {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmMetadataEntry;
    constructor(key: string, value: string);
    key: string;
    value: string;
}

/**
 * Line break syntax in Markdown output.
 *
 * Controls how soft line breaks (from `<br>` or line breaks in source) are rendered.
 */
export enum WasmNewlineStyle {
    Spaces = 0,
    Backslash = 1,
}

/**
 * The semantic content type of a document node.
 *
 * Uses internally tagged representation (`"node_type": "heading"`) for JSON serialization.
 */
export class WasmNodeContent {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmNodeContent;
    constructor();
    get content(): string | undefined;
    set content(value: string | null | undefined);
    get definition(): string | undefined;
    set definition(value: string | null | undefined);
    get description(): string | undefined;
    set description(value: string | null | undefined);
    get entries(): WasmMetadataEntry[] | undefined;
    set entries(value: WasmMetadataEntry[] | null | undefined);
    get format(): string | undefined;
    set format(value: string | null | undefined);
    get grid(): WasmTableGrid | undefined;
    set grid(value: WasmTableGrid | null | undefined);
    get headingLevel(): number | undefined;
    set headingLevel(value: number | null | undefined);
    get headingText(): string | undefined;
    set headingText(value: string | null | undefined);
    get imageIndex(): number | undefined;
    set imageIndex(value: number | null | undefined);
    get label(): string | undefined;
    set label(value: string | null | undefined);
    get language(): string | undefined;
    set language(value: string | null | undefined);
    get level(): number | undefined;
    set level(value: number | null | undefined);
    nodeType: string;
    get ordered(): boolean | undefined;
    set ordered(value: boolean | null | undefined);
    get src(): string | undefined;
    set src(value: string | null | undefined);
    get term(): string | undefined;
    set term(value: string | null | undefined);
    get text(): string | undefined;
    set text(value: string | null | undefined);
}

/**
 * Context information passed to all visitor methods.
 *
 * Provides comprehensive metadata about the current node being visited,
 * including its type, tag name, position in the DOM tree, and parent context.
 *
 * ## Attributes
 *
 * Access attributes via `NodeContext.attributes`, which returns
 * `&BTreeMap<String, String>`. When the context was built with
 * `NodeContext.with_lazy_attributes` (the hot path inside the converter),
 * the map is only materialized on the first call — if the visitor never reads
 * attributes, the allocation is skipped.
 *
 * ## Lifetimes
 *
 * String fields use `Cow<'_, str>` so the converter can pass slices directly
 * out of the parsed DOM without allocating. Visitor implementations that need
 * to outlive the callback should call `NodeContext.into_owned`.
 */
export class WasmNodeContext {
    free(): void;
    [Symbol.dispose](): void;
    /**
     * Return a reference to the attribute map.
     *
     * If the context was built with `NodeContext.with_lazy_attributes`, the
     * map is materialized on the first call and cached for subsequent calls.
     * If this method is never called, no allocation occurs for attributes.
     */
    attributes(): any;
    static default(): WasmNodeContext;
    /**
     * Promote any borrowed fields into owned storage so the context can outlive `'a`.
     */
    intoOwned(): WasmNodeContext;
    constructor(nodeType: WasmNodeType, tagName: string, depth: number, indexInParent: number, isInline: boolean, parentTag?: string | null);
    /**
     * Construct a `NodeContext` with an owned attribute map.
     *
     * Prefer `NodeContext.with_lazy_attributes` (pub(crate)) inside the
     * converter to avoid the eager `collect_tag_attributes` allocation.
     */
    static withOwnedAttributes(node_type: WasmNodeType, tag_name: string, attributes: any, depth: number, index_in_parent: number, parent_tag: string | null | undefined, is_inline: boolean): WasmNodeContext;
    depth: number;
    indexInParent: number;
    isInline: boolean;
    get nodeType(): string;
    set nodeType(value: WasmNodeType);
    get parentTag(): string | undefined;
    set parentTag(value: string | null | undefined);
    tagName: string;
}

/**
 * Node type enumeration covering all HTML element types.
 *
 * This enum categorizes all HTML elements that the converter recognizes,
 * providing a coarse-grained classification for visitor dispatch.
 */
export enum WasmNodeType {
    Text = 0,
    Element = 1,
    Heading = 2,
    Paragraph = 3,
    Div = 4,
    Blockquote = 5,
    Pre = 6,
    Hr = 7,
    List = 8,
    ListItem = 9,
    DefinitionList = 10,
    DefinitionTerm = 11,
    DefinitionDescription = 12,
    Table = 13,
    TableRow = 14,
    TableCell = 15,
    TableHeader = 16,
    TableBody = 17,
    TableHead = 18,
    TableFoot = 19,
    Link = 20,
    Image = 21,
    Strong = 22,
    Em = 23,
    Code = 24,
    Strikethrough = 25,
    Underline = 26,
    Subscript = 27,
    Superscript = 28,
    Mark = 29,
    Small = 30,
    Br = 31,
    Span = 32,
    Article = 33,
    Section = 34,
    Nav = 35,
    Aside = 36,
    Header = 37,
    Footer = 38,
    Main = 39,
    Figure = 40,
    Figcaption = 41,
    Time = 42,
    Details = 43,
    Summary = 44,
    Form = 45,
    Input = 46,
    Select = 47,
    Option = 48,
    Button = 49,
    Textarea = 50,
    Label = 51,
    Fieldset = 52,
    Legend = 53,
    Audio = 54,
    Video = 55,
    Picture = 56,
    Source = 57,
    Iframe = 58,
    Svg = 59,
    Canvas = 60,
    Ruby = 61,
    Rt = 62,
    Rp = 63,
    Abbr = 64,
    Kbd = 65,
    Samp = 66,
    Var = 67,
    Cite = 68,
    Q = 69,
    Del = 70,
    Ins = 71,
    Data = 72,
    Meter = 73,
    Progress = 74,
    Output = 75,
    Template = 76,
    Slot = 77,
    Html = 78,
    Head = 79,
    Body = 80,
    Title = 81,
    Meta = 82,
    LinkTag = 83,
    Style = 84,
    Script = 85,
    Base = 86,
    Custom = 87,
}

/**
 * Output format for conversion.
 *
 * Specifies the target markup language format for the conversion output.
 */
export enum WasmOutputFormat {
    Markdown = 0,
    Djot = 1,
    Plain = 2,
}

/**
 * HTML preprocessing options for document cleanup before conversion.
 */
export class WasmPreprocessingOptions {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmPreprocessingOptions;
    constructor(enabled?: boolean | null, preset?: WasmPreprocessingPreset | null, removeNavigation?: boolean | null, removeForms?: boolean | null);
    enabled: boolean;
    get preset(): string;
    set preset(value: WasmPreprocessingPreset);
    removeForms: boolean;
    removeNavigation: boolean;
}

/**
 * Partial update for `PreprocessingOptions`.
 *
 * This struct uses `Option<T>` to represent optional fields that can be selectively updated.
 * Only specified fields (values) will override existing options; undefined values leave the
 * corresponding fields unchanged when applied via `PreprocessingOptions.apply_update`.
 */
export class WasmPreprocessingOptionsUpdate {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmPreprocessingOptionsUpdate;
    constructor(enabled?: boolean | null, preset?: WasmPreprocessingPreset | null, removeNavigation?: boolean | null, removeForms?: boolean | null);
    get enabled(): boolean | undefined;
    set enabled(value: boolean | null | undefined);
    get preset(): string | undefined;
    set preset(value: WasmPreprocessingPreset | null | undefined);
    get removeForms(): boolean | undefined;
    set removeForms(value: boolean | null | undefined);
    get removeNavigation(): boolean | undefined;
    set removeNavigation(value: boolean | null | undefined);
}

/**
 * HTML preprocessing aggressiveness level.
 *
 * Controls the extent of cleanup performed before conversion. Higher levels remove more elements.
 */
export enum WasmPreprocessingPreset {
    Minimal = 0,
    Standard = 1,
    Aggressive = 2,
}

/**
 * A non-fatal diagnostic produced during HTML conversion.
 *
 * Warnings indicate that conversion completed but some content may have been handled
 * differently than expected — for example, an image that could not be extracted, a truncated
 * input, or malformed HTML that was repaired with best-effort parsing.
 *
 * Conversion always succeeds (returns `ConversionResult`) even when warnings are
 * present. Callers should inspect `warnings` and decide how to
 * handle them based on their tolerance for partial results:
 *
 * - **Logging pipelines**: emit each warning at `WARN` level and continue.
 * - **Strict pipelines**: treat any warning as a hard error by checking
 *   `result.warnings.is_empty()` before using the output.
 *
 * See `WarningKind` for the full taxonomy of warning categories.
 */
export class WasmProcessingWarning {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmProcessingWarning;
    constructor(message: string, kind: WasmWarningKind);
    get kind(): string;
    set kind(value: WasmWarningKind);
    message: string;
}

/**
 * Structured data block (JSON-LD, Microdata, or `RDFa`).
 *
 * Represents machine-readable structured data found in the document.
 * JSON-LD blocks are collected as raw JSON strings for flexibility.
 *
 * # Examples
 */
export class WasmStructuredData {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmStructuredData;
    constructor(dataType: WasmStructuredDataType, rawJson: string, schemaType?: string | null);
    get dataType(): string;
    set dataType(value: WasmStructuredDataType);
    rawJson: string;
    get schemaType(): string | undefined;
    set schemaType(value: string | null | undefined);
}

/**
 * Structured data format type.
 *
 * Identifies the schema/format used for structured data markup.
 */
export enum WasmStructuredDataType {
    JsonLd = 0,
    Microdata = 1,
    RDFa = 2,
}

/**
 * A top-level extracted table with both structured data and markdown representation.
 */
export class WasmTableData {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmTableData;
    constructor(grid: WasmTableGrid, markdown: string);
    grid: WasmTableGrid;
    markdown: string;
}

/**
 * A structured table grid with cell-level data including spans.
 */
export class WasmTableGrid {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmTableGrid;
    constructor(rows?: number | null, cols?: number | null, cells?: WasmGridCell[] | null);
    cells: WasmGridCell[];
    cols: number;
    rows: number;
}

/**
 * A styling or semantic annotation that applies to a byte range within a node's text.
 *
 * Unlike `DocumentNode`, which captures block-level structure (headings, paragraphs, etc.),
 * a `TextAnnotation` describes inline-level markup — bold, italic, links, code spans, and
 * similar — that spans a contiguous run of bytes inside `DocumentNode.content`'s text field.
 *
 * Byte offsets (`start`..`end`) are into the UTF-8 encoded text of the parent node. The range
 * follows Rust slice conventions: `start` is inclusive and `end` is exclusive, so the annotated
 * text is `text[start as usize..end as usize]`.
 *
 * Multiple annotations on the same node can overlap (e.g. bold-italic text), and they are
 * stored in the order they are encountered during DOM traversal.
 *
 * See `AnnotationKind` for the full list of supported annotation types.
 */
export class WasmTextAnnotation {
    free(): void;
    [Symbol.dispose](): void;
    static default(): WasmTextAnnotation;
    constructor(start: number, end: number, kind: any);
    end: number;
    kind: any;
    start: number;
}

/**
 * Text directionality of document content.
 *
 * Corresponds to the HTML `dir` attribute and `bdi` element directionality.
 */
export enum WasmTextDirection {
    LeftToRight = 0,
    RightToLeft = 1,
    Auto = 2,
}

/**
 * Controls which conversion tier is used.
 */
export enum WasmTierStrategy {
    Auto = 0,
    Tier2 = 1,
    Tier1 = 2,
}

/**
 * URL encoding strategy for link and image destinations.
 *
 * Controls how special characters in URL destinations are handled when they
 * require escaping to produce valid Markdown.
 *
 * The `Angle` variant (default) wraps the destination in angle brackets:
 * `[text](<url with spaces>)`. This is the CommonMark-specified escape hatch
 * but breaks when the URL itself contains `>`.
 *
 * The `Percent` variant percent-encodes every character that is not an RFC 3986
 * unreserved character or `/`, producing a destination safe for all Markdown
 * parsers: `[text](url%20with%20spaces)`.
 */
export enum WasmUrlEscapeStyle {
    Angle = 0,
    Percent = 1,
}

/**
 * Result of a visitor callback.
 *
 * Allows visitors to control the conversion flow by either proceeding
 * with default behavior, providing custom output, skipping elements,
 * preserving HTML, or signaling errors.
 */
export enum WasmVisitResult {
    Continue = 0,
    Custom = 1,
    Skip = 2,
    PreserveHtml = 3,
    Error = 4,
}

/**
 * Shareable, thread-safe handle to a user-provided HTML visitor implementation.
 *
 * Pass an instance wrapped in this handle to `ConversionOptions` to
 * customise how the HTML document is traversed and converted to Markdown.
 * The handle may be cloned and shared across threads without additional
 * synchronisation on the caller's side.
 */
export class WasmVisitorHandle {
    free(): void;
    [Symbol.dispose](): void;
    constructor(visitor: any);
}

/**
 * Categories of processing warnings.
 */
export enum WasmWarningKind {
    ImageExtractionFailed = 0,
    EncodingFallback = 1,
    TruncatedInput = 2,
    MalformedHtml = 3,
    SanitizationApplied = 4,
    DepthLimitExceeded = 5,
}

/**
 * Whitespace handling strategy during conversion.
 *
 * Determines how sequences of whitespace characters (spaces, tabs, newlines) are processed.
 */
export enum WasmWhitespaceMode {
    Normalized = 0,
    Strict = 1,
}

/**
 * Convert HTML to Markdown, returning a `ConversionResult` with content, metadata, images,
 * and warnings.
 *
 * # Arguments
 *
 * * `html` — the HTML string to convert.
 * * `options` — conversion options. The parameter bound is
 *   `impl Into<Option<ConversionOptions>>`, so any of the following call shapes are accepted:
 *   - `convert(html, ConversionOptions.default())` — bare options.
 *   - `convert(html, opts)` — bare options.
 *   - `convert(html, Some(opts))` — explicit `Option`.
 *   - `convert(html, None)` — fall back to `ConversionOptions.default`.
 *
 * # Example
 *
 *
 * # Errors
 *
 * Returns an error if HTML parsing fails or if the input contains invalid UTF-8.
 */
export function convert(html: string, options?: WasmConversionOptions | null): WasmConversionResult;
