// Generated by alef. Do not edit by hand.
@file:Suppress(
    "ktlint:standard:trailing-comma-on-call-site",
    "ktlint:standard:trailing-comma-on-declaration-site",
    "ktlint:standard:spacing-between-declarations-with-comments",
    "ktlint:standard:spacing-between-declarations-with-annotations",
    "ktlint:standard:when-entry-bracing",
    "ktlint:standard:blank-line-between-when-conditions",
    "ktlint:standard:blank-line-before-declaration",
    "ktlint:standard:chain-method-continuation",
    "ktlint:standard:annotation",
    "ktlint:standard:max-line-length",
    "ktlint:standard:no-semi",
    "ktlint:standard:statement-wrapping",
    "MaxLineLength",
    "TooManyFunctions",
    "FunctionParameterNaming",
    "LongParameterList",
    "CyclomaticComplexMethod",
    "LongMethod",
)

package dev.kreuzberg

/**
 * Top-level structured document representation.
 *
 * A flat array of nodes with index-based parent/child references forming a tree.
 * Root-level nodes have `parent: None`. Use `body_roots()` and `furniture_roots()`
 * to iterate over top-level content by layer.
 *
 * # Validation
 *
 * Call `validate()` after construction to verify all node indices are in bounds
 * and parent-child relationships are bidirectionally consistent.
 */
data class DocumentStructure(
    /** All nodes in document/reading order. */
    val nodes: List<DocumentNode> = emptyList(),
    /**
     * Origin format identifier (e.g. "docx", "pptx", "html", "pdf").
     *
     * Allows renderers to apply format-aware heuristics when converting
     * the document tree to output formats.
     */
    val sourceFormat: String? = null,
    /**
     * Resolved relationships between nodes (footnote refs, citations, anchor links, etc.).
     *
     * Populated during derivation from the internal document representation.
     * Empty when no relationships are detected.
     */
    val relationships: List<DocumentRelationship> = emptyList(),
    /**
     * Sorted, deduplicated list of node type names present in this document.
     *
     * Each value is the snake_case `node_type` tag of the corresponding
     * `NodeContent` variant (e.g. `"paragraph"`, `"heading"`, `"table"`, …).
     *
     * Computed from `nodes` via `DocumentStructure.finalize_node_types`.
     * Empty until that method is called (internal construction paths call it
     * at the end of derivation).
     */
    val nodeTypes: List<String> = emptyList(),
)
