/** * Which parts of the OOXML package to include in the markdown projection. * Bitflags mirroring the .NET `Docxodus.ProjectionScopes` enum. */ export declare enum ProjectionScopes { Body = 1, Headers = 2, Footers = 4, Footnotes = 8, Endnotes = 16, Comments = 32, All = 63 } /** * How anchor markers are rendered in the markdown projection. * Mirrors the .NET `Docxodus.AnchorRenderMode` enum. */ export declare enum AnchorRenderMode { /** Anchor appears on its own line before each block element (default). */ Block = 0, /** Block anchors plus inline `{#…}` markers for spans (comments, hyperlinks). */ BlockAndInline = 1, /** No anchor markers in the output (projection only, no addressing). */ None = 2 } /** * Strategy for rendering `w:tbl` elements that don't fit GFM pipe-table constraints. * Mirrors the .NET `Docxodus.TableRenderMode` enum. */ export declare enum TableRenderMode { /** Emit GFM pipe tables when possible, opaque anchor blocks otherwise (default). */ GfmWithOpaqueFallback = 0, /** Always emit GFM pipe tables, flattening complex structure with possible loss. */ AlwaysGfm = 1, /** Always emit opaque anchor blocks. */ AlwaysOpaque = 2 } /** * How tracked changes are handled in the markdown projection. * Mirrors the .NET `Docxodus.TrackedChangeMode` enum. */ export declare enum TrackedChangeMode { /** Accept all revisions before conversion (default). */ Accept = 0, /** Render insertions and deletions inline as `{+ins+}` / `{-del-}`. */ RenderInline = 1, /** Accept insertions, drop deletions. */ StripDeletions = 2 } /** * How empty paragraphs are rendered. Mirrors the .NET `Docxodus.EmptyParagraphMode` enum. */ export declare enum EmptyParagraphMode { /** Default: emit the anchor on its own line (`{#p:body:UNID}\n`). */ AnchorOnly = 0, /** Tag the empty paragraph visibly so agents can pattern-match (`{#p:body:UNID} ∅`). */ MarkedEmpty = 1, /** Skip empty paragraphs entirely — they don't appear in the markdown or the anchor index. */ Suppress = 2 } /** * How anchor ids are rendered inside `{#…}` tokens (and keyed in * {@link MarkdownProjection.anchorIndex}). Mirrors the .NET * `Docxodus.AnchorIdRendering` enum. * * `Anchor.token` (and any `AnchorRef` returned by `DocxSession` mutations) * always carries the full Unid regardless of rendering — the choice only * affects the markdown text. The returned `anchorIndex` is dual-keyed so * lookups by either the rendered id or the full Unid work for the * `Abbreviated`/`Sequential` modes. */ export declare enum AnchorIdRendering { /** Full 32-char hex Unid (default; e.g. `{#h:body:a1b2c3d4e5f6789012345678901234ab}`). */ FullUnid = 0, /** Shortest unique prefix per (kind, scope) bucket, 4-char floor (e.g. `{#h:body:a1b2}`). * Saves 5-10% of projection-token budget for LLM consumption. */ Abbreviated = 1, /** Sequential numeric ids per (kind, scope) bucket in document order (e.g. `{#h:body:1}`). * Maximally token-efficient for one-shot LLM contexts. NOT stable across * `project()` calls and must NOT be persisted. */ Sequential = 2 } /** * How far below the target anchor to include in * {@link DocxSession.projectAnchor}. Mirrors the .NET * `Docxodus.ProjectionDepth` enum. */ export declare enum ProjectionDepth { /** Just the target block itself (its anchor + its own text). For headings, * returns only the heading paragraph, not the section under it. */ SelfOnly = 0, /** Self + descendants. Most useful for `tbl` anchors (returns the whole table); * for paragraphs it's the same as `SelfOnly`. */ Subtree = 1, /** Self + descendants + following siblings up to (but not including) the next * sibling at the same or higher heading level. For non-heading anchors, * equivalent to `Subtree`. Dominant "give me this section" case; the default. */ SubtreeAndFollowingSiblings = 2 } /** * Settings controlling the markdown projection. Mirrors the .NET * `WmlToMarkdownConverterSettings` class — see `docs/architecture/markdown_projection.md`. */ export interface MarkdownProjectionSettings { scopes?: ProjectionScopes; headingLevelOffset?: number; anchorMode?: AnchorRenderMode; tableMode?: TableRenderMode; tableInlineCellMax?: number; trackedChanges?: TrackedChangeMode; resolveNumbering?: boolean; emptyParagraphs?: EmptyParagraphMode; /** * How anchor ids are rendered in markdown output. Default `FullUnid`. * Set to `Abbreviated` for terse LLM-friendly ids; `Sequential` for * 1-based per-scope counters (best for replay logs / human review). * `Anchor.token` (and any `AnchorRef`) always reflects the full Unid * regardless; this only affects the markdown text. Use the returned * {@link MarkdownProjection.anchorIndex} (dual-keyed for Abbreviated / * Sequential) to translate rendered ids back to full Unids. */ anchorIdRendering?: AnchorIdRendering; } /** * Resolved location of an anchor in the underlying OOXML package — sufficient to walk * back to the source element via the .NET API. */ export interface MarkdownAnchorTarget { id: string; kind: string; scope: string; unid: string; partUri: string; /** First ~80 characters of the element's flat text — for previewing/picking anchors. */ textPreview: string; /** Resolved auto-numbering prefix (e.g. "1.", "First") for paragraphs/headings/list * items whose style or `w:numPr` produces numbering. Absent when the element has * no numbering. The prefix is NOT included in {@link textPreview} because * textPreview reflects only the run text; this field gives callers the value * Word actually renders before the element's text. */ autoNumberPrefix?: string; } /** * Output of the markdown projection: rendered text plus the anchor index mapping * each `{#…}` token back to a location in the OOXML package. */ export interface MarkdownProjection { markdown: string; anchorIndex: Record; } /** * Revision type enum matching the .NET `DocxDiffRevisionType`, as returned by the `docxDiff*` * comparison APIs. NOT the shape {@link getRevisions} returns — that reads a document's own markup * and reports the markup-level kind on `RevisionListEntry.type` (`ins`/`del`/`moveFrom`), with the * grouped classification on `family`. */ export declare enum RevisionType { /** Text or content that was added/inserted */ Inserted = "Inserted", /** Text or content that was removed/deleted */ Deleted = "Deleted", /** Text or content that was relocated within the document */ Moved = "Moved", /** Text content unchanged but formatting (bold, italic, etc.) changed */ FormatChanged = "FormatChanged" } /** * Comment render mode * Use -1 (Disabled) to not render comments, or a positive value to enable with that mode */ export declare enum CommentRenderMode { /** Do not render comments (default) */ Disabled = -1, /** Render comments at the end of the document with bidirectional links (like footnotes) */ EndnoteStyle = 0, /** Render comments as inline tooltips with data attributes */ Inline = 1, /** Render comments in a margin column (CSS-positioned) */ Margin = 2 } /** * Pagination mode for HTML output */ export declare enum PaginationMode { /** No pagination - content flows continuously (default) */ None = 0, /** * Paginated view - outputs page containers with document dimensions * and content with data attributes for client-side pagination. * Creates a PDF.js-style page preview experience. */ Paginated = 1 } /** * How rendered tracked changes look (issue #851). Only used when `renderTrackedChanges` is on. */ export declare enum RevisionPresentation { /** Docxodus's own review style (default): green/red text with light fills, purple moves, pilcrows. */ Docxodus = 0, /** * Close to Word's All Markup print: one colour per author for both insertions (underlined) and * deletions (struck through), no fills or pilcrows, green double-lined moves, Word's default cell * shading, and one left-margin change bar per changed paragraph. Full renders only. */ Word = 1 } /** * Annotation label display mode */ export declare enum AnnotationLabelMode { /** Floating label positioned above the highlight */ Above = 0, /** Label displayed inline at start of highlight */ Inline = 1, /** Label shown only on hover (tooltip) */ Tooltip = 2, /** No labels displayed, only highlights */ None = 3 } /** * Types of content that cannot be fully converted to HTML. * Used for placeholder rendering when unsupported content is encountered. */ export declare enum UnsupportedContentType { /** Windows Metafile image format (legacy vector graphics) */ WmfImage = "WmfImage", /** Enhanced Metafile image format (legacy vector graphics) */ EmfImage = "EmfImage", /** SVG image format (not yet supported) */ SvgImage = "SvgImage", /** Office Math Markup Language equations */ MathEquation = "MathEquation", /** Form field elements (checkboxes, text inputs, dropdowns) */ FormField = "FormField", /** Ruby annotations for East Asian text */ RubyAnnotation = "RubyAnnotation", /** Embedded OLE objects */ OleObject = "OleObject", /** Other unsupported content */ Other = "Other" } /** * Options for DOCX to HTML conversion */ export interface ConversionOptions { /** Title for the HTML document (default: "Document") */ pageTitle?: string; /** CSS class prefix for generated styles (default: "docx-") */ cssPrefix?: string; /** Whether to generate CSS classes (default: true) */ fabricateClasses?: boolean; /** Additional CSS to include in the output */ additionalCss?: string; /** Comment rendering mode: Disabled (-1), EndnoteStyle (0), Inline (1), or Margin (2). Default: Disabled */ commentRenderMode?: CommentRenderMode; /** CSS class prefix for comment elements (default: "comment-") */ commentCssClassPrefix?: string; /** Pagination mode: None (0) or Paginated (1). Default: None */ paginationMode?: PaginationMode; /** Scale factor for page rendering in paginated mode (1.0 = 100%). Default: 1.0 */ paginationScale?: number; /** CSS class prefix for pagination elements. Default: "page-" */ paginationCssClassPrefix?: string; /** Whether to render custom annotations (default: false) */ renderAnnotations?: boolean; /** How to display annotation labels (default: Above) */ annotationLabelMode?: AnnotationLabelMode; /** CSS class prefix for annotation elements (default: "annot-") */ annotationCssClassPrefix?: string; /** Whether to render footnotes and endnotes sections at the end of the document (default: false) */ renderFootnotesAndEndnotes?: boolean; /** Whether to render document headers and footers (default: false) */ renderHeadersAndFooters?: boolean; /** In flow HTML, emit active header/footer variants for every section in the hidden * #document-hf-registry instead of a visible default pair. Requires renderHeadersAndFooters. * Default: false. Paginated output keeps its existing registry. */ renderHeaderFooterRegistry?: boolean; /** Preserve PAGE / NUMPAGES fields as data-field spans in flow HTML, including empty results. * Cached text and formatting are retained; this does not calculate page numbers. * Default: false. Paginated output always marks these fields. */ stampPageNumberFields?: boolean; /** Whether to render tracked changes visually (insertions/deletions) (default: false) */ renderTrackedChanges?: boolean; /** Show formatting revision annotations while keeping current formatting (default: true). */ showFormattingChanges?: boolean; /** Show insertion/deletion and move markup; false displays current text (default: true). */ showInsertionsAndDeletions?: boolean; /** Whether to show deleted content with strikethrough (only when renderTrackedChanges=true, default: true) */ showDeletedContent?: boolean; /** Whether to distinguish move operations from regular insert/delete (only when renderTrackedChanges=true, default: true) */ renderMoveOperations?: boolean; /** How tracked changes look (only when renderTrackedChanges=true, default: RevisionPresentation.Docxodus) */ revisionPresentation?: RevisionPresentation; /** * Whether to render placeholders for unsupported content (default: false) * When enabled, unsupported content (WMF/EMF images, math equations, form fields, etc.) * will display as styled placeholder spans instead of being silently dropped. */ renderUnsupportedContentPlaceholders?: boolean; /** * Override the document's default language for the HTML lang attribute. * If not specified, the language is auto-detected from document settings * (w:themeFontLang or default paragraph style), falling back to "en-US". * Examples: "en-US", "fr-FR", "de-DE", "ja-JP" */ documentLanguage?: string; /** * Stamp block-level elements (p, h1-h6, li, table) with a `data-anchor` * attribute carrying the block's stable Unid. Required for the editor to * address blocks in the DOM and drive incremental per-block re-render via * `renderBlockHtml`. Default: false. */ stampAnchors?: boolean; /** * Emit Word lists as `
    `/`