<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
class UndoState internal constructor(private val state: TextFieldState)
```


Defines an interactable undo history.


## Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
val canUndo: Boolean
```


Whether it is possible to execute a meaningful undo action right now. If this value is false,
calling `undo` would be a no-op.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val canRedo: Boolean
```


Whether it is possible to execute a meaningful redo action right now. If this value is false,
calling `redo` would be a no-op.



## Functions



<h2 id="undo">undo</h2>

```kotlin
fun undo()
```


Reverts the latest edit action or a group of actions that are merged together. Calling it
repeatedly can continue undoing the previous actions.




<hr class="docs-overload-divider">


<h2 id="redo">redo</h2>

```kotlin
fun redo()
```


Re-applies a change that was previously reverted via `undo`.




<hr class="docs-overload-divider">


<h2 id="clearhistory">clearHistory</h2>

```kotlin
fun clearHistory()
```


Clears all undo and redo history up to this point.