# getUndoRedoDepth

Reads the number of available undo and redo steps.

Canonical: https://grid.syidax.com/docs/methods/getUndoRedoDepth/

<a id="meaning"></a>

## What does this API do?

Reads the number of available undo and redo steps.

<a id="contract"></a>

## Exact input and result types

```typescript
getUndoRedoDepth(): Promise<{ undo: number; redo: number }>
```

| Arguments | Required | Type |
| --- | --- | --- |

The return type is `Promise<{ undo: number; redo: number }>`.

<a id="usage"></a>

## Usage flow

After registering and initializing the Grid element, call grid.getUndoRedoDepth(…). Read the return value with await. For methods returning a boolean or report, inspect the result before continuing.

<a id="recipes"></a>

## Feature explanations and examples

- [Edit history](https://grid.syidax.com/docs/features/undo-redo.md) — Undo or redo recorded editing transactions. One operation may contain multiple cell changes, so cell counts and history counts are not necessarily equal.
