@univerjsdocs-uifacadeclassesFdocument

@univerjs/docs-ui v0.5.4


Class: FDocument

Defined in: submodules/univer/packages/docs-ui/src/facade/f-document.ts:30

Constructors

new FDocument()

new FDocument(
   _documentDataModel, 
   _injector, 
   _univerInstanceService, 
   _commandService, 
   _resourceManagerService, 
   _renderManagerService): FDocument

Defined in: submodules/univer/packages/docs-ui/src/facade/f-document.ts:33

Parameters

ParameterType
_documentDataModelDocumentDataModel
_injectorInjector
_univerInstanceServiceIUniverInstanceService
_commandServiceICommandService
_resourceManagerServiceIResourceManagerService
_renderManagerServiceIRenderManagerService

Returns

FDocument

Properties

PropertyModifierTypeDefined in
_injectorreadonlyInjectorsubmodules/univer/packages/docs-ui/src/facade/f-document.ts:35
idreadonlystringsubmodules/univer/packages/docs-ui/src/facade/f-document.ts:31

Methods

appendText()

appendText(text): Promise<boolean>

Defined in: submodules/univer/packages/docs-ui/src/facade/f-document.ts:73

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

Parameters

ParameterTypeDescription
textstringThe text to be added to the end of this text region.

Returns

Promise<boolean>


getId()

getId(): string

Defined in: submodules/univer/packages/docs-ui/src/facade/f-document.ts:44

Returns

string


getName()

getName(): string

Defined in: submodules/univer/packages/docs-ui/src/facade/f-document.ts:48

Returns

string


getSnapshot()

getSnapshot(): IDocumentData

Defined in: submodules/univer/packages/docs-ui/src/facade/f-document.ts:52

Returns

IDocumentData


redo()

redo(): Promise<boolean>

Defined in: submodules/univer/packages/docs-ui/src/facade/f-document.ts:64

Returns

Promise<boolean>


setSelection()

setSelection(startOffset, endOffset): void

Defined in: submodules/univer/packages/docs-ui/src/facade/f-document.ts:112

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

Parameters

ParameterTypeDescription
startOffsetnumberThe starting offset of the selection in the document.
endOffsetnumberThe ending offset of the selection in the document.

Returns

void

Example

document.setSelection(10, 20);

undo()

undo(): Promise<boolean>

Defined in: submodules/univer/packages/docs-ui/src/facade/f-document.ts:59

Returns

Promise<boolean>