# OpenCommand

## Content

# Class: OpenCommand

Open command.

## Implements

- [`UndoCommandSupport`](../interfaces/UndoCommandSupport)

## Constructors

### Constructor

```ts
new OpenCommand(
   viewer, 
   file, 
   params): OpenCommand;
```

OpenCommand constructor.

#### Parameters

##### viewer

[`ImageViewerAPI`](../interfaces/ImageViewerAPI)

##### file

`string` | `URL` | `Uint8Array`&lt;`ArrayBufferLike`&gt; | `number`[]

##### params

[`OpenParameters`](../type-aliases/OpenParameters)

#### Returns

`OpenCommand`

## Properties

### name

```ts
name: "Open";
```

Optional. The unique name of the command. Used by the undo.skipCommands option setting.

#### Implementation of

[`UndoCommandSupport`](../interfaces/UndoCommandSupport).[`name`](../interfaces/UndoCommandSupport#name)

## Methods

### execute()

```ts
execute(viewer): Promise<void>;
```

Action implementation.

#### Parameters

##### viewer

[`ImageViewerAPI`](../interfaces/ImageViewerAPI)

#### Returns

`Promise`&lt;`void`&gt;

#### Implementation of

[`UndoCommandSupport`](../interfaces/UndoCommandSupport).[`execute`](../interfaces/UndoCommandSupport#execute)

***

### undo()

```ts
undo(viewer): Promise<void>;
```

Undo action implementation.

#### Parameters

##### viewer

[`ImageViewerAPI`](../interfaces/ImageViewerAPI)

#### Returns

`Promise`&lt;`void`&gt;

#### Implementation of

[`UndoCommandSupport`](../interfaces/UndoCommandSupport).[`undo`](../interfaces/UndoCommandSupport#undo)
