@univerjs/engine-render v0.5.0-beta.1 • Docs


Class: DocumentViewModel

Implements

Constructors

new DocumentViewModel()

new DocumentViewModel(_documentDataModel): DocumentViewModel

Parameters

ParameterType
_documentDataModelDocumentDataModel

Returns

DocumentViewModel

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:181

Properties

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

ParameterType
currentIndexnumber
textLengthnumber

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

IDisposable.dispose

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

ParameterType
indexnumber

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

ParameterType
indexnumber

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

ParameterType
indexnumber

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

ParameterType
indexnumber

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

ParameterType
indexnumber

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

ParameterType
indexnumber

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

DocumentDataModel

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

DocumentEditArea

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

ParameterTypeDefault value
indexnumberundefined
fromStartbooleanfalse

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

ParameterType
indexnumber

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

ParameterType
segmentId?string

Returns

DocumentViewModel

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

IDocumentData

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

ParameterType
indexnumber

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

ParameterType
indexnumber

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

ParameterTypeDefault value
startIndexnumber0
endIndexnumberundefined

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

ParameterTypeDefault value
insertBodyIDocumentBodyundefined
insertIndexnumber0

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

ParameterType
interceptorICustomRangeInterceptor

Returns

IDisposable

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

ParameterType
documentDataModelDocumentDataModel

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

ParameterType
_lennumber
_indexnumber

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

ParameterType
editAreaDocumentEditArea

Returns

void

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/components/docs/view-model/document-view-model.ts:210