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

/**
 * The type of an inline text annotation.
 *
 * Uses internally tagged representation (`"annotation_type": "bold"`) for JSON serialization.
 */
export enum WasmAnnotationKind {
    Bold = 0,
    Italic = 1,
    Underline = 2,
    Strikethrough = 3,
    Code = 4,
    Subscript = 5,
    Superscript = 6,
    Highlight = 7,
    Link = 8,
}

/**
 * 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
 *
 * ```text
 * use html_to_markdown_rs::ConversionOptions;
 *
 * let options = ConversionOptions::builder()
 *     .heading_style(HeadingStyle::Atx)
 *     .wrap(true)
 *     .wrap_width(100)
 *     .build();
 * ```
 */
export class WasmConversionOptions {
    free(): void;
    [Symbol.dispose](): void;
    /**
     * Apply a partial update to these conversion options.
     */
    applyUpdate(_update: WasmConversionOptionsUpdate): void;
    /**
     * Create a new builder with default values.
     */
    static builder(): WasmConversionOptionsBuilder;
    static default(): WasmConversionOptions;
    static from(update: WasmConversionOptionsUpdate): WasmConversionOptions;
    /**
     * Create from a partial update, applying to defaults.
     */
    static fromUpdate(update: WasmConversionOptionsUpdate): WasmConversionOptions;
    constructor(heading_style?: WasmHeadingStyle | null, list_indent_type?: WasmListIndentType | null, list_indent_width?: number | null, bullets?: string | null, strong_em_symbol?: string | null, escape_asterisks?: boolean | null, escape_underscores?: boolean | null, escape_misc?: boolean | null, escape_ascii?: boolean | null, code_language?: string | null, autolinks?: boolean | null, default_title?: boolean | null, br_in_tables?: boolean | null, highlight_style?: WasmHighlightStyle | null, extract_metadata?: boolean | null, whitespace_mode?: WasmWhitespaceMode | null, strip_newlines?: boolean | null, wrap?: boolean | null, wrap_width?: number | null, convert_as_inline?: boolean | null, sub_symbol?: string | null, sup_symbol?: string | null, newline_style?: WasmNewlineStyle | null, code_block_style?: WasmCodeBlockStyle | null, keep_inline_images_in?: string[] | null, preprocessing?: WasmPreprocessingOptions | null, encoding?: string | null, debug?: boolean | null, strip_tags?: string[] | null, preserve_tags?: string[] | null, skip_images?: boolean | null, link_style?: WasmLinkStyle | null, output_format?: WasmOutputFormat | null, include_document_structure?: boolean | null, extract_images?: boolean | null, max_image_size?: bigint | null, capture_svg?: boolean | null, infer_dimensions?: boolean | null, exclude_selectors?: string[] | null, max_depth?: number | null);
    autolinks: boolean;
    brInTables: boolean;
    bullets: string;
    captureSvg: boolean;
    codeBlockStyle: WasmCodeBlockStyle;
    codeLanguage: string;
    convertAsInline: boolean;
    debug: boolean;
    defaultTitle: boolean;
    encoding: string;
    escapeAscii: boolean;
    escapeAsterisks: boolean;
    escapeMisc: boolean;
    escapeUnderscores: boolean;
    excludeSelectors: string[];
    extractImages: boolean;
    extractMetadata: boolean;
    headingStyle: WasmHeadingStyle;
    highlightStyle: WasmHighlightStyle;
    includeDocumentStructure: boolean;
    inferDimensions: boolean;
    keepInlineImagesIn: string[];
    linkStyle: WasmLinkStyle;
    listIndentType: WasmListIndentType;
    listIndentWidth: number;
    get maxDepth(): number | undefined;
    set maxDepth(value: number | null | undefined);
    maxImageSize: bigint;
    newlineStyle: WasmNewlineStyle;
    outputFormat: WasmOutputFormat;
    preprocessing: WasmPreprocessingOptions;
    preserveTags: string[];
    skipImages: boolean;
    stripNewlines: boolean;
    stripTags: string[];
    strongEmSymbol: string;
    subSymbol: string;
    supSymbol: string;
    whitespaceMode: WasmWhitespaceMode;
    wrap: boolean;
    wrapWidth: number;
}

/**
 * Builder for [`ConversionOptions`].
 *
 * All fields start with default values. Call `.build()` to produce the final options.
 */
