# `History`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `configurator-runtime.d.ts` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

Interface · `import type { History } from '@holostep-configurators/runtime-client/contract';` · stable · since 2.0.0 · section 5. Writers, transactions, session

Undo state and grouping. The flags are intent reads of committed history. Not here: [`undo()`](Session.undo.md)
and [`redo()`](Session.redo.md) are session members ([`session.undo()`](Session.undo.md), [`session.redo()`](Session.redo.md)), which these flags
describe.

## Members

| Member | Kind | Summary |
| --- | --- | --- |
| <a id="canundo"></a>[`canUndo`](History.canUndo.md) | property | Committed history only: a pending or queued write doesn't count yet. |
| <a id="canredo"></a>[`canRedo`](History.canRedo.md) | property | True after an undo, until a new undo step or a rebase clears redo. |
| <a id="undolabel"></a>[`undoLabel`](History.undoLabel.md) | property | The label of the step [`undo()`](Session.undo.md) would undo, or null. |
| <a id="redolabel"></a>[`redoLabel`](History.redoLabel.md) | property | The label of the step [`redo()`](Session.redo.md) would redo, or null. |
| <a id="depth"></a>[`depth`](History.depth.md) | property | The number of undo steps above the floor. |
| <a id="group"></a>[`group`](History.group.md) | method | Opens a group (immediate): every write called until `commit()` that makes an undo step (a recorded change, or a labelled look write) is part of one undo step, also one that commits after it (a gesture's last write… |

## Declaration

```ts
export interface History {
  readonly canUndo: boolean;
  readonly canRedo: boolean;
  readonly undoLabel: string | null;
  readonly redoLabel: string | null;
  readonly depth: number;
  group(options?: HistoryGroupOptions): HistoryGroup;
}
```

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `History` names no product |
| 2. A precedent | not recorded: no ledger row (coverage.json) names this member or its owner |
| 3. Two apps, or labs | pass: 22 apps (fleet cross-check: app-04c2774145, app-37356bf09f, app-4762caacdc, app-4f16d2f6da, app-510d750508, app-59c5b5751e, app-b362a81c85, app-b4ae2fce25 and 14 more) |
| 4. The cheaper fix first | not recorded per member (Appendix B decides it per need) |
