@univerjs/core v0.4.2 • Docs
Class: abstract
UnitModel<D, T>
The base class for all units.
Extends
Extended by
Type Parameters
Type Parameter | Default type |
---|---|
D | object |
T extends UnitType | UnitType |
Constructors
new UnitModel()
new UnitModel<D, T>(): UnitModel<D, T>
Returns
UnitModel
<D
, T
>
Inherited from
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:93 (opens in a new tab) |
name$ | abstract | Observable <string > | undefined | - | submodules/univer/packages/core/src/common/unit.ts:33 (opens in a new tab) |
type | abstract | T | undefined | - | submodules/univer/packages/core/src/common/unit.ts:29 (opens in a new tab) |
Methods
dispose()
dispose(): void
Returns
void
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:106 (opens in a new tab)
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
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
Parameter | Type |
---|---|
name | string |
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
Parameter | Type |
---|---|
rev | number |
Returns
void
Defined in
submodules/univer/packages/core/src/common/unit.ts:43 (opens in a new tab)