跳转到内容

pivotick v3.0.0


拓展 / 历史 / GraphHistoryLike

接口: GraphHistoryLike ​

定义于:interfaces/History.ts:136

画布所包含和显示的内容的有界的、会话范围的历史记录:带入的内容、取出的内容、隐藏的内容。

达到graph.history。读取并驱动它——条目类型是封闭的,因此用户无法写入其中。每个条目都会对其所接触的特定元素进行命名,这使得密封条目可以在跨度中被跳过,而周围的条目不会乱序。

方法 ​

canRedo() ​

canRedo(): boolean

定义于:interfaces/History.ts:142

返回值 ​

boolean


canUndo() ​

canUndo(): boolean

定义于:interfaces/History.ts:141

返回值 ​

boolean


clear() ​

clear(): void

定义于:interfaces/History.ts:158

忘记一切。画布保持原样。

返回值 ​

void


entries() ​

entries(): HistoryEntry[]

定义于:interfaces/History.ts:138

已完成的操作和可以撤消的操作,最新的在前 — 菜单呈现的顺序。

返回值 ​

HistoryEntry[]


on() ​

on(listener): () => void

定义于:interfaces/History.ts:156

历史的每一个变化都会引发。返回一个处理器。

参数 ​

listener ​

(history) => void

返回值 ​

(): void

返回值 ​

void


preview() ​

preview(throughEntryId, direction?): HistoryPreview

定义于:interfaces/History.ts:154

该跨度会触及什么——驱动悬停突出显示和菜单自己的副本的因素。

参数 ​

throughEntryId ​

string

direction? ​

"undo" | "redo"

返回值 ​

HistoryPreview


redo() ​

redo(throughEntryId?): HistoryEntry[]

定义于:interfaces/History.ts:152

重做返回 throughEntryId 的跨度;默认为最近的一个。

参数 ​

throughEntryId? ​

string

返回值 ​

HistoryEntry[]


redoable() ​

redoable(): HistoryEntry[]

定义于:interfaces/History.ts:140

已撤消且可以重做的内容,最新的优先。任何新行动都会清空。

返回值 ​

HistoryEntry[]


undo() ​

undo(throughEntryId?): HistoryEntry[]

定义于:interfaces/History.ts:150

撤消从最新条目到throughEntryId的跨度;默认情况下仅最新条目。落地为一dataBatchChanged。

参数 ​

throughEntryId? ​

string

返回值 ​

HistoryEntry[]

条目实际上颠倒了,最新的在前——密封的条目被忽略并且不在其中。