Class CommandManager
Performs operations on the product and its design elements.
Package: @aurigma/design-editor-iframe
Remarks
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the CommandManager class.
Examples
const ids = (await editor.getSelectedItems()).map(item => item.id);
const args = {
translateX: 108,
translateY: 0,
itemIds: ids
};
// Moves the selected items 1.5 inches horizontally.
editor.commandManager.execute("translateItems", args);
Methods
execute(name, args, historyUpdateMode)
Executes the Translate and Resize operations.
Declaration
execute(name: any, args?: any, historyUpdateMode?: HistoryUpdateMode): Promise<any>;
Parameters
| Type | Name | Description |
|---|---|---|
| any | name |
The name of the operation, for example, |
| any | args |
An object defining arguments of the operation. The current implementation supports |
| HistoryUpdateMode | historyUpdateMode |
Defines how the history of user actions should be updated, one of |
Returns
| Type | Description |
|---|---|
| Promise<any> |
Examples
const ids = (await editor.getSelectedItems()).map(item => item.id);
const args = {
translateX: 108,
translateY: 0,
itemIds: ids
};
// Moves the selected items 1.5 inches horizontally.
editor.commandManager.execute("translateItems", args);