UNPKG

@aurigma/design-atoms

Version:

Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.

48 lines (47 loc) 2.52 kB
import { ShapeItem, RectangleItem, EllipseItem, ImageItem, BaseTextItem, BaseItem, PlaceholderItem, Item, GroupItem, BarcodeItem, BarcodeFormat, BarcodeSubType, LayoutItem } from "@aurigma/design-atoms-model/Product/Items"; import { Product } from "@aurigma/design-atoms-model/Product"; import { Canvas } from "../Canvas"; import { ProductHandler } from "./ProductHandler"; import { EventManager } from "./EventManager"; export declare class VariableItemHelper { private _productHandler; private _canvas; private _eventManager; maskSymbol: string; constructor(_productHandler: ProductHandler, _canvas: Canvas, _eventManager: EventManager); initVariableItems(product: Product): void; setVariableValues(items: Array<Item>, value: boolean): void; setVariableValue(item: Item, value: boolean, supressUpdate?: boolean): void; getVariableItemDisplayName(name: string): string; private _isCanBeVariable; getRealItemName(item: Item): string; createNewItemName(item: Item, newRealName: string): string; private _setVariableValue; initVariableItem(item: BaseItem): void; static getVariablesFromItems(items: BaseItem[]): IVariable[]; static getVariablesFromLayoutItem(item: LayoutItem): IVariable[]; static getVariablesFromGroupItem(item: GroupItem): IVariable[]; static getVariablesFromShapeItem(item: ShapeItem): IVariable[]; static getVariablesFromEllipseItem(item: EllipseItem): IVariable[]; static getVariablesFromRectangleItem(item: RectangleItem): IVariable[]; static getVariablesFromImageItem(item: ImageItem): IVariable[]; static getVariablesFromPlaceholderItem(item: PlaceholderItem): IVariable[]; static getVariablesFromBarcodeItem(item: BarcodeItem, ignoreIsVariableMarker?: boolean): IBarcodeVariable[]; static getVariablesFromTextItem(item: BaseTextItem): IVariable[]; static getInterpolationVariables(textItem: BaseTextItem): IInterpolationPlaceholderVariable[]; static isInStringPlacehodler(item: Item): boolean; } export interface IVariable { name: string; value: string; type: "Image" | "ImagePlaceholder" | "Text" | "InString" | "BarcodePlaceholder" | "Barcode"; } export interface IBarcodeVariable extends IVariable { type: "BarcodePlaceholder" | "Barcode"; barcodeFormat: BarcodeFormat; barcodeSubType: BarcodeSubType; } export interface IInterpolationPlaceholderVariable extends IVariable { mask: string; values: string[]; }