@univerjs/core v0.5.0-beta.1 • Docs
Class: LocalUndoRedoService
This UndoRedoService is local.
Extends
Implements
Constructors
new LocalUndoRedoService()
new LocalUndoRedoService(
_univerInstanceService,
_commandService,
_contextService): LocalUndoRedoService
Parameters
Parameter | Type |
---|---|
_univerInstanceService | IUniverInstanceService |
_commandService | ICommandService |
_contextService | IContextService |
Returns
Overrides
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:168
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_commandService | readonly | ICommandService | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:170 |
_disposed | protected | boolean | false | Disposable ._disposed | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:93 |
_redoStacks | readonly | Map <string , IUndoRedoItem []> | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:164 |
_undoRedoStatus$ | readonly | BehaviorSubject <{ redos : number ; undos : number ; }> | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:160 |
_undoStacks | readonly | Map <string , IUndoRedoItem []> | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:163 |
_univerInstanceService | readonly | IUniverInstanceService | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:169 |
undoRedoStatus$ | readonly | Observable <IUndoRedoStatus > | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:159 |
Methods
__tempBatchingUndoRedo()
__tempBatchingUndoRedo(unitId): IDisposable
Batch undo redo elements into a single IUndoRedoItem
util the returned IDisposable
is called.
Parameters
Parameter | Type |
---|---|
unitId | string |
Returns
a disposable to cancel batching undo redo elements
Deprecated
This is a temporary solution. We are going to refactor the undo redo service shortly.
Implementation of
IUndoRedoService
.__tempBatchingUndoRedo
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:271
_getRedoStack()
_getRedoStack(unitId)
protected _getRedoStack(unitId): null | IUndoRedoItem[]
Parameters
Parameter | Type |
---|---|
unitId | string |
Returns
null
| IUndoRedoItem
[]
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:303
_getRedoStack(unitId, createAsNeeded)
protected _getRedoStack(unitId, createAsNeeded): IUndoRedoItem[]
Parameters
Parameter | Type |
---|---|
unitId | string |
createAsNeeded | true |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:304
_getRedoStackForFocused()
protected _getRedoStackForFocused(): IUndoRedoItem[]
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:325
_getUndoStack()
_getUndoStack(unitId)
protected _getUndoStack(unitId): null | IUndoRedoItem[]
Parameters
Parameter | Type |
---|---|
unitId | string |
Returns
null
| IUndoRedoItem
[]
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:291
_getUndoStack(unitId, createAsNeeded)
protected _getUndoStack(unitId, createAsNeeded): IUndoRedoItem[]
Parameters
Parameter | Type |
---|---|
unitId | string |
createAsNeeded | true |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:292
_getUndoStackForFocused()
protected _getUndoStackForFocused(): IUndoRedoItem[]
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:315
_updateStatus()
protected _updateStatus(): void
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:280
clearUndoRedo()
clearUndoRedo(unitID): void
Parameters
Parameter | Type |
---|---|
unitID | string |
Returns
void
Implementation of
IUndoRedoService
.clearUndoRedo
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:217
dispose()
dispose(): void
Returns
void
Inherited from
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:106
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:96
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:100
pitchTopRedoElement()
pitchTopRedoElement(): Nullable<IUndoRedoItem>
Pitch the top undo element of the currently focused Univer document instance.
Returns
Implementation of
IUndoRedoService
.pitchTopRedoElement
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:236
pitchTopUndoElement()
pitchTopUndoElement(): Nullable<IUndoRedoItem>
Pitch the top redo element of the currently focused Univer document instance.
Returns
Implementation of
IUndoRedoService
.pitchTopUndoElement
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:231
popRedoToUndo()
popRedoToUndo(): void
Returns
void
Implementation of
IUndoRedoService
.popRedoToUndo
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:261
popUndoToRedo()
popUndoToRedo(): void
Returns
void
Implementation of
IUndoRedoService
.popUndoToRedo
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:251
pushUndoRedo()
pushUndoRedo(item): void
Parameters
Parameter | Type |
---|---|
item | IUndoRedoItem |
Returns
void
Implementation of
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:184