# SelectionHistory

Class · category: Other

Source: https://github.com/playcanvas/editor-api/blob/4303c34bcee9a418297350899ad3a3f555526ec4/src/selection.ts#L10

Enables undo / redo of selection changes

## Constructors

### constructor

```ts
new SelectionHistory(selection: Selection)
```

Constructor

**Parameters**

- `selection` ([`Selection`](https://api.playcanvas.com/editor/classes/Selection.md))

## Accessors

### enabled

```ts
get enabled(): boolean
set enabled(value: boolean)
```

Gets enabled state of selection undo / redo.

## Methods

### wrapAction

```ts
wrapAction(name: any, fn: () => void): void
```

Record history action after executing function.
The history action will restore the previous selection.

**Parameters**

- `name` (`any`)
- `fn` (`() => void`)
