Skip to content

Documentation / @geoverse/editor-core / RestoreFeatureVersionCommand

Class: RestoreFeatureVersionCommand ​

Defined in: packages/editor-core/src/commands/restoreFeatureVersion.ts:24

回滚要素到某历史版本(RFC-0006 §六:回滚 = 一次普通编辑)。

内部即 SetGeometry + 可选属性还原:产出含 modified(几何)与/或 propertyChanges 的 ChangeSet,before = 当前态、after = 目标版本态。由此走同一撤销栈 + 乐观锁 (提交携当前版本做 base)+ 三路合并 + 审计——多人协同下回滚不盲目覆盖他人新编辑, 且回滚本身可被再回滚。editor-core 改动极小。

Implements ​

Constructors ​

Constructor ​

ts
new RestoreFeatureVersionCommand(
   targetId, 
   target, 
   targetVersion?, 
   label?): RestoreFeatureVersionCommand;

Defined in: packages/editor-core/src/commands/restoreFeatureVersion.ts:26

Parameters ​

targetId ​

string

target ​

RestoreTarget

targetVersion? ​

number

目标版本号,仅用于默认 label / 审计。

label? ​

string

Returns ​

RestoreFeatureVersionCommand

Properties ​

label ​

ts
readonly label: string;

Defined in: packages/editor-core/src/commands/restoreFeatureVersion.ts:25

Implementation of ​

Command.label

Methods ​

plan() ​

ts
plan(ctx): ChangeSet;

Defined in: packages/editor-core/src/commands/restoreFeatureVersion.ts:38

Parameters ​

ctx ​

EditContext

Returns ​

ChangeSet

Implementation of ​

Command.plan