@eigenpal/docx-editor-core/types/content
Document Content Model — barrel.
All content-bearing types: runs, hyperlinks, bookmarks, fields, images, shapes, tables, lists, paragraphs, headers/footers, footnotes/endnotes, and sections.
The types form a deeply interrelated tree (Paragraph ↔ Table ↔ ShapeTextBody) and are split across `./content/*.ts` by domain. This file re-exports them so existing imports from `@eigenpal/docx-editor-core/types/content` keep working unchanged.
Interfaces(67)
BlockSdt
Block-level SDT (content control wrapping paragraphs/tables)
interface BlockSdt| Member | Type | Summary |
|---|---|---|
| content | (Paragraph | Table)[] | Block content inside the control |
| properties | SdtProperties | SDT properties |
| type | 'blockSdt' |
BookmarkEnd
Bookmark end marker (w:bookmarkEnd)
interface BookmarkEnd| Member | Type | Summary |
|---|---|---|
| id | number | Bookmark ID |
| type | 'bookmarkEnd' |
BookmarkStart
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' |
BreakContent
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' |
Column
Column definition
interface Column| Member | Type | Summary |
|---|---|---|
| space? | number | Space after column in twips |
| width? | number | Column width in twips |
Comment_2
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) |
CommentRangeEnd
Comment range end marker in paragraph content
interface CommentRangeEnd| Member | Type | Summary |
|---|---|---|
| id | number | |
| type | 'commentRangeEnd' |
CommentRangeStart
Comment range start marker in paragraph content
interface CommentRangeStart| Member | Type | Summary |
|---|---|---|
| id | number | |
| type | 'commentRangeStart' |
ComplexField
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 |
| instruction | string | Field instruction |
| type | 'complexField' |
Deletion
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' |
DocumentBody
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) |
DrawingContent
Drawing/image reference
interface DrawingContent| Member | Type | Summary |
|---|---|---|
| image | Image | Image data |
| type | 'drawing' |
Endnote
Endnote (w:endnote)
interface Endnote| Member | Type | Summary |
|---|---|---|
| content | (Paragraph | Table)[] | Content. Per ECMA-376 §17.11.4 endnotes can hold the same blocks as the body — paragraphs and tables. See note on `Footnote.content`. |
| id | number | Endnote ID |
| noteType? | 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice' | Special endnote type |
| type | 'endnote' |
EndnoteProperties
Endnote properties
interface EndnoteProperties| Member | Type | Summary |
|---|---|---|
| numFmt? | NumberFormat | |
| numRestart? | NoteNumberRestart | |
| numStart? | number | |
| position? | EndnotePosition |
FieldCharContent
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' |
Footnote
Footnote (w:footnote)
interface Footnote| Member | Type | Summary |
|---|---|---|
| content | (Paragraph | Table)[] | Content. Per ECMA-376 §17.11.10 footnotes can hold the same blocks as the body — paragraphs and tables. The parser previously only collected w:p children which silently dropped any w:tbl inside a footnote; widened to match HeaderFooter / TableCell shape so the body pipeline (toProseDoc → toFlowBlocks) can render them uniformly. |
| id | number | Footnote ID |
| noteType? | 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice' | Special footnote type |
| type | 'footnote' |
FootnoteProperties
Footnote properties
interface FootnoteProperties| Member | Type | Summary |
|---|---|---|
| numFmt? | NumberFormat | |
| numRestart? | NoteNumberRestart | |
| numStart? | number | |
| position? | FootnotePosition |
HeaderReference
Header or footer reference
interface HeaderReference| Member | Type | Summary |
|---|---|---|
| rId | string | |
| type | HeaderFooterType |
Hyperlink
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_2
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 |
ImageCrop
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 |
ImagePadding
Image padding/margins
interface ImagePadding| Member | Type | Summary |
|---|---|---|
| bottom? | number | |
| left? | number | |
| right? | number | |
| top? | number |
ImagePosition
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 |
ImageSize
Image size specification
interface ImageSize| Member | Type | Summary |
|---|---|---|
| height | number | Height in EMUs |
| width | number | Width in EMUs (English Metric Units) |
ImageTransform
Image transformation
interface ImageTransform| Member | Type | Summary |
|---|---|---|
| flipH? | boolean | Flip horizontal |
| flipV? | boolean | Flip vertical |
| rotation? | number | Rotation in degrees |
ImageWrap
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 |
InlineSdt
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' |
Insertion
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' |
InstrTextContent
Field instruction text
interface InstrTextContent| Member | Type | Summary |
|---|---|---|
| text | string | Field instruction |
| type | 'instrText' |
MathEquation
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' |
MoveFrom
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' |
MoveFromRangeEnd
Move-from range end marker (w:moveFromRangeEnd)
interface MoveFromRangeEnd| Member | Type | Summary |
|---|---|---|
| id | number | |
| type | 'moveFromRangeEnd' |
MoveFromRangeStart
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' |
MoveTo
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' |
MoveToRangeEnd
Move-to range end marker (w:moveToRangeEnd)
interface MoveToRangeEnd| Member | Type | Summary |
|---|---|---|
| id | number | |
| type | 'moveToRangeEnd' |
MoveToRangeStart
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' |
NoBreakHyphenContent
Non-breaking hyphen
interface NoBreakHyphenContent| Member | Type | Summary |
|---|---|---|
| type | 'noBreakHyphen' |
NoteReferenceContent
Footnote or endnote reference
interface NoteReferenceContent| Member | Type | Summary |
|---|---|---|
| id | number | Note ID |
| type | 'footnoteRef' | 'endnoteRef' |
Paragraph
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 |
| 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' |
ParagraphPropertyChange
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' |
PropertyChangeInfo
Generic tracked property-change wrapper metadata (w:*PrChange)
interface PropertyChangeInfo extends TrackedChangeInfo| Member | Type | Summary |
|---|---|---|
| rsid? | string | Optional revision session ID |
Run
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' |
RunPropertyChange
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' |
SdtProperties
SDT properties (w:sdtPr)
interface SdtProperties| Member | Type | Summary |
|---|---|---|
| alias? | string | Alias (friendly name) |
| checked? | boolean | Checkbox checked state |
| dateFormat? | string | Date format for date controls |
| listItems? | {
displayText: string;
value: string;
}[] | Dropdown/combobox list items |
| lock? | 'sdtLocked' | 'contentLocked' | 'sdtContentLocked' | 'unlocked' | Lock content editing |
| placeholder? | string | Placeholder text |
| sdtType | SdtType | SDT type |
| showingPlaceholder? | boolean | Whether showing placeholder |
| tag? | string | Tag (developer identifier) |
Section
One section of the document — a `SectionProperties` plus the block content (`Paragraph`s and `Table`s) 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 |
SectionProperties
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 |
| 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 |
Shape
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 |
ShapeContent
Shape reference
interface ShapeContent| Member | Type | Summary |
|---|---|---|
| shape | Shape | Shape data |
| type | 'shape' |
ShapeFill
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' |
ShapeOutline
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 |
ShapeTextBody
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 |
SimpleField
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' |
SoftHyphenContent
Soft hyphen
interface SoftHyphenContent| Member | Type | Summary |
|---|---|---|
| type | 'softHyphen' |
SymbolContent
Symbol character (special font character)
interface SymbolContent| Member | Type | Summary |
|---|---|---|
| char | string | Character code |
| font | string | Font name |
| type | 'symbol' |
TabContent
Tab character
interface TabContent| Member | Type | Summary |
|---|---|---|
| type | 'tab' |
Table
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' |
TableCell
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' |
TableCellPropertyChange
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' |
TablePropertyChange
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' |
TableRow
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' |
TableRowPropertyChange
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' |
TableStructuralChangeInfo
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' |
TextBox
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 |
TextContent
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' |
TrackedChangeInfo
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(16)
BlockContent
Block-level content types
type BlockContent = Paragraph | Table | BlockSdt;EndnotePosition
Endnote position
type EndnotePosition = 'sectEnd' | 'docEnd';type Field = SimpleField | ComplexField;FieldType
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';FootnotePosition
Footnote position
type FootnotePosition = 'pageBottom' | 'beneathText' | 'sectEnd' | 'docEnd';LineNumberRestart
Line number restart type
type LineNumberRestart = 'continuous' | 'newPage' | 'newSection';NoteNumberRestart
Number restart type
type NoteNumberRestart = 'continuous' | 'eachSect' | 'eachPage';PageOrientation
Page orientation
type PageOrientation = 'portrait' | 'landscape';ParagraphContent
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;RunContent
All possible run content types
type RunContent = TextContent | TabContent | BreakContent | SymbolContent | NoteReferenceContent | FieldCharContent | InstrTextContent | SoftHyphenContent | NoBreakHyphenContent | DrawingContent | ShapeContent;SdtType
SDT type (content control type)
type SdtType = 'richText' | 'plainText' | 'date' | 'dropdown' | 'comboBox' | 'checkbox' | 'picture' | 'buildingBlockGallery' | 'group' | 'unknown';SectionStart
Section start type
type SectionStart = 'continuous' | 'nextPage' | 'oddPage' | 'evenPage' | 'nextColumn';ShapeType
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';TrackedRunChange
Run-level tracked wrappers represented in WordprocessingML.
type TrackedRunChange = Insertion | Deletion | MoveFrom | MoveTo;VerticalAlign
Vertical alignment
type VerticalAlign = 'top' | 'center' | 'both' | 'bottom';