@univerjscoreclassesLocalundoredoservice

@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

ParameterType
_univerInstanceServiceIUniverInstanceService
_commandServiceICommandService
_contextServiceIContextService

Returns

LocalUndoRedoService

Overrides

Disposable.constructor

Defined in

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

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_commandServicereadonlyICommandServiceundefined-packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:170
_disposedprotectedbooleanfalseDisposable._disposedpackages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:93
_redoStacksreadonlyMap<string, IUndoRedoItem[]>undefined-packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:164
_undoRedoStatus$readonlyBehaviorSubject<{ redos: number; undos: number; }>undefined-packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:160
_undoStacksreadonlyMap<string, IUndoRedoItem[]>undefined-packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:163
_univerInstanceServicereadonlyIUniverInstanceServiceundefined-packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:169
undoRedoStatus$readonlyObservable<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

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

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
ParameterType
unitIdstring
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
ParameterType
unitIdstring
createAsNeededtrue
Returns

IUndoRedoItem[]

Defined in

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


_getRedoStackForFocused()

protected _getRedoStackForFocused(): IUndoRedoItem[]

Returns

IUndoRedoItem[]

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
ParameterType
unitIdstring
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
ParameterType
unitIdstring
createAsNeededtrue
Returns

IUndoRedoItem[]

Defined in

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


_getUndoStackForFocused()

protected _getUndoStackForFocused(): IUndoRedoItem[]

Returns

IUndoRedoItem[]

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

ParameterType
unitIDstring

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

Disposable.dispose

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:106


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:96


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

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

Nullable<IUndoRedoItem>

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

Nullable<IUndoRedoItem>

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

ParameterType
itemIUndoRedoItem

Returns

void

Implementation of

IUndoRedoService.pushUndoRedo

Defined in

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