Skip to main content

Class: HistoryMemo

historyMemo is a set of history of memos of tool state. That is, it remembers what has been applied to various images.

Constructors

new HistoryMemo()

new HistoryMemo(label, size): HistoryMemo

Parameters

label: string = 'Tools'

size: number = 50

Returns

HistoryMemo

Defined in

packages/core/src/utilities/historyMemo/index.ts:65

Properties

label

readonly label: any

Defined in

packages/core/src/utilities/historyMemo/index.ts:56

Accessors

size

get size(): number

The number of items that can be stored in the history

set size(newSize): void

Sets the size, clearing all history elements

Parameters

newSize: number

Returns

number

Defined in

packages/core/src/utilities/historyMemo/index.ts:71

Methods

endGroupRecording()

endGroupRecording(): void

Ends a group recording. Must be called after the group action is finished

Returns

void

Defined in

packages/core/src/utilities/historyMemo/index.ts:185


push()

push(item): Memo

Pushes a new memo onto the ring. This will remove all redoable items from the ring if a memo was pushed. Ignores undefined or null items.

Parameters

item: Memo | Memoable

Returns

Memo

Defined in

packages/core/src/utilities/historyMemo/index.ts:211


redo()

redo(items): void

Redoes up to the given number of items, adding them to the top of the ring. If one is a group (array) item it will redo every item inside

Parameters

items: number = 1

Returns

void

Defined in

packages/core/src/utilities/historyMemo/index.ts:141


startGroupRecording()

startGroupRecording(): void

Starts a group recording, so that with a single undo you can undo multiple actions that are related to each other. Requires endGroupRecording to be called after the group action is done.

Returns

void

Defined in

packages/core/src/utilities/historyMemo/index.ts:172


undo()

undo(items): void

Undoes up to the given number of items off the ring. If one is a group (array) item it will undo every item inside

Parameters

items: number = 1

Returns

void

Defined in

packages/core/src/utilities/historyMemo/index.ts:88


undoIf()

undoIf(condition): boolean

Undoes if the condition is met for the current item

Parameters

condition

Function that evaluates if the undo should be performed

Returns

boolean

True if an undo was performed, false otherwise

Defined in

packages/core/src/utilities/historyMemo/index.ts:109