API Reference
@univerjs
@univerjs/core
classes
Documentdatamodel

@univerjs/core v0.4.2Docs


Class: DocumentDataModel

Extends

  • DocumentDataModelSimple

Constructors

new DocumentDataModel()

new DocumentDataModel(snapshot): DocumentDataModel

Parameters

ParameterType
snapshotPartial<IDocumentData>

Returns

DocumentDataModel

Overrides

DocumentDataModelSimple.constructor

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:232 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDocumentDataModelSimple._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:93 (opens in a new tab)
_name$readonlyBehaviorSubject<string>undefinedDocumentDataModelSimple._name$submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:55 (opens in a new tab)
footerModelMappublicMap<string, DocumentDataModel>undefined-submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:230 (opens in a new tab)
headerModelMappublicMap<string, DocumentDataModel>undefined-submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:228 (opens in a new tab)
name$publicObservable<string>undefinedDocumentDataModelSimple.name$submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:56 (opens in a new tab)
snapshotprotectedIDocumentDataundefinedDocumentDataModelSimple.snapshotsubmodules/univer/packages/core/src/docs/data-model/document-data-model.ts:58 (opens in a new tab)
typepublicUNIVER_DOCUniverInstanceType.UNIVER_DOCDocumentDataModelSimple.typesubmodules/univer/packages/core/src/docs/data-model/document-data-model.ts:49 (opens in a new tab)

Accessors

documentStyle

get documentStyle(): IDocumentStyle

Returns

IDocumentStyle

Inherited from

DocumentDataModelSimple.documentStyle

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:88 (opens in a new tab)


drawings

get drawings(): undefined | IDrawings

Returns

undefined | IDrawings

Inherited from

DocumentDataModelSimple.drawings

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:84 (opens in a new tab)


lists

get lists(): undefined | ILists

Returns

undefined | ILists

Inherited from

DocumentDataModelSimple.lists

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:92 (opens in a new tab)


zoomRatio

get zoomRatio(): number

Returns

number

Inherited from

DocumentDataModelSimple.zoomRatio

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:96 (opens in a new tab)

Methods

apply()

apply(actions): undefined | IDocumentData

Parameters

ParameterType
actionsJSONOp

Returns

undefined | IDocumentData

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:304 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Overrides

DocumentDataModelSimple.dispose

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:243 (opens in a new tab)


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

DocumentDataModelSimple.disposeWithMe

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

DocumentDataModelSimple.ensureNotDisposed

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)


getBody()

getBody(): undefined | IDocumentBody

Returns

undefined | IDocumentBody

Inherited from

DocumentDataModelSimple.getBody

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:105 (opens in a new tab)


getBulletPresetList()

getBulletPresetList(): Record<string, IListData>

Returns

Record<string, IListData>

Inherited from

DocumentDataModelSimple.getBulletPresetList

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:113 (opens in a new tab)


getCustomDecorations()

getCustomDecorations(): undefined | ICustomDecoration[]

Returns

undefined | ICustomDecoration[]

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:268 (opens in a new tab)


getCustomRanges()

getCustomRanges(): undefined | ICustomRange<Record<string, any>>[]

Returns

undefined | ICustomRange<Record<string, any>>[]

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:264 (opens in a new tab)


getDrawings()

getDrawings(): undefined | IDrawings

Returns

undefined | IDrawings

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:256 (opens in a new tab)


getDrawingsOrder()

getDrawingsOrder(): undefined | string[]

Returns

undefined | string[]

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:260 (opens in a new tab)


getRev()

getRev(): number

Get revision of the unit's snapshot. Note that revision should start from 1.

Returns

number

Inherited from

DocumentDataModelSimple.getRev

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:67 (opens in a new tab)


getSelfOrHeaderFooterModel()

getSelfOrHeaderFooterModel(segmentId?): DocumentDataModel

Parameters

ParameterType
segmentId?string

Returns

DocumentDataModel

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:286 (opens in a new tab)


getSettings()

getSettings(): undefined | IDocumentSettings

Returns

undefined | IDocumentSettings

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:272 (opens in a new tab)


getSnapshot()

getSnapshot(): IDocumentData

Returns

IDocumentData

Inherited from

DocumentDataModelSimple.getSnapshot

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:109 (opens in a new tab)


getUnitId()

getUnitId(): string

Returns

string

Overrides

DocumentDataModelSimple.getUnitId

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:300 (opens in a new tab)


incrementRev()

incrementRev(): void

Increment the current revision.

Returns

void

Inherited from

DocumentDataModelSimple.incrementRev

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:71 (opens in a new tab)


reset()

reset(snapshot): void

Parameters

ParameterType
snapshotPartial<IDocumentData>

Returns

void

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:277 (opens in a new tab)


resetDrawing()

resetDrawing(drawings, drawingsOrder): void

Parameters

ParameterType
drawingsIDrawings
drawingsOrderstring[]

Returns

void

Inherited from

DocumentDataModelSimple.resetDrawing

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:100 (opens in a new tab)


setName()

setName(name): void

Parameters

ParameterType
namestring

Returns

void

Inherited from

DocumentDataModelSimple.setName

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:79 (opens in a new tab)


setRev()

setRev(rev): void

Set revision of the current snapshot.

Parameters

ParameterType
revnumber

Returns

void

Inherited from

DocumentDataModelSimple.setRev

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:75 (opens in a new tab)


setZoomRatio()

setZoomRatio(zoomRatio): void

Parameters

ParameterTypeDefault value
zoomRationumber1

Returns

void

Inherited from

DocumentDataModelSimple.setZoomRatio

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:214 (opens in a new tab)


sliceBody()

sliceBody(
   startOffset, 
   endOffset, 
type): Nullable<IDocumentBody>

Parameters

ParameterTypeDefault value
startOffsetnumberundefined
endOffsetnumberundefined
typeSliceBodyTypeSliceBodyType.copy

Returns

Nullable<IDocumentBody>

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:321 (opens in a new tab)


updateDocumentDataMargin()

updateDocumentDataMargin(data): void

Parameters

ParameterType
dataIPaddingData

Returns

void

Inherited from

DocumentDataModelSimple.updateDocumentDataMargin

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:151 (opens in a new tab)


updateDocumentDataPageSize()

updateDocumentDataPageSize(width?, height?): void

Parameters

ParameterType
width?number
height?number

Returns

void

Inherited from

DocumentDataModelSimple.updateDocumentDataPageSize

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:172 (opens in a new tab)


updateDocumentId()

updateDocumentId(unitId): void

Parameters

ParameterType
unitIdstring

Returns

void

Overrides

DocumentDataModelSimple.updateDocumentId

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:351 (opens in a new tab)


updateDocumentRenderConfig()

updateDocumentRenderConfig(config): void

Parameters

ParameterType
configIDocumentRenderConfig

Returns

void

Inherited from

DocumentDataModelSimple.updateDocumentRenderConfig

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:127 (opens in a new tab)


updateDocumentStyle()

updateDocumentStyle(config): void

Parameters

ParameterType
configIDocumentStyle

Returns

void

Inherited from

DocumentDataModelSimple.updateDocumentStyle

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:140 (opens in a new tab)


updateDrawing()

updateDrawing(id, config): void

Parameters

ParameterType
idstring
configIDrawingUpdateConfig

Returns

void

Inherited from

DocumentDataModelSimple.updateDrawing

Defined in

submodules/univer/packages/core/src/docs/data-model/document-data-model.ts:196 (opens in a new tab)


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