@univerjsdocs-uifacadeclassesFdocument

@univerjs/docs-ui v0.5.0-beta.1Docs


Class: FDocument

Constructors

new FDocument()

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

Parameters

ParameterType
_documentDataModelDocumentDataModel
_injectorInjector
_univerInstanceServiceIUniverInstanceService
_commandServiceICommandService
_resourceManagerServiceIResourceManagerService
_renderManagerServiceIRenderManagerService

Returns

FDocument

Defined in

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

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>

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

Parameters

ParameterType
textstring

Returns

Promise<boolean>

Defined in

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


getId()

getId(): string

Returns

string

Defined in

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


getName()

getName(): string

Returns

string

Defined in

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


getSnapshot()

getSnapshot(): IDocumentData

Returns

IDocumentData

Defined in

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


redo()

redo(): Promise<boolean>

Returns

Promise<boolean>

Defined in

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


setSelection()

setSelection(startOffset, endOffset): void

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);

Defined in

submodules/univer/packages/docs-ui/src/facade/f-document.ts:114


undo()

undo(): Promise<boolean>

Returns

Promise<boolean>

Defined in

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