Home Reference Source
import WhiteboardHistory from '@quobis/sippojs'
public class | source

WhiteboardHistory

Class that stores the changes made in the whiteboard and allows you to get the shapes that undo the changes introduced in the whiteboard. As long as no new changes are introduced this class also allows to obtain the shapes that reverts the changes made (redo action).

Constructor Summary

Public Constructor
public

Method Summary

Public Methods
public

add(shape: Object)

Add a new shape state to the history.

public

Check if there are items stored in the history that can be used to redo an action.

public

Check if there are items stored in the history can be used to undo an action.

public

clear()

Reset the history.

public

Get a shape that can be used to revert last undo action.

public

Get a shape that can be used to undo last added shape.

Public Constructors

public constructor() source

Public Methods

public add(shape: Object) source

Add a new shape state to the history.

Params:

NameTypeAttributeDescription
shape Object

the new state of the shape.

public canRedo(): boolean source

Check if there are items stored in the history that can be used to redo an action.

Return:

boolean

true if there is at least one item stored in the history.

public canUndo(): boolean source

Check if there are items stored in the history can be used to undo an action.

Return:

boolean

true if there is at least one item stored in the history.

public clear() source

Reset the history.

public redo(): Object source

Get a shape that can be used to revert last undo action.

Return:

Object

shape that reverts last undo action.

public undo(): Object source

Get a shape that can be used to undo last added shape.

Return:

Object

shape that reverts last change.