@aurigma/design-editor-iframe
Version:
Using this module you can embed Design Editor (a part of Customer's Canvas) to your page through the IFrame API.
47 lines (46 loc) • 1.78 kB
TypeScript
import { IExternalCommandManager } from "@aurigma/design-atoms/Commands/CommandManager";
import { Client } from "./PostMessage/Client";
import { HistoryUpdateMode } from "@aurigma/design-atoms/Commands/ModelUpdateCommand";
/**
* Performs operations on the product and its design elements.
* @example
* ``` js
* 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);
* ```
* @public
*/
export declare class CommandManager implements IExternalCommandManager {
private _postMessageClient;
/** @internal */
constructor(_postMessageClient: Client);
/**
* Executes the Translate and Resize operations.
* @param name - The name of the operation, for example, `"translateItems"` or `"resize"`.
* @param args - An object defining arguments of the operation. The current implementation supports `IExternalResizeArgs` and `IExternalTranslateItemCommandArgs`.
* @param historyUpdateMode - Defines how the history of user actions should be updated, one of `NotUpdate`, `Update` (by default), or `ForceUpdate`.
* @example
* ``` js
* 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);
* ```
* @public
*/
execute(name: any, args?: any, historyUpdateMode?: HistoryUpdateMode): Promise<any>;
}