@univerjs/docs-ui v0.5.0-beta.1 • Docs
Class: FDocument
Constructors
new FDocument()
new FDocument(
_documentDataModel,
_injector,
_univerInstanceService,
_commandService,
_resourceManagerService,
_renderManagerService): FDocument
Parameters
Parameter | Type |
---|---|
_documentDataModel | DocumentDataModel |
_injector | Injector |
_univerInstanceService | IUniverInstanceService |
_commandService | ICommandService |
_resourceManagerService | IResourceManagerService |
_renderManagerService | IRenderManagerService |
Returns
Defined in
submodules/univer/packages/docs-ui/src/facade/f-document.ts:33
Properties
Property | Modifier | Type | Defined in |
---|---|---|---|
_injector | readonly | Injector | submodules/univer/packages/docs-ui/src/facade/f-document.ts:35 |
id | readonly | string | submodules/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
Parameter | Type |
---|---|
text | string |
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
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
Parameter | Type | Description |
---|---|---|
startOffset | number | The starting offset of the selection in the document. |
endOffset | number | The 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