clear() {
        this.undoStack = [];
        this.redoStack = [];
        this.snapshots.clear();
        this.notifyListeners();
    }
Clears all undo and redo history.

@description
This method resets the undo and redo stacks to empty arrays, clears all snapshots,
and notifies listeners of the state change. It effectively resets the entire
undo/redo system to its initial state.

@example
undoRedoManager.clear();
console.log(undoRedoManager.canUndo); // false
console.log(undoRedoManager.canRedo); // false