@univerjscoreclassesLocalundoredoservice

@univerjs/core v0.5.4


Class: LocalUndoRedoService

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:161

This UndoRedoService is local.

Extends

Extended by

Implements

Constructors

new LocalUndoRedoService()

new LocalUndoRedoService(
   _univerInstanceService, 
   _commandService, 
   _contextService): LocalUndoRedoService

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:171

Parameters

ParameterType
_univerInstanceServiceIUniverInstanceService
_commandServiceICommandService
_contextServiceIContextService

Returns

LocalUndoRedoService

Overrides

Disposable.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_commandServicereadonlyICommandServiceundefined-packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:173
_disposedprotectedbooleanfalseDisposable._disposedpackages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:96
_redoStacksreadonlyMap<string, IUndoRedoItem[]>undefined-packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:167
_undoRedoStatus$readonlyBehaviorSubject<{ redos: number; undos: number; }>undefined-packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:163
_undoStacksreadonlyMap<string, IUndoRedoItem[]>undefined-packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:166
_univerInstanceServicereadonlyIUniverInstanceServiceundefined-packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:172
undoRedoStatus$readonlyObservable<IUndoRedoStatus>undefined-packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:162

Methods

__tempBatchingUndoRedo()

__tempBatchingUndoRedo(unitId): IDisposable

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:274

Batch undo redo elements into a single IUndoRedoItem util the returned IDisposable is called.

Parameters

ParameterType
unitIdstring

Returns

IDisposable

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


_getRedoStack()

Call Signature

protected _getRedoStack(unitId): null | IUndoRedoItem[]

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:306

Parameters
ParameterType
unitIdstring
Returns

null | IUndoRedoItem[]

Call Signature

protected _getRedoStack(unitId, createAsNeeded): IUndoRedoItem[]

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:307

Parameters
ParameterType
unitIdstring
createAsNeededtrue
Returns

IUndoRedoItem[]


_getRedoStackForFocused()

protected _getRedoStackForFocused(): IUndoRedoItem[]

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:328

Returns

IUndoRedoItem[]


_getUndoStack()

Call Signature

protected _getUndoStack(unitId): null | IUndoRedoItem[]

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:294

Parameters
ParameterType
unitIdstring
Returns

null | IUndoRedoItem[]

Call Signature

protected _getUndoStack(unitId, createAsNeeded): IUndoRedoItem[]

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:295

Parameters
ParameterType
unitIdstring
createAsNeededtrue
Returns

IUndoRedoItem[]


_getUndoStackForFocused()

protected _getUndoStackForFocused(): IUndoRedoItem[]

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:318

Returns

IUndoRedoItem[]


_updateStatus()

protected _updateStatus(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:283

Returns

void


clearUndoRedo()

clearUndoRedo(unitID): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:220

Parameters

ParameterType
unitIDstring

Returns

void

Implementation of

IUndoRedoService.clearUndoRedo


dispose()

dispose(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:109

Returns

void

Inherited from

Disposable.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

Disposable.ensureNotDisposed


pitchTopRedoElement()

pitchTopRedoElement(): Nullable<IUndoRedoItem>

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:239

Pitch the top undo element of the currently focused Univer document instance.

Returns

Nullable<IUndoRedoItem>

Implementation of

IUndoRedoService.pitchTopRedoElement


pitchTopUndoElement()

pitchTopUndoElement(): Nullable<IUndoRedoItem>

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:234

Pitch the top redo element of the currently focused Univer document instance.

Returns

Nullable<IUndoRedoItem>

Implementation of

IUndoRedoService.pitchTopUndoElement


popRedoToUndo()

popRedoToUndo(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:264

Returns

void

Implementation of

IUndoRedoService.popRedoToUndo


popUndoToRedo()

popUndoToRedo(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:254

Returns

void

Implementation of

IUndoRedoService.popUndoToRedo


pushUndoRedo()

pushUndoRedo(item): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:187

Parameters

ParameterType
itemIUndoRedoItem

Returns

void

Implementation of

IUndoRedoService.pushUndoRedo