export class WasmConversionOptionsBuilder {
    private constructor();
    free(): void;
    [Symbol.dispose](): void;
    /**
     * Build the final [`ConversionOptions`].
     */
    build(): WasmConversionOptions;
    /**
     * Set the list of CSS selectors for elements to exclude entirely from output.
     */
    excludeSelectors(selectors: string[]): WasmConversionOptionsBuilder;
    /**
     * Set the list of HTML tag names whose `<img>` children are kept inline.
     */
    keepInlineImagesIn(tags: string[]): WasmConversionOptionsBuilder;
    /**
     * Set the pre-processing options applied to the HTML before conversion.
     */
    preprocessing(preprocessing: WasmPreprocessingOptions): WasmConversionOptionsBuilder;
    /**
     * Set the list of HTML tag names that are preserved verbatim in output.
     */
    preserveTags(tags: string[]): WasmConversionOptionsBuilder;
    /**
     * Set the list of HTML tag names whose content is stripped from output.
     */
    stripTags(tags: string[]): WasmConversionOptionsBuilder;
}

/**
 * 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;
    constructor(heading_style?: WasmHeadingStyle | null, list_indent_type?: WasmListIndentType | null, list_indent_width?: number | null, bullets?: string | null, strong_em_symbol?: string | null, escape_asterisks?: boolean | null, escape_underscores?: boolean | null, escape_misc?: boolean | null, escape_ascii?: boolean | null, code_language?: string | null, autolinks?: boolean | null, default_title?: boolean | null, br_in_tables?: boolean | null, highlight_style?: WasmHighlightStyle | null, extract_metadata?: boolean | null, whitespace_mode?: WasmWhitespaceMode | null, strip_newlines?: boolean | null, wrap?: boolean | null, wrap_width?: number | null, convert_as_inline?: boolean | null, sub_symbol?: string | null, sup_symbol?: string | null, newline_style?: WasmNewlineStyle | null, code_block_style?: WasmCodeBlockStyle | null, keep_inline_images_in?: string[] | null, preprocessing?: WasmPreprocessingOptionsUpdate | null, encoding?: string | null, debug?: boolean | null, strip_tags?: string[] | null, preserve_tags?: string[] | null, skip_images?: boolean | null, link_style?: WasmLinkStyle | null, output_format?: WasmOutputFormat | null, include_document_structure?: boolean | null, extract_images?: boolean | null, max_image_size?: bigint | null, capture_svg?: boolean | null, infer_dimensions?: boolean | null, max_depth?: number | null, exclude_selectors?: string[] | 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(): WasmCodeBlockStyle | undefined;
    set codeBlockStyle(value: WasmCodeBlockStyle | null | undefined);
    get codeLanguage(): string | undefined;
    set codeLanguage(value: string | 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(): WasmHeadingStyle | undefined;
    set headingStyle(value: WasmHeadingStyle | null | undefined);
    get highlightStyle(): WasmHighlightStyle | 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(): WasmLinkStyle | undefined;
    set linkStyle(value: WasmLinkStyle | null | undefined);
    get listIndentType(): WasmListIndentType | 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(): WasmNewlineStyle | undefined;
    set newlineStyle(value: WasmNewlineStyle | null | undefined);
    get outputFormat(): WasmOutputFormat | 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 whitespaceMode(): WasmWhitespaceMode | 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;
    constructor(metadata?: WasmHtmlMetadata | null, tables?: WasmTableData[] | null, images?: string[] | 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);
    images: string[];
    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
 *
 * ```
 * # use html_to_markdown_rs::metadata::DocumentMetadata;
 * let doc = DocumentMetadata {
 *     title: Some("My Article".to_string()),
 *     description: Some("A great article about Rust".to_string()),
 *     keywords: vec!["rust".to_string(), "programming".to_string()],
 *     ..Default::default()
 * };
 *
 * assert_eq!(doc.title, Some("My Article".to_string()));
 * ```
 */
export class WasmDocumentMetadata {
    free(): void;
    [Symbol.dispose](): void;
    constructor(keywords?: string[] | null, open_graph?: any | null, twitter_card?: any | null, meta_tags?: any | null, title?: string | null, description?: string | null, author?: string | null, canonical_url?: string | null, base_href?: string | null, language?: string | null, text_direction?: 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(): WasmTextDirection | 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;
    constructor(id: string, content: WasmNodeContent, 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: WasmNodeContent;
    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;
    constructor(nodes: WasmDocumentNode[], source_format?: 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;
    constructor(content: string, row: number, col: number, row_span: number, col_span: number, is_header: 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
 *
 * ```
 * # use html_to_markdown_rs::metadata::HeaderMetadata;
 * let header = HeaderMetadata {
 *     level: 1,
 *     text: "Main Title".to_string(),
 *     id: Some("main-title".to_string()),
 *     depth: 0,
 *     html_offset: 145,
 * };
 *
 * assert_eq!(header.level, 1);
 * assert!(header.is_valid());
 * ```
 */
export class WasmHeaderMetadata {
    free(): void;
    [Symbol.dispose](): void;
    /**
     * Validate that the header level is within valid range (1-6).
     *
     * # Returns
     *
     * `true` if level is 1-6, `false` otherwise.
     *
     * # Examples
     *
     * ```
     * # use html_to_markdown_rs::metadata::HeaderMetadata;
     * let valid = HeaderMetadata {
     *     level: 3,
     *     text: "Title".to_string(),
     *     id: None,
     *     depth: 2,
     *     html_offset: 100,
     * };
     * assert!(valid.is_valid());
     *
     * let invalid = HeaderMetadata {
     *     level: 7,  // Invalid
     *     text: "Title".to_string(),
     *     id: None,
     *     depth: 2,
     *     html_offset: 100,
     * };
     * assert!(!invalid.is_valid());
     * ```
     */
    isValid(): boolean;
    constructor(level: number, text: string, depth: number, html_offset: 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
 *
 * ```
 * # use html_to_markdown_rs::metadata::HtmlMetadata;
 * let metadata = HtmlMetadata {
 *     document: Default::default(),
 *     headers: Vec::new(),
 *     links: Vec::new(),
 *     images: Vec::new(),
 *     structured_data: Vec::new(),
 * };
 *
 * assert!(metadata.headers.is_empty());
 * ```
 */
export class WasmHtmlMetadata {
    free(): void;
    [Symbol.dispose](): void;
    constructor(document?: WasmDocumentMetadata | null, headers?: WasmHeaderMetadata[] | null, links?: WasmLinkMetadata[] | null, images?: WasmImageMetadata[] | null, structured_data?: WasmStructuredData[] | null);
    document: WasmDocumentMetadata;
    headers: WasmHeaderMetadata[];
    images: WasmImageMetadata[];
    links: WasmLinkMetadata[];
    structuredData: WasmStructuredData[];
}

/**
 * Image metadata with source and dimensions.
 *
 * Captures `<img>` elements and inline `<svg>` elements with metadata
 * for image analysis and optimization.
 *
 * # Examples
 *
 * ```
 * # use html_to_markdown_rs::metadata::{ImageMetadata, ImageType};
 * let img = ImageMetadata {
 *     src: "https://example.com/image.jpg".to_string(),
 *     alt: Some("An example image".to_string()),
 *     title: Some("Example".to_string()),
 *     dimensions: Some((800, 600)),
 *     image_type: ImageType::External,
 *     attributes: Default::default(),
 * };
 *
 * assert_eq!(img.image_type, ImageType::External);
 * ```
 */
export class WasmImageMetadata {
    free(): void;
    [Symbol.dispose](): void;
    constructor(src: string, image_type: WasmImageType, attributes: any, alt?: string | null, title?: string | null, dimensions?: Uint32Array | null);
    get alt(): string | undefined;
    set alt(value: string | null | undefined);
    attributes: any;
    get dimensions(): Uint32Array | undefined;
    set dimensions(value: Uint32Array | null | undefined);
    imageType: 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
 *
 * ```
 * # use html_to_markdown_rs::metadata::{LinkMetadata, LinkType};
 * let link = LinkMetadata {
 *     href: "https://example.com".to_string(),
 *     text: "Example".to_string(),
 *     title: Some("Visit Example".to_string()),
 *     link_type: LinkType::External,
 *     rel: vec!["nofollow".to_string()],
 *     attributes: Default::default(),
 * };
 *
 * assert_eq!(link.link_type, LinkType::External);
 * assert_eq!(link.text, "Example");
 * ```
 */
export class WasmLinkMetadata {
    free(): void;
    [Symbol.dispose](): void;
    /**
     * Classify a link based on href value.
     *
     * # Arguments
     *
     * * `href` - The href attribute value
     *
     * # Returns
     *
     * Appropriate [`LinkType`] based on protocol and content.
     *
     * # Examples
     *
     * ```
     * # use html_to_markdown_rs::metadata::{LinkMetadata, LinkType};
     * assert_eq!(LinkMetadata::classify_link("#section"), LinkType::Anchor);
     * assert_eq!(LinkMetadata::classify_link("mailto:test@example.com"), LinkType::Email);
     * assert_eq!(LinkMetadata::classify_link("tel:+1234567890"), LinkType::Phone);
     * assert_eq!(LinkMetadata::classify_link("https://example.com"), LinkType::External);
     * ```
     */
    static classifyLink(href: string): WasmLinkType;
    constructor(href: string, text: string, link_type: WasmLinkType, rel: string[], attributes: any, title?: string | null);
    attributes: any;
    href: string;
    linkType: 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,
}

/**
 * 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 enum WasmNodeContent {
    Heading = 0,
    Paragraph = 1,
    List = 2,
    ListItem = 3,
    Table = 4,
    Image = 5,
    Code = 6,
    Quote = 7,
    DefinitionList = 8,
    DefinitionItem = 9,
    RawBlock = 10,
    MetadataBlock = 11,
    Group = 12,
}

/**
 * Context information passed to all visitor methods.
 *
 * Provides comprehensive metadata about the current node being visited,
 * including its type, attributes, position in the DOM tree, and parent context.
 */
export class WasmNodeContext {
    free(): void;
    [Symbol.dispose](): void;
    constructor(node_type: WasmNodeType, tag_name: string, attributes: any, depth: number, index_in_parent: number, is_inline: boolean, parent_tag?: string | null);
    attributes: any;
    depth: number;
    indexInParent: number;
    isInline: boolean;
    nodeType: 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;
    /**
     * Apply a partial update to these preprocessing options.
     *
     * Any specified fields in the update will override the current values.
     * Unspecified fields (None) are left unchanged.
     *
     * # Arguments
     *
     * * `update` - Partial preprocessing options update
     */
    applyUpdate(_update: WasmPreprocessingOptionsUpdate): void;
    static default(): WasmPreprocessingOptions;
    static from(update: WasmPreprocessingOptionsUpdate): WasmPreprocessingOptions;
    /**
     * Create new preprocessing options from a partial update.
     *
     * Creates a new `PreprocessingOptions` struct with defaults, then applies the update.
     * Fields not specified in the update keep their default values.
     *
     * # Arguments
     *
     * * `update` - Partial preprocessing options update
     *
     * # Returns
     *
     * New `PreprocessingOptions` with specified updates applied to defaults
     */
    static fromUpdate(update: WasmPreprocessingOptionsUpdate): WasmPreprocessingOptions;
    constructor(enabled?: boolean | null, preset?: WasmPreprocessingPreset | null, remove_navigation?: boolean | null, remove_forms?: boolean | null);
    enabled: boolean;
    preset: 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 (Some values) will override existing options; None values leave the
 * corresponding fields unchanged when applied via [`PreprocessingOptions::apply_update`].
 */
export class WasmPreprocessingOptionsUpdate {
    free(): void;
    [Symbol.dispose](): void;
    constructor(enabled?: boolean | null, preset?: WasmPreprocessingPreset | null, remove_navigation?: boolean | null, remove_forms?: boolean | null);
    get enabled(): boolean | undefined;
    set enabled(value: boolean | null | undefined);
    get preset(): WasmPreprocessingPreset | 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 warning generated during HTML processing.
 */
export class WasmProcessingWarning {
    free(): void;
    [Symbol.dispose](): void;
    constructor(message: string, kind: WasmWarningKind);
    kind: 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
 *
 * ```
 * # use html_to_markdown_rs::metadata::{StructuredData, StructuredDataType};
 * let schema = StructuredData {
 *     data_type: StructuredDataType::JsonLd,
 *     raw_json: r#"{"@context":"https://schema.org","@type":"Article"}"#.to_string(),
 *     schema_type: Some("Article".to_string()),
 * };
 *
 * assert_eq!(schema.data_type, StructuredDataType::JsonLd);
 * ```
 */
export class WasmStructuredData {
    free(): void;
    [Symbol.dispose](): void;
    constructor(data_type: WasmStructuredDataType, raw_json: string, schema_type?: string | null);
    dataType: 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;
    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;
    constructor(rows?: number | null, cols?: number | null, cells?: WasmGridCell[] | null);
    cells: WasmGridCell[];
    cols: number;
    rows: number;
}

/**
 * An inline text annotation with byte-range offsets.
 *
 * Annotations describe formatting (bold, italic, etc.) and links within a node's text content.
 */
export class WasmTextAnnotation {
    free(): void;
    [Symbol.dispose](): void;
    constructor(start: number, end: number, kind: WasmAnnotationKind);
    end: number;
    kind: WasmAnnotationKind;
    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,
}

/**
 * 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,
}

/**
 * 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,
}

export function convert(html: string, options?: WasmConversionOptions | null, visitor?: any | null): WasmConversionResult;


export type WasmHeadingStyle = "underlined" | "atx" | "atxClosed";
export type WasmListIndentType = "spaces" | "tabs";
export type WasmWhitespaceMode = "normalized" | "strict";
export type WasmNewlineStyle = "spaces" | "backslash";
export type WasmCodeBlockStyle = "indented" | "backticks" | "tildes";
export type WasmHighlightStyle = "doubleEqual" | "html" | "bold" | "none";
export type WasmPreprocessingPreset = "minimal" | "standard" | "aggressive";
export type WasmOutputFormat = "markdown" | "djot" | "plain";

export interface WasmPreprocessingOptions {
  enabled?: boolean;
  preset?: WasmPreprocessingPreset;
  removeNavigation?: boolean;
  removeForms?: boolean;
}

export interface WasmConversionOptions {
  headingStyle?: WasmHeadingStyle;
  listIndentType?: WasmListIndentType;
  listIndentWidth?: number;
  bullets?: string;
  strongEmSymbol?: string;
  escapeAsterisks?: boolean;
  escapeUnderscores?: boolean;
  escapeMisc?: boolean;
  escapeAscii?: boolean;
  codeLanguage?: string;
  autolinks?: boolean;
  defaultTitle?: boolean;
  brInTables?: boolean;
  hocrSpatialTables?: boolean;
  highlightStyle?: WasmHighlightStyle;
  extractMetadata?: boolean;
  whitespaceMode?: WasmWhitespaceMode;
  stripNewlines?: boolean;
  wrap?: boolean;
  wrapWidth?: number;
  convertAsInline?: boolean;
  subSymbol?: string;
  supSymbol?: string;
  newlineStyle?: WasmNewlineStyle;
  codeBlockStyle?: WasmCodeBlockStyle;
  keepInlineImagesIn?: string[];
  preprocessing?: WasmPreprocessingOptions | null;
  encoding?: string;
  debug?: boolean;
  stripTags?: string[];
  preserveTags?: string[];
  skipImages?: boolean;
  outputFormat?: WasmOutputFormat;
  includeDocumentStructure?: boolean;
  extractImages?: boolean;
  maxImageSize?: number;
  captureSvg?: boolean;
  inferDimensions?: boolean;
}

/** A single cell in a structured table grid. */
export interface WasmGridCell {
  content: string;
  row: number;
  col: number;
  rowSpan: number;
  colSpan: number;
  isHeader: boolean;
}

/** Structured table grid with cell-level data. */
export interface WasmTableGrid {
  rows: number;
  cols: number;
  cells: WasmGridCell[];
}

/** A table extracted during conversion. */
export interface WasmConversionTable {
  grid: WasmTableGrid;
  markdown: string;
}

/** Non-fatal warning emitted during conversion. */
export interface WasmConversionWarning {
  /** Human-readable warning message. */
  message: string;
  /** Warning kind identifier. */
  kind: string;
}

/** An extracted inline image from the HTML document. */
export interface WasmInlineImage {
  /** Raw image data as a Uint8Array. */
  data: Uint8Array;
  /** Image format (png, jpeg, gif, svg, etc.). */
  format: string;
  /** Generated or provided filename, or null. */
  filename: string | null;
  /** Alt text or description, or null. */
  description: string | null;
  /** Image width in pixels, or null if not available. */
  width: number | null;
  /** Image height in pixels, or null if not available. */
  height: number | null;
  /** Source type ("img_data_uri" or "svg_element"). */
  source: string;
  /** HTML attributes from the source element. */
  attributes: Record<string, string>;
}

/** Result of the convert() API. */
export interface WasmConversionResult {
  /** Converted text output (markdown, djot, or plain text), or null. */
  content: string | null;
  /** Structured document tree serialized as a JSON value, or null. */
  document: unknown | null;
  /** Extracted HTML metadata serialized as a JSON value, or null. */
  metadata: unknown | null;
  /** All tables found in the HTML, in document order. */
  tables: WasmConversionTable[];
  /** Extracted inline images (data URIs and SVGs). */
  images: WasmInlineImage[];
  /** Non-fatal processing warnings. */
  warnings: WasmConversionWarning[];
}
