API Reference
@univerjs
@univerjs/engine-render
classes
Documentviewmodel

@univerjs/engine-render v0.4.2Docs


Class: DocumentViewModel

Implements

Constructors

new DocumentViewModel()

new DocumentViewModel(_documentDataModel): DocumentViewModel

Parameters

ParameterType
_documentDataModelDocumentDataModel

Returns

DocumentViewModel

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:181 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueDefined in
childrenpublicDataStreamTreeNode[][]submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:163 (opens in a new tab)
editAreaChange$readonlyObservable<Nullable<DocumentEditArea>>undefinedsubmodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:173 (opens in a new tab)
footerTreeMappublicMap<string, DocumentViewModel>undefinedsubmodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:176 (opens in a new tab)
headerTreeMappublicMap<string, DocumentViewModel>undefinedsubmodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:175 (opens in a new tab)
segmentViewModels$readonlyObservable<DocumentViewModel[]>undefinedsubmodules/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

ParameterType
currentIndexnumber
textLengthnumber

Returns

void

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:350 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Implementation of

IDisposable.dispose

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:196 (opens in a new tab)


getBody()

getBody(): undefined | IDocumentBody

Returns

undefined | IDocumentBody

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:225 (opens in a new tab)


getCustomBlock()

getCustomBlock(index): undefined | ICustomBlock

Parameters

ParameterType
indexnumber

Returns

undefined | ICustomBlock

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:515 (opens in a new tab)


getCustomBlockWithoutSetCurrentIndex()

getCustomBlockWithoutSetCurrentIndex(index): undefined | ICustomBlock

Parameters

ParameterType
indexnumber

Returns

undefined | ICustomBlock

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:531 (opens in a new tab)


getCustomDecoration()

getCustomDecoration(index): Nullable<ICustomDecorationForInterceptor>

Parameters

ParameterType
indexnumber

Returns

Nullable<ICustomDecorationForInterceptor>

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:603 (opens in a new tab)


getCustomDecorationRaw()

getCustomDecorationRaw(index): undefined | ICustomDecoration

Parameters

ParameterType
indexnumber

Returns

undefined | ICustomDecoration

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:589 (opens in a new tab)


getCustomRange()

getCustomRange(index): Nullable<ICustomRangeForInterceptor>

Parameters

ParameterType
indexnumber

Returns

Nullable<ICustomRangeForInterceptor>

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:581 (opens in a new tab)


getCustomRangeRaw()

getCustomRangeRaw(index): undefined | ICustomRange<Record<string, any>>

Parameters

ParameterType
indexnumber

Returns

undefined | ICustomRange<Record<string, any>>

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:567 (opens in a new tab)


getDataModel()

getDataModel(): DocumentDataModel

Returns

DocumentDataModel

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:233 (opens in a new tab)


getEditArea()

getEditArea(): DocumentEditArea

Returns

DocumentEditArea

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:206 (opens in a new tab)


getLastIndex()

getLastIndex(): number

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:221 (opens in a new tab)


getParagraph()

getParagraph(index, fromStart): undefined | IParagraph

Parameters

ParameterTypeDefault value
indexnumberundefined
fromStartbooleanfalse

Returns

undefined | IParagraph

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:415 (opens in a new tab)


getPositionInParent()

getPositionInParent(): number

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:217 (opens in a new tab)


getSectionBreak()

getSectionBreak(index): undefined | ISectionBreak

Parameters

ParameterType
indexnumber

Returns

undefined | ISectionBreak

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:396 (opens in a new tab)


getSelfOrHeaderFooterViewModel()

getSelfOrHeaderFooterViewModel(segmentId?): DocumentViewModel

Parameters

ParameterType
segmentId?string

Returns

DocumentViewModel

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:237 (opens in a new tab)


getSnapshot()

getSnapshot(): IDocumentData

Returns

IDocumentData

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:229 (opens in a new tab)


getTable()

getTable(index): undefined | ITable

Parameters

ParameterType
indexnumber

Returns

undefined | ITable

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:544 (opens in a new tab)


getText()

getText(): string

Get pure text content in the given range.

Returns

string

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:357 (opens in a new tab)


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

ParameterType
indexnumber

Returns

undefined | ITextRun

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:487 (opens in a new tab)


getTextRunRange()

getTextRunRange(startIndex, endIndex): ITextRun[]

Parameters

ParameterTypeDefault value
startIndexnumber0
endIndexnumberundefined

Returns

ITextRun[]

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:433 (opens in a new tab)


insert()

insert(insertBody, insertIndex): void

Parameters

ParameterTypeDefault value
insertBodyIDocumentBodyundefined
insertIndexnumber0

Returns

void

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:261 (opens in a new tab)


registerCustomRangeInterceptor()

registerCustomRangeInterceptor(interceptor): IDisposable

Parameters

ParameterType
interceptorICustomRangeInterceptor

Returns

IDisposable

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:191 (opens in a new tab)


reset()

reset(documentDataModel): void

Parameters

ParameterType
documentDataModelDocumentDataModel

Returns

void

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:253 (opens in a new tab)


resetCache()

resetCache(): void

Returns

void

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:375 (opens in a new tab)


selfPlus()

selfPlus(_len, _index): void

Parameters

ParameterType
_lennumber
_indexnumber

Returns

void

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:202 (opens in a new tab)


setEditArea()

setEditArea(editArea): void

Parameters

ParameterType
editAreaDocumentEditArea

Returns

void

Defined in

submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:210 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.