@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
35 lines (34 loc) • 2.05 kB
TypeScript
import { BaseProductCommand } from "./BaseProductCommand";
import { ImageMetaData, ShapeItem, RectangleItem, PlaceholderItem } from "@aurigma/design-atoms-model/Product/Items";
import { IColorWithTitle } from "@aurigma/design-atoms-model/Product/Interfaces";
import { CommandManager } from "../CommandManager";
import { Product, Surface } from "@aurigma/design-atoms-model/Product";
import { Color } from "@aurigma/design-atoms-model/Colors";
import { IHistoryArgs } from "../ModelUpdateCommand";
import { ProductHandler } from "../../Services/ProductHandler";
import { ProductThemeManager } from "../../Services/ProductTheme/ProductThemeManager";
import { Canvas } from "../../Canvas";
import { EventManager } from "../../Services/EventManager";
export declare class ChangeBackgroundCommand extends BaseProductCommand<IChangeBgArgs, void> {
private _productHandler;
private _commandManager;
private _productThemeManager;
private _canvas;
private _eventManager;
constructor(_productHandler: ProductHandler, historyArgs: IHistoryArgs, product: Product, args: IChangeBgArgs, _commandManager: CommandManager, _productThemeManager: ProductThemeManager, _canvas: Canvas, _eventManager: EventManager);
_executeCommandBody(): Promise<void>;
changeBackground(surfaces: Surface[], type: "image", changeBgItem: (bgItem: PlaceholderItem) => void, value?: Color | IColorWithTitle): any;
changeBackground(surfaces: Surface[], type: "solidColor", changeBgItem: (bgItem: RectangleItem | PlaceholderItem) => Promise<void>, value?: Color | IColorWithTitle): any;
getOrCreateBgItems(surface: Surface, type: "image"): ShapeItem[];
getOrCreateBgItems(surface: Surface, type: "solidColor"): ShapeItem[];
private _addItem;
private _setBgImage;
private _getBgImageRectangle;
private _selectBgRectangleColor;
redo(): Promise<void>;
undo(): Promise<void>;
}
export interface IChangeBgArgs {
surfaces: Surface[];
data: ImageMetaData | Color | IColorWithTitle;
}