FDocument

GitHubEdit on GitHub
packages@univerjs/docs-ui

APIs

appendText

Adds the specified text to the end of this text region.

Signature

appendText(text: string): Promise<boolean>

Parameters

  • text (string) — - The text to be added to the end of this text region.

getId

Signature

getId(): string

getName

Signature

getName(): string

getSnapshot

Signature

getSnapshot(): IDocumentData

redo

Signature

redo(): Promise<boolean>

setSelection

Sets the selection to a specified text range in the document.

Signature

setSelection(startOffset: number, endOffset: number): void

Parameters

  • startOffset (number) — - The starting offset of the selection in the document.
  • endOffset (number) — - The ending offset of the selection in the document.

Examples

document.setSelection(10, 20)

undo

Signature

undo(): Promise<boolean>