exportState() {
        return {
            undoStack: this.undoStack.map(cmd => cmd.serialize()),
            redoStack: this.redoStack.map(cmd => cmd.serialize()),
            maxStackSize: this.maxStackSize,
            snapshotInterval: this.snapshotInterval,
            compressThreshold: this.compressThreshold,
            mergeWindow: this.mergeWindow
        };
    }
Exports the current state of the undo/redo manager.

@returns {Object} An object representing the serialized state.

@description
This method creates a serializable object containing the current state
of the undo and redo stacks, as well as any relevant configuration.
The returned object can be easily converted to JSON for storage.

@example
const state = undoRedoManager.exportState();
const jsonState = JSON.stringify(state);
// Developer can now save jsonState to file, localStorage, etc.