API Reference
@univerjs
@univerjs/core
classes
Localundoredoservice

@univerjs/core v0.4.2Docs


Class: LocalUndoRedoService

This UndoRedoService is local.

Extends

Implements

Constructors

new LocalUndoRedoService()

new LocalUndoRedoService(
   _univerInstanceService, 
   _commandService, 
   _contextService): LocalUndoRedoService

Parameters

ParameterType
_univerInstanceServiceIUniverInstanceService
_commandServiceICommandService
_contextServiceIContextService

Returns

LocalUndoRedoService

Overrides

Disposable.constructor

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:168 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_commandServicereadonlyICommandServiceundefined-submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:170 (opens in a new tab)
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:93 (opens in a new tab)
_redoStacksreadonlyMap<string, IUndoRedoItem[]>undefined-submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:164 (opens in a new tab)
_undoRedoStatus$readonlyBehaviorSubject<{ redos: number; undos: number; }>undefined-submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:160 (opens in a new tab)
_undoStacksreadonlyMap<string, IUndoRedoItem[]>undefined-submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:163 (opens in a new tab)
_univerInstanceServicereadonlyIUniverInstanceServiceundefined-submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:169 (opens in a new tab)
undoRedoStatus$readonlyObservable<IUndoRedoStatus>undefined-submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:159 (opens in a new tab)

Methods

__tempBatchingUndoRedo()

__tempBatchingUndoRedo(unitId): IDisposable

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

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:271 (opens in a new tab)


_getRedoStack()

_getRedoStack(unitId)

protected _getRedoStack(unitId): null | IUndoRedoItem[]
Parameters
ParameterType
unitIdstring
Returns

null | IUndoRedoItem[]

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:303 (opens in a new tab)

_getRedoStack(unitId, createAsNeeded)

protected _getRedoStack(unitId, createAsNeeded): IUndoRedoItem[]
Parameters
ParameterType
unitIdstring
createAsNeededtrue
Returns

IUndoRedoItem[]

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:304 (opens in a new tab)


_getRedoStackForFocused()

protected _getRedoStackForFocused(): IUndoRedoItem[]

Returns

IUndoRedoItem[]

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:325 (opens in a new tab)


_getUndoStack()

_getUndoStack(unitId)

protected _getUndoStack(unitId): null | IUndoRedoItem[]
Parameters
ParameterType
unitIdstring
Returns

null | IUndoRedoItem[]

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:291 (opens in a new tab)

_getUndoStack(unitId, createAsNeeded)

protected _getUndoStack(unitId, createAsNeeded): IUndoRedoItem[]
Parameters
ParameterType
unitIdstring
createAsNeededtrue
Returns

IUndoRedoItem[]

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:292 (opens in a new tab)


_getUndoStackForFocused()

protected _getUndoStackForFocused(): IUndoRedoItem[]

Returns

IUndoRedoItem[]

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:315 (opens in a new tab)


_updateStatus()

protected _updateStatus(): void

Returns

void

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:280 (opens in a new tab)


clearUndoRedo()

clearUndoRedo(unitID): void

Parameters

ParameterType
unitIDstring

Returns

void

Implementation of

IUndoRedoService.clearUndoRedo

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:217 (opens in a new tab)


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)


pitchTopRedoElement()

pitchTopRedoElement(): Nullable<IUndoRedoItem>

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

Returns

Nullable<IUndoRedoItem>

Implementation of

IUndoRedoService.pitchTopRedoElement

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:236 (opens in a new tab)


pitchTopUndoElement()

pitchTopUndoElement(): Nullable<IUndoRedoItem>

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

Returns

Nullable<IUndoRedoItem>

Implementation of

IUndoRedoService.pitchTopUndoElement

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:231 (opens in a new tab)


popRedoToUndo()

popRedoToUndo(): void

Returns

void

Implementation of

IUndoRedoService.popRedoToUndo

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:261 (opens in a new tab)


popUndoToRedo()

popUndoToRedo(): void

Returns

void

Implementation of

IUndoRedoService.popUndoToRedo

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:251 (opens in a new tab)


pushUndoRedo()

pushUndoRedo(item): void

Parameters

ParameterType
itemIUndoRedoItem

Returns

void

Implementation of

IUndoRedoService.pushUndoRedo

Defined in

submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:184 (opens in a new tab)


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