# UndoRedoMethods

Undo/Redo methods returned from useGridUndoRedo.

## Properties

| Property | Type | Description |
| -------- | ---- | ----------- |
| `undo` | <code>() =&gt; <a href="/grid/plugins/undo-redo/types/undoredoaction/">UndoRedoAction</a> &#124; unknown</code> | Undo the last edit action. |
| `redo` | <code>() =&gt; <a href="/grid/plugins/undo-redo/types/undoredoaction/">UndoRedoAction</a> &#124; unknown</code> | Redo the last undone action. |
| `canUndo` | <code>() =&gt; boolean</code> | Check if there are any actions that can be undone. |
| `canRedo` | <code>() =&gt; boolean</code> | Check if there are any actions that can be redone. |
| `clearHistory` | <code>() =&gt; void</code> | Clear all undo/redo history. |
| `getUndoStack` | <code>() =&gt; <a href="/grid/plugins/undo-redo/types/undoredoaction/">UndoRedoAction</a>[]</code> | Get a copy of the current undo stack. |
| `getRedoStack` | <code>() =&gt; <a href="/grid/plugins/undo-redo/types/undoredoaction/">UndoRedoAction</a>[]</code> | Get a copy of the current redo stack. |
| `recordEdit` | <code>(rowIndex: number, field: string, oldValue: unknown, newValue: unknown) =&gt; void</code> | Manually record an edit action. If a transaction is active, the action is buffered; otherwise it's pushed to the undo stack. |
| `beginTransaction` | <code>() =&gt; void</code> | Begin a transaction. All edits recorded until `endTransaction()` are grouped into a single compound action for undo/redo. |
| `endTransaction` | <code>() =&gt; void</code> | End the active transaction and push the compound action to the undo stack. If only one edit was recorded, it's pushed as a plain EditAction. If no edits were recorded, the transaction is discarded. |
