@univerjs/engine-render v0.5.0-beta.1 • Docs
Class: DocumentViewModel
Implements
Constructors
new DocumentViewModel()
new DocumentViewModel(_documentDataModel): DocumentViewModel
Parameters
Parameter | Type |
---|---|
_documentDataModel | DocumentDataModel |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:181
Properties
Property | Modifier | Type | Default value | Defined in |
---|---|---|---|---|
children | public | DataStreamTreeNode [] | [] | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:163 |
editAreaChange$ | readonly | Observable <Nullable <DocumentEditArea >> | undefined | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:173 |
footerTreeMap | public | Map <string , DocumentViewModel > | undefined | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:176 |
headerTreeMap | public | Map <string , DocumentViewModel > | undefined | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:175 |
segmentViewModels$ | readonly | Observable <DocumentViewModel []> | undefined | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:179 |
Methods
delete()
delete(currentIndex, textLength): void
Parameters
Parameter | Type |
---|---|
currentIndex | number |
textLength | number |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:350
dispose()
dispose(): void
Returns
void
Implementation of
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:196
getBody()
getBody(): undefined | IDocumentBody
Returns
undefined
| IDocumentBody
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:225
getCustomBlock()
getCustomBlock(index): undefined | ICustomBlock
Parameters
Parameter | Type |
---|---|
index | number |
Returns
undefined
| ICustomBlock
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:515
getCustomBlockWithoutSetCurrentIndex()
getCustomBlockWithoutSetCurrentIndex(index): undefined | ICustomBlock
Parameters
Parameter | Type |
---|---|
index | number |
Returns
undefined
| ICustomBlock
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:531
getCustomDecoration()
getCustomDecoration(index): Nullable<ICustomDecorationForInterceptor>
Parameters
Parameter | Type |
---|---|
index | number |
Returns
Nullable
<ICustomDecorationForInterceptor
>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:603
getCustomDecorationRaw()
getCustomDecorationRaw(index): undefined | ICustomDecoration
Parameters
Parameter | Type |
---|---|
index | number |
Returns
undefined
| ICustomDecoration
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:589
getCustomRange()
getCustomRange(index): Nullable<ICustomRangeForInterceptor>
Parameters
Parameter | Type |
---|---|
index | number |
Returns
Nullable
<ICustomRangeForInterceptor
>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:581
getCustomRangeRaw()
getCustomRangeRaw(index): undefined | ICustomRange<Record<string, any>>
Parameters
Parameter | Type |
---|---|
index | number |
Returns
undefined
| ICustomRange
<Record
<string
, any
>>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:567
getDataModel()
getDataModel(): DocumentDataModel
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:233
getEditArea()
getEditArea(): DocumentEditArea
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:206
getLastIndex()
getLastIndex(): number
Returns
number
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:221
getParagraph()
getParagraph(index, fromStart): undefined | IParagraph
Parameters
Parameter | Type | Default value |
---|---|---|
index | number | undefined |
fromStart | boolean | false |
Returns
undefined
| IParagraph
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:415
getPositionInParent()
getPositionInParent(): number
Returns
number
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:217
getSectionBreak()
getSectionBreak(index): undefined | ISectionBreak
Parameters
Parameter | Type |
---|---|
index | number |
Returns
undefined
| ISectionBreak
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:396
getSelfOrHeaderFooterViewModel()
getSelfOrHeaderFooterViewModel(segmentId?): DocumentViewModel
Parameters
Parameter | Type |
---|---|
segmentId ? | string |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:237
getSnapshot()
getSnapshot(): IDocumentData
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:229
getTable()
getTable(index): undefined | ITable
Parameters
Parameter | Type |
---|---|
index | number |
Returns
undefined
| ITable
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:544
getText()
getText(): string
Get pure text content in the given range.
Returns
string
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:357
getTextRun()
getTextRun(index): undefined | ITextRun
textRun matches according to the selection. If the text length is 10, then the range of textRun is from 0 to 11.
Parameters
Parameter | Type |
---|---|
index | number |
Returns
undefined
| ITextRun
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:487
getTextRunRange()
getTextRunRange(startIndex, endIndex): ITextRun[]
Parameters
Parameter | Type | Default value |
---|---|---|
startIndex | number | 0 |
endIndex | number | undefined |
Returns
ITextRun
[]
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:433
insert()
insert(insertBody, insertIndex): void
Parameters
Parameter | Type | Default value |
---|---|---|
insertBody | IDocumentBody | undefined |
insertIndex | number | 0 |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:261
registerCustomRangeInterceptor()
registerCustomRangeInterceptor(interceptor): IDisposable
Parameters
Parameter | Type |
---|---|
interceptor | ICustomRangeInterceptor |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:191
reset()
reset(documentDataModel): void
Parameters
Parameter | Type |
---|---|
documentDataModel | DocumentDataModel |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:253
resetCache()
resetCache(): void
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:375
selfPlus()
selfPlus(_len, _index): void
Parameters
Parameter | Type |
---|---|
_len | number |
_index | number |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:202
setEditArea()
setEditArea(editArea): void
Parameters
Parameter | Type |
---|---|
editArea | DocumentEditArea |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:210