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.

37 lines (36 loc) 1.81 kB
import { IDesignAtomsApiClient } from "../IDesignAtomsApiClient"; import { IListenableColorPreviewService } from "../IColorPreviewService"; import { Service } from "../Service"; import { IViewerConfigurationContext } from "./PreviewCanvas"; import { IPreviewOptions } from "./Interfaces/IPreviewOptions"; import { IProductContext } from "./Interfaces/IProductContext"; import { IColorParser } from "../../Serialization/Color"; export declare class ProductPreviewService { private readonly _productContext; private readonly _designAtomsApiClient; private readonly _colorPreviewService; private readonly _service; private readonly _viewerConfigurationContext; private readonly _colorParser; private _productPreviewRenderer?; constructor(productContext: IProductContext, designAtomsApiClient: IDesignAtomsApiClient, colorPreviewService: IListenableColorPreviewService, service: Service, viewerConfigurationContext: IViewerConfigurationContext, colorParser: IColorParser); private get _productPreviewEnabled(); private get _currentSurfaceIndex(); /** * @param surfaceIndex Index of the surface to preview * @param options Preview rendering options * @returns Blob containing the preview image of given surface */ getSurfacePreview(surfaceIndex: number, options?: IPreviewOptions): Promise<Blob>; /** * @param options Preview rendering options * @returns Blob containing the preview image of the current surface */ getCurrentSurfacePreview(options?: IPreviewOptions): Promise<Blob>; dispose(): void; private _enableProductPreview; private _createPreviewRenderer; private _onCurrentSurfaceChanged; private _getIgnoreContainers; private _getPreviewSizeAndOffset; }