Documentation - v1.5.3
    Preparing search index...

    UndoManager class for managing undo actions in the application.

    This class provides functionality to manage undo actions, allowing users to revert changes made to the token manager.

    Index

    Constructors

    Accessors

    Methods

    • Add a create undo action to the stack.

      Parameters

      • start: number

        The start index of the block to be deleted.

      Returns void

      This method creates a new delete action and adds it to the undo stack.

    • Add a delete undo action to the stack.

      Parameters

      Returns void

      This method creates a new create action and adds it to the undo stack.

    • Add an overlapping undo action to the stack.

      Parameters

      • overlappingBlocks: TMTokenBlock[]

        An array of token blocks that overlap with the new block.

      • newBlockStart: number

        The start index of the new block that overlaps with existing blocks.

      Returns void

      This method creates a new overlapping action and adds it to the undo stack.

    • Add an update undo action to the stack.

      Parameters

      Returns void

      This method creates a new update action and adds it to the undo stack.

    • Undo the last action in the stack.

      Parameters

      • tokenManager: TokenManager

        The TokenManager instance to apply the undo action to.

      Returns void

      This method pops the last action from the undo stack and executes its callback.

    • Undo all actions in the stack.

      Parameters

      • tokenManager: TokenManager

        The TokenManager instance to apply the undo actions to.

      Returns void

      This method iterates through the undo stack and applies each action's callback, effectively reverting all changes made.