@univerjs-pro/collaboration-client v0.5.4


Class: CollaborativeUndoRedoService

Defined in: packages/collaboration-client/src/services/undoredo/collaborative-undoredo.service.ts:13

This UndoRedoService is local.

Extends

Implements

  • ICollaborativeUndoRedoService

Constructors

new CollaborativeUndoRedoService()

new CollaborativeUndoRedoService(
   _currentUniverSheet, 
   _commandService, 
   _contextService, 
   _transformService, 
   _logService): CollaborativeUndoRedoService

Defined in: packages/collaboration-client/src/services/undoredo/collaborative-undoredo.service.ts:14

Parameters

ParameterType
_currentUniverSheetIUniverInstanceService
_commandServiceICommandService
_contextServiceIContextService
_transformServiceITransformService
_logServiceILogService

Returns

CollaborativeUndoRedoService

Overrides

LocalUndoRedoService.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_commandServicereadonlyICommandServiceundefinedLocalUndoRedoService._commandServicesubmodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:173
_disposedprotectedbooleanfalseLocalUndoRedoService._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:96
_redoStacksreadonlyMap<string, IUndoRedoItem[]>undefinedLocalUndoRedoService._redoStackssubmodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:167
_undoRedoStatus$readonlyBehaviorSubject<{ redos: number; undos: number; }>undefinedLocalUndoRedoService._undoRedoStatus$submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:163
_undoStacksreadonlyMap<string, IUndoRedoItem[]>undefinedLocalUndoRedoService._undoStackssubmodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:166
_univerInstanceServicereadonlyIUniverInstanceServiceundefinedLocalUndoRedoService._univerInstanceServicesubmodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:172
undoRedoStatus$readonlyObservable<IUndoRedoStatus>undefinedICollaborativeUndoRedoService.undoRedoStatus$ LocalUndoRedoService.undoRedoStatus$submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:162

Methods

__tempBatchingUndoRedo()

__tempBatchingUndoRedo(unitId): IDisposable

Defined in: 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

ICollaborativeUndoRedoService.__tempBatchingUndoRedo

Inherited from

LocalUndoRedoService.__tempBatchingUndoRedo


_getRedoStack()

Call Signature

protected _getRedoStack(unitId): 
  | null
  | IUndoRedoItem[]

Defined in: submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:306

Parameters
ParameterType
unitIdstring
Returns

| null | IUndoRedoItem[]

Inherited from

LocalUndoRedoService._getRedoStack

Call Signature

protected _getRedoStack(unitId, createAsNeeded): IUndoRedoItem[]

Defined in: submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:307

Parameters
ParameterType
unitIdstring
createAsNeededtrue
Returns

IUndoRedoItem[]

Inherited from

LocalUndoRedoService._getRedoStack


_getRedoStackForFocused()

protected _getRedoStackForFocused(): IUndoRedoItem[]

Defined in: submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:328

Returns

IUndoRedoItem[]

Inherited from

LocalUndoRedoService._getRedoStackForFocused


_getUndoStack()

Call Signature

protected _getUndoStack(unitId): 
  | null
  | IUndoRedoItem[]

Defined in: submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:294

Parameters
ParameterType
unitIdstring
Returns

| null | IUndoRedoItem[]

Inherited from

LocalUndoRedoService._getUndoStack

Call Signature

protected _getUndoStack(unitId, createAsNeeded): IUndoRedoItem[]

Defined in: submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:295

Parameters
ParameterType
unitIdstring
createAsNeededtrue
Returns

IUndoRedoItem[]

Inherited from

LocalUndoRedoService._getUndoStack


_getUndoStackForFocused()

protected _getUndoStackForFocused(): IUndoRedoItem[]

Defined in: submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:318

Returns

IUndoRedoItem[]

Inherited from

LocalUndoRedoService._getUndoStackForFocused


_updateStatus()

protected _updateStatus(): void

Defined in: submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:283

Returns

void

Inherited from

LocalUndoRedoService._updateStatus


clearUndoRedo()

clearUndoRedo(unitID): void

Defined in: submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:220

Parameters

ParameterType
unitIDstring

Returns

void

Implementation of

ICollaborativeUndoRedoService.clearUndoRedo

Inherited from

LocalUndoRedoService.clearUndoRedo


dispose()

dispose(): void

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:109

Returns

void

Inherited from

LocalUndoRedoService.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

LocalUndoRedoService.disposeWithMe


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

LocalUndoRedoService.ensureNotDisposed


pitchTopRedoElement()

pitchTopRedoElement(): Nullable<IUndoRedoItem>

Defined in: 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

ICollaborativeUndoRedoService.pitchTopRedoElement

Inherited from

LocalUndoRedoService.pitchTopRedoElement


pitchTopUndoElement()

pitchTopUndoElement(): Nullable<IUndoRedoItem>

Defined in: 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

ICollaborativeUndoRedoService.pitchTopUndoElement

Inherited from

LocalUndoRedoService.pitchTopUndoElement


popRedoToUndo()

popRedoToUndo(): void

Defined in: submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:264

Returns

void

Implementation of

ICollaborativeUndoRedoService.popRedoToUndo

Inherited from

LocalUndoRedoService.popRedoToUndo


popUndoToRedo()

popUndoToRedo(): void

Defined in: submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:254

Returns

void

Implementation of

ICollaborativeUndoRedoService.popUndoToRedo

Inherited from

LocalUndoRedoService.popUndoToRedo


pushUndoRedo()

pushUndoRedo(item): void

Defined in: submodules/univer/packages/core/src/services/undoredo/undoredo.service.ts:187

Parameters

ParameterType
itemIUndoRedoItem

Returns

void

Implementation of

ICollaborativeUndoRedoService.pushUndoRedo

Inherited from

LocalUndoRedoService.pushUndoRedo


transformUndoRedo()

transformUndoRedo(unitID, changesets): void

Defined in: packages/collaboration-client/src/services/undoredo/collaborative-undoredo.service.ts:24

Parameters

ParameterType
unitIDstring
changesetsIChangeset

Returns

void

Implementation of

ICollaborativeUndoRedoService.transformUndoRedo