API 参考

ITextRun

本 API 页面目前提供英文正文。代码签名与标识符不随界面语言变化。

A text formatting run within an IDocumentBody. It associates a text interval1 with an ITextStyle.

Import

TypeScript
import type { ITextRun } from '@univerjs/core'

Definition

TypeScript
interface ITextRun {  st: number  ed: number  sId?: string  ts?: ITextStyle}

Fields

st

Required · number

Inclusive character index of the first styled character.

ed

Required · number

Exclusive character boundary after the last styled character.

sId

Optional · string | undefined

ts

Optional · ITextStyle | undefined

Package: @univerjs/core · Type definitions

Footnotes

  1. Text offsets use JavaScript UTF-16 code units, not visible character counts. For example, "😀".length is 2. A text run covers [st, ed): st is included and ed is excluded; do not reuse the inclusive end indices of sheet ranges.

你觉得这篇文档如何?

© 2026 DreamNum Co., Ltd.