IDocumentBody
The text stream and formatting runs inside a document. It is also used by rich-text cells through ICellData.p.body. Prefer the rich-text builder for constructing styled content.
Import
import type { IDocumentBody } from '@univerjs/core'Definition
interface IDocumentBody { dataStream: string renderedPageBreaks?: number[] textRuns?: ITextRun[] paragraphs?: IParagraph[] sectionBreaks?: ISectionBreak[] customBlocks?: ICustomBlock[] docxRawCustomBlocks?: ICustomBlock[] docxRawBlocks?: IDocxRawBlock[] docxExportExcludedRanges?: IDocxExportExcludedRange[] tables?: ICustomTable[] columnGroups?: ICustomColumnGroup[] blockRanges?: IDocumentBlockRange[] customRanges?: ICustomRange[] customDecorations?: ICustomDecoration[] payloads?: Record<string, string>}Fields
dataStream
Required · string
renderedPageBreaks
Optional · number[] | undefined
UTF-16 offsets of soft page-break tokens (\f) produced by the layout engine that last
saved the source document. Renderers may honor them for traditional/paginated fidelity;
exporters must keep them soft rather than converting them to authored page breaks.
textRuns
Optional · ITextRun[] | undefined
paragraphs
Optional · IParagraph[] | undefined
sectionBreaks
Optional · ISectionBreak[] | undefined
customBlocks
Optional · ICustomBlock[] | undefined
docxRawCustomBlocks
Optional · ICustomBlock[] | undefined
Opaque DOCX runs represented by custom-block sentinels for lossless round-trip. They participate in text offsets like regular custom blocks but are not rendered as drawings.
docxRawBlocks
Optional · IDocxRawBlock[] | undefined
Opaque DOCX XML anchored at a document offset for lossless round-trip.
docxExportExcludedRanges
Optional · IDocxExportExcludedRange[] | undefined
Document ranges excluded from generated DOCX content because their raw XML is preserved separately.
tables
Optional · ICustomTable[] | undefined
columnGroups
Optional · ICustomColumnGroup[] | undefined
blockRanges
Optional · IDocumentBlockRange[] | undefined
customRanges
Optional · ICustomRange<Record<string, any>>[] | undefined
customDecorations
Optional · ICustomDecoration[] | undefined
payloads
Optional · Record<string, string> | undefined
for copy/paste, data of custom-range and other module it won't save to disk
Related types
ITextRunIParagraphISectionBreakICustomBlockIDocxRawBlockIDocxExportExcludedRangeICustomTableICustomColumnGroupIDocumentBlockRangeICustomRangeICustomDecorationRecord
Package: @univerjs/core · Type definitions
How is this guide?