
# Class: SwapSurfacesCommand

Swaps two surfaces (pages) in the product.

Here, we swap the first page of the loaded product with the second page.
```
{
  "type": "design-editor",
  "name": "editor",
  "params": {
    "initial": { ... },
    "swapSurfaces": [{
        "lhsSurfaceIndex": 0,
        "rhsSurfaceIndex": 1,
    }]
  }
}
```

## Hierarchy

* [DesignEditorWidgetCommand](designeditorwidgetcommand.md)

  ↳ **SwapSurfacesCommand**

## Index

### Methods

* [execute](swapsurfacescommand.md#execute)

## Methods

###  execute

▸ **execute**(`params`: [ISwapSurfacesCommandDefinition](../interfaces/iswapsurfacescommanddefinition.md)[] | [ISwapSurfacesCommandDefinition](../interfaces/iswapsurfacescommanddefinition.md)): *Promise‹void›*

*Overrides [DesignEditorWidgetCommand](designeditorwidgetcommand.md).[execute](designeditorwidgetcommand.md#abstract-execute)*

Executes this command.

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`params` | [ISwapSurfacesCommandDefinition](../interfaces/iswapsurfacescommanddefinition.md)[] &#124; [ISwapSurfacesCommandDefinition](../interfaces/iswapsurfacescommanddefinition.md) | Parameters for the command.  |

**Returns:** *Promise‹void›*
