@eigenpal/docx-editor-core/types/document
Comprehensive TypeScript types for full DOCX document representation
This barrel file re-exports all types from the split modules. Existing imports from './types/document' continue to work unchanged.
Module structure: - colors.ts — Color primitives, borders, shading - formatting.ts — Text, paragraph, and table formatting properties - lists.ts — Numbering and list definitions - content.ts — Content model (runs, images, shapes, tables, paragraphs, sections) - styles.ts — Styles, theme, fonts, relationships, media
Functions (1)
pictureWatermarkDisplayEmufunctionSource ↗
Compute the display dimensions (in EMUs) for a picture watermark from the source image's natural pixel size. Bounds the larger side to a page-sized default and derives the other from the aspect ratio, so the watermark is never distorted (the serializer would otherwise force a square) and never overflows the page. Returns undefined for an unusable size (zero/NaN), letting callers fall back to defaults.
declare function pictureWatermarkDisplayEmu(naturalWidthPx: number, naturalHeightPx: number): {
widthEmu: number;
heightEmu: number;
} | undefined;Interfaces (107)
AbstractNumberinginterfaceSource ↗
Abstract numbering definition (w:abstractNum) — the reusable template for a list: which NumberFormat at each indentation level, what marker text, what paragraph/character formatting. Multiple NumberingInstances (w:num) can reference one abstract numbering to share the template while keeping independent counters.
See ECMA-376 §17.9.
interface AbstractNumbering| Member | Type | Summary |
|---|---|---|
| abstractNumId | number | Abstract numbering ID |
| levels | ListLevel[] | Level definitions |
| multiLevelType? | 'hybridMultilevel' | 'multilevel' | 'singleLevel' | Multi-level type |
| name? | string | Name |
| numStyleLink? | string | Numbering style link |
| styleLink? | string | Style link |
BlockSdtinterfaceSource ↗
Block-level SDT (content control wrapping block content).
content is BlockContent[] (not just paragraphs/tables) so a nested block SDT survives the round trip. CT_SdtContentBlock also permits run-level content (bookmarks, etc.); that is carried through the same block-content parsing as elsewhere in the document.
interface BlockSdt| Member | Type | Summary |
|---|---|---|
| content | BlockContent[] | Block content inside the control |
| properties | SdtProperties | SDT properties |
| type | 'blockSdt' |
BookmarkEndinterfaceSource ↗
Bookmark end marker (w:bookmarkEnd)
interface BookmarkEnd| Member | Type | Summary |
|---|---|---|
| id | number | Bookmark ID |
| type | 'bookmarkEnd' |
BookmarkStartinterfaceSource ↗
Bookmark start marker (w:bookmarkStart)
interface BookmarkStart| Member | Type | Summary |
|---|---|---|
| colFirst? | number | Column index for table bookmarks |
| colLast? | number | |
| id | number | Bookmark ID |
| name | string | Bookmark name |
| type | 'bookmarkStart' |
BorderSpecinterfaceSource ↗
One side of a border — style, color, width, spacing. Used by paragraph borders, table borders (per-cell or whole-table), and page borders. size is in eighths of a point (Word's wire format); space is in points.
See ECMA-376 §17.18.2 (ST_Border).
interface BorderSpec| Member | Type | Summary |
|---|---|---|
| color? | ColorValue | Color of the border |
| frame? | boolean | Frame effect |
| shadow? | boolean | Shadow effect |
| size? | number | Width in eighths of a point (1/8 pt) |
| space? | number | Spacing from text in points |
| style | 'none' | 'single' | 'double' | 'dotted' | 'dashed' | 'thick' | 'triple' | 'thinThickSmallGap' | 'thickThinSmallGap' | 'thinThickMediumGap' | 'thickThinMediumGap' | 'thinThickLargeGap' | 'thickThinLargeGap' | 'wave' | 'doubleWave' | 'dashSmallGap' | 'dashDotStroked' | 'threeDEmboss' | 'threeDEngrave' | 'outset' | 'inset' | 'nil' | Border style |
BreakContentinterfaceSource ↗
Line break
interface BreakContent| Member | Type | Summary |
|---|---|---|
| breakType? | 'page' | 'column' | 'textWrapping' | Break type |
| clear? | 'none' | 'left' | 'right' | 'all' | Clear type for text wrapping break |
| type | 'break' |
CellMarginsinterfaceSource ↗
Cell margins
interface CellMargins| Member | Type | Summary |
|---|---|---|
| bottom? | TableMeasurement | |
| left? | TableMeasurement | |
| right? | TableMeasurement | |
| top? | TableMeasurement |
ColorValueinterfaceSource ↗
ECMA-376 color reference — either a direct RGB hex, a theme slot reference (with optional tint/shade), or auto for context-dependent defaults (usually black for text on light backgrounds). When both rgb and themeColor are set, the theme wins on Word import and the rgb acts as a fallback for renderers without theme support.
See ECMA-376 §17.18.39 (ST_ThemeColor).
interface ColorValue| Member | Type | Summary |
|---|---|---|
| auto? | boolean | Auto color - context-dependent (usually black for text) |
| rgb? | string | RGB hex value without # (e.g., "FF0000") |
| themeColor? | ThemeColorSlot | Theme color slot reference |
| themeShade? | string | Shade modifier (0-255 as hex string) - makes color darker |
| themeTint? | string | Tint modifier (0-255 as hex string, e.g., "80") - makes color lighter |
ColumninterfaceSource ↗
Column definition
interface Column| Member | Type | Summary |
|---|---|---|
| space? | number | Space after column in twips |
| width? | number | Column width in twips |
Comment_2interface
A comment from comments.xml — the top-level entity for review comments and replies. id matches the inline CommentRangeStart / CommentRangeEnd markers that anchor it inside a paragraph; parentId threads replies under their parent; done reflects Word's "Resolve" state (w15:done).
interface Comment| Member | Type | Summary |
|---|---|---|
| author | string | Author name |
| content | Paragraph[] | Comment content (paragraphs) |
| date? | string | Date |
| done? | boolean | Whether the comment is resolved/done |
| id | number | Comment ID (matches commentRangeStart/End) |
| initials? | string | Author initials |
| parentId? | number | Parent comment ID (for replies) |
CommentRangeEndinterfaceSource ↗
Comment range end marker in paragraph content
interface CommentRangeEnd| Member | Type | Summary |
|---|---|---|
| id | number | |
| type | 'commentRangeEnd' |
CommentRangeStartinterfaceSource ↗
Comment range start marker in paragraph content
interface CommentRangeStart| Member | Type | Summary |
|---|---|---|
| id | number | |
| type | 'commentRangeStart' |
ComplexFieldinterfaceSource ↗
Complex field (w:fldChar begin/separate/end with w:instrText)
interface ComplexField| Member | Type | Summary |
|---|---|---|
| dirty? | boolean | Field is dirty |
| fieldCode | Run[] | Field code runs |
| fieldResult | Run[] | Display result runs |
| fieldType | FieldType | Parsed field type |
| fldLock? | boolean | Field is locked |
| formatting? | TextFormatting | Run formatting carried by the field's structural runs (the runs holding the `w:fldChar` begin/separate/end). Word styles the field result with this `w:rPr` when there is no separate result run (e.g. a `PAGE` field collapsed into a single run). Used as a fallback for rendering and serialization so the formatting survives the round-trip. |
| instruction | string | Field instruction |
| type | 'complexField' |
ConditionalFormatStyleinterfaceSource ↗
Conditional format style
interface ConditionalFormatStyle| Member | Type | Summary |
|---|---|---|
| evenHBand? | boolean | Even horizontal band |
| evenVBand? | boolean | Even vertical band |
| firstColumn? | boolean | First column |
| firstRow? | boolean | First row |
| lastColumn? | boolean | Last column |
| lastRow? | boolean | Last row |
| neCell? | boolean | Northeast corner |
| nwCell? | boolean | Northwest corner |
| oddHBand? | boolean | Odd horizontal band |
| oddVBand? | boolean | Odd vertical band |
| seCell? | boolean | Southeast corner |
| swCell? | boolean | Southwest corner |
DeletioninterfaceSource ↗
Deletion wrapper (w:del) — runs deleted by tracked changes
interface Deletion| Member | Type | Summary |
|---|---|---|
| content | (Run | Hyperlink)[] | Deleted content |
| info | TrackedChangeInfo | Tracked change metadata |
| type | 'deletion' |
DocDefaultsinterfaceSource ↗
Document defaults (w:docDefaults)
interface DocDefaults| Member | Type | Summary |
|---|---|---|
| pPr? | ParagraphFormatting | Default paragraph properties |
| rPr? | TextFormatting | Default run properties |
Document_2interface
Top-level parsed DOCX document — the result of parseDocx(buffer).
Wraps the unzipped DOCX package (document.xml, styles.xml, etc.), the original buffer for round-trip saves, and any template variables / parse warnings detected during ingestion.
interface Document```ts
import { parseDocx } from '@eigenpal/docx-editor-core/headless';
const doc = await parseDocx(buffer);
console.log(doc.package.document.content.length);
```| Member | Type | Summary |
|---|---|---|
| originalBuffer? | ArrayBuffer | Original DOCX buffer. Kept for round-trip saves that preserve untouched parts. |
| package | DocxPackage | Parsed DOCX package — body, styles, numbering, theme, media, headers/footers. |
| templateVariables? | string[] | Detected docxtemplater variables (e.g. `{name}`, `{address}`). Populated when the document is recognized as a template. |
| warnings? | string[] | Non-fatal parser diagnostics — malformed parts, unsupported features, fallbacks. |
DocumentBodyinterfaceSource ↗
Document body (w:body) — the editable content of the document.
Contains the ordered block content (paragraphs and tables), the section layout chain derived from inline sectPr markers, the final sectPr, and any document-level comments. This is what most edit operations mutate; headers/footers/styles live elsewhere in the package.
interface DocumentBody| Member | Type | Summary |
|---|---|---|
| comments? | Comment[] | Comments from comments.xml |
| content | BlockContent[] | All content (paragraphs, tables) |
| finalSectionProperties? | SectionProperties | Final section properties (from body's sectPr) |
| sections? | Section[] | Sections (derived from sectPr in paragraphs and final sectPr) |
DocumentSettingsinterfaceSource ↗
Document-wide settings parsed from word/settings.xml.
interface DocumentSettings| Member | Type | Summary |
|---|---|---|
| defaultTableStyle? | string | `w:defaultTableStyle` (§17.15.1.44) — the styleId applied to every newly created table in this document. Distinct from the type-default table style (`w:default="1"`), which is what tables inherit from when they carry no `w:tblStyle`. Absent in most documents; a template author sets it so inserted tables pick up the template's table look. |
| defaultTabStop | number | `w:defaultTabStop` (§17.6.13) — interval in twips between default tab stops applied when a paragraph has no custom `w:tabs`. Word's default if unspecified is 720 twips (0.5 inch). |
DocxPackageinterfaceSource ↗
Complete DOCX package structure
interface DocxPackage| Member | Type | Summary |
|---|---|---|
| document | DocumentBody | Document body |
| endnotes? | Endnote[] | Endnotes (normal notes only — separators live in `endnoteSeparators`) |
| endnoteSeparators? | Endnote[] | Separator endnotes — see `footnoteSeparators`. |
| fontTable? | FontTable | Font table |
| footers? | Map<string, HeaderFooter> | Footers by relationship ID |
| footnotes? | Footnote[] | Footnotes (normal notes only — separators live in `footnoteSeparators`) |
| footnoteSeparators? | Footnote[] | Separator footnotes (`w:type="separator"` / `"continuationSeparator"` / `"continuationNotice"`) kept out of `footnotes` so rendering/layout only sees real notes. Retained for round-trip: Word rejects a footnotes part whose separator notes are missing, so the serializer re-emits these ahead of the normal notes. |
| headers? | Map<string, HeaderFooter> | Headers by relationship ID |
| media? | Map<string, MediaFile> | Media files |
| numbering? | NumberingDefinitions | Numbering definitions |
| properties? | {
title?: string;
subject?: string;
creator?: string;
keywords?: string;
description?: string;
lastModifiedBy?: string;
revision?: number;
created?: Date;
modified?: Date;
} | Document properties |
| relationships? | RelationshipMap | Document relationships |
| settings? | DocumentSettings | Document-wide settings from `word/settings.xml` |
| styles? | StyleDefinitions | Style definitions |
| theme? | Theme | Theme |
DrawingContentinterfaceSource ↗
Drawing/image reference
interface DrawingContent| Member | Type | Summary |
|---|---|---|
| image | Image | Image data |
| type | 'drawing' |
EndnoteinterfaceSource ↗
Endnote (w:endnote)
interface Endnote| Member | Type | Summary |
|---|---|---|
| content | BlockContent[] | Content. Per ECMA-376 §17.11.4 endnotes can hold the same blocks as the body — paragraphs, tables, and block-level content controls. See note on `Footnote.content`. |
| id | number | Endnote ID |
| noteType? | 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice' | Special endnote type |
| type | 'endnote' | |
| verbatimXml? | string | Verbatim original XML — see `Footnote.verbatimXml` (#646 F3). |
EndnotePropertiesinterfaceSource ↗
Endnote properties
interface EndnoteProperties| Member | Type | Summary |
|---|---|---|
| numFmt? | NumberFormat | |
| numRestart? | NoteNumberRestart | |
| numStart? | number | |
| position? | EndnotePosition |
FieldCharContentinterfaceSource ↗
Field character (begin/separate/end)
interface FieldCharContent| Member | Type | Summary |
|---|---|---|
| charType | 'begin' | 'separate' | 'end' | Field character type |
| dirty? | boolean | Field is dirty (needs update) |
| fldLock? | boolean | Field is locked |
| type | 'fieldChar' |
FloatingTablePropertiesinterfaceSource ↗
Floating table properties
interface FloatingTableProperties| Member | Type | Summary |
|---|---|---|
| bottomFromText? | number | |
| horzAnchor? | 'margin' | 'page' | 'text' | Horizontal anchor |
| leftFromText? | number | |
| rightFromText? | number | |
| tblpX? | number | Horizontal position |
| tblpXSpec? | 'left' | 'center' | 'right' | 'inside' | 'outside' | |
| tblpY? | number | Vertical position |
| tblpYSpec? | 'top' | 'center' | 'bottom' | 'inside' | 'outside' | 'inline' | |
| topFromText? | number | Distance from surrounding text |
| vertAnchor? | 'margin' | 'page' | 'text' | Vertical anchor |
FontEmbedinterfaceSource ↗
A single embedded font face referenced from fontTable.xml. The font binary lives at the relationship target (an obfuscated .odttf under word/fonts/) and is descrambled with fontKey. See utils/fontDeobfuscation.ts.
interface FontEmbed| Member | Type | Summary |
|---|---|---|
| fontKey? | string | Obfuscation key GUID (`w:fontKey`), e.g. `{XXXXXXXX-....}`. |
| relId | string | Relationship ID (`r:id`) resolved via `word/_rels/fontTable.xml.rels`. |
| subsetted? | boolean | Whether the embedded face is subsetted (`w:subsetted`). |
FontInfointerfaceSource ↗
Font info from fontTable.xml
interface FontInfo| Member | Type | Summary |
|---|---|---|
| altName? | string | Alternate names |
| charset? | string | Character set |
| embedBold? | FontEmbed | Embedded bold face (`w:embedBold`) |
| embedBoldItalic? | FontEmbed | Embedded bold-italic face (`w:embedBoldItalic`) |
| embedItalic? | FontEmbed | Embedded italic face (`w:embedItalic`) |
| embedRegular? | FontEmbed | Embedded regular face (`w:embedRegular`) |
| family? | 'decorative' | 'modern' | 'roman' | 'script' | 'swiss' | 'auto' | Font family type |
| name | string | Font name |
| panose1? | string | Panose-1 classification |
| pitch? | 'default' | 'fixed' | 'variable' | Pitch (fixed or variable) |
| sig? | {
usb0?: string;
usb1?: string;
usb2?: string;
usb3?: string;
csb0?: string;
csb1?: string;
} | Signature |
FontTableinterfaceSource ↗
Font table from fontTable.xml
interface FontTable| Member | Type | Summary |
|---|---|---|
| fonts | FontInfo[] |
FooterReferenceinterfaceSource ↗
interface FooterReference| Member | Type | Summary |
|---|---|---|
| rId | string | |
| type | HeaderFooterType |
FootnoteinterfaceSource ↗
Footnote (w:footnote)
interface Footnote| Member | Type | Summary |
|---|---|---|
| content | BlockContent[] | Content. Per ECMA-376 §17.11.10 footnotes can hold the same blocks as the body, so the note parser reuses the body's `parseBlockContent`: the full block model — paragraphs, tables, and block-level `w:sdt` content controls (as `BlockSdt`) — flows through the body pipeline (toProseDoc → toFlowBlocks) and stays editable on round-trip. |
| id | number | Footnote ID |
| noteType? | 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice' | Special footnote type |
| type | 'footnote' | |
| verbatimXml? | string | Verbatim original XML of the entire `<w:footnote>` element, captured at parse time ONLY when the note body carries a block-level construct the model still can't represent — note-level bookmarks (`w:bookmarkStart`/`w:bookmarkEnd`) or `w:customXml`. Block-level `w:sdt` is NOT a trigger: it round-trips through the model as `BlockSdt`. When present the serializer re-emits these bytes instead of rebuilding from `content`, restoring pre-#646 fidelity for the unmodeled constructs. See `parseNoteBlockContent` / `serializeNote` for the gate (#646 F3). |
FootnotePropertiesinterfaceSource ↗
Footnote properties
interface FootnoteProperties| Member | Type | Summary |
|---|---|---|
| numFmt? | NumberFormat | |
| numRestart? | NoteNumberRestart | |
| numStart? | number | |
| position? | FootnotePosition |
HeaderFooterinterfaceSource ↗
Header or footer content
interface HeaderFooter| Member | Type | Summary |
|---|---|---|
| content | BlockContent[] | Content (paragraphs, tables, etc.) |
| hdrFtrType | HeaderFooterType | Header/footer type |
| type | 'header' | 'footer' | |
| watermark? | Watermark | Watermark stored on this header (MS Word "Design → Watermark"). Lives here, not in `content`, so it stays out of the editable text flow while still round-tripping. Only headers carry watermarks; footers never do. |
HeaderReferenceinterfaceSource ↗
Header or footer reference
interface HeaderReference| Member | Type | Summary |
|---|---|---|
| rId | string | |
| type | HeaderFooterType |
HyperlinkinterfaceSource ↗
Hyperlink (w:hyperlink) — wraps runs in a clickable link. External targets resolve through the relationships part (rId → href); internal targets reference a BookmarkStart anchor by name.
interface Hyperlink| Member | Type | Summary |
|---|---|---|
| anchor? | string | Internal bookmark anchor |
| children | (Run | BookmarkStart | BookmarkEnd)[] | Child runs |
| docLocation? | string | Document location |
| history? | boolean | Link history tracking |
| href? | string | Resolved URL (from relationships) |
| rId? | string | Relationship ID for external link |
| target? | string | Target frame |
| tooltip? | string | Tooltip text |
| type | 'hyperlink' |
Image_2interface
Embedded image (w:drawing with an inline or anchored picture). Carries the relationship-id pointer to the binary in word/media/, its resolved data URL (src), display dimensions, optional crop / transform / wrap behaviors, and anchor positioning for floating images.
See ECMA-376 §20.4 (DrawingML wordprocessingDrawing).
interface Image| Member | Type | Summary |
|---|---|---|
| allowOverlap? | boolean | `wp:anchor allowOverlap` — when true (default), anchored objects may overlap; when false, Word repositions them to avoid collisions. We don't currently reposition; we round-trip the flag so saving preserves the author's intent. |
| alt? | string | Alt text for accessibility |
| crop? | ImageCrop | Source-image crop (fractional, OOXML `a:srcRect`). |
| decorative? | boolean | Whether this is a decorative image |
| effects? | {
brightness?: number;
contrast?: number;
saturation?: number;
} | Image effects |
| filename? | string | Original filename |
| hlinkHref? | string | Hyperlink URL for clickable image |
| id? | string | Unique ID |
| layoutInCell? | boolean | `wp:anchor layoutInCell` — when true (default), an anchored image inside a table cell is constrained to the cell. When false, the image escapes the cell into the page area. Round-tripped on save. |
| mimeType? | string | Image MIME type |
| opacity? | number | Opacity in [0, 1] (OOXML `a:alphaModFix amt`). Undefined = fully opaque. |
| originalSize? | ImageSize | Original size before any transforms |
| outline? | ShapeOutline | Image outline/border |
| padding? | ImagePadding | Padding around image |
| position? | ImagePosition | Position for floating images |
| rId | string | Relationship ID for the image data |
| size | ImageSize | Image size |
| src? | string | Resolved image data (base64 or blob URL) |
| title? | string | Title/description |
| transform? | ImageTransform | Image transformations |
| type | 'image' | |
| wrap | ImageWrap | Wrap settings |
ImageCropinterfaceSource ↗
Image crop, expressed as fractions of the source image to trim from each edge. OOXML's <a:srcRect l="10000" t="0" r="5000" b="0"/> uses units of 1/100000 (so 10000 → 0.1 → 10% trimmed from the left). We store the normalised fraction so both the renderer and the saver can read it directly without re-parsing units.
interface ImageCrop| Member | Type | Summary |
|---|---|---|
| bottom? | number | |
| left? | number | |
| right? | number | |
| top? | number |
ImagePaddinginterfaceSource ↗
Image padding/margins
interface ImagePadding| Member | Type | Summary |
|---|---|---|
| bottom? | number | |
| left? | number | |
| right? | number | |
| top? | number |
ImagePositioninterfaceSource ↗
Position for floating images
interface ImagePosition| Member | Type | Summary |
|---|---|---|
| horizontal | {
relativeTo: 'character' | 'column' | 'insideMargin' | 'leftMargin' | 'margin' | 'outsideMargin' | 'page' | 'rightMargin';
alignment?: 'left' | 'right' | 'center' | 'inside' | 'outside';
posOffset?: number;
} | Horizontal positioning |
| vertical | {
relativeTo: 'insideMargin' | 'line' | 'margin' | 'outsideMargin' | 'page' | 'paragraph' | 'topMargin' | 'bottomMargin';
alignment?: 'top' | 'bottom' | 'center' | 'inside' | 'outside';
posOffset?: number;
} | Vertical positioning |
ImageSizeinterfaceSource ↗
Image size specification
interface ImageSize| Member | Type | Summary |
|---|---|---|
| height | number | Height in EMUs |
| width | number | Width in EMUs (English Metric Units) |
ImageTransforminterfaceSource ↗
Image transformation
interface ImageTransform| Member | Type | Summary |
|---|---|---|
| flipH? | boolean | Flip horizontal |
| flipV? | boolean | Flip vertical |
| rotation? | number | Rotation in degrees |
ImageWrapinterfaceSource ↗
Image wrap type for floating images
interface ImageWrap| Member | Type | Summary |
|---|---|---|
| distB? | number | |
| distL? | number | |
| distR? | number | |
| distT? | number | Distance from text |
| type | WrapType | |
| wrapText? | 'bothSides' | 'left' | 'right' | 'largest' | Wrap text direction |
InlineSdtinterfaceSource ↗
Inline SDT (content control within a paragraph)
interface InlineSdt| Member | Type | Summary |
|---|---|---|
| content | (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | MathEquation)[] | Inline content held inside the control. OOXML allows runs, hyperlinks, simple/complex fields, nested SDTs, and math at this level; the renderer must descend into all of them so docProps-bound fields and similar template content survive paged rendering. |
| properties | SdtProperties | SDT properties |
| type | 'inlineSdt' |
InsertioninterfaceSource ↗
Insertion wrapper (w:ins) — runs inserted by tracked changes
interface Insertion| Member | Type | Summary |
|---|---|---|
| content | (Run | Hyperlink)[] | Inserted content |
| info | TrackedChangeInfo | Tracked change metadata |
| type | 'insertion' |
InstrTextContentinterfaceSource ↗
Field instruction text
interface InstrTextContent| Member | Type | Summary |
|---|---|---|
| text | string | Field instruction |
| type | 'instrText' |
ListLevelinterfaceSource ↗
One indentation level of an abstract numbering definition (w:lvl). Carries the number format, the marker template (lvlText — e.g. "%1.%2."), the level's paragraph properties (indent, hanging) and character properties (font, size, color for the marker itself).
ilvl ranges 0-8 in standard Word documents.
interface ListLevel| Member | Type | Summary |
|---|---|---|
| ilvl | number | Level index (0-8) |
| isLgl? | boolean | Is legal numbering style |
| legacy? | {
legacy?: boolean;
legacySpace?: number;
legacyIndent?: number;
} | Legacy settings |
| lvlJc? | 'left' | 'center' | 'right' | Justification |
| lvlRestart? | number | Restart numbering from higher level |
| lvlText | string | Level text (e.g., "%1." or "•") |
| numFmt | NumberFormat | Number format |
| pPr? | ParagraphFormatting | Paragraph properties for this level |
| rPr? | TextFormatting | Run properties for the number/bullet |
| start? | number | Starting number |
| suffix? | LevelSuffix | Suffix after number |
ListRenderinginterfaceSource ↗
Computed list marker for one paragraph — what the layout engine and painter need to render the "1.", "a)", "•" prefix. Not part of the wire format; the parser fills this from the numbering.xml chain plus the paragraph's numPr. Paragraphs without list rendering omit it.
interface ListRendering| Member | Type | Summary |
|---|---|---|
| abstractNumId? | number | abstractNumId the paragraph's numId points to (counters key on this). |
| isBullet | boolean | Whether this is a bullet or numbered list |
| level | number | List level (0-8) |
| levelNumFmts? | NumberFormat[] | NumberFormat for each level from 0..ilvl (inclusive). Used to resolve multi-level templates like "%1.%2." where each %N may need a different format (e.g., upperRoman parent + decimal child). |
| marker | string | Computed marker text (e.g., "1.", "a)", "•") |
| markerFontFamily? | string | Marker font family from numbering level rPr (ascii name) |
| markerFontSize? | number | Marker font size from numbering level rPr, in points |
| markerSuffix? | LevelSuffix | Suffix character placed after the marker before body text (§17.9.25). Default is `tab`; `space` inserts a single space; `nothing` no gap. Drives marker-slot sizing in `getListMarkerInlineWidth`. |
| numFmt? | NumberFormat | Number format type (decimal, lowerRoman, upperRoman, etc.) |
| numId | number | Numbering ID |
| startOverride? | number | Start value from the numId's lvlOverride for the paragraph's ilvl, if any. Per ECMA-376 §17.9.18, this resets the shared abstractNum counter the first time the numId appears. |
MathEquationinterfaceSource ↗
Math equation content (m:oMath or m:oMathPara)
interface MathEquation| Member | Type | Summary |
|---|---|---|
| display | 'inline' | 'block' | Whether this is a block (oMathPara) or inline (oMath) equation |
| ommlXml | string | Raw OMML XML for round-trip preservation |
| plainText? | string | Plain text representation for accessibility/fallback |
| type | 'mathEquation' |
MediaFileinterfaceSource ↗
Media file from word/media/
interface MediaFile| Member | Type | Summary |
|---|---|---|
| base64? | string | Base64 encoded data for rendering |
| data | ArrayBuffer | Binary data |
| dataUrl? | string | Data URL for direct use in src attributes |
| filename? | string | Original filename |
| mimeType | string | MIME type |
| path | string | File path in ZIP |
MoveFrominterfaceSource ↗
Move-from wrapper (w:moveFrom) — content moved away from this position
interface MoveFrom| Member | Type | Summary |
|---|---|---|
| content | (Run | Hyperlink)[] | Moved content |
| info | TrackedChangeInfo | Tracked change metadata |
| type | 'moveFrom' |
MoveFromRangeEndinterfaceSource ↗
Move-from range end marker (w:moveFromRangeEnd)
interface MoveFromRangeEnd| Member | Type | Summary |
|---|---|---|
| id | number | |
| type | 'moveFromRangeEnd' |
MoveFromRangeStartinterfaceSource ↗
Move-from range start marker (w:moveFromRangeStart) — ECMA-376 §17.13.5.22 Pairs with moveFromRangeEnd to delimit the source of a move in the document.
interface MoveFromRangeStart| Member | Type | Summary |
|---|---|---|
| id | number | |
| name | string | |
| type | 'moveFromRangeStart' |
MoveTointerfaceSource ↗
Move-to wrapper (w:moveTo) — content moved into this position
interface MoveTo| Member | Type | Summary |
|---|---|---|
| content | (Run | Hyperlink)[] | Moved content |
| info | TrackedChangeInfo | Tracked change metadata |
| type | 'moveTo' |
MoveToRangeEndinterfaceSource ↗
Move-to range end marker (w:moveToRangeEnd)
interface MoveToRangeEnd| Member | Type | Summary |
|---|---|---|
| id | number | |
| type | 'moveToRangeEnd' |
MoveToRangeStartinterfaceSource ↗
Move-to range start marker (w:moveToRangeStart) — ECMA-376 §17.13.5.24 Pairs with moveToRangeEnd to delimit the destination of a move.
interface MoveToRangeStart| Member | Type | Summary |
|---|---|---|
| id | number | |
| name | string | |
| type | 'moveToRangeStart' |
NoBreakHyphenContentinterfaceSource ↗
Non-breaking hyphen
interface NoBreakHyphenContent| Member | Type | Summary |
|---|---|---|
| type | 'noBreakHyphen' |
NoteReferenceContentinterfaceSource ↗
Footnote or endnote reference
interface NoteReferenceContent| Member | Type | Summary |
|---|---|---|
| id | number | Note ID |
| type | 'footnoteRef' | 'endnoteRef' |
NoteRefMarkContentinterfaceSource ↗
Footnote/endnote auto-number mark (w:footnoteRef / w:endnoteRef).
Distinct from [NoteReferenceContent](NoteReferenceContent): that is the *reference* placed in the document body (w:footnoteReference), whereas this is the numbering placeholder that lives *inside* the note body — the run carrying it is what Word renders as the note's leading superscript number. Preserving it keeps the note's own number visible on round-trip.
interface NoteRefMarkContent| Member | Type | Summary |
|---|---|---|
| type | 'footnoteRefMark' | 'endnoteRefMark' |
NumberingDefinitionsinterfaceSource ↗
Top-level numbering data from numbering.xml — the set of abstract templates and the per-document NumberingInstances that reference them. Paragraphs reference a numId (instance), not an abstractNumId directly.
interface NumberingDefinitions| Member | Type | Summary |
|---|---|---|
| abstractNums | AbstractNumbering[] | Abstract numbering definitions |
| nums | NumberingInstance[] | Numbering instances |
NumberingInstanceinterfaceSource ↗
Numbering instance (w:num)
interface NumberingInstance| Member | Type | Summary |
|---|---|---|
| abstractNumId | number | Reference to abstract numbering |
| levelOverrides? | Array<{
ilvl: number;
startOverride?: number;
lvl?: ListLevel;
}> | Level overrides |
| numId | number | Numbering ID (referenced by paragraphs) |
ParagraphinterfaceSource ↗
Paragraph (w:p) — the primary block-level container in a Word document.
Every paragraph carries direct formatting (formatting), tracked property changes (propertyChanges), inline content (content), and optional list rendering / section break metadata. paraId is Word's stable identifier (w14:paraId) and is what EditorBridge and the agent toolkit use to address paragraphs.
See ECMA-376 §17.3.1.
interface Paragraph| Member | Type | Summary |
|---|---|---|
| content | ParagraphContent[] | Paragraph content |
| formatting? | ParagraphFormatting | Paragraph formatting |
| listRendering? | ListRendering | Computed list rendering (if this is a list item) |
| paraId? | string | Unique paragraph ID |
| pPrDel? | TrackedChangeInfo | Paragraph-mark deletion tracking (`<w:pPr><w:rPr><w:del/>`). Set when this paragraph's terminating pilcrow was deleted as a tracked change — e.g., the user pressed Backspace at the start of the next paragraph in suggesting mode. Accept joins this paragraph with the following one. |
| pPrIns? | TrackedChangeInfo | Paragraph-mark insertion tracking (`<w:pPr><w:rPr><w:ins/>`). Set when this paragraph's terminating pilcrow was added as a tracked change — e.g., the user pressed Enter mid-paragraph in suggesting mode. Reject joins this paragraph with the following one. |
| propertyChanges? | ParagraphPropertyChange[] | Paragraph-level tracked property changes (w:pPrChange) |
| renderedPageBreakBefore? | boolean | Word's cached layout says this paragraph started on a new rendered page. |
| sectionProperties? | SectionProperties | Section properties (if this paragraph ends a section) |
| textId? | string | Text ID |
| type | 'paragraph' |
ParagraphFormattinginterfaceSource ↗
Paragraph-level formatting (w:pPr) — alignment, indentation, spacing (before/after, line height), pagination flags (keepNext, keepLines, pageBreakBefore, widowControl), tabs, borders, shading, numbering reference, style reference, and frame/anchored-text properties.
Most fields mirror their ECMA-376 element names (see §17.3.1). Inheritance: direct formatting beats the linked style which beats document defaults.
interface ParagraphFormatting| Member | Type | Summary |
|---|---|---|
| afterAutospacing? | boolean | Auto space after (w:spacing/w:afterAutospacing) |
| alignment? | ParagraphAlignment | Paragraph alignment (w:jc) |
| beforeAutospacing? | boolean | Auto space before (w:spacing/w:beforeAutospacing) |
| bidi? | boolean | Text direction (w:bidi) |
| borders? | {
top?: BorderSpec;
bottom?: BorderSpec;
left?: BorderSpec;
right?: BorderSpec;
between?: BorderSpec;
bar?: BorderSpec;
} | Paragraph borders (w:pBdr) |
| contextualSpacing? | boolean | Contextual spacing — suppress space between paragraphs of the same style (w:contextualSpacing) |
| frame? | {
width?: number;
height?: number;
hAnchor?: 'text' | 'margin' | 'page';
vAnchor?: 'text' | 'margin' | 'page';
x?: number;
y?: number;
xAlign?: 'left' | 'center' | 'right' | 'inside' | 'outside';
yAlign?: 'top' | 'center' | 'bottom' | 'inside' | 'outside' | 'inline';
wrap?: 'around' | 'auto' | 'none' | 'notBeside' | 'through' | 'tight';
} | Text frame properties (w:framePr) |
| hangingIndent? | boolean | Whether first line is hanging indent |
| indentFirstLine? | number | First line indent in twips - positive for indent, negative for hanging (w:ind/w:firstLine or w:hanging) |
| indentLeft? | number | Left indent in twips (w:ind/w:left) |
| indentRight? | number | Right indent in twips (w:ind/w:right) |
| keepLines? | boolean | Keep lines together (w:keepLines) |
| keepNext? | boolean | Keep with next paragraph (w:keepNext) |
| lineSpacing? | number | Line spacing value (w:spacing/w:line) |
| lineSpacingRule? | LineSpacingRule | Line spacing rule (w:spacing/w:lineRule) |
| numPr? | {
numId?: number;
ilvl?: number;
} | Numbering properties (w:numPr) |
| numPrFromStyle? | {
numId?: number;
ilvl?: number;
} | When `numPr` was resolved from the paragraph STYLE's pPr rather than the paragraph's own `<w:numPr>`, this records the style-sourced value. The serializer omits `numPr` while it still equals this value — writing it as direct formatting would flip Word's indent precedence (a directly referenced level's indents beat the style's; a style-referenced level's do not) and break the document on save/reload. Cleared the moment the user changes the numbering (values diverge). |
| outlineLevel? | number | Outline level 0-9 (w:outlineLvl) |
| pageBreakBefore? | boolean | Page break before (w:pageBreakBefore) |
| runProperties? | TextFormatting | Run properties to apply to all runs (w:rPr) |
| shading? | ShadingProperties | Paragraph shading (w:shd) |
| spaceAfter? | number | Spacing after in twips (w:spacing/w:after) |
| spaceBefore? | number | Spacing before in twips (w:spacing/w:before) |
| spacingExplicit? | SpacingExplicit | Per-side flags marking which `<w:spacing>` attrs came from this paragraph's own pPr (vs inherited). Word collapses style-inherited spacing on empty paragraphs but honors the explicit values. |
| styleId? | string | Paragraph style ID (w:pStyle) |
| suppressAutoHyphens? | boolean | Suppress auto hyphens (w:suppressAutoHyphens) |
| suppressLineNumbers? | boolean | Suppress line numbers (w:suppressLineNumbers) |
| tabs? | TabStop[] | Custom tab stops (w:tabs) |
| widowControl? | boolean | Widow/orphan control (w:widowControl) |
ParagraphPropertyChangeinterfaceSource ↗
Paragraph property change (w:pPrChange)
interface ParagraphPropertyChange| Member | Type | Summary |
|---|---|---|
| currentFormatting? | ParagraphFormatting | Paragraph properties after the tracked change (editor model convenience) |
| info | PropertyChangeInfo | Tracked change metadata |
| previousFormatting? | ParagraphFormatting | Paragraph properties before the tracked change |
| type | 'paragraphPropertyChange' |
PictureWatermarkinterfaceSource ↗
Picture watermark — a scaled, optionally washed-out background image.
interface PictureWatermark| Member | Type | Summary |
|---|---|---|
| contentType? | string | MIME type for `data`. |
| data? | Uint8Array | Raw bytes for an image added in-editor (no rId yet). |
| dataUrl? | string | Ready-to-use data URL for rendering (resolved from media or `data`). |
| heightEmu? | number | Natural height in EMUs (when known). |
| kind | 'picture' | |
| mediaPath? | string | Package path of the media, e.g. 'word/media/image1.png'. |
| relId? | string | Header-part relationship id of the media (set for images parsed from an existing file). |
| scale | number | Scale factor; 1 = 100% / Word's "Auto". |
| washout | boolean | Word's "Washout" checkbox — lightens the image so text stays readable. |
| widthEmu? | number | Natural width in EMUs (when known). |
PropertyChangeInfointerfaceSource ↗
Generic tracked property-change wrapper metadata (w:*PrChange)
interface PropertyChangeInfo extends TrackedChangeInfo| Member | Type | Summary |
|---|---|---|
| rsid? | string | Optional revision session ID |
RelationshipinterfaceSource ↗
Relationship entry
interface Relationship| Member | Type | Summary |
|---|---|---|
| id | string | Relationship ID (e.g., "rId1") |
| target | string | Target path or URL |
| targetMode? | 'External' | 'Internal' | Target mode |
| type | RelationshipType | Relationship type URI |
RuninterfaceSource ↗
A run (w:r) — a contiguous span of inline content sharing one set of character properties (bold, italic, font, color, etc.). Runs are the atomic unit of character formatting; toggling bold on a selection that spans different formatting creates new runs.
See ECMA-376 §17.3.2.
interface Run```ts
const run: Run = {
type: 'run',
formatting: { bold: true },
content: [{ type: 'text', text: 'Hello' }],
};
```| Member | Type | Summary |
|---|---|---|
| content | RunContent[] | Run content (text, tabs, breaks, etc.) |
| formatting? | TextFormatting | Text formatting properties |
| propertyChanges? | RunPropertyChange[] | Run-level tracked property changes (w:rPrChange) |
| type | 'run' |
RunPropertyChangeinterfaceSource ↗
Run property change (w:rPrChange)
interface RunPropertyChange| Member | Type | Summary |
|---|---|---|
| currentFormatting? | TextFormatting | Run properties after the tracked change (editor model convenience) |
| info | PropertyChangeInfo | Tracked change metadata |
| previousFormatting? | TextFormatting | Run properties before the tracked change |
| type | 'runPropertyChange' |
SdtDataBindinginterfaceSource ↗
XML data binding (w:dataBinding) — links a content control to a node in a Custom XML data store. Modeled read-only; the binding round-trips verbatim via rawPropertiesXml (this projection is for inspection, e.g. "which controls are bound, and to what XPath"). The editor does not resolve or sync bound values.
interface SdtDataBinding| Member | Type | Summary |
|---|---|---|
| prefixMappings? | string | Namespace prefix mappings used by the XPath (`w:prefixMappings`). |
| storeItemID? | string | Target Custom XML store id (`w:storeItemID`). |
| xpath? | string | XPath into the bound Custom XML part (`w:xpath`). |
SdtPropertiesinterfaceSource ↗
SDT properties (w:sdtPr).
The modeled fields are a **read-only projection** for downstream tooling (tag/alias addressing, template extraction). They are NOT the serialization source: the original w:sdtPr is captured verbatim in rawPropertiesXml and replayed on save, which preserves element order (CT_SdtPr is an xsd:sequence), avoids double-emission, and keeps unmodeled features (data binding, w15:*, @lastValue) lossless.
interface SdtProperties| Member | Type | Summary |
|---|---|---|
| alias? | string | Alias (friendly name, `w:alias`). |
| checked? | boolean | Checkbox checked state (`w14:checkbox`). |
| dataBinding? | SdtDataBinding | XML data binding (`w:dataBinding`), if the control is bound. |
| dateFormat? | string | Date format for date controls (`w:date@w:fullDate`). |
| id? | number | Unique numeric id (`w:id`, signed). |
| listItems? | {
displayText: string;
value: string;
}[] | Dropdown/combobox list items. |
| lock? | 'sdtLocked' | 'contentLocked' | 'sdtContentLocked' | 'unlocked' | Lock setting (`w:lock`). |
| placeholder? | string | Placeholder building-block name (`w:placeholder/w:docPart@w:val`). This is a reference to a glossary docPart that supplies the placeholder content — NOT the literal placeholder text. |
| rawEndPropertiesXml? | string | The original `<w:sdtEndPr>` serialized verbatim, if present. |
| rawPropertiesXml? | string | The original `<w:sdtPr>` serialized verbatim as an XML string, captured at parse time. Replayed unchanged on save so the properties block round-trips losslessly. Stored as a string (not an `XmlElement`) so the types layer stays free of the parser/`xml-js` dependency. Absent for SDTs created programmatically — the serializer then synthesizes a minimal, sequence-valid `w:sdtPr` from the modeled fields. |
| sdtType | SdtType | SDT type (projection; see [SdtType](SdtType)). |
| showingPlaceholder? | boolean | Whether the control is currently showing its placeholder (`w:showingPlcHdr`). |
| tag? | string | Tag (developer identifier, `w:tag`). |
SectioninterfaceSource ↗
One section of the document — a SectionProperties plus the block content (Paragraphs and Tables) that lives under those properties.
Sections are derived during parse: every paragraph carrying an inline sectPr ends a section, and the body's final sectPr defines the last section. Each section may carry its own headers/footers map.
interface Section| Member | Type | Summary |
|---|---|---|
| content | BlockContent[] | Content in this section |
| footers? | Map<HeaderFooterType, HeaderFooter> | Footers for this section |
| headers? | Map<HeaderFooterType, HeaderFooter> | Headers for this section |
| properties | SectionProperties | Section properties |
SectionPropertiesinterfaceSource ↗
Section properties (w:sectPr) — page geometry, margins, columns, header/footer references, and page numbering for one section of the document. Sections are introduced by inline sectPr markers on the terminating paragraph (Paragraph.sectionProperties) and the body's final sectPr.
All distance units are twips (1/20 of a point) on the wire. The layout engine converts to pixels.
See ECMA-376 §17.6.
interface SectionProperties| Member | Type | Summary |
|---|---|---|
| background? | {
color?: ColorValue;
themeColor?: ThemeColorSlot;
themeTint?: string;
themeShade?: string;
} | Page background |
| bidi? | boolean | Right-to-left section |
| columnCount? | number | Number of columns |
| columns? | Column[] | Individual column definitions |
| columnSpace? | number | Space between columns in twips |
| docGrid? | {
type?: 'default' | 'lines' | 'linesAndChars' | 'snapToChars';
linePitch?: number;
charSpace?: number;
} | Document grid |
| endnotePr? | EndnoteProperties | Endnote properties for this section |
| equalWidth? | boolean | Equal width columns |
| evenAndOddHeaders? | boolean | Different odd/even page headers/footers |
| footerDistance? | number | Footer distance from bottom in twips |
| footerReferences? | FooterReference[] | Footer references |
| footnoteColumns? | number | Number of columns the footnote area is laid out in (`w15:footnoteColumns`). Word's "Footnote layout → Columns" setting, independent of the body column count above. Undefined/1 means the footnote area follows the body (single column for a single-column section). See ECMA-376 + the w15 extension. |
| footnotePr? | FootnoteProperties | Footnote properties for this section |
| gutter? | number | Gutter margin in twips |
| headerDistance? | number | Header distance from top in twips |
| headerReferences? | HeaderReference[] | Header references |
| lineNumbers? | {
start?: number;
countBy?: number;
distance?: number;
restart?: LineNumberRestart;
} | Line numbering settings |
| marginBottom? | number | Bottom margin in twips |
| marginLeft? | number | Left margin in twips |
| marginRight? | number | Right margin in twips |
| marginTop? | number | Top margin in twips |
| orientation? | PageOrientation | Page orientation |
| pageBorders? | {
top?: BorderSpec;
bottom?: BorderSpec;
left?: BorderSpec;
right?: BorderSpec;
display?: 'allPages' | 'firstPage' | 'notFirstPage';
offsetFrom?: 'page' | 'text';
zOrder?: 'front' | 'back';
} | Page borders |
| pageHeight? | number | Page height in twips |
| pageWidth? | number | Page width in twips |
| paperSrcFirst? | number | First page paper source |
| paperSrcOther? | number | Other pages paper source |
| sectionStart? | SectionStart | Section start type |
| separator? | boolean | Separator line between columns |
| titlePg? | boolean | Different first page header/footer |
| verticalAlign? | VerticalAlign | Vertical alignment of text |
SeparatorContentinterfaceSource ↗
Footnote/endnote separator mark (w:separator / w:continuationSeparator).
These appear inside the special separator notes (w:type="separator" and w:type="continuationSeparator") and draw the horizontal rule Word places between the body and its notes. They carry no content; Word rejects a notes part whose separator notes have lost these markers, so they must round-trip.
interface SeparatorContent| Member | Type | Summary |
|---|---|---|
| type | 'separator' | 'continuationSeparator' |
ShadingPropertiesinterfaceSource ↗
Cell/paragraph/run shading — Word's combined "fill + pattern overlay" model. fill is the solid background; color is the pattern overlay drawn on top; pattern selects the pattern type (defaults to 'clear' = solid fill, no pattern).
See ECMA-376 §17.4.32 (CT_Shd).
interface ShadingProperties| Member | Type | Summary |
|---|---|---|
| color? | ColorValue | Pattern fill color |
| fill? | ColorValue | Background fill color |
| pattern? | 'clear' | 'solid' | 'horzStripe' | 'vertStripe' | 'reverseDiagStripe' | 'diagStripe' | 'horzCross' | 'diagCross' | 'thinHorzStripe' | 'thinVertStripe' | 'thinReverseDiagStripe' | 'thinDiagStripe' | 'thinHorzCross' | 'thinDiagCross' | 'pct5' | 'pct10' | 'pct12' | 'pct15' | 'pct20' | 'pct25' | 'pct30' | 'pct35' | 'pct37' | 'pct40' | 'pct45' | 'pct50' | 'pct55' | 'pct60' | 'pct62' | 'pct65' | 'pct70' | 'pct75' | 'pct80' | 'pct85' | 'pct87' | 'pct90' | 'pct95' | 'nil' | Shading pattern type |
ShapeinterfaceSource ↗
Shape/drawing object (wps:wsp)
interface Shape| Member | Type | Summary |
|---|---|---|
| customGeometry? | string | Custom geometry points |
| fill? | ShapeFill | Fill |
| id? | string | Unique ID |
| name? | string | Name |
| outline? | ShapeOutline | Outline/stroke |
| position? | ImagePosition | Position for floating shapes |
| shapeType | ShapeType | Shape type preset |
| size | ImageSize | Size in EMUs |
| textBody? | ShapeTextBody | Text content inside the shape |
| transform? | ImageTransform | Transform |
| type | 'shape' | |
| wrap? | ImageWrap | Wrap settings |
ShapeContentinterfaceSource ↗
Shape reference
interface ShapeContent| Member | Type | Summary |
|---|---|---|
| shape | Shape | Shape data |
| type | 'shape' |
ShapeFillinterfaceSource ↗
Shape fill type
interface ShapeFill| Member | Type | Summary |
|---|---|---|
| color? | ColorValue | Solid fill color |
| gradient? | {
type: 'linear' | 'radial' | 'rectangular' | 'path';
angle?: number;
stops: Array<{
position: number;
color: ColorValue;
}>;
} | Gradient stops for gradient fill |
| type | 'none' | 'solid' | 'gradient' | 'pattern' | 'picture' |
ShapeOutlineinterfaceSource ↗
Shape outline/stroke
interface ShapeOutline| Member | Type | Summary |
|---|---|---|
| cap? | 'flat' | 'round' | 'square' | Line cap |
| color? | ColorValue | Line color |
| headEnd? | {
type: 'none' | 'triangle' | 'stealth' | 'diamond' | 'oval' | 'arrow';
width?: 'sm' | 'med' | 'lg';
length?: 'sm' | 'med' | 'lg';
} | Head arrow |
| join? | 'bevel' | 'miter' | 'round' | Line join |
| style? | 'solid' | 'dot' | 'dash' | 'lgDash' | 'dashDot' | 'lgDashDot' | 'lgDashDotDot' | 'sysDot' | 'sysDash' | 'sysDashDot' | 'sysDashDotDot' | Line style |
| tailEnd? | {
type: 'none' | 'triangle' | 'stealth' | 'diamond' | 'oval' | 'arrow';
width?: 'sm' | 'med' | 'lg';
length?: 'sm' | 'med' | 'lg';
} | Tail arrow |
| width? | number | Line width in EMUs |
ShapeTextBodyinterfaceSource ↗
Text body inside a shape
interface ShapeTextBody| Member | Type | Summary |
|---|---|---|
| anchor? | 'top' | 'middle' | 'bottom' | 'distributed' | 'justified' | Anchor/vertical alignment |
| anchorCenter? | boolean | Anchor center |
| autoFit? | 'none' | 'normal' | 'shape' | Auto fit |
| content | Paragraph[] | Paragraphs inside the shape |
| margins? | {
top?: number;
bottom?: number;
left?: number;
right?: number;
} | Text margins |
| rotation? | number | Rotation |
| vertical? | boolean | Text direction |
SimpleFieldinterfaceSource ↗
Simple field (w:fldSimple)
interface SimpleField| Member | Type | Summary |
|---|---|---|
| content | (Run | Hyperlink)[] | Current display value |
| dirty? | boolean | Field is dirty |
| fieldType | FieldType | Parsed field type |
| fldLock? | boolean | Field is locked |
| instruction | string | Field instruction (e.g., "PAGE \* MERGEFORMAT") |
| type | 'simpleField' |
SoftHyphenContentinterfaceSource ↗
Soft hyphen
interface SoftHyphenContent| Member | Type | Summary |
|---|---|---|
| type | 'softHyphen' |
StyleinterfaceSource ↗
Style definition from styles.xml — a named, reusable bundle of paragraph and/or character formatting. Word's "Heading 1", "Normal", "Title", and "List Bullet" are styles; user-defined styles look the same. basedOn chains styles for inheritance; link pairs a paragraph style with a matching character style.
See ECMA-376 §17.7.4.
interface Style| Member | Type | Summary |
|---|---|---|
| basedOn? | string | Based on style ID |
| default? | boolean | Is default style |
| link? | string | Linked style (paragraph/character pair) |
| name? | string | Display name |
| next? | string | Next style after Enter (for paragraph styles) |
| personal? | boolean | Personal style (custom) |
| pPr? | ParagraphFormatting | Paragraph properties (for paragraph/table styles) |
| qFormat? | boolean | Quick format in gallery |
| rPr? | TextFormatting | Run properties |
| styleId | string | Style ID |
| tblPr? | TableFormatting | Table properties (for table styles) |
| tblStylePr? | Array<{
type: 'band1Horz' | 'band1Vert' | 'band2Horz' | 'band2Vert' | 'firstCol' | 'firstRow' | 'lastCol' | 'lastRow' | 'neCell' | 'nwCell' | 'seCell' | 'swCell';
pPr?: ParagraphFormatting;
rPr?: TextFormatting;
tblPr?: TableFormatting;
trPr?: TableRowFormatting;
tcPr?: TableCellFormatting;
}> | Conditional table style parts |
| tcPr? | TableCellFormatting | Table cell properties |
| trPr? | TableRowFormatting | Table row properties |
| type | StyleType | Style type |
| uiPriority? | number | UI sort priority |
| unhideWhenUsed? | boolean | Unhide when used |
StyleDefinitionsinterfaceSource ↗
Style definitions from styles.xml
interface StyleDefinitions| Member | Type | Summary |
|---|---|---|
| docDefaults? | DocDefaults | Document defaults |
| latentStyles? | {
defLockedState?: boolean;
defUIPriority?: number;
defSemiHidden?: boolean;
defUnhideWhenUsed?: boolean;
defQFormat?: boolean;
count?: number;
} | Latent styles |
| styles | Style[] | Style definitions |
SymbolContentinterfaceSource ↗
Symbol character (special font character)
interface SymbolContent| Member | Type | Summary |
|---|---|---|
| char | string | Character code |
| font | string | Font name |
| type | 'symbol' |
TabContentinterfaceSource ↗
Tab character
interface TabContent| Member | Type | Summary |
|---|---|---|
| type | 'tab' |
TableinterfaceSource ↗
Table (w:tbl) — a block-level grid of rows × cells. Tables carry their own formatting layer (borders, shading, alignment, indent, floating placement) and an explicit column-width grid in twips. Tables can nest arbitrarily through TableCell.content.
See ECMA-376 §17.4.
interface Table| Member | Type | Summary |
|---|---|---|
| columnWidths? | number[] | Column widths in twips |
| formatting? | TableFormatting | Table formatting |
| propertyChanges? | TablePropertyChange[] | Table-level tracked property changes (w:tblPrChange) |
| rows | TableRow[] | Table rows |
| type | 'table' |
TableBordersinterfaceSource ↗
Table borders
interface TableBorders| Member | Type | Summary |
|---|---|---|
| bottom? | BorderSpec | |
| insideH? | BorderSpec | |
| insideV? | BorderSpec | |
| left? | BorderSpec | |
| right? | BorderSpec | |
| top? | BorderSpec |
TableCellinterfaceSource ↗
Table cell (w:tc). Holds nested block content (paragraphs and nested tables), cell-level formatting (borders, shading, vertical merge), tracked property changes, and tracked structural changes for cell insert/delete/merge operations.
interface TableCell| Member | Type | Summary |
|---|---|---|
| content | (Paragraph | Table)[] | Cell content (paragraphs, tables, etc.) |
| formatting? | TableCellFormatting | Cell formatting |
| propertyChanges? | TableCellPropertyChange[] | Cell-level tracked property changes (w:tcPrChange) |
| structuralChange? | TableStructuralChangeInfo | Tracked structural changes (cell insert/delete/merge) |
| type | 'tableCell' |
TableCellFormattinginterfaceSource ↗
Table cell formatting properties (w:tcPr)
interface TableCellFormatting| Member | Type | Summary |
|---|---|---|
| borders? | TableBorders | Cell borders |
| conditionalFormat? | ConditionalFormatStyle | Conditional format style |
| fitText? | boolean | Fit text to cell width |
| gridSpan? | number | Grid span (horizontal merge) |
| hideMark? | boolean | Hide cell marker |
| margins? | CellMargins | Cell margins (override table default) |
| noWrap? | boolean | Wrap text |
| shading? | ShadingProperties | Cell shading/background |
| textDirection? | 'lr' | 'lrV' | 'rl' | 'rlV' | 'tb' | 'tbV' | 'tbRl' | 'tbRlV' | 'btLr' | Text direction |
| verticalAlign? | 'top' | 'center' | 'bottom' | Vertical alignment |
| vMerge? | 'restart' | 'continue' | Vertical merge |
| width? | TableMeasurement | Cell width |
TableCellPropertyChangeinterfaceSource ↗
Table cell property change (w:tcPrChange)
interface TableCellPropertyChange| Member | Type | Summary |
|---|---|---|
| currentFormatting? | TableCellFormatting | Cell properties after the tracked change (editor model convenience) |
| info | PropertyChangeInfo | Tracked change metadata |
| previousFormatting? | TableCellFormatting | Cell properties before the tracked change |
| type | 'tableCellPropertyChange' |
TableFormattinginterfaceSource ↗
Table formatting properties (w:tblPr)
interface TableFormatting| Member | Type | Summary |
|---|---|---|
| bidi? | boolean | Right to left table |
| borders? | TableBorders | Table borders |
| cellMargins? | CellMargins | Default cell margins |
| cellSpacing? | TableMeasurement | Cell spacing |
| floating? | FloatingTableProperties | Floating table properties |
| indent? | TableMeasurement | Table indent from left margin |
| justification? | 'left' | 'center' | 'right' | Table justification |
| layout? | 'fixed' | 'autofit' | Table layout |
| look? | TableLook | Table look (conditional formatting flags) |
| overlap? | 'never' | 'overlap' | Overlap for floating tables |
| shading? | ShadingProperties | Shading/background |
| styleId? | string | Table style ID |
| width? | TableMeasurement | Table width |
TableLookinterfaceSource ↗
Table look flags (for table styles)
interface TableLook| Member | Type | Summary |
|---|---|---|
| firstColumn? | boolean | |
| firstRow? | boolean | |
| lastColumn? | boolean | |
| lastRow? | boolean | |
| noHBand? | boolean | |
| noVBand? | boolean |
TableMeasurementinterfaceSource ↗
Table measurement (width or height)
interface TableMeasurement| Member | Type | Summary |
|---|---|---|
| type | TableWidthType | Measurement type |
| value | number | Value in twips (for dxa) or fifths of a percent (for pct) |
TablePropertyChangeinterfaceSource ↗
Table property change (w:tblPrChange)
interface TablePropertyChange| Member | Type | Summary |
|---|---|---|
| currentFormatting? | TableFormatting | Table properties after the tracked change (editor model convenience) |
| info | PropertyChangeInfo | Tracked change metadata |
| previousFormatting? | TableFormatting | Table properties before the tracked change |
| type | 'tablePropertyChange' |
TableRowinterfaceSource ↗
Table row (w:tr) — an ordered list of TableCell plus row-level formatting (height, repeated header, cantSplit) and tracked changes for inserts/deletes.
interface TableRow| Member | Type | Summary |
|---|---|---|
| cells | TableCell[] | Cells in this row |
| formatting? | TableRowFormatting | Row formatting |
| propertyChanges? | TableRowPropertyChange[] | Row-level tracked property changes (w:trPrChange) |
| structuralChange? | TableStructuralChangeInfo | Tracked structural changes (row insert/delete) |
| type | 'tableRow' |
TableRowFormattinginterfaceSource ↗
Table row formatting properties (w:trPr)
interface TableRowFormatting| Member | Type | Summary |
|---|---|---|
| cantSplit? | boolean | Allow row to break across pages |
| conditionalFormat? | ConditionalFormatStyle | Conditional format style |
| header? | boolean | Header row (repeats on each page) |
| height? | TableMeasurement | Row height |
| heightRule? | 'auto' | 'atLeast' | 'exact' | Height rule |
| justification? | 'left' | 'center' | 'right' | Row justification |
TableRowPropertyChangeinterfaceSource ↗
Table row property change (w:trPrChange)
interface TableRowPropertyChange| Member | Type | Summary |
|---|---|---|
| currentFormatting? | TableRowFormatting | Row properties after the tracked change (editor model convenience) |
| info | PropertyChangeInfo | Tracked change metadata |
| previousFormatting? | TableRowFormatting | Row properties before the tracked change |
| type | 'tableRowPropertyChange' |
TableStructuralChangeInfointerfaceSource ↗
Table structural tracked change metadata (row/cell insert/delete/merge)
interface TableStructuralChangeInfo| Member | Type | Summary |
|---|---|---|
| info | TrackedChangeInfo | Tracked change metadata |
| type | 'tableRowInsertion' | 'tableRowDeletion' | 'tableCellInsertion' | 'tableCellDeletion' | 'tableCellMerge' | |
| vMerge? | 'rest' | 'cont' | `<w:cellMerge w:vMerge="…">` value, only meaningful for `tableCellMerge`. Schema `ST_AnnotationVMerge`: `"rest"` = anchor (start of merged span), `"cont"` = continuation (merged into predecessor). Word's default for a tracked merge is `"cont"` (most edits track "this cell got merged INTO the one above"); we preserve the on-disk value when present. |
| vMergeOrig? | 'rest' | 'cont' | `<w:cellMerge w:vMergeOrig="…">` — the pre-merge vMerge state. |
TabStopinterfaceSource ↗
Tab stop definition
interface TabStop| Member | Type | Summary |
|---|---|---|
| alignment | TabStopAlignment | Alignment at tab stop |
| leader? | TabLeader | Leader character |
| position | number | Position in twips from left margin |
TextBoxinterfaceSource ↗
Text box (floating text container)
interface TextBox| Member | Type | Summary |
|---|---|---|
| content | Paragraph[] | Text content |
| fill? | ShapeFill | Fill |
| id? | string | Unique ID |
| margins? | {
top?: number;
bottom?: number;
left?: number;
right?: number;
} | Internal margins |
| outline? | ShapeOutline | Outline |
| position? | ImagePosition | Position |
| size | ImageSize | Size |
| type | 'textBox' | |
| wrap? | ImageWrap | Wrap settings |
TextContentinterfaceSource ↗
Plain text run content (w:t). preserveSpace mirrors the xml:space="preserve" attribute and matters for runs that begin or end with whitespace — without it, Word collapses leading/trailing spaces.
interface TextContent| Member | Type | Summary |
|---|---|---|
| preserveSpace? | boolean | Preserve whitespace (xml:space="preserve") |
| text | string | The text string |
| type | 'text' |
TextFormattinginterfaceSource ↗
Character-level formatting (w:rPr) — the full set of run properties Word supports: weight, slant, font, size, color, highlight, underline, strikethrough, vertical position, language, complex-script variants, spacing/kerning, emphasis marks, and more.
Most fields mirror their ECMA-376 element names (see §17.3.2). Missing keys inherit from the run's paragraph style → linked style → document defaults chain.
interface TextFormatting| Member | Type | Summary |
|---|---|---|
| allCaps? | boolean | All caps (w:caps) |
| bold? | boolean | Bold (w:b) |
| boldCs? | boolean | Bold complex script (w:bCs) |
| color? | ColorValue | Text color (w:color) |
| cs? | boolean | Complex script formatting (w:cs) |
| doubleStrike? | boolean | Double strikethrough (w:dstrike) |
| effect? | TextEffect | Text effect animation (w:effect) |
| emboss? | boolean | Emboss effect (w:emboss) |
| emphasisMark? | EmphasisMark | Emphasis mark (w:em) |
| fontFamily? | {
ascii?: string;
hAnsi?: string;
eastAsia?: string;
cs?: string;
asciiTheme?: 'majorAscii' | 'majorHAnsi' | 'majorEastAsia' | 'majorBidi' | 'minorAscii' | 'minorHAnsi' | 'minorEastAsia' | 'minorBidi';
hAnsiTheme?: string;
eastAsiaTheme?: string;
csTheme?: string;
} | Font family (w:rFonts) |
| fontSize? | number | Font size in half-points (w:sz) - e.g., 24 = 12pt |
| fontSizeCs? | number | Font size complex script (w:szCs) |
| highlight? | 'black' | 'blue' | 'cyan' | 'darkBlue' | 'darkCyan' | 'darkGray' | 'darkGreen' | 'darkMagenta' | 'darkRed' | 'darkYellow' | 'green' | 'lightGray' | 'magenta' | 'none' | 'red' | 'white' | 'yellow' | Highlight/background color (w:highlight) |
| imprint? | boolean | Imprint/engrave effect (w:imprint) |
| italic? | boolean | Italic (w:i) |
| italicCs? | boolean | Italic complex script (w:iCs) |
| kerning? | number | Kerning threshold in half-points (w:kern) |
| outline? | boolean | Outline effect (w:outline) |
| position? | number | Raised/lowered text position in half-points (w:position) |
| rtl? | boolean | Right-to-left text (w:rtl) |
| scale? | number | Horizontal text scale percentage (w:w) |
| shading? | ShadingProperties | Character shading (w:shd) |
| shadow? | boolean | Shadow effect (w:shadow) |
| smallCaps? | boolean | Small caps (w:smallCaps) |
| spacing? | number | Character spacing in twips (w:spacing) |
| strike? | boolean | Strikethrough (w:strike) |
| styleId? | string | Character style ID (w:rStyle) |
| underline? | {
style: UnderlineStyle;
color?: ColorValue;
} | Underline style and color (w:u) |
| vertAlign? | 'baseline' | 'superscript' | 'subscript' | Superscript/subscript (w:vertAlign) |
TextWatermarkinterfaceSource ↗
Text watermark (e.g. "CONFIDENTIAL", "DRAFT").
interface TextWatermark| Member | Type | Summary |
|---|---|---|
| color | string | Fill color as a CSS hex string (e.g. '#C0C0C0'). |
| font | string | Font family (e.g. 'Calibri'). |
| fontSize? | number | Font size in points. When undefined the renderer auto-sizes to the page (Word's "Auto"). |
| kind | 'text' | |
| layout | 'diagonal' | 'horizontal' | Diagonal (≈ -45°) or horizontal layout. |
| semitransparent | boolean | Word's "Semitransparent" checkbox — renders at reduced opacity. |
| text | string | The watermark text. |
ThemeinterfaceSource ↗
Theme (from theme1.xml)
interface Theme| Member | Type | Summary |
|---|---|---|
| colorScheme? | ThemeColorScheme | Color scheme |
| fontScheme? | ThemeFontScheme | Font scheme |
| formatScheme? | {
name?: string;
} | Format scheme (fills, lines, effects) - simplified |
| name? | string | Theme name |
ThemeColorSchemeinterfaceSource ↗
Theme color scheme (a:clrScheme)
interface ThemeColorScheme| Member | Type | Summary |
|---|---|---|
| accent1? | string | Accent colors 1-6 |
| accent2? | string | |
| accent3? | string | |
| accent4? | string | |
| accent5? | string | |
| accent6? | string | |
| dk1? | string | Dark 1 color (usually black) |
| dk2? | string | Dark 2 color |
| folHlink? | string | Followed hyperlink color |
| hlink? | string | Hyperlink color |
| lt1? | string | Light 1 color (usually white) |
| lt2? | string | Light 2 color |
ThemeFontinterfaceSource ↗
Theme font (with script variants)
interface ThemeFont| Member | Type | Summary |
|---|---|---|
| cs? | string | Complex script font |
| ea? | string | East Asian font |
| fonts? | Record<string, string> | Script-specific fonts |
| latin? | string | Latin font |
ThemeFontSchemeinterfaceSource ↗
Theme font scheme (a:fontScheme)
interface ThemeFontScheme| Member | Type | Summary |
|---|---|---|
| majorFont? | ThemeFont | Major font (headings) |
| minorFont? | ThemeFont | Minor font (body text) |
TrackedChangeInfointerfaceSource ↗
Tracked change metadata (w:ins, w:del attributes)
interface TrackedChangeInfo| Member | Type | Summary |
|---|---|---|
| author | string | Author who made the change |
| date? | string | Date of the change |
| id | number | Revision ID |
Type aliases (31)
BlockContenttypeSource ↗
Block-level content types
type BlockContent = Paragraph | Table | BlockSdt;EmphasisMarktypeSource ↗
Emphasis mark type
type EmphasisMark = 'none' | 'dot' | 'comma' | 'circle' | 'underDot';EndnotePositiontypeSource ↗
Endnote position
type EndnotePosition = 'sectEnd' | 'docEnd';FieldtypeSource ↗
type Field = SimpleField | ComplexField;FieldTypetypeSource ↗
Known field types
type FieldType = 'PAGE' | 'NUMPAGES' | 'NUMWORDS' | 'NUMCHARS' | 'DATE' | 'TIME' | 'CREATEDATE' | 'SAVEDATE' | 'PRINTDATE' | 'AUTHOR' | 'TITLE' | 'SUBJECT' | 'KEYWORDS' | 'COMMENTS' | 'FILENAME' | 'FILESIZE' | 'TEMPLATE' | 'DOCPROPERTY' | 'DOCVARIABLE' | 'REF' | 'PAGEREF' | 'NOTEREF' | 'HYPERLINK' | 'TOC' | 'TOA' | 'INDEX' | 'SEQ' | 'STYLEREF' | 'AUTONUM' | 'AUTONUMLGL' | 'AUTONUMOUT' | 'IF' | 'MERGEFIELD' | 'NEXT' | 'NEXTIF' | 'ASK' | 'SET' | 'QUOTE' | 'INCLUDETEXT' | 'INCLUDEPICTURE' | 'SYMBOL' | 'ADVANCE' | 'EDITTIME' | 'REVNUM' | 'SECTION' | 'SECTIONPAGES' | 'USERADDRESS' | 'USERNAME' | 'USERINITIALS' | 'UNKNOWN';FootnotePositiontypeSource ↗
Footnote position
type FootnotePosition = 'pageBottom' | 'beneathText' | 'sectEnd' | 'docEnd';HeaderFooterTypetypeSource ↗
Header/footer type
type HeaderFooterType = 'default' | 'first' | 'even';LevelSuffixtypeSource ↗
Multi-level suffix (what follows the number)
type LevelSuffix = 'tab' | 'space' | 'nothing';LineNumberRestarttypeSource ↗
Line number restart type
type LineNumberRestart = 'continuous' | 'newPage' | 'newSection';LineSpacingRuletypeSource ↗
Line spacing rule
type LineSpacingRule = 'auto' | 'exact' | 'atLeast';NoteNumberRestarttypeSource ↗
Number restart type
type NoteNumberRestart = 'continuous' | 'eachSect' | 'eachPage';NumberFormattypeSource ↗
Number format type
type NumberFormat = 'decimal' | 'upperRoman' | 'lowerRoman' | 'upperLetter' | 'lowerLetter' | 'ordinal' | 'cardinalText' | 'ordinalText' | 'hex' | 'chicago' | 'ideographDigital' | 'japaneseCounting' | 'aiueo' | 'iroha' | 'decimalFullWidth' | 'decimalHalfWidth' | 'japaneseLegal' | 'japaneseDigitalTenThousand' | 'decimalEnclosedCircle' | 'decimalFullWidth2' | 'aiueoFullWidth' | 'irohaFullWidth' | 'decimalZero' | 'decimalZero3' | 'decimalZero4' | 'decimalZero5' | 'bullet' | 'ganada' | 'chosung' | 'decimalEnclosedFullstop' | 'decimalEnclosedParen' | 'decimalEnclosedCircleChinese' | 'ideographEnclosedCircle' | 'ideographTraditional' | 'ideographZodiac' | 'ideographZodiacTraditional' | 'taiwaneseCounting' | 'ideographLegalTraditional' | 'taiwaneseCountingThousand' | 'taiwaneseDigital' | 'chineseCounting' | 'chineseLegalSimplified' | 'chineseCountingThousand' | 'koreanDigital' | 'koreanCounting' | 'koreanLegal' | 'koreanDigital2' | 'vietnameseCounting' | 'russianLower' | 'russianUpper' | 'none' | 'numberInDash' | 'hebrew1' | 'hebrew2' | 'arabicAlpha' | 'arabicAbjad' | 'hindiVowels' | 'hindiConsonants' | 'hindiNumbers' | 'hindiCounting' | 'thaiLetters' | 'thaiNumbers' | 'thaiCounting';PageOrientationtypeSource ↗
Page orientation
type PageOrientation = 'portrait' | 'landscape';ParagraphAlignmenttypeSource ↗
Paragraph alignment/justification
type ParagraphAlignment = 'left' | 'center' | 'right' | 'both' | 'distribute' | 'mediumKashida' | 'highKashida' | 'lowKashida' | 'thaiDistribute';ParagraphContenttypeSource ↗
Inline content that can appear inside a paragraph. Covers runs (text), hyperlinks, bookmarks, fields, structured document tags, comment range markers, tracked-change wrappers, and math equations. Every node in this union carries a type discriminator so consumers can narrow at runtime.
type ParagraphContent = Run | Hyperlink | BookmarkStart | BookmarkEnd | SimpleField | ComplexField | InlineSdt | CommentRangeStart | CommentRangeEnd | Insertion | Deletion | MoveFrom | MoveTo | MoveFromRangeStart | MoveFromRangeEnd | MoveToRangeStart | MoveToRangeEnd | MathEquation;RelationshipMaptypeSource ↗
Relationship map (keyed by rId)
type RelationshipMap = Map<string, Relationship>;RelationshipTypetypeSource ↗
Relationship type
type RelationshipType = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/header' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData' | string;RunContenttypeSource ↗
All possible run content types
type RunContent = TextContent | TabContent | BreakContent | SymbolContent | NoteReferenceContent | NoteRefMarkContent | SeparatorContent | FieldCharContent | InstrTextContent | SoftHyphenContent | NoBreakHyphenContent | DrawingContent | ShapeContent;SdtTypetypeSource ↗
SDT type (content control type).
Values mirror the w:sdtPr type-marker element names from ECMA-376 §17.5.2 (CT_SdtPr), with two deliberate exceptions: - checkbox is the w14:checkbox (Office 2010) extension, not a base OOXML type marker. - buildingBlockGallery covers both w:docPartObj and w:docPartList.
A w:sdtPr with no type marker means richText (the spec default). A type marker the parser does not model maps to unknown — it is never coerced to richText, so the projection stays honest. Round-trip fidelity does not depend on this enum: the raw w:sdtPr is replayed verbatim (see rawPropertiesXml).
type SdtType = 'richText' | 'plainText' | 'date' | 'dropDownList' | 'comboBox' | 'checkbox' | 'picture' | 'buildingBlockGallery' | 'group' | 'equation' | 'citation' | 'bibliography' | 'unknown';SectionStarttypeSource ↗
Section start type
type SectionStart = 'continuous' | 'nextPage' | 'oddPage' | 'evenPage' | 'nextColumn';ShapeTypetypeSource ↗
Shape types
type ShapeType = 'rect' | 'roundRect' | 'ellipse' | 'triangle' | 'rtTriangle' | 'parallelogram' | 'trapezoid' | 'pentagon' | 'hexagon' | 'heptagon' | 'octagon' | 'decagon' | 'dodecagon' | 'star4' | 'star5' | 'star6' | 'star7' | 'star8' | 'star10' | 'star12' | 'star16' | 'star24' | 'star32' | 'line' | 'straightConnector1' | 'bentConnector2' | 'bentConnector3' | 'bentConnector4' | 'bentConnector5' | 'curvedConnector2' | 'curvedConnector3' | 'curvedConnector4' | 'curvedConnector5' | 'rightArrow' | 'leftArrow' | 'upArrow' | 'downArrow' | 'leftRightArrow' | 'upDownArrow' | 'quadArrow' | 'leftRightUpArrow' | 'bentArrow' | 'uturnArrow' | 'leftUpArrow' | 'bentUpArrow' | 'curvedRightArrow' | 'curvedLeftArrow' | 'curvedUpArrow' | 'curvedDownArrow' | 'stripedRightArrow' | 'notchedRightArrow' | 'homePlate' | 'chevron' | 'rightArrowCallout' | 'downArrowCallout' | 'leftArrowCallout' | 'upArrowCallout' | 'leftRightArrowCallout' | 'quadArrowCallout' | 'circularArrow' | 'flowChartProcess' | 'flowChartAlternateProcess' | 'flowChartDecision' | 'flowChartInputOutput' | 'flowChartPredefinedProcess' | 'flowChartInternalStorage' | 'flowChartDocument' | 'flowChartMultidocument' | 'flowChartTerminator' | 'flowChartPreparation' | 'flowChartManualInput' | 'flowChartManualOperation' | 'flowChartConnector' | 'flowChartOffpageConnector' | 'flowChartPunchedCard' | 'flowChartPunchedTape' | 'flowChartSummingJunction' | 'flowChartOr' | 'flowChartCollate' | 'flowChartSort' | 'flowChartExtract' | 'flowChartMerge' | 'flowChartOnlineStorage' | 'flowChartDelay' | 'flowChartMagneticTape' | 'flowChartMagneticDisk' | 'flowChartMagneticDrum' | 'flowChartDisplay' | 'wedgeRectCallout' | 'wedgeRoundRectCallout' | 'wedgeEllipseCallout' | 'cloudCallout' | 'borderCallout1' | 'borderCallout2' | 'borderCallout3' | 'accentCallout1' | 'accentCallout2' | 'accentCallout3' | 'callout1' | 'callout2' | 'callout3' | 'accentBorderCallout1' | 'accentBorderCallout2' | 'accentBorderCallout3' | 'actionButtonBlank' | 'actionButtonHome' | 'actionButtonHelp' | 'actionButtonInformation' | 'actionButtonBackPrevious' | 'actionButtonForwardNext' | 'actionButtonBeginning' | 'actionButtonEnd' | 'actionButtonReturn' | 'actionButtonDocument' | 'actionButtonSound' | 'actionButtonMovie' | 'irregularSeal1' | 'irregularSeal2' | 'frame' | 'halfFrame' | 'corner' | 'diagStripe' | 'chord' | 'arc' | 'bracketPair' | 'bracePair' | 'leftBracket' | 'rightBracket' | 'leftBrace' | 'rightBrace' | 'can' | 'cube' | 'bevel' | 'donut' | 'noSmoking' | 'blockArc' | 'foldedCorner' | 'smileyFace' | 'heart' | 'lightningBolt' | 'sun' | 'moon' | 'cloud' | 'snip1Rect' | 'snip2SameRect' | 'snip2DiagRect' | 'snipRoundRect' | 'round1Rect' | 'round2SameRect' | 'round2DiagRect' | 'plaque' | 'teardrop' | 'mathPlus' | 'mathMinus' | 'mathMultiply' | 'mathDivide' | 'mathEqual' | 'mathNotEqual' | 'gear6' | 'gear9' | 'funnel' | 'pieWedge' | 'pie' | 'leftCircularArrow' | 'leftRightCircularArrow' | 'swooshArrow' | 'textBox';StyleTypetypeSource ↗
Style type
type StyleType = 'paragraph' | 'character' | 'numbering' | 'table';TabLeadertypeSource ↗
Tab leader character
type TabLeader = 'none' | 'dot' | 'hyphen' | 'underscore' | 'heavy' | 'middleDot';TableWidthTypetypeSource ↗
Table width type
type TableWidthType = 'auto' | 'dxa' | 'nil' | 'pct';TabStopAlignmenttypeSource ↗
Tab stop alignment
type TabStopAlignment = 'left' | 'center' | 'right' | 'decimal' | 'bar' | 'clear' | 'num';TextEffecttypeSource ↗
Text effect animations
type TextEffect = 'none' | 'blinkBackground' | 'lights' | 'antsBlack' | 'antsRed' | 'shimmer' | 'sparkle';ThemeColorSlottypeSource ↗
Theme color slots from theme1.xml
type ThemeColorSlot = 'dk1' | 'lt1' | 'dk2' | 'lt2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6' | 'hlink' | 'folHlink' | 'background1' | 'text1' | 'background2' | 'text2';TrackedRunChangetypeSource ↗
Run-level tracked wrappers represented in WordprocessingML.
type TrackedRunChange = Insertion | Deletion | MoveFrom | MoveTo;UnderlineStyletypeSource ↗
Underline style options
type UnderlineStyle = 'none' | 'single' | 'words' | 'double' | 'thick' | 'dotted' | 'dottedHeavy' | 'dash' | 'dashedHeavy' | 'dashLong' | 'dashLongHeavy' | 'dotDash' | 'dashDotHeavy' | 'dotDotDash' | 'dashDotDotHeavy' | 'wave' | 'wavyHeavy' | 'wavyDouble';VerticalAligntypeSource ↗
Vertical alignment
type VerticalAlign = 'top' | 'center' | 'both' | 'bottom';WatermarktypeSource ↗
A document watermark — text or picture.
type Watermark = TextWatermark | PictureWatermark;Variables (1)
DEFAULT_WATERMARK_PRESETSconstSource ↗
Default text-watermark presets shown in the watermark dialog, mirroring the canned phrases MS Word offers. Adapters expose a watermarkPresets prop to override this list; both React and Vue fall back to these when unset.
DEFAULT_WATERMARK_PRESETS: readonly string[]