@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
50 lines (32 loc) • 1.23 kB
Markdown
# 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)[] | [ISwapSurfacesCommandDefinition](../interfaces/iswapsurfacescommanddefinition.md) | Parameters for the command. |
**Returns:** *Promise‹void›*