export declare type SurfaceTypes = string | IPrintAreaTemplate | ISurfaceDefinition | ISurfaceTemplate | ISurfaceFromState; import { IProductThemeConfig } from "./../Configuration/ConfigurationInterfaces"; import { Editor } from "../Editor"; import { StateId } from "../IframeApi"; import { Product as CCProduct } from "@aurigma/design-atoms/Model/Product/Product"; import { BaseItem as CCBaseItem } from "@aurigma/design-atoms/Model/Product/Items/BaseItem"; import { IVariable } from "@aurigma/design-atoms/Services/VariableItemHelper"; import { PointF } from "@aurigma/design-atoms/Math/PointF"; import { ImageMetaData } from "@aurigma/design-atoms/Model/Product/Items/ImageMetaData"; import { Color } from "@aurigma/design-atoms/Colors/Color"; import { ShapeItem } from "@aurigma/design-atoms/Model/Product/Items/ShapeItem"; export interface IModelComponent { name?: string; } export interface IProductDefinition extends IModelComponent { defaultSafetyLines?: ISafetyLine[]; defaultDesignLocation?: IPointF; defaultCropMarks?: ICropMark[]; surfaces: SurfaceTypes[] | ISurfacesFromFolder | ISurfacesFromMultipageTemplate; } export interface IChannelContainerDefinition { type?: ChannelContainerType; name?: string; translationKey?: string; previewColor?: string; texture?: string; } export declare enum ChannelContainerType { Texture = 0, SpotColor = 1 } export interface IBaseSurfaceDefinition extends IModelComponent { foldingLines?: IFoldingLine[]; spines?: ISpine[]; bgFoldingMode?: IBgFoldingModeParams; proofImage?: IProofImage; } export interface ISurfaceDefinition extends IBaseSurfaceDefinition { width: number; height: number; printAreas?: IPrintAreaDefinition[]; containers?: IChannelContainerDefinition[]; } export interface IMockupTemplate extends IModelComponent { down?: string; up?: string; } export interface ISurfaceTemplate extends IBaseSurfaceDefinition { mockup?: IMockupTemplate; previewMockups?: IMockupTemplate[]; printAreas?: (IPrintAreaTemplate | IPrintAreaDefinition)[]; containers?: IChannelContainerDefinition[]; } export interface IMockupFolders { up?: string; down?: string; } export interface IBaseSurfacesDefinition extends IBaseSurfaceDefinition { names?: string[]; } export interface ISurfacesFromFolder extends IBaseSurfacesDefinition { designFolder?: string; mockupFolder?: IMockupFolders; previewMockupFolder?: string | IMockupFolders; } export interface ISurfacesFromMultipageTemplate extends IBaseSurfacesDefinition { file?: string; pageTemplates?: IPageTemplate[]; hiResOutput?: IHiResOutput; } export interface IPageTemplate extends ISurfaceTemplate { index?: number; location?: PointF; } export interface ISurfaceFromState extends ISurfaceTemplate { stateId: string; surface?: number; location?: PointF; } export interface IBgFoldingModeParams { enabled?: boolean; flip?: { enabled?: boolean; order?: "Even" | "Odd"; }; } export interface IFoldingLine { isVertical?: boolean; margin?: string; bleed?: number; pen?: { width?: number; dashStep?: number; color?: string; altColor?: string; }; } export interface ISpine extends IFoldingLine { width?: number; fillColor?: string; } export interface IBasePrintAreaDefinition extends IModelComponent { safetyLines?: ISafetyLine[]; cropMarks?: ICropMark[]; containers?: IChannelContainerDefinition[]; hiResOutput?: IHiResOutput; } export interface IPrintAreaDefinition extends IBasePrintAreaDefinition { bounds: IRectangleF; } export interface IPrintAreaTemplate extends IBasePrintAreaDefinition { designFile: string; designLocation?: IPointF; } export declare enum PdfBox { Crop = "Crop", Trim = "Trim", Bleed = "Bleed" } export interface ISafetyLine { name?: string; margin?: number | { horizontal: number; vertical: number; } | { left: number; top: number; right: number; bottom: number; }; color?: string; altColor?: string; stepPx?: number; widthPx?: number; borderRadius?: string; pdfBox?: PdfBox; } export declare enum CropMarkTextAlignment { Left = 0, Center = 1, Right = 2 } export interface ICropMarkText { alignment?: CropMarkTextAlignment; fontSize?: number; text: string; } export interface ICropMark { name?: string; margin?: number | { vertical: number; horizontal: number; }; color?: string; widthPx?: number; length?: number | { vertical: number; horizontal: number; }; texts?: ICropMarkText[]; } export interface IProofImage { fileFormat?: string; safetyLinesEnabled?: boolean; cropSafetyLineName?: string; spineAndFoldingLinesEnabled?: boolean; mockupEnabled?: boolean; showStubContent?: boolean; flipMode?: string; rotateMode?: string; interpolationMode?: string; inStringPlaceholderHintsEnabled?: boolean; } export interface IHiResOutput { dpi?: number; fileFormat?: string; colorSpace?: string; backgroundColor?: string; compression?: string; jpegCompressionQuality?: number; flipMode?: string; rotateMode?: string; inStringPlaceholderHintsEnabled?: string; } export interface IMockupData { surface: Surface; mockup?: IMockupTemplate; previewMockups?: IMockupTemplate[]; } export interface IStateSurfaces { stateId: string | StateId; surfaces?: string[]; } export interface IStateSurface { stateId: string | StateId; surface?: string; } export declare class ModelComponent { id: string; name: string; constructor(rawComponent: {}); } export declare class Product extends ModelComponent { private _context; surfaces: Surface[]; currentSurface: Surface; constructor(rawProduct: {}, _context: Editor.IContext); swapSurfaces(lhsSurface: Surface, rhsSurface: Surface): Promise; setSurfaces(surfaces: SurfaceTypes[]): Promise; addSurfaces(surfaces: SurfaceTypes[] | IStateSurfaces, position?: number): Promise; addSurface(surface: SurfaceTypes | IStateSurface, position?: number): Promise; removeSurface(surface: Surface): Promise; switchTo(surface: Surface): Promise; getTags(): Promise; setTags(tags: ITagsDictionary): Promise; setMockups(mockupsData: IMockupData[], options?: { updateRevertData?: boolean; addToHistory?: boolean; updateSurfaceSize?: boolean; resetHistory?: boolean; }): Promise; applyProductTheme(theme: string | IProductThemeConfig): Promise; getAllItems(options?: { includeMockup: boolean; }): Promise; getProductModel(): Promise; setProductModel(product: CCProduct): Promise; getItems(predicate: (item: CCBaseItem, args?: object) => boolean, args?: object): Promise; setItem(item: CCBaseItem): Promise; getItemById(id: string): Promise; getItemByName(name: string): Promise; removeItems(predicate: (item: CCBaseItem, args?: object) => boolean, args?: object): Promise; removeItemById(id: string): Promise; removeItemByName(name: string): Promise; getVariableItems(): Promise; get currentSurfaceIndex(): number; changeBackground(surfaces: Surface[], data: ImageMetaData | Color): Promise; } export interface ISetPrintAreaOptions { updateRevertData?: boolean; preserveUserChanges?: boolean; preserveSafetyLines?: boolean; replaceAll?: boolean; updateSurfaceSize?: boolean; } export declare class Surface extends ModelComponent { private _parentProduct; private _context; width: number; height: number; mockup: SurfaceMockup; previewMockups: SurfaceMockup[]; printAreas: PrintArea[]; containers: Container[]; constructor(rawSurface: {}, _parentProduct: Product, _context: Editor.IContext); setMockup(mockup: IMockupTemplate, previewMockups?: IMockupTemplate[], options?: { updateRevertData?: boolean; }): Promise; changeBackground(data: ImageMetaData | Color): Promise; setPrintAreas(printAreas: (IPrintAreaTemplate | IPrintAreaDefinition)[], options?: ISetPrintAreaOptions): Promise; getContainer(name: string): Container; getContainers(): Container[]; addContainer(containerDefiniton: IChannelContainerDefinition): Promise; insertContainer(containerDefiniton: IChannelContainerDefinition, index: number | string): Promise; removeContainer(index: number): void; moveContainer(initialIndex: number, destinationIndex: number): Container; insertItem(item: CCBaseItem, index?: number, containerIndex?: number): Promise; private get restrictedContainersEnumerationString(); private isIndexOfContainers; private isIndexInRestrictedRange; } export declare class PrintArea extends ModelComponent { private _surface; containers: Container[]; constructor(rawPrintArea: {}, _surface: Surface); getContainer(name: string): Container; getContainers(): Container[]; addContainer(containerDefiniton: IChannelContainerDefinition): Promise; insertContainer(containerDefiniton: IChannelContainerDefinition, index: number | string): Promise; removeContainer(index: number): void; moveContainer(initialIndex: number, destinationIndex: number): Container; } export declare class Container extends ModelComponent implements IChannelContainerDefinition { private _context; static readonly BG_CONTAINER_NAME = "Background"; static readonly MAIN_CONTAINER_NAME = "Main"; static readonly FG_CONTAINER_NAME = "Foreground"; static readonly restrictedContainerNames: string[]; constructor(rawContainer: {} | IChannelContainerDefinition, _context: Editor.IContext); type: ChannelContainerType; translationKey?: string; previewColor?: string; texture?: string; update(params: IChannelContainerDefinition): Promise; } export declare class SurfaceMockup extends ModelComponent { constructor(rawMockup: {}); } export declare class Item extends ModelComponent { tags: { [key: string]: any; }; content: Item; constructor(rawComponent: {}); } export interface IPointF { x: number; y: number; } export interface IRectangleF { x: number; y: number; width: number; height: number; } export interface ISize { width: number; height: number; } export interface ITagsDictionary { [key: string]: any; }