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 — ITextRun
paragraphs
Optional · IParagraph[] | undefined — IParagraph
sectionBreaks
Optional · ISectionBreak[] | undefined — ISectionBreak
customBlocks
Optional · ICustomBlock[] | undefined — ICustomBlock
docxRawCustomBlocks
Optional · ICustomBlock[] | undefined — ICustomBlock
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 — IDocxRawBlock
Opaque DOCX XML anchored at a document offset for lossless round-trip.
docxExportExcludedRanges
Optional · IDocxExportExcludedRange[] | undefined — IDocxExportExcludedRange
Document ranges excluded from generated DOCX content because their raw XML is preserved separately.
tables
Optional · ICustomTable[] | undefined — ICustomTable
columnGroups
Optional · ICustomColumnGroup[] | undefined — ICustomColumnGroup
blockRanges
Optional · IDocumentBlockRange[] | undefined — IDocumentBlockRange
customRanges
Optional · ICustomRange<Record<string, any>>[] | undefined — ICustomRange
customDecorations
Optional · ICustomDecoration[] | undefined — ICustomDecoration
payloads
Optional · Record<string, string> | undefined
for copy/paste, data of custom-range and other module it won't save to disk
Related types
ITextRunIParagraphISectionBreakICustomBlockIDocxRawBlockIDocxExportExcludedRangeICustomTableICustomColumnGroupIDocumentBlockRangeICustomRangeICustomDecoration
Package: @univerjs/core · Type definitions
How is this guide?