# IDocumentBody

- Human documentation: [https://docs.univer.ai/reference/types/document-body](https://docs.univer.ai/reference/types/document-body)

- Agent Markdown: [https://docs.univer.ai/reference/types/document-body.md](https://docs.univer.ai/reference/types/document-body.md)

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

- Source: [types/document-body.mdx](https://github.com/dream-num/documentation/blob/dev/content/reference/types/document-body.mdx)

---

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

```ts
import type { IDocumentBody } from '@univerjs/core'
```

## Definition

```ts
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

* [`ITextRun`](https://docs.univer.ai/reference/types/text-run.md)
* [`IParagraph`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/types/interfaces/i-document-data.d.ts)
* [`ISectionBreak`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/types/interfaces/i-document-data.d.ts)
* [`ICustomBlock`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/types/interfaces/i-document-data.d.ts)
* [`IDocxRawBlock`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/types/interfaces/i-document-data.d.ts)
* [`IDocxExportExcludedRange`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/types/interfaces/i-document-data.d.ts)
* [`ICustomTable`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/types/interfaces/i-document-data.d.ts)
* [`ICustomColumnGroup`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/types/interfaces/i-document-data.d.ts)
* [`IDocumentBlockRange`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/types/interfaces/i-document-data.d.ts)
* [`ICustomRange`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/types/interfaces/i-document-data.d.ts)
* [`ICustomDecoration`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/types/interfaces/i-document-data.d.ts)
* [`Record`](https://unpkg.com/@typescript/typescript-darwin-arm64@7.0.2/lib/lib.es5.d.ts)

**Package:** [`@univerjs/core`](https://docs.univer.ai/reference/packages/plugins/univerjs/core.md) · [Type definitions](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/types/interfaces/i-document-data.d.ts)
