Document

GitHubEdit on GitHub
Packages@univerjs/docs-ui
CORE

This class should not be instantiated directly. Use factory methods on univerAPI instead.

Overview

@univerjs/docs-ui

MethodDescription
appendTextAdds the specified text to the end of this text region
getId-
getName-
getSnapshot-
id-
redo-
setSelectionSets the selection to a specified text range in the document
undo-

APIs

Getters & Queries

getId

Signature

getId(): string

Returns

  • string — See signature above.
Source: @univerjs/docs-ui

getName

Signature

getName(): string

Returns

  • string — See signature above.
Source: @univerjs/docs-ui

getSnapshot

Signature

getSnapshot(): IDocumentData

Returns

  • IDocumentData — See signature above.
Source: @univerjs/docs-ui

Setters & Modifiers

setSelection

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

Signature

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

Parameters

  • startOffset numberNo description
  • endOffset numberNo description

Examples

document.setSelection(10, 20);
Source: @univerjs/docs-ui

Actions & Operations

redo

Signature

redo(): Promise<boolean>

Returns

  • Promise<boolean> — See signature above.
Source: @univerjs/docs-ui

undo

Signature

undo(): Promise<boolean>

Returns

  • Promise<boolean> — See signature above.
Source: @univerjs/docs-ui

Miscellaneous

appendText

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

Signature

appendText(text: string): Promise<boolean>

Parameters

  • text stringNo description

Returns

  • Promise<boolean> — See signature above.
Source: @univerjs/docs-ui

id

Signature

id: string

Returns

  • string — See signature above.
Source: @univerjs/docs-ui