@univerjs/engine-render v0.4.2 • Docs
Class: DocumentViewModel
Implements
Constructors
new DocumentViewModel()
new DocumentViewModel(_documentDataModel): DocumentViewModel
Parameters
Parameter | Type |
---|---|
_documentDataModel | DocumentDataModel |
Returns
Defined in
Properties
Property | Modifier | Type | Default value | Defined in |
---|---|---|---|---|
children | public | DataStreamTreeNode [] | [] | submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:163 (opens in a new tab) |
editAreaChange$ | readonly | Observable <Nullable <DocumentEditArea >> | undefined | submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:173 (opens in a new tab) |
footerTreeMap | public | Map <string , DocumentViewModel > | undefined | submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:176 (opens in a new tab) |
headerTreeMap | public | Map <string , DocumentViewModel > | undefined | submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:175 (opens in a new tab) |
segmentViewModels$ | readonly | Observable <DocumentViewModel []> | undefined | submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:179 (opens in a new tab) |
Methods
delete()
delete(currentIndex, textLength): void
Parameters
Parameter | Type |
---|---|
currentIndex | number |
textLength | number |
Returns
void
Defined in
dispose()
dispose(): void
Returns
void
Implementation of
Defined in
getBody()
getBody(): undefined | IDocumentBody
Returns
undefined
| IDocumentBody
Defined in
getCustomBlock()
getCustomBlock(index): undefined | ICustomBlock
Parameters
Parameter | Type |
---|---|
index | number |
Returns
undefined
| ICustomBlock
Defined in
getCustomBlockWithoutSetCurrentIndex()
getCustomBlockWithoutSetCurrentIndex(index): undefined | ICustomBlock
Parameters
Parameter | Type |
---|---|
index | number |
Returns
undefined
| ICustomBlock
Defined in
getCustomDecoration()
getCustomDecoration(index): Nullable<ICustomDecorationForInterceptor>
Parameters
Parameter | Type |
---|---|
index | number |
Returns
Nullable
<ICustomDecorationForInterceptor
>
Defined in
getCustomDecorationRaw()
getCustomDecorationRaw(index): undefined | ICustomDecoration
Parameters
Parameter | Type |
---|---|
index | number |
Returns
undefined
| ICustomDecoration
Defined in
getCustomRange()
getCustomRange(index): Nullable<ICustomRangeForInterceptor>
Parameters
Parameter | Type |
---|---|
index | number |
Returns
Nullable
<ICustomRangeForInterceptor
>
Defined in
getCustomRangeRaw()
getCustomRangeRaw(index): undefined | ICustomRange<Record<string, any>>
Parameters
Parameter | Type |
---|---|
index | number |
Returns
undefined
| ICustomRange
<Record
<string
, any
>>
Defined in
getDataModel()
getDataModel(): DocumentDataModel
Returns
Defined in
getEditArea()
getEditArea(): DocumentEditArea
Returns
Defined in
getLastIndex()
getLastIndex(): number
Returns
number
Defined in
getParagraph()
getParagraph(index, fromStart): undefined | IParagraph
Parameters
Parameter | Type | Default value |
---|---|---|
index | number | undefined |
fromStart | boolean | false |
Returns
undefined
| IParagraph
Defined in
getPositionInParent()
getPositionInParent(): number
Returns
number
Defined in
getSectionBreak()
getSectionBreak(index): undefined | ISectionBreak
Parameters
Parameter | Type |
---|---|
index | number |
Returns
undefined
| ISectionBreak
Defined in
getSelfOrHeaderFooterViewModel()
getSelfOrHeaderFooterViewModel(segmentId?): DocumentViewModel
Parameters
Parameter | Type |
---|---|
segmentId ? | string |
Returns
Defined in
getSnapshot()
getSnapshot(): IDocumentData
Returns
Defined in
getTable()
getTable(index): undefined | ITable
Parameters
Parameter | Type |
---|---|
index | number |
Returns
undefined
| ITable
Defined in
getText()
getText(): string
Get pure text content in the given range.
Returns
string
Defined in
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
getTextRunRange()
getTextRunRange(startIndex, endIndex): ITextRun[]
Parameters
Parameter | Type | Default value |
---|---|---|
startIndex | number | 0 |
endIndex | number | undefined |
Returns
ITextRun
[]
Defined in
insert()
insert(insertBody, insertIndex): void
Parameters
Parameter | Type | Default value |
---|---|---|
insertBody | IDocumentBody | undefined |
insertIndex | number | 0 |
Returns
void
Defined in
registerCustomRangeInterceptor()
registerCustomRangeInterceptor(interceptor): IDisposable
Parameters
Parameter | Type |
---|---|
interceptor | ICustomRangeInterceptor |
Returns
Defined in
reset()
reset(documentDataModel): void
Parameters
Parameter | Type |
---|---|
documentDataModel | DocumentDataModel |
Returns
void
Defined in
resetCache()
resetCache(): void
Returns
void
Defined in
selfPlus()
selfPlus(_len, _index): void
Parameters
Parameter | Type |
---|---|
_len | number |
_index | number |
Returns
void
Defined in
setEditArea()
setEditArea(editArea): void
Parameters
Parameter | Type |
---|---|
editArea | DocumentEditArea |
Returns
void