API Reference
@univerjs
@univerjs/core
classes
Unitmodel

@univerjs/core v0.4.2Docs


Class: abstract UnitModel<D, T>

The base class for all units.

Extends

Extended by

Type Parameters

Type ParameterDefault type
Dobject
T extends UnitTypeUnitType

Constructors

new UnitModel()

new UnitModel<D, T>(): UnitModel<D, T>

Returns

UnitModel<D, T>

Inherited from

Disposable.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:93 (opens in a new tab)
name$abstractObservable<string>undefined-submodules/univer/packages/core/src/common/unit.ts:33 (opens in a new tab)
typeabstractTundefined-submodules/univer/packages/core/src/common/unit.ts:29 (opens in a new tab)

Methods

dispose()

dispose(): void

Returns

void

Inherited from

Disposable.dispose

Defined in

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


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.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

Disposable.ensureNotDisposed

Defined in

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


getRev()

abstract getRev(): number

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

Returns

number

Defined in

submodules/univer/packages/core/src/common/unit.ts:39 (opens in a new tab)


getSnapshot()

abstract getSnapshot(): D

Returns

D

Defined in

submodules/univer/packages/core/src/common/unit.ts:36 (opens in a new tab)


getUnitId()

abstract getUnitId(): string

Returns

string

Defined in

submodules/univer/packages/core/src/common/unit.ts:31 (opens in a new tab)


incrementRev()

abstract incrementRev(): void

Increment the current revision.

Returns

void

Defined in

submodules/univer/packages/core/src/common/unit.ts:41 (opens in a new tab)


setName()

abstract setName(name): void

Parameters

ParameterType
namestring

Returns

void

Defined in

submodules/univer/packages/core/src/common/unit.ts:34 (opens in a new tab)


setRev()

abstract setRev(rev): void

Set revision of the current snapshot.

Parameters

ParameterType
revnumber

Returns

void

Defined in

submodules/univer/packages/core/src/common/unit.ts:43 (opens in a new tab)


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