import { FunctionComponent, ReactNode } from 'preact/compat';
import * as _apollo_client_core from '@apollo/client/core';
import { MutationOptions, FetchResult, ApolloClient } from '@apollo/client/core';
import { RenderableContextService, RenderableContext, ThreeDPreviewService, ModelContainer } from '@spiffcommerce/preview';
import * as lodash from 'lodash';
import { CompleteQuoteMessage, ThemeInstallConfigurationGraphQl, ConversionConfiguration } from '@spiffcommerce/theme-bridge';
export { ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation } from '@spiffcommerce/theme-bridge';
import { FuseResult } from 'fuse.js';
import { Font } from 'opentype.js';

/**
 * A renderable scene is a scene that can be displayed to the user. This is based on the workflow state.
 */
interface RenderableScene {
    /**
     * The id of the scene.
     */
    id: string;
    /**
     * The title of the scene.
     */
    title: string;
    /**
     * The id of each step inside the scene that can be rendered. This is based on the workflow state.
     */
    renderableSteps: string[];
    /**
     * The WorkflowScene representation of this object. Provided for backwards compatibility.
     * @deprecated
     */
    workflowScene: WorkflowScene;
}
/**
 * Information parsed froma workflow structure that is relevant
 * to a given scene.
 */
interface WorkflowScene {
    /**
     * A unique identifier for the scene.
     */
    name: string;
    /**
     * A human-readable title for the scene.
     */
    title: string;
    /**
     * Steps which can display to the user.
     * But may be conditionally hidden based on workflow logic
     */
    renderableSteps: Step<AnyStepData>[];
    /**
     * Steps which don't display to the user.
     * Their behavior is always silent & executed in the background.
     * @deprecated Silent steps are no longer handled seperately from normal steps.
     */
    silentSteps: Step<AnyStepData>[];
}

/**
 * A queue promise is a container for a promise that can be
 * executed at a later time.
 */
declare abstract class QueueablePromise {
    readonly timestamp: number;
    abstract execute(): Promise<any>;
}
/**
 * A promise queue contains any number of QueuePromise objects. These objects are stored within a PromiseQueue and executed
 * as quickly as possible in order. This is ideal in situations where a specific operation should be
 * applied in an ordered way while still making.
 */
declare class PromiseQueue<T extends QueueablePromise> {
    private queue;
    private activePromise?;
    private queueMaxSize;
    private isEnabled;
    /**
     * Constructs a new promise queue.
     * @param queueMaxSize An optional maximum size, when the max size is hit.
     *                     The older promises will be discarded.
     * @param enabled When false, the queue will not process any jobs. Assign `enabled` to true to start processing.
     */
    constructor(queueMaxSize?: number, enabled?: boolean);
    /**
     * Enqueue a new promise.
     * @param promise A new promise to add to the queue.
     */
    enqueue(promise: T): void;
    get enabled(): boolean;
    /**
     * Enable or disable the queue. When disabled, the queue will not process any jobs.
     * Disabling processing will not cancel any active promises.
     */
    set enabled(value: boolean);
    /**
     * @returns Returns true when work is being actively processed by this queue.
     */
    hasActivePromise(): boolean;
    /**
     * @returns The number of unexecuted jobs remaining in the queue. Not including the active job.
     */
    getRemainingQueueSize(): number;
    /**
     * Finalize the queue, any jobs that come in while this is in progress will result
     * in the promise being extended.
     */
    finalize(): Promise<void>;
    /**
     * Once called will recursively resolve the jobs in the
     * queue until no more are available.
     */
    private dequeue;
}

/**
 * Bounds the offsets for an image to the box, preventing
 * the user from moving the image in a way that wouldn't be intended.
 * @param newOffsets The new intended offsets for the image.
 * @param frameData The current frame information
 * @param borderWidth The width of the border added by the cropper.
 * @param mustCover When true the image sgould be bounded in such a way that it covers the entire frame at all times.
 */
declare function getBoundedOffsets(newOffsets: FrameOffsets, frameData: FrameData, imageData: PatternImageData, mustCover?: boolean): FrameOffsets;
declare class FrameService {
    private offsets;
    private thresholdSettings;
    private forceImageCover?;
    private initialZoom?;
    private targetElements;
    private imageData?;
    private frameData?;
    private readonly _debouncedUpdateFrameOffsets;
    /**
     * The calculated minimum zoom value, per frame.
     */
    minZoomScale: number[];
    /**
     * The calculated maximum zoom value. Note: This is calculated based on the first frame.
     */
    maxZoomScale: number[];
    private onFrameDataChangeListeners;
    private onZoomChangeListeners;
    private workflowManager?;
    private stepName?;
    constructor(forceImageCover?: boolean, initialZoom?: number);
    /**
     * When we want to connect a workflow manager to the state of the image cropper we
     * can pass it to this function. Inside we'll attach any required event listeners.
     * @param workflowManager The workflow manager to attach.
     * @param stepName The specific step we want to attach to within the manager.
     */
    connectWorkflowManager(workflowManager: WorkflowManager, stepName?: string): void;
    /**
     * Sets the elements that should be update when changes are made to
     * the cropper that owns this service.
     * @param targetElements A list of element Ids to track
     */
    setTargetElements(targetElements: string[]): void;
    /**
     * Gets the current calculated frame data
     * @returns A FrameData object or undefined if no frame has been set.
     */
    getFrameData(): FrameData[] | undefined;
    /**
     * Sets the current frame data. Note:
     * @param paths The paths to lookup in our frame data cache.
     */
    setFrameData(paths: string[] | undefined): void;
    /**
     * Gets the currently set image of the frame..
     * @returns A PatternImageData object, or undefined if no image is set.
     */
    getImageData(): PatternImageData | undefined;
    /**
     * Helper function to get the src of the image of the frame, since it can be an svg with modified colors.
     * @returns A url (a data url if svg), or undefined if no image is set.
     */
    getImageSrc(): string | undefined;
    /**
     * Gets the current calculated offsets of the pattern within the frame.
     * @returns A FrameOffsets object or undefined if no offsets are defined.
     */
    getOffsets(): FrameOffsets[] | undefined;
    /**
     * Updates the frame offsets explicitly.
     */
    setOffsets(offsets: FrameOffsets[]): void;
    /**
     * Sets the zoom of the cropper that owns this service.
     * @param zoom The new zoom value, per frame.
     * @param cX The center of zoom on x axis, per frame.
     * @param cY The center of zoom on Y axis, per frame.
     * @param onComplete A function to call when zoom changes have been completed
     */
    setZoom(zoom: number[], cX: number[], cY: number[], onComplete?: () => void): void;
    /**
     * Sets the image currently contained by this frame.
     * @param value The new image as an ImageData property
     * @param [recalculateOffsets=true] Optional: Enable/disable re-calculating of frame offsets. Default: `true`.
     * Note: Will always calculate when offsets have not been calculated.
     */
    setPatternData(value: PatternImageData, recalculateOffsets?: boolean): void;
    /**
     * Modify the offsets of the frame.
     * @param value The new FrameOffsets objects.
     * @param onComplete A callback, called when the modification is complete
     * @param forceUpdate When true the offsets will be updated even if they haven't changed.
     */
    updateOffsets(value: FrameOffsets[], onComplete?: () => void, forceUpdate?: boolean): void;
    getThresholdSettings(): FrameThresholdSettings;
    setThresholdSettings(settings: FrameThresholdSettings): void;
    onFrameDataChanged(newListener: (frameData: FrameData[] | undefined) => void): void;
    /**
     * Append a new listener to zoom events on this frame.
     * @param newListener
     */
    onZoom(newListener: (zoomValue: number[]) => void): void;
    /**
     * Updates the offsets of the frame
     * @param newOffsets New offset object
     * @param imageData The image data
     * @param frameData The frame data
     * @param targetElements A list of elements that need updating, by ID
     * @param onComplete A callback when the operation is completed.
     */
    private updateFrameOffsets;
    /**
     * Determines limitations of zoom based on relative size of image and frame.
     * @param imageData The image to include in calculations
     * @param frameData The frame to include in calculations.
     */
    private recalculateZoomLimits;
    private recalculateOffsets;
}

declare class Poller {
    private pollingId;
    private attempts;
    private readonly interval;
    private readonly maxAttempts;
    private readonly predicate;
    private readonly onSuccess;
    private readonly onFailure;
    private poll;
    /**
     * Constructs a new polling service.
     * @param predicate An async function that returns true when polling has returned a successful result.
     * @param onSuccess The callback to be called when polling has returned a successful result.
     * @param onFailure The callback to be called when polling has returned a failed result.
     * @param interval The number of milliseconds to wait between each poll.
     * @param maxAttempts The maximum amount of times to check the condition.
     */
    constructor(predicate: () => Promise<boolean>, onSuccess: () => void, onFailure: () => void, interval?: number, maxAttempts?: number);
}

declare abstract class ModuleProduct {
    /**
     * Name used by class. Usually product or brand name.
     */
    abstract moduleName: string;
    /**
     * SVG with styled path positioned on a background image. To be displayed to user.
     */
    abstract svgPreview(text: string, region: Region): string;
    /**
     * SVG with styled path positioned on a background image. To be submitted for print.
     */
    abstract svgPrint(text: string, region: Region): string;
}

interface DesignInputStep {
    data: DesignInputStepData;
    name: string;
}
interface DesignInputStepData {
}

interface SVGLayoutProps {
    configuration: RenderingConfiguration;
    preserveAspectRatio?: string;
    outlineArea?: {
        x?: number;
        y?: number;
        width?: number;
        height?: number;
        scale?: number;
        hidden?: boolean;
    };
    viewBox?: {
        x: number;
        y: number;
        width: number;
        height: number;
    };
    width: number | string;
    height: number | string;
    position?: string;
    maxWidth?: string;
    maxHeight?: string;
    elements: LayoutElement[];
    backgroundColor?: string;
    outlineColor?: string;
    omitBoundClipping?: boolean;
    borderRadius?: number;
}

/**
 * An abstract base class from which to extend all potential element commands. These commands
 * follow the command design pattern in software development. To learn more about this pattern
 * take a look at the following link.
 *
 * https://sourcemaking.com/design_patterns/command
 *
 */
declare abstract class CanvasCommand {
    abstract apply(state: LayoutsState): LayoutsState;
    protected oldState?: LayoutsState;
    undo(): LayoutsState;
    overrideOldState(state: LayoutsState): void;
    sequenceId?: string;
}
/**
 * Shifts an element with given ID from its current position to a new position.
 */
declare class MoveCommand extends CanvasCommand {
    private id;
    private x;
    private y;
    constructor(id: string, x: number, y: number);
    apply(state: LayoutsState): {
        layouts: {
            [x: string]: LayoutState;
        };
        serializableWorkflow: SerializableWorkflow;
    };
}
/**
 * Rotates an element to a given angle in degrees.
 */
declare class RotateCommand extends CanvasCommand {
    private id;
    private angle;
    constructor(id: string, angle: number);
    apply(state: LayoutsState): {
        layouts: {
            [x: string]: LayoutState;
        };
        serializableWorkflow: SerializableWorkflow;
    };
}
/**
 * Updates the width and height of an element to reflect a new size. Negative values will be
 * converted to their absolute value. ie. -10 will become 10.
 */
declare class ResizeCommand extends CanvasCommand {
    private id;
    private width;
    private height;
    constructor(id: string, width: number, height: number);
    apply(state: LayoutsState): {
        layouts: {
            [x: string]: LayoutState;
        };
        serializableWorkflow: SerializableWorkflow;
    };
}
/**
 * Applys a list of command objects to the current state, the final state
 * will be that of all commands applied in the order of left to right.
 */
declare class GroupCommand extends CanvasCommand {
    private commands;
    constructor(commands: CanvasCommand[]);
    apply(state: LayoutsState): LayoutsState;
}
declare class CreateLayoutCommand extends CanvasCommand {
    private layout;
    constructor(layout: ILayout);
    apply(state: LayoutsState): LayoutsState;
}
/**
 * Add an element to the canvas
 */
declare class CreateElementCommand<T extends LayoutElement> extends CanvasCommand {
    private element;
    private layout;
    /**
     * @param initialParams The initial parameters to be set on this new object
     * @param callback An optional callback function to be notified when the object has been instantiated
     * @param layout
     */
    constructor(element: T, layout: ILayout);
    apply(state: LayoutsState): {
        layouts: {
            [x: string]: LayoutState | {
                elements: LayoutElement[];
                modificationID: string;
                layout: ILayout;
            };
        };
        serializableWorkflow: SerializableWorkflow;
    };
    private assignIndex;
}
/**
 * Delete an element on the canvas
 */
declare class DeleteElementCommand extends CanvasCommand {
    private id;
    constructor(id: string);
    apply(state: LayoutsState): {
        layouts: {
            [key: string]: LayoutState;
        };
        serializableWorkflow: SerializableWorkflow;
    };
}
declare class FontColorCommand extends CanvasCommand {
    private id;
    private color;
    private textFillSpotColor?;
    constructor(id: string, color: string, textFillSpotColor?: TextFillSpotColor$1);
    apply(state: LayoutsState): {
        layouts: {
            [x: string]: LayoutState;
        };
        serializableWorkflow: SerializableWorkflow;
    };
}
declare class FontSizeCommand extends CanvasCommand {
    private id;
    private size;
    constructor(id: string, size: number);
    apply(state: LayoutsState): {
        layouts: {
            [x: string]: LayoutState;
        };
        serializableWorkflow: SerializableWorkflow;
    };
}
declare class FontSourceCommand extends CanvasCommand {
    private id;
    private fontData;
    constructor(id: string, fontData: FontData);
    apply(state: LayoutsState): {
        layouts: {
            [x: string]: LayoutState;
        };
        serializableWorkflow: SerializableWorkflow;
    };
}
declare class FontAlignmentCommand extends CanvasCommand {
    private id;
    private align;
    constructor(id: string, align: "left" | "center" | "right");
    apply(state: LayoutsState): {
        layouts: {
            [x: string]: LayoutState;
        };
        serializableWorkflow: SerializableWorkflow;
    };
}
declare class UpdateImageSourceCommand extends CanvasCommand {
    private id;
    private src;
    constructor(id: string, src: string);
    apply(state: LayoutsState): LayoutsState;
}
/**
 * TextChange will modify the text displayed in a text box
 */
declare class TextChangeCommand extends CanvasCommand {
    private id;
    private text;
    constructor(id: string, text: string);
    apply(state: LayoutsState): {
        layouts: {
            [x: string]: LayoutState;
        };
        serializableWorkflow: SerializableWorkflow;
    };
}
declare class BringToFrontCommand extends CanvasCommand {
    private id;
    /**
     * @param id The targeted element to bring to the front.
     */
    constructor(id: string);
    apply(state: LayoutsState): {
        layouts: {
            [x: string]: LayoutState | {
                elements: LayoutElement[];
                modificationID: string;
                layout: ILayout;
            };
        };
        serializableWorkflow: SerializableWorkflow;
    };
}
declare class BringToBackCommand extends CanvasCommand {
    private id;
    /**
     * @param id The targeted element to bring to the back.
     */
    constructor(id: string);
    apply(state: LayoutsState): {
        layouts: {
            [x: string]: LayoutState | {
                elements: LayoutElement[];
                modificationID: string;
                layout: ILayout;
            };
        };
        serializableWorkflow: SerializableWorkflow;
    };
}
/**
 * Bring an element forward by one layer. Does nothing if the element is already at the front.
 */
declare class BringForwardCommand extends CanvasCommand {
    private id;
    /**
     * @param id The targeted element to bring to the front.
     */
    constructor(id: string);
    apply(state: LayoutsState): {
        layouts: {
            [x: string]: LayoutState | {
                elements: LayoutElement[];
                modificationID: string;
                layout: ILayout;
            };
        };
        serializableWorkflow: SerializableWorkflow;
    };
}
/**
 * Send an element backwards by one layer. Does nothing if the element is already at the back.
 */
declare class SendBackwardsCommand extends CanvasCommand {
    private id;
    /**
     * @param id The targeted element to bring to the front.
     */
    constructor(id: string);
    apply(state: LayoutsState): {
        layouts: {
            [x: string]: LayoutState | {
                elements: LayoutElement[];
                modificationID: string;
                layout: ILayout;
            };
        };
        serializableWorkflow: SerializableWorkflow;
    };
}

interface CommandState {
    transaction: LayoutsState;
}
interface LayoutComponentConfiguration {
    renderingConfiguration: RenderingConfiguration;
    outlineArea?: {
        x?: number;
        y?: number;
        width?: number;
        height?: number;
        scale?: number;
        hidden?: boolean;
    };
    viewBox?: {
        x: number;
        y: number;
        width: number;
        height: number;
    };
    maxHeight?: string;
    maxWidth?: string;
    height?: string | number;
    width?: string | number;
    position?: string;
    borderRadius?: number;
    outlineColor?: string;
    backgroundColor?: string;
}
declare class CommandContext {
    private state;
    private stateCallbacks;
    private id;
    private prevCommands;
    private nextCommands;
    constructor();
    registerStateCallback(callback: () => void): void;
    unregisterStateCallback(callback: () => void): void;
    getState(): CommandState | undefined;
    private runStateCallbacks;
    apply(command: CanvasCommand, leaveOffUndoStack?: boolean): void;
    undo(): void;
    redo(): void;
    /**
     * Find all commands in history with the given sequence ID,
     * discard all but the last and overwrite its oldState.
     */
    flattenSequence(sequenceId: string, initialState: LayoutsState): void;
    getLayoutById(layoutId: string): LayoutData;
    getAllLayouts(): LayoutData[];
    private getLayoutDataWithState;
    initialize(layouts: ILayout[], reloadedState?: LayoutsState): void;
    private commandReducer;
}
declare const getSvgElement: (layout: ILayout, elements: LayoutElement[], configuration: LayoutComponentConfiguration) => PapyrusNode;
interface LayoutData {
    layoutState: LayoutState;
    Component: PapyrusComponent<SVGLayoutProps>;
    getComponentWithProps: (configuration: LayoutComponentConfiguration) => PapyrusComponent<SVGLayoutProps>;
}

declare class LayoutPreviewService implements RenderableContextService {
    private readonly layouts;
    private handleCompleteRender;
    constructor(layouts: ILayout[]);
    setCompleteRenderCallback(handleCompleteRender: (layouts: LayoutPreviewBridge[]) => void): void;
    onCompleteRender(): void;
    getAll(): ReadonlyMap<string, LayoutPreviewBridge>;
}
/**
 * The panel canvas class that stores both the main rendering canvas as well as rendering context
 * for a rendering context
 */
declare class LayoutPreviewBridge implements RenderableContext {
    hasSetStaticContext: boolean;
    private readonly id;
    private readonly name;
    private readonly panelSize;
    private service;
    private interactiveDirty;
    private textureCtx?;
    private staticCtxDirty;
    private lastRequestedRenderArguments;
    private lastCompletedStaticRender;
    private renderQueue;
    constructor(id: string, name: string, service: LayoutPreviewService, panelSize: {
        width: number;
        height: number;
    });
    getID(): string;
    getName(): string;
    getPanelSize(): {
        width: number;
        height: number;
    };
    getStaticContext(): CanvasRenderingContext2D | undefined;
    /**
     * Register canvas to be rendered to.
     */
    setStaticContext(ctx: CanvasRenderingContext2D): void;
    getStaticContextDirty(): boolean;
    setStaticContextDirty(dirty: boolean): void;
    getInteractiveCanvasDirty(): boolean;
    setInteractiveCanvasDirty(dirty: boolean): void;
    markLastCompletedStaticRender(): void;
    /**
     * Returns a timestamp for the last time that this canvas rendered to its dynamic texture in the
     * form of Date.now(). If this panel has never rendered undefined will be returned.
     */
    getLastCompletedStaticRender(): number | undefined;
    /**
     * Actions to perform when a static render event is fired for this canvas.
     */
    render(layouts: LayoutData[]): Promise<void>;
}
interface StepAspectValue {
    stepName: string;
    stepAspectType: string;
    value?: string;
}
declare const stepAspectValuesToDesignInputSteps: (stepAspectValues: StepAspectValue[], workflow: Workflow) => DesignInputStep[];
declare const generateStateFromDesignInputSteps: (designInputSteps: DesignInputStep[], workflow: Workflow, layouts: ILayout[], productOverlayImageUrl?: string) => Promise<LayoutsState>;

/**
 * An asset manager provides a way to create and
 * manage assets on the Spiff Commerce Platform.
 */
interface AssetManager {
    /**
     * Uploads a file to the Spiff Commerce Platform.
     */
    uploadFile: (file: File, onProgress: (val: number) => void) => Promise<Asset>;
    /**
     * From an existing asset, generates a new asset that has the background replaced with transparency.
     * This process is idempotent, i.e. it will only run once for a given asset.
     * @param asset The existing asset to remove the background from.
     * @returns A promise that resolves with a new asset.
     */
    removeBackgroundFromAsset(asset: Asset): Promise<Asset>;
}
declare class AssetService implements AssetManager {
    private cache;
    /**
     * Promise cache for BG removal processes. Values only present while process is active.
     * Use BGRMStorage and the regular asset promise cache to cache the actual objects.
     */
    private bgrmProcessCache;
    private materialCache;
    /**
     * Allows for retrieving an asset, returns the option from a cache if possible.
     */
    getLocalOrFromServer(assetKey: string): Promise<Asset>;
    /**
     * Retrieves the asset from the server, bypassing cache (but still writing the result to cache)
     */
    getFromServer(assetKey: string): Promise<Asset>;
    keyFromURL(url: string): string | undefined;
    /**
     * Caches an asset if it doesn't already exist.
     */
    cacheAsset(asset: Asset): void;
    /**
     * Caches a material if it doesn't already exist.
     */
    cacheMaterial(material: MaterialResource): void;
    /**
     * Allows for retrieving a material, returns the option from a cache if possible.
     * @param id The option ID to be retrieved.
     */
    getMaterialLocalOrFromServer(id: string): Promise<MaterialResource>;
    /**
     * Upload a user asset to the server. Using callbacks to notify important events.
     * The asset will be stored via the persistence service for future access, if available.
     */
    uploadAssetWithProgress(file: FileInfo, assetType: AssetType, onProgress: (val: number) => void, anonymous?: boolean, temporary?: boolean): Promise<Asset>;
    uploadAsset(file: FileInfo, assetType: AssetType, anonymous?: boolean, temporary?: boolean): Promise<Asset>;
    uploadFile(file: File, onProgress: (val: number) => void): Promise<Asset>;
    removeBackgroundFromAsset(asset: Asset): Promise<Asset>;
    removePersistedAsset(assetKey: string): void;
    getPersistedAssets(): PersistedAsset[];
    registerPersistedAssetListener(callback: () => void): void;
    unRegisterPersistedAssetListener(callback: () => void): void;
    /**
     * Convert a File object for an image into a FileInfo.
     */
    loadImageAsFileInfo: (file: File) => Promise<FileInfo>;
    private isRaster;
    private postProcessFileUpload;
    /**
     * Handles mimeType resolution & asset creation request
     * @param file A file info object containing data about the file and its name
     * @param assetType The type of asset we're expecting to upload
     */
    private dispatchCreateAssetRequest;
    private guessMIME;
}
interface PersistedAsset {
    assetKey: string;
    src: string;
}
declare const assetService: AssetService;

/**
 * A wrapping component that provides a simple interface for interacting with a variant.
 */
declare class Variant {
    private readonly variantData;
    constructor(variant: VariantResource);
    getType(): AssetType | undefined;
    /**
     * @returns The unique identifier for the variant.
     */
    getId(): string;
    /**
     * @returns The configured name of the variant. Generally a human readable value.
     */
    getName(): string;
    /**
     * @returns The price modifier for this variant. This is the amount that will be added to the base price of the product.
     */
    getPriceFormatted(locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions | undefined): string;
    /**
     * @returns The price modifier for this variant. This is the amount that will be added to the base price of the product.
     *          Presented in subunits of the currency of the option. For example, if the option is configured to use USD, the price modifier will be in cents.
     */
    getPrice(): number;
    /**
     * @returns The URL for the base asset resource configured on this variant
     */
    getAsset(): string | undefined;
    /**
     * @returns The URL for the base asset resource configured on this variant
     */
    getAssetResource(): Asset | undefined;
    /**
     * @returns The URL for a thumbnail resource configured on this variant.
     */
    getThumbnail(): string | undefined;
    /**
     * @returns When this variant is configured to have a color, this will return the hex value for that color.
     */
    getColor(): string | undefined;
    /**
     * @returns True when the variant is the default for its containing option. False otherwise.
     */
    isDefault(): boolean;
    /**
     * @returns The underlying variant resource. Generally not needed but made available just incase.
     */
    getResource(): VariantResource;
    /**
     * @returns True when the variant is enabled. False otherwise.
     */
    isEnabled(): boolean;
}

/**
 * Steps that support custom color variants should implement the following interface to
 * add the behavior in the way that makes sense to the step.
 */
interface CustomColorSupport {
    /**
     * Allows for setting a custom color when the custom variant is selected. Will
     * throw when a non-custom variant is selected.
     */
    setCustomColor(color: string): any;
    /**
     * Get the custom color that is currently set on the step.
     */
    getCustomColor(): string;
}
/**
 * A StepHandle allows for managing the state of a specific step in a workflow. This class
 * abstracts away the complexities of dealing with a step directly and allows for using high level
 * concepts instead of dealing with the underlying data structures.
 */
declare abstract class StepHandle<T extends AnyStepData> {
    /**
     * Stores whether or not the step is currently updating.
     */
    private static readonly updateState;
    /**
     * Access to the workflow manager this step is contained by.
     */
    protected readonly manager: WorkflowManager;
    /**
     * The step metadata, useful for determining logic based on configuration.
     */
    protected readonly step: Step<T>;
    /**
     * The tags set against this step.
     */
    protected readonly tags: string[];
    constructor(manager: WorkflowManager, step: Step<T>, tags: string[]);
    /**
     * Set the current update state of this step. All step handles pointing to this step will
     * see this value.
     * @param value The new value
     */
    protected setUpdateState(value: boolean): void;
    /**
     * @returns Gets the current update state of this step. All step handles for this step will see this value.
     */
    protected getUpdateState(): boolean;
    /**
     * Gets the currently selected variant, or undefined if no variant is selected.
     */
    getCurrentVariant(): Variant | undefined;
    /**
     * @returns A list of valid variants for this step. Does not include disabled variants.
     */
    getAvailableVariants(): Variant[];
    /**
     * @returns A list of all variants for this step, including disabled ones.
     */
    getAllVariants(): Variant[];
    /**
     * Most step types have a base option type that variants can be selected for.
     * Selects a specific variant for this step. This will execute all required changes to
     * the design and update the metadata to include the new selection. Any conditions
     * that would be triggered will also be executed.
     */
    abstract selectVariant(variant: Variant): Promise<void>;
    /**
     * @returns A unique identifier for this step within the workflow.
     */
    getId(): string;
    /**
     * @returns The name of the step
     */
    getName(): string;
    /**
     * @returns A message that can accompany the step name in UI components. Used to describe the purpose of the step in more detail.
     */
    getHelpText(): string | undefined;
    /**
     * @returns The type of the step handle.
     */
    getType(): StepType;
    /**
     * @returns The underlying data for this step. Favor using the step handle methods instead of this.
     */
    getRaw(): Step<T>;
    /**
     * @returns Returns all of the tags that are present on this step.
     */
    getTags(): string[];
    /**
     * @param tag The tag to check for.
     * @returns True if the step has the specified tag, false otherwise.
     */
    hasTag(tag: string): boolean;
    /**
     * @returns True if the step is required to be filled by the customer. False otherwise.
     */
    getMandatory(): boolean;
    /**
     * @param type The AspectType to fetch the value for.
     * @returns A boolean indicating whether this step should override Global Properties.
     * Only relevant when the Workflow Experience is associated with a Bundle that is using Global Properties,
     * and when this step is associated with one or more Global Property Aspects.
     */
    getOverrideGlobalPropertyConfiguration(type: AspectType): boolean;
    /**
     * Sets whether or not this step should override Global Properties.
     * Only relevant when the Workflow Experience is associated with a Bundle that is using Global Properties,
     * and when this step is associated with one or more Global Property Aspects.
     * @param type The AspectType to override.
     */
    setOverrideGlobalPropertyConfiguration(type: AspectType, value: boolean): void;
    /**
     * Retrieves the identifiers of all of the configured aspects for the specified Global Property Configuration.
     * @param configurationId The ID of the Global Property Configuration. You can usually find this with `bundle.getGlobalPropertyConfiguration()?.id`
     * @returns An array of strings matching the keys of all the Global Property Aspects in the Configuration that this step is configured to use.
     */
    getGlobalPropertyAspects(configurationId: string): string[];
    /**
     * Fires any configured animations on the 3D preview for this step.
     * This includes camera & model animations. If the preview is unavailable
     * this function will do nothing.
     */
    executeAnimations(immediate?: boolean): void;
}

declare const createDesign: (workflowManager: WorkflowManager, workflow: Workflow, layouts: ILayout[], getReducerState: () => CommandState, product: Product, transaction: Transaction, workflowSelections: WorkflowSelections, designName: string, onProgressUpdate: DesignCreationProgressUpdate, createPreviewImage: (shouldRender3D?: boolean, transactionId?: string) => Promise<string | undefined>, workflowMetadata?: WorkflowMetadata) => Promise<DesignCreationMessage>;
interface SavedDesign {
    /**
     * The user's name for this saved design.
     */
    title: string;
    /**
     * A URL pointing to an image of the design. Typically a data URL
     */
    thumbnail?: string;
    /**
     * The ID of the transaction relating to this design.
     */
    transactionId: string;
    /**
     * The product ID for this transaction.
     */
    productId: string;
    /**
     * The integration product ID related to this order.
     */
    integrationProductId: string;
    /**
     * The name of the workflow annotated at time of save (may be different from current workflow name).
     */
    workflowName: string;
    /**
     * The ID of the workflow annotated at time of save.
     */
    workflowId: string;
    /**
     * The last edit that occured on this saved design.
     */
    lastEdited: Date;
}
/**
 * The design service exposes helper functionality wrapping important design management operations.
 * NOTE: In the future this interface should allow for storing/pulling designs from the server.
 */
declare class DesignService {
    readonly localPersistenceKey = "designTransactions";
    private storageMethod;
    private designSavedListeners;
    /**
     * @param func The function to call when a design is saved.
     */
    attachSaveListener(func: (design: SavedDesign) => void): void;
    /**
     * @param func The function to remove from the list of listeners.
     */
    detachSaveListener(func: (design: SavedDesign) => void): void;
    /**
     * Gets the currently persisted designs.
     */
    getSavedDesigns(): Promise<SavedDesign[]>;
    /**
     * Search for a transaction that has been saved.
     * @param transactionId The id to search for.
     * @returns The transaction for the given id provided it has been saved. undefined if it doesn't exist.
     */
    getSavedDesignByTransaction(transactionId: string): Promise<SavedDesign | undefined>;
    /**
     * Saves a design to storage.
     * @param design The design to save.
     */
    addDesign(design: SavedDesign): Promise<void>;
    /**
     * Change the user's name of the given saved design.
     */
    renameDesign(transactionId: string, title: string): Promise<void>;
    /**
     * Removes a given design from storage.
     * @param transactionId
     */
    removeDesign(transactionId: string): Promise<void>;
    private setDesigns;
}
declare const designService: DesignService;

/**
 * A scene is a collection of steps that can be used to group steps together.
 */
interface Scene {
    /**
     * The unique identifier for the scene.
     */
    id?: string;
    /**
     * The name of the scene.
     */
    name: string;
    /**
     * The steps that are part of the scene. A list of ids. See getStepById.
     */
    stepIds: string[];
}
/**
 * State related to a workflow experience.
 */
interface ExperienceOptions {
    product: Product;
    transaction: Transaction;
    workflow?: Workflow;
    /**
     * @deprecated favor inject / eject functions.
     */
    previewService?: ThreeDPreviewService;
    modelContainer?: ModelContainer;
    renderableContextService?: LayoutPreviewService;
    layouts: ILayout[];
    reloadedState?: LayoutsState;
    /**
     * When true the experience is intended to be immutable.
     */
    readOnly?: boolean;
    /**
     * A function that communicates state changes to the server.
     */
    stateMutationFunc: StateMutationFunc;
    /**
     * Should be set to true when the experience is loaded from an existing transaction.
     * FIXME: Wouldn't we know this from existance of reloadedState
     */
    isReloadedTransaction?: boolean;
    /**
     * When true the system will treat steps with
     * a single variant as renderable. False
     * by default.
     */
    singleVariantsRenderable?: boolean;
    /**
     * When true, will delay syncing the workflow state until manually enabled.
     */
    delayWorkflowStateSync?: boolean;
}
/**
 * A Workflow experience encapsulates the workflow manager and command context. It
 * provides a simplified interface for interacting with the workflow manager. You
 * should get an instance of this class from a Client you have constructed previously.
 */
interface WorkflowExperience {
    /**
     * Get the bundle this experience is part of. May be undefined.
     */
    getBundle(): Bundle$1 | undefined;
    /**
     * Set the bundle this experience is part of. Can be cleared using undefined.
     */
    setBundle(bundle: Bundle$1 | undefined): any;
    /**
     * Returns the client that was responsible for spawning this experience.
     */
    getClient(): SpiffCommerceClient;
    /**
     * State related to the design of the user.
     */
    getCommandContext(): CommandContext;
    /**
     * Returns true when the user may only view the design.
     */
    getIsReadOnly(): boolean;
    /**
     * Get the low level workflow amanager instance for this experience. Don't touch this unless you're willing to break things.
     */
    getWorkflowManager(): WorkflowManager;
    /**
     * Returns the step matching a given name, undefined if not found.
     * @param id The id the step must match.
     */
    getStepById(id: string): StepHandle<AnyStepData> | undefined;
    /**
     * Returns the step matching a given name, undefined if not found.
     * @param name The name the step must match.
     */
    getStepByName(name: string): StepHandle<AnyStepData> | undefined;
    /**
     * Returns all steps matching a specific type in the workflow. These steps
     * may be across multiple scenes and may or may not be active based on condition state.
     */
    getStepsByType(type: StepType): StepHandle<AnyStepData>[];
    /**
     * Returns all steps that are children of a given scene.
     * @param scene The scene you want the steps for.
     */
    getStepsByScene(scene: Scene): StepHandle<AnyStepData>[];
    /**
     * Returns all steps in the workflow. Ordered by scene and appearance within their respective scenes.
     */
    getSteps(): StepHandle<AnyStepData>[];
    /**
     * Returns all steps in the workflow that are conditionally active. Ordered by scene and appearance within their respective scenes.
     */
    getStepsConditionallyActive(): StepHandle<AnyStepData>[];
    /**
     * Returns a list of scenes that are configured in the workflow. Each scene
     * contains a list of steps. See getStepsByScene to access these.
     */
    getScenes(): Scene[];
    /**
     * Returns the total cost in subunits for all selections made on the design.
     * @param disablePriceBreaks Whether to exclude price breaks from the calculation.
     */
    getSelectionPriceSubunits(disablePriceBreaks?: boolean): number;
    /**
     * Returns the total cost in subunits for the base product.
     * @param includeAdditionalProduct When true the additional product cost will be included in the total (if configured).
     * @param disablePriceBreaks Whether to exclude price breaks from the calculation.
     */
    getBasePriceSubunits(includeAdditionalProduct?: boolean, disablePriceBreaks?: boolean): number;
    /**
     * If an additional product is configured, returns the base price of that product. Returns undefined otherwise.
     * @param disablePriceBreaks Whether to exclude price breaks from the calculation.
     */
    getAdditionalProductPriceSubunits(disablePriceBreaks?: boolean): number | undefined;
    /**
     * A convenience function returning the sum of the selection and base price values.
     * @param disablePriceBreaks Whether to exclude price breaks from the calculation.
     */
    getTotalPriceSubunits(disablePriceBreaks?: boolean): number;
    /**
     * The price break percentage that is expected to be applied in price calculations.
     */
    priceBreakToBeApplied(): number;
    /**
     * Calculates the price break and fires the "PriceBreakChanged" event if required.
     * This function is primarily intended for internal use.
     */
    checkForPriceBreakChanges(): void;
    /**
     * Takes selections made by the user in another workflow and applies them to this workflow. For
     * selections to be copied they must both have a matching global property configuration.
     * @param experience The experience to take selections from.
     * @param filter A list of steps to apply the selections to. If undefined all steps will be updated.
     */
    copySelectionsViaGlobalConfiguration(bundle: Bundle$1, experience: WorkflowExperience, filter?: StepHandle<AnyStepData>[]): Promise<void>;
    /**
     * Attach specific details about the customer to the experience. This is useful for things like retargeting. Currently only
     * email is supported. From SpiffCommerce hosted experiences these details will be attached whenever the customer has provided & given permission.
     * @param details The new customer details. Only email is supported.
     * @deprecated Use assignCustomerDetails instead.
     */
    attachCustomerDetails(details: {
        /**
         * An email used for things like sending a design to the user.
         */
        email: string;
    }): Promise<void>;
    /**
     * Attach specific details about the customer to the experience. This is useful for things like retargeting.
     * From SpiffCommerce hosted experiences these details will be attached whenever the customer has provided & given permission.
     * @param details The new customer details.
     */
    assignCustomerDetails(details: CustomerDetailsInput): Promise<void>;
    /**
     * Attaches a listener to the scenes on a workflow experience. The scenes returned are a subset of the scenes configured in the
     * workflow and are based on the current state of the experience. This is useful for building a navigation menu.
     * @param cb The callback to be called when the scenes change. The new scenes are passed as an argument.
     */
    attachRenderableSceneListener(cb: (scenes: RenderableScene[]) => void): void;
    /**
     * Detaches a listener from the scenes on a workflow experience.
     */
    detachRenderableSceneListener(cb: (scenes: RenderableScene[]) => void): void;
    /**
     * Saves this experience to storage. This may be local or remote depending
     * on configuration.
     * @param title The title for the saved design.
     */
    save(title: string): Promise<SavedDesign>;
    /**
     * Returns a copy of the currently loaded design as a new, seperated workflow experience with
     * a fresh transaction.
     */
    copy(): Promise<WorkflowExperience>;
    /**
     * Creates a data URL preview for the current design.
     */
    createPreviewImage(isThreeD?: boolean, resolution?: number): Promise<string>;
    /**
     * To be called when the workflow experience is considered completed by the user.
     * @param onProgressUpdate Progress callback for finalizing the design. Optional
     * @param capturePreviewImage When true a preview image will be generated for the design. Defaults to true.
     */
    onDesignFinished(onProgressUpdate?: DesignCreationProgressUpdate, capturePreviewImage?: boolean): Promise<DesignCreationMessage>;
    /**
     * Returns the metadata associated with this workflow experience.
     * This is a combination of the metadata from the workflow, and the selections made by the user.
     */
    getExportedData(): Map<string, {
        [key: string]: string;
    }>;
    /**
     * Get the quantity of this WorkflowExperience's Transaction.
     * @returns The amount that was, or will be, ordered.
     */
    getQuantity(): number;
    /**
     * Sets the quantity of this WorkflowExperience's Transaction.
     * @throws {Error} if the WorkflowExperience is read-only.
     * @throws {RangeError} if the value is below 1.
     * @param quantity The amount that was, or will be, ordered.
     * @returns A promise that resolves when the Transaction has been updated on the server.
     */
    setQuantity(quantity: number): Promise<void>;
    /**
     * Registers a callback function to be called when the specified event is raised.
     * @param type The type of event to listen for.
     * @param callback The function to call when the event occurs.
     */
    addEventListener(type: WorkflowExperienceEventType, callback: (workflowExperience: WorkflowExperience) => void): void;
    /**
     * Removes a previously registered callback.
     * @param type The type of event.
     * @param callback The function to remove.
     */
    removeEventListener(type: WorkflowExperienceEventType, callback: (workflowExperience: WorkflowExperience) => void): void;
    attachAddress(streetAddress?: string, apartment?: string, city?: string, country?: string, state?: string, postCode?: string): Promise<void>;
    attachOrganization(name: string): Promise<void>;
}
declare enum WorkflowExperienceEventType {
    QuantityChanged = "QuantityChanged",
    PriceBreakChanged = "PriceBreakChanged"
}
declare class WorkflowExperienceImpl implements WorkflowExperience {
    readonly client: SpiffCommerceClient;
    readonly commandContext: CommandContext;
    readonly workflowManager: WorkflowManager;
    readonly isReadOnly: boolean;
    readonly cachedStepHandles: Map<string, StepHandle<any>>;
    /**
     * Bundle this experience has been added to.
     */
    private bundle?;
    private currentPriceBreak;
    private renderableScenes;
    private renderableSceneCallbacks;
    private eventCallbacks;
    constructor(client: SpiffCommerceClient, experienceOptions: ExperienceOptions);
    attachAddress(streetAddress?: string, apartment?: string, city?: string, country?: string, state?: string, postCode?: string): Promise<void>;
    attachOrganization(name: string): Promise<void>;
    getBundle(): Bundle$1 | undefined;
    setBundle(bundle: Bundle$1): void;
    getClient(): SpiffCommerceClient;
    getIsReadOnly(): boolean;
    getCommandContext(): CommandContext;
    getWorkflowManager(): WorkflowManager;
    createPreviewImage(isThreeD?: boolean, resolution?: number): Promise<string>;
    getStepById(id: string): StepHandle<any> | undefined;
    getSteps(): StepHandle<AnyStepData>[];
    getStepsConditionallyActive(): StepHandle<AnyStepData>[];
    getScenes(): Scene[];
    getSelectionPriceSubunits(disablePriceBreaks?: boolean): number;
    getBasePriceSubunits(includeAdditionalProduct?: boolean, disablePriceBreaks?: boolean): number;
    getAdditionalProductPriceSubunits(disablePriceBreaks?: boolean): number | undefined;
    getTotalPriceSubunits(disablePriceBreaks?: boolean): number;
    private getPriceSubUnitsAfterPriceBreaks;
    priceBreakToBeApplied(): number;
    checkForPriceBreakChanges(): void;
    private getMatchingExperiencesFromBundle;
    private updatePriceBreak;
    copySelectionsViaGlobalConfiguration(bundle: Bundle$1, experience: WorkflowExperience, filter?: StepHandle<AnyStepData>[]): Promise<void>;
    getStepByName(name: string): DigitalContentStepHandle | ModuleStepHandle | TextStepHandle | FrameStepHandle | ShapeStepHandle | InformationStepHandle | IllustrationStepHandle | MaterialStepHandle | ModelStepHandle | PictureStepHandle | QuestionStepHandle | undefined;
    getStepsByType(type: StepType): StepHandle<AnyStepData>[];
    getStepsByScene(scene: Scene): StepHandle<AnyStepData>[];
    attachCustomerDetails(details: {
        email: string;
    }): Promise<void>;
    assignCustomerDetails(details: CustomerDetailsInput): Promise<void>;
    attachRenderableSceneListener(cb: (scenes: RenderableScene[]) => void): void;
    detachRenderableSceneListener(cb: (scenes: RenderableScene[]) => void): void;
    debouncedSavedDesignUpdate: lodash.DebouncedFunc<() => Promise<void>>;
    save(title?: string): Promise<SavedDesign>;
    copy(): Promise<WorkflowExperience>;
    onDesignFinished(onProgressUpdate?: DesignCreationProgressUpdate, capturePreviewImage?: boolean): Promise<DesignCreationMessage>;
    /**
     * @param step The step to test against.
     * @returns Returns true when a valid handle is implemented for a given step type. Certain steps don't support handles, such as silent illustrations.
     */
    private stepHasHandle;
    private getCanvasObjectURLAsync;
    getExportedData(): Map<string, {
        [key: string]: string;
    }>;
    getQuantity(): number;
    setQuantity(quantity: number): Promise<void>;
    addEventListener(type: WorkflowExperienceEventType, callback: (workflowExperience: WorkflowExperience) => void): void;
    removeEventListener(type: WorkflowExperienceEventType, callback: (workflowExperience: WorkflowExperience) => void): void;
    private callEvent;
}

/**
 * A GlobalPropertyHandle acts as an interface to global properties on our platform. Currently
 * bundles can return a handle for any global properties associated to the collection.
 */
declare abstract class GlobalPropertyHandle {
    protected readonly bundle: Bundle$1;
    protected readonly property: GlobalPropertyConfigurationAspect;
    constructor(bundle: Bundle$1, property: GlobalPropertyConfigurationAspect);
    /**
     * @returns The name of the global property. This is the key used to store the property in the state.
     */
    getName(): string;
    /**
     * @returns A human friendly title.
     */
    getTitle(): string;
    /**
     * @returns A human friendly description.
     */
    getDescription(): string;
    /**
     * @returns The type of the global property. Use this to determine how to render the property.
     */
    getType(): AspectType;
    /**
     * @returns The underlying property data object.
     */
    getRawProperty(): GlobalPropertyConfigurationAspect;
    /**
     * Applies the global state to all shared steps, if the state is set.
     * @param targetExperiences Optionally filter the workflow experiences it should be applied to.
     */
    abstract applyGlobalState(targetExperiences?: WorkflowExperience[]): Promise<void>;
    /**
     * Returns all steps that share this property.
     * @param targetExperiences Optionally filter the steps to only those in the given experiences.
     */
    protected getSharedSteps(targetExperiences?: WorkflowExperience[]): StepHandle<AnyStepData>[];
    protected getStateValue(): string | undefined;
}
/**
 * A file upload global property allows for setting a frame image against all shared steps.
 */
declare class FileUploadGlobalPropertyHandle extends GlobalPropertyHandle {
    private colorOption?;
    private imageData?;
    constructor(bundle: Bundle$1, property: GlobalPropertyConfigurationAspect);
    initialize(): Promise<FileUploadGlobalPropertyHandle>;
    private loadImageData;
    /**
     * Select an image to be used for all shared steps.
     * @param asset The asset to use.
     * @returns A promise resolving when all affected steps have been updated.
     */
    selectImage(asset: Asset): Promise<void>;
    canUseBackgroundRemover(): Promise<boolean>;
    /**
     * Removes the background from an image, stores it in the state, and returns the new asset.
     * @param applyNewAsset Optionally applies the new asset to all shared steps. Default: `true`.
     * @returns A promise that resolves with the newly generated Asset.
     */
    removeBackgroundFromImage(applyNewAsset?: boolean): Promise<Asset>;
    /**
     * Returns `true` if the state has an image assigned, otherwise `false`.
     */
    hasImage(): boolean;
    /**
     * Retrieves the current image selection, if one exists.
     * @returns A promise that resolves with an `Asset` object if one is assigned to the state, otherwise `undefined`.
     */
    getImage(): Promise<Asset | undefined>;
    getImageWithColors(): Promise<string | undefined>;
    /**
     * Retrieves the original, unmodified image selection, if one exists.
     * @returns A promise that resolves with an `Asset` object if one is assigned to the state, otherwise `undefined`.
     */
    getOriginalImage(): Promise<Asset | undefined>;
    /**
     * Retrieves the version of the image selection that has the background removed, if one exists.
     * @returns A promise that resolves with an `Asset` object if one is assigned to the state, otherwise `undefined`.
     */
    getBackgroundRemovedImage(): Promise<Asset | undefined>;
    getUseOriginalImage(): boolean;
    setUseOriginalImage(value: boolean): Promise<void>;
    applyGlobalState(targetExperiences?: WorkflowExperience[]): Promise<void>;
    getAvailableColors(): ColorOption[];
    getCurrentColors(): {
        [key: string]: ColorDefinition;
    } | undefined;
    isColorPickerEnabled(): boolean;
    isPmsPickerEnabled(): boolean;
    getOriginalColors(): Promise<{
        [key: string]: ColorDefinition;
    } | undefined>;
    changeColors(newFills: {
        [key: string]: ColorDefinition;
    }): Promise<void>;
    private applyImageSelection;
    private updateSharedStepStorage;
}
declare class TextGlobalPropertyHandle extends GlobalPropertyHandle {
    constructor(bundle: Bundle$1, property: GlobalPropertyConfigurationAspect);
    /**
     * Gets the current text
     */
    getText(): string;
    /**
     * Set the text.
     */
    setText(text: string): Promise<void>;
    applyGlobalState(targetExperiences?: WorkflowExperience[]): Promise<void>;
    private applyTextSelection;
}
/**
 * An option property handle represents a property that can
 * affect the option of steps across multiple transactions.
 */
declare class OptionGlobalPropertyHandle extends GlobalPropertyHandle {
    protected optionResource?: OptionResource;
    constructor(bundle: Bundle$1, property: GlobalPropertyConfigurationAspect, optionResource: OptionResource | undefined);
    /**
     * If the option has a default variant, select it.
     */
    initDefaultVariant(): Promise<void>;
    /**
     * Gets the currently selected variant, or undefined if no variant is selected.
     */
    getCurrentVariant(): Variant | undefined;
    /**
     * @returns A list of valid variants for this step. Does not include disabled variants.
     */
    getAvailableVariants(): Variant[];
    /**
     * @returns A list of all variants for this step, including disabled ones.
     */
    getAllVariants(): Variant[];
    /**
     * Select a given variant on the option for all shared steps.
     * @param variant The variant to select.
     */
    selectVariant(variant: Variant, channel?: number): Promise<void>;
    applyGlobalState(targetExperiences?: WorkflowExperience[]): Promise<void>;
    private applyVariantSelection;
}
/**
 * A color option property handle represents a property that can
 * affect the option of steps across multiple transactions. This class is a specialization of the OptionGlobalPropertyHandle which includes functionality for
 * setting custom color values when a custom color variant is selected.
 */
declare class ColorOptionGlobalPropertyHandle extends OptionGlobalPropertyHandle {
    constructor(bundle: Bundle$1, property: GlobalPropertyConfigurationAspect, optionResource: OptionResource | undefined);
    /**
     * Select a given variant on the option for all shared steps.
     * @param variant The variant to select.
     */
    selectVariant(variant: Variant, channel?: number): Promise<void>;
    applyGlobalState(targetExperiences?: WorkflowExperience[]): Promise<void>;
    private applyColorVariant;
    /**
     * Sets a custom color on the global state.
     */
    setCustomColor(color: string): void;
    /**
     * Gets the custom color used by the global state.
     */
    getCustomColor(): string;
}

interface GlobalPropertyStateManager {
    getInitializationPromise(): Promise<void>;
    getGlobalPropertyState(): GlobalPropertyState | undefined;
    setGlobalPropertyState(state: GlobalPropertyState): Promise<void>;
    getAspect(name: string, channel?: number): string | undefined;
    getAspectStorage<S extends GlobalPropertyStateAspectStorage>(name: string, channel?: number): S | undefined;
    /**
     * Updates the value of a named aspect in the state.
     * @param name The name (key) of the aspect. This must match the key in the associated Global Property Config
     * @param value The value, represented as a string.
     * @param storage Optional: Additional data storage for the aspect. Not specifying this parameter, or providing `undefined`, will not update the
     * storage (if it already exists). Providing `null` will clear the existing storage.
     */
    setAspect(name: string, value: string, storage?: GlobalPropertyStateAspectStorage | null, channel?: number): Promise<void>;
    setAspectStorage<S extends GlobalPropertyStateAspectStorage>(name: string, storage: S | null, channel?: number): Promise<void>;
    setBundleOptions(bundleOptions?: BundleOptions): void;
    getBundleOptions(): BundleOptions | undefined;
    setConfiguration(configuration: GlobalPropertyConfiguration | undefined): void;
}
interface BundleOptions {
    additionalHeaders?: {
        [key: string]: string;
    };
    /**
     * If set to true, the products associated with the bundle will be eagerly fetched.
     */
    eagerFetchProducts?: boolean;
    bundleOwnerId?: string;
    /**
     * When reloading a bundle we may have an existing state to pull with it.
     */
    existingGlobalPropertyState?: GlobalPropertyState;
    readonly?: boolean;
}

interface ProductMetafieldFilter {
    operator: "Equals" | "IsEmpty";
    invert?: boolean;
    metafieldConfigurationId: string;
    value?: string;
}
/**
 * A collection of products that can be used to form a bundle.
 */
declare class ProductCollection {
    private readonly collection;
    private fullFetched;
    constructor(collection: ProductCollectionResource);
    /**
     * The ID of the product collection.
     */
    getId(): string;
    /**
     * The name of the collection.
     */
    getName(): string;
    /**
     * The description of the collection.
     */
    getDescription(): string;
    /**
     * The image of the collection.
     */
    getImage(): undefined | Asset;
    /**
     * A list of products in this collections with useful helpers for interacting with them.
     */
    getProducts(): CollectionProduct[];
    /**
     * A list of products in this collections with useful helpers for interacting with them.
     */
    fetchProducts(productIds?: string[]): Promise<CollectionProduct[]>;
    /**
     * Returns a list of collections products matching the associated metafield filters.
     * @param filters A list of filters to apply.
     */
    filterProducts(filters: ProductMetafieldFilter[]): Promise<CollectionProduct[]>;
    /**
     * Fetches a paginated feed of products.
     * @param offset The zero-based start index.
     * @param limit The maximum number of products to return.
     * @param filters Optional filters to apply to the query.
     * @returns
     */
    fetchProductsFeed(offset: number, limit: number, filters?: ProductMetafieldFilter[]): Promise<{
        items: CollectionProduct[];
        total: number;
    }>;
    getTransformCollection(): TransformCollection$1 | undefined;
    /**
     * The raw collection resource. This is generally not needed and should be avoided.
     */
    getResource(): ProductCollectionResource;
}
/**
 * A collection product is a product within a ProductCollection. It provides a simple interface for interacting with the product.
 */
declare class CollectionProduct {
    private readonly product;
    private readonly productResource;
    constructor(productCollectionProduct: ProductCollectionProductResource);
    /**
     * The ID of the product in SpiffCommerce.
     * @returns
     */
    getId(): string;
    /**
     * The name of the product. Human readable.
     */
    getName(): string;
    /**
     * A helper function for getting integrations
     * @param type The type of integration you want.
     * @param externalId An external integration ID to further filter by. Otherwise we return the first encountered.
     * @returns The integration if found. Throws an error if not found as this data is typically a neccesity.
     */
    getIntegrationByType(type: IntegrationType, externalId?: string): IntegrationProductResource;
    getCurrentIntegration(): IntegrationProductResource;
    /**
     * A helper function for pulling the default workflow.
     */
    getDefaultWorkflow(): ProductWorkflow$1;
    /**
     * @returns All workflows associated with this Product.
     */
    getAllWorkflows(): ProductWorkflow$1[];
    /**
     * A list of all integrations this product is connected to.
     */
    getIntegrations(): IntegrationProductResource[];
    /**
     * The raw product resource. This is generally not needed and should be avoided.
     */
    getResource(): Product;
    /**
     * Gets the base price of the product. Optionally include additional product pricing.
     * @param includeAdditionalProduct Optionally include additional product pricing. You must provide at least one of the fields on this object.
     * @returns
     */
    getBasePrice(includeAdditionalProduct?: {
        /**
         * The integration type to locate the additional product on.
         */
        integrationType?: IntegrationType;
        /**
         * The external ID of the integration to locate the additional product on.
         */
        externalId?: string;
        /**
         * The internal Spiff integration ID to locate the additional product on.
         */
        integrationId?: string;
    }): number;
}
/**
 * Represents a the relationship between a workflow and a product.
 */
declare class ProductWorkflow$1 {
    private readonly workflow;
    constructor(workflow: ProductWorkflow);
    /**
     * @returns The ID of this workflow, to be used when starting an experience.
     */
    getId(): string;
    /**
     * @returns The name of the workflow.
     */
    getName(): string;
    /**
     * An image to be used to display this workflow in a UI to the customer.
     * @returns A resource URL.
     */
    getThumbnail(): string;
}
/**
 * Represents a collection of transforms that can be applied inside a product collection.
 */
declare class TransformCollection$1 {
    private readonly collection;
    constructor(collection: TransformCollection);
    /**
     * @returns The ID of the transform collection.
     */
    getId(): string;
    /**
     * @returns The name of the transform collection.
     */
    getName(): string;
    /**
     * @returns The transforms in this collection.
     */
    getTransforms(): Transform[];
}
/**
 * Represents the translations, rotation & scale of a product in 3D space.
 */
declare class Transform {
    private readonly transform;
    constructor(position: TransformCollectionTransform);
    /**
     * @returns The ID of the transform.
     */
    getId(): string;
    /**
     * @returns The name of the transform.
     */
    getName(): string;
    /**
     * @returns The transformation to be used to place the object.
     */
    get(): BundleStateTransform;
}

/**
 * A bundle serves as a container for a set of workflow experience.
 */
interface Bundle$1 {
    /**
     * @returns The client that this bundle is associated with.
     */
    getClient(): SpiffCommerceClient;
    /**
     * @returns The id of the bundle entity in the Spiff Commerce system.
     */
    getId(): string;
    /**
     * @returns The name of the bundle.
     */
    getName(): string;
    getQuoteId(): string | undefined;
    /**
     * Set the name of the bundle.
     * @param name The new name for the bundle.
     * @returns A promise that resolves when the name has been updated in the Spiff Commerce system.
     */
    setName(name: string): Promise<void>;
    /**
     * @returns Custom metadata associated with this bundle.
     */
    getMetadata(): Map<string, string>;
    /**
     * Set custom metadata associated with this bundle.
     * @param metadata Updated map of metadata items.
     * @returns A promise that resolves when the metadata has been updated in the Spiff Commerce system.
     */
    setMetadata(metadata: Map<string, string>): Promise<void>;
    /**
     * Set the name and metadata for this bundle.
     * @param name The new name for the bundle.
     * @param metadata Updated map of metadata items.
     * @returns A promise that resolves when the name and metadata have been updated in the Spiff Commerce system.
     */
    setNameAndMetadata(name: string, metadata: Map<string, string>): Promise<void>;
    /**
     * Returns true if this bundle is associated with a Product Collection that is linked to a Global Property Configuration
     */
    hasGlobalProperties(): boolean;
    /**
     * Get a handle to the global properties available within this bundle. Setting values
     * via this method will make selections on all bundles that share the property.
     */
    getGlobalProperties(): Promise<GlobalPropertyHandle[]>;
    /**
     * Get the low level state manager for this bundle. Don't use this unless you know what you're doing.
     */
    getGlobalPropertyStateManager(): GlobalPropertyStateManager;
    /**
     * Get the total in subunits for all global properties in this bundle.
     */
    getGlobalPropertyTotalSubunits(): Promise<number>;
    /**
     * Return the total in subunits for this bundle. This is the sum of the total for all individual transactions.
     */
    getTotalSubunits(): number;
    /**
     * Retrieves the product collection associated with this bundle.
     * If the bundle is not associated with a product collection, this method will return undefined.
     */
    getProductCollection(): ProductCollection | undefined;
    /**
     * Add another workflow experience to this bundle.
     * @param experience The workflow experience to add to this bundle.
     */
    addWorkflowExperience(experience: WorkflowExperience): Promise<void>;
    /**
     * Adds multiple workflow experiences to this bundle.
     * @param experiences The workflow experiences to add to this bundle.
     */
    addWorkflowExperiences(experiences: WorkflowExperience[]): Promise<void>;
    /**
     * Remove a workflow experience from this bundle.
     * @param experience The workflow experience to remove from this bundle.
     */
    removeWorkflowExperience(experience: WorkflowExperience): Promise<void>;
    /**
     * Removes multiple workflow experiences from this bundle.
     * @param experiences The workflow experiences to remove from this bundle.
     */
    removeWorkflowExperiences(experiences: WorkflowExperience[]): Promise<void>;
    /**
     * Remove a workflow experience from this bundle by transaction.
     * @param transaction The transaction to remove from this bundle.
     */
    removeWorkflowExperienceByTransaction(transaction: Transaction): Promise<void>;
    /**
     * Removes multiple workflow experiences from this bundle by their transactions.
     * @param transactions The transactions to remove from this bundle.
     */
    removeWorkflowExperiencesByTransactions(transactions: Transaction[]): Promise<void>;
    /**
     * Inserts the given workflow experience into the bundle at the given index.
     * NOTE: If you intend to insert a workflow experience at the end of the bundle, use `addWorkflowExperience` instead as it is more efficient.
     * @param experience The workflow experience to insert.
     * @param index The index to insert the workflow experience at.
     */
    insertWorkflowExperience(experience: WorkflowExperience, index: number): Promise<void>;
    /**
     * Replaces a workflow experience at the given index with the given workflow experience. This essentially removes the old one and inserts the new one.
     * @param index The index to replace the workflow experience at.
     * @param experience The workflow experience to replace the old one with.
     */
    replaceWorkflowExperience(index: number, experience: WorkflowExperience): Promise<void>;
    /**
     * Swaps the workflow experiences at the given indices.
     */
    swapWorkflowExperiences(a: number, b: number): Promise<void>;
    /**
     * Returns all workflow experiences currently added to this bundle.
     */
    getWorkflowExperiences(): WorkflowExperience[];
    /**
     * Sort the list of workflow experiences. The sorting is performed locally, and then the order is updated in the Spiff Commerce system.
     * @returns A promise that resolves when the re-ordering of the workflow experiences has been updated in the Spiff Commerce system.
     * The sorting will occur immediately, but the promise will not resolve until the Spiff Commerce system has been updated.
     */
    sortWorkflowExperiences(sortFunc: (expA: WorkflowExperience, expB: WorkflowExperience) => number): Promise<void>;
    /**
     * @returns The number of workflow experiences in this bundle.
     */
    getWorkflowExperienceCount(): number;
    /**
     * Add a stakeholder to this bundle. If the stakeholder already exists, it will be updated. Write access to the bundle is required.
     * @param customerDetails The details of the customer to add. The emailAddress field is required.
     * @param stakeholderType The type of stakeholder to add. Defaults to Owner.
     */
    addStakeholder(customerDetails: CustomerDetailsInput, stakeholderType?: StakeholderType): Promise<void>;
    /**
     * Removes a stakeholder from this bundle. Write access to the bundle is required.
     * @param emailAddress The email address of the stakeholder to remove.
     */
    removeStakeholder(emailAddress: string): Promise<void>;
    /**
     * Updates all stakeholders associated with this bundle. Write access to the bundle is required.
     * @param stakeholders An array of stakeholders to update. Unknown stakeholders will be added, and absent stakeholders will be removed.
     */
    updateStakeholders(stakeholders: BundleStakeholderInput[]): Promise<void>;
    /**
     * Retrieves all stakeholders associated with this bundle.
     */
    getAllStakeholders(): Promise<BundleStakeholder[]>;
    getCurrentStakeholder(): Promise<BundleStakeholder | undefined>;
    /**
     * Finalizes all experiences within the bundle. This will return a promise that resolves when all experiences have been finalized.
     * The promise resolves with a list of messages that indicate the status of each experience including
     * helpful details like what product to add to cart on supported e-commerce platforms.
     * @param onProgressUpdate A callback that will be called when the progress of the finalization changes.
     * @param createPreviewImage A callback that will be called when a preview image is required. This is used to generate a preview image for the design.
     * If this callback is not provided, no preview image will be generated.
     * @returns {BundleDesignCreationMessage} An object containing an array of design messages, along with the Bundle's Id and the event type.
     */
    finish(onProgressUpdate?: DesignCreationProgressUpdate, createPreviewImage?: (workflowExperience: WorkflowExperience, shouldRender3D?: boolean) => Promise<string | undefined>): Promise<BundleDesignCreationMessage>;
    /**
     * A convenience function allowing you to place an order with all the items in the bundle.
     */
    placeOrder(): Promise<Order>;
    /**
     * Add an event listener to this bundle.
     * @param event The event to listen for. Currently only "conditional-global-properties-changed" is supported.
     * @param listener The listener to call when the event occurs.
     */
    addEventListener(event: BundleEventType, listener: (e: BundleEvent) => void): void;
    /**
     * Remove a previously added event listener from this bundle.
     */
    removeEventListener(event: BundleEventType, listener: (e: BundleEvent) => void): void;
    /**
     * Retrieves the current preview service for this bundle, if one exists.
     * If a preview service was specified when calling client.getExistingBundle, this will return that service.
     * Call `setPreviewService` to update the preview service for this bundle.
     */
    getPreviewService(): ThreeDPreviewService | undefined;
    /**
     * Set the preview service for this bundle. This will update the preview service for all workflow experiences in this bundle, and will
     * also automatically inject the preview service into any new workflow experiences that are added to this bundle.
     * If this method is called with no arguments or undefined, the preview service will be removed from this bundle.
     * @param previewService The preview service to use for this bundle.
     * @returns A promise that resolves when the preview service has been updated for all workflow experiences in this bundle.
     */
    setPreviewService(previewService?: ThreeDPreviewService): Promise<void>;
    /**
     * Returns a promise that resolves when the bundle has been initialized.
     * This will resolve immediately if the bundle has no experiences, or if the bundle has already been initialized.
     */
    getInitializationPromise(): Promise<void>;
    /**
     * Sets the position, rotation, and scale of a named transform for a workflow experience within this bundle.
     * @param workflowExperience The workflow experience to update.
     * @param transformName The name of the transform.
     * @param transform An object containing `position`, `rotation`, and `scale` properties. Each property is an object with `x`, `y`, and `z` properties.
     */
    updateWorkflowExperienceTransform(workflowExperience: WorkflowExperience, transformName: string, transform: BundleStateTransform): Promise<void>;
    /**
     * Sets a transform of a workflow experience within this bundle to be the active one.
     * @param workflowExperience The workflow experience to update.
     * @param transform The name of the transform to make the active transform.
     */
    activateWorkflowExperienceTransform(workflowExperience: WorkflowExperience, transformName: string): Promise<void>;
    /**
     * @returns The raw Global Property Configuration that is in use, otherwise `undefined`.
     */
    getGlobalPropertyConfiguration(): GlobalPropertyConfiguration | undefined;
    setBundleOptions(bundleOptions?: BundleOptions): any;
    /**
     * Assigns a Product Collection to the Bundle. This will only succeed if the Bundle does not already have a Product Collection assigned to it.
     * @param productCollectionId The ID of the Product Collection to assign to this Bundle.
     */
    assignProductCollection(productCollectionId: string): Promise<void>;
    getShareActions(): undefined | ShareAction[];
    getWorkflowViewerLink(): string;
    getWorkflowViewerAmendLink(): string;
    approve(note?: string, stakeholderId?: string): Promise<void>;
    reject(note?: string, stakeholderId?: string): Promise<void>;
    attachAddress(streetAddress?: string, apartment?: string, city?: string, country?: string, state?: string, postCode?: string): Promise<void>;
    attachOrganization(name: string): Promise<void>;
    generateQuoteId(): Promise<string>;
    getQuoteCompleteMessage(): CompleteQuoteMessage;
}
type BundleEventType = "conditional-global-properties-changed" | "workflow-experience-hover-enter" | "workflow-experience-hover-exit";
type BundleEventData = ConditionalGlobalPropertiesChangedEventData | WorkflowExperienceHoverEventData;
type BundleEvent = {
    bundle: Bundle$1;
    data: BundleEventData;
    event: BundleEventType;
};
interface ConditionalGlobalPropertiesChangedEventData {
    globalProperties: GlobalPropertyHandle[];
}
interface WorkflowExperienceHoverEventData {
    workflowExperience: WorkflowExperience;
}

/**
 * A list of node types available in executions
 */
declare enum NodeType {
    Split = "Split",
    TextJoin = "TextJoin",
    TextSlice = "TextSlice",
    TextUpper = "TextUpper",
    TextLower = "TextLower",
    ParseJson = "ParseJson",
    TextBuilder = "TextBuilder",
    Design = "Design",
    OverlayImage = "OverlayImage",
    OverlayText = "OverlayText",
    TableGenerator = "TableGenerator",
    QR = "QR",
    CSV = "CSV",
    PDF = "PDF",
    PNG = "PNG",
    Email = "Email",
    LocationDelivery = "LocationDelivery",
    TemplateEmail = "TemplateEmail",
    Map = "Map",
    Sort = "Sort",
    Group = "Group",
    InnerJoin = "InnerJoin",
    Contains = "Contains",
    Flatten = "Flatten",
    KeyValuePairs = "KeyValuePairs",
    ListConcatenate = "ListConcatenate",
    Repeat = "Repeat",
    Size = "Size",
    ListBuilder = "ListBuilder",
    MapBuilder = "MapBuilder",
    PairBuilder = "PairBuilder",
    AND = "AND",
    OR = "OR",
    NOT = "NOT",
    Equals = "Equals",
    Present = "Present",
    ManualOperation = "ManualOperation",
    Switch = "Switch",
    AssetMetadata = "AssetMetadata",
    DataSelect = "DataSelect",
    LayoutSelect = "LayoutSelect",
    TransactionMetadata = "TransactionMetadata",
    VariantSelection = "VariantSelection",
    StartTerminal = "StartTerminal",
    EndTerminal = "EndTerminal",
    MiscNote = "MiscNote",
    Assign = "Assign",
    CsvVlookup = "CsvVlookup",
    ProcessFlow = "ProcessFlow",
    TemporaryAssetUrl = "TemporaryAssetUrl",
    WebRequest = "WebRequest"
}
interface ExecutionNodeResponse {
    id: string;
    type: NodeType;
    artifacts: string;
}
interface ExecutionResponse {
    id: string;
    nodes: ExecutionNodeResponse[];
    completedAt?: string;
    failedAt?: string;
}
/**
 * A service containing functionality for interacting with the Spiff Commerce API to execute and inspect the result of process flows.
 */
declare class FlowService {
    /**
     *
     * @param id
     * @param inputs
     * @param options
     * @returns
     */
    execute(id: string, inputs: FlowExecutionInput[], options?: {
        sleepTime?: number;
        repeats?: number;
    }): Promise<FlowExecutionResult>;
}
/**
 * Handles preparing a flow input for transmission to the server.
 */
declare class FlowExecutionResult {
    protected readonly execution: ExecutionResponse;
    constructor(execution: ExecutionResponse);
    /**
     * @returns The raw response from the server.
     */
    getRaw(): ExecutionResponse;
    /**
     * @returns The nodes contained within the execution.
     */
    getNodes(): FlowExecutionNodeResult[];
    /**
     * @param type The type of node to return.
     * @returns A list of nodes matching the requested type.
     */
    getNodesByType(type: NodeType): FlowExecutionNodeResult[];
    /**
     * @returns A list of input nodes that exist in this execution.
     */
    getInputs(): FlowExecutionNodeResult[];
    /**
     * @returns A list of out put nodes that exist in this execution.
     */
    getOutputs(): FlowExecutionNodeResult[];
    /**
     * @returns A date object representing the point in time this execution completed.
     */
    getCompletedAt(): Date | undefined;
    /**
     * @returns A date object representing the point in time this execution failed.
     */
    getFailedAt(): Date | undefined;
}
/**
 * Handles preparing a flow input for transmission to the server.
 */
declare class FlowExecutionNodeResult {
    protected readonly node: ExecutionNodeResponse;
    constructor(node: ExecutionNodeResponse);
    getId(): string;
    getType(): NodeType;
    getArtifacts(): Map<string, any>;
    getArtifactByName<T>(name: string): T;
}
/**
 * Handles preparing a flow input for transmission to the server.
 */
declare abstract class FlowExecutionInput {
    protected readonly value: string;
    constructor(value: string);
    getRaw(): string;
    getValueForTransmission(): string;
}
/**
 * Represents the type of object being referenced by the input.
 */
declare const enum ObjectInputType {
    Transaction = "Transaction",
    Bundle = "Bundle",
    Product = "Product",
    Variant = "Variant",
    Option = "Option",
    LineItem = "LineItem",
    Asset = "Asset"
}
declare class TextInput extends FlowExecutionInput {
    constructor(input: string);
}
/**
 * Handles validation of spiffObject structure for transmission to the server.
 */
declare class ObjectInput extends FlowExecutionInput {
    constructor(id: string, type: ObjectInputType);
    static validUUID(uuid: string): RegExpMatchArray | null;
}
/**
 * Handles validation of array input for transmission to the server.
 */
declare class ArrayInput extends FlowExecutionInput {
    constructor(elements: FlowExecutionInput[]);
}

declare class IntegrationProduct {
    private readonly integrationProduct;
    constructor(product: IntegrationProductResource);
    getId(): string;
    getResource(): IntegrationProductResource;
    getBasePrice(): number;
    getDefaultWorkflow(): ProductWorkflow$1;
    getAllWorkflows(): ProductWorkflow$1[];
}

declare const getWorkflows: (ids: string[], options?: GetWorkflowGraphqlOptions) => Promise<Workflow[]>;
declare const getWorkflow: (id: string, options?: GetWorkflowGraphqlOptions) => Promise<Workflow>;
/**
 * Options that can be used during instantiation of the SpiffCommerce Javascript Client.
 * Please refer to the documentation for more information.
 */
interface ClientOptions {
    /**
     * The client will use the provided application key to
     * authenticate with the SpiffCommerce API. This key can be generated and replaced in Spiffcommerce Hub.
     */
    applicationKey?: string;
}
interface GetBundleGraphqlAssetsOptions {
    metadata?: boolean;
}
interface GetBundleGraphqlProductCollectionOptions {
    eagerFetchProducts?: boolean;
}
interface GetBundleGraphqlOptions {
    productCollection?: GetBundleGraphqlProductCollectionOptions;
    assets?: GetBundleGraphqlAssetsOptions;
    additionalHeaders?: {
        [key: string]: string;
    };
}
interface GetBundleOptions {
    /**
     * Configuration for the graphQL request made for bundles. Allows for retrieval
     * of additional data.
     */
    graphql?: GetBundleGraphqlOptions;
    readonly?: boolean;
}
interface GetWorkflowGraphqlAssetsOptions {
    metadata?: boolean;
}
interface GetWorkflowGraphqlOptions {
    assets?: GetWorkflowGraphqlAssetsOptions;
    bundleOwnerId?: string;
}
interface GetWorkflowOptionsBase {
    /**
     * An existing preview service to use, instead of creating a new one.
     */
    previewService?: ThreeDPreviewService;
    /**
     * Configuration related to the
     * workflow and how the system interprets it.
     */
    workflowConfiguration?: {
        /**
         * False by default, when true the system will treat
         * steps with a single variant
         * as being renderable.
         */
        singleVariantsRenderable?: boolean;
    };
    /**
     * Configuration for the graphQL request made for workflows. Allows for retrieval
     * of additional data.
     */
    graphql?: GetWorkflowGraphqlOptions;
}
interface GetWorkflowFromTransactionOptions extends GetWorkflowOptionsBase {
    /** The existing Transaction to use. */
    transactionId: string;
    /** If set to true, the workflow will display in a read-only mode. */
    readOnly?: boolean;
    /** An existing workflow state, if available. */
    workflowState?: string;
    type: "transaction";
}
interface GetNewWorkflowOptionsBase extends GetWorkflowOptionsBase {
    /** A name for the new transaction. */
    designName?: string;
    /** The workflow to load. */
    workflowId: string;
    /** An existing workflow state, if available. */
    workflowState?: string;
}
interface GetWorkflowFromIntegrationProductOptions extends GetNewWorkflowOptionsBase {
    integrationProductId: string;
    type: "integration";
}
interface GetWorkflowFromExternalProductOptions extends GetNewWorkflowOptionsBase {
    /** The external ID associated with an integration. */
    externalIntegrationId: string;
    /** The ID of the product from the external system. */
    externalProductId: string;
    type: "external";
}
type GetNewWorkflowOptions = GetWorkflowFromIntegrationProductOptions | GetWorkflowFromExternalProductOptions;
type GetWorkflowOptions = GetWorkflowFromTransactionOptions | GetNewWorkflowOptions;
interface ClientConfiguration {
    hubUrl: string;
    serverUrl: string;
    servicesApiUrl: string;
    marketplaceThemeInstallId?: string;
    marketplaceThemeInstallConfigurationId?: string;
    bearerAuthenticationToken?: string;
}
/**
 * The Spiff Commerce Javascript Client. Required for
 * creating workflow experiences.
 */
declare class SpiffCommerceClient {
    private options;
    private currencyCode?;
    private customer?;
    private activeIntegration?;
    private marketplaceThemeInstallId?;
    private marketplaceThemeInstallConfigurationId?;
    constructor(options: ClientOptions);
    configure(configuration: ClientConfiguration): void;
    /**
     * @returns The asset manager allows for common operations related to assets
     * and the Spiff Commerce platform.
     */
    getAssetManager(): AssetManager;
    getCurrencyCode(): string;
    getFlowService(): FlowService;
    getIntegration(): Promise<Integration>;
    canUseAddon(addonHandle: AddonHandle): Promise<boolean>;
    /**
     * Attempts to load persisted authentication information from local storage, and authenticate with the Spiff Commerce API.
     * @param bundleId The ID of the bundle you intend to load.
     * @returns An object containing the success status of the authentication attempt, and the type of stakeholder when successful.
     */
    authenticateBundleFromLocalStorage(bundleId: string): Promise<{
        stakeholderType?: StakeholderType;
        success: boolean;
    }>;
    /**
     * Attempts to load persisted authentication information from local storage, and authenticate with the Spiff Commerce API.
     * @param transactionId The ID of the transaction that the user is attempting to load.
     * @returns An object containing the following:
     * - `customLogoLink`: A link to a custom logo to display in the header.
     * - `transactionReadOnly`: Whether or not the transaction is read-only. Shadow will not accept any changes to the transaction if this is set to true.
     * - `stakeholderType`: The type of stakeholder that the user is authenticated as.
     * - `success`: Whether or not the authentication was successful.
     * @throws An error if the transaction is not found.
     */
    authenticateTransactionFromLocalStorage(transactionId: string): Promise<{
        customLogoLink?: string;
        transactionReadOnly?: boolean;
        stakeholderType?: StakeholderType;
        success: boolean;
        theme?: Theme;
    }>;
    clearCustomer(): void;
    clearCustomerForTransaction(transactionId: string): void;
    customerHasBundleTemplates(emailAddress: string): Promise<boolean>;
    getStakeholderTypeForTransaction(transactionId: string): StakeholderType | undefined;
    getOrCreateCustomer(emailAddress: string): Promise<{
        customer: Customer;
        isAuthenticated: boolean;
    }>;
    getCustomer(): Customer | undefined;
    private authenticateCustomerId;
    /**
     * Generates a verification code for the given email address.
     * @param emailAddress The email address to generate a verification code for. The user will be sent an email with the verification code.
     */
    generateVerificationCode(emailAddress: string): Promise<void>;
    /**
     * Verifies the given email address with the given verification code.
     * @param emailAddress The email address to verify.
     * @param verificationCode The verification code to verify the email address with.
     * @returns True if the verification was successful, false otherwise.
     */
    verifyCode(emailAddress: string, verificationCode: string): Promise<boolean>;
    getCustomerMetafields(): Promise<Metafield[]>;
    /**
     * @param collectionId Optional: The id of the product collection that the bundle can use.
     * @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
     */
    getNewBundle(collectionId?: string, initialMetadata?: {
        [key: string]: string;
    }, options?: GetBundleOptions): Promise<Bundle$1>;
    /**
     * Retrieves an existing bundle from the API, by id.
     * @param bundleId The id of the bundle to retrieve.
     * @param previewService Optional: A reference to an existing preview service to use. This can be assigned manually later.
     * @param graphqlOptions Optional: Options to configure loading the bundle.
     * @param options Optional: Options to configure loading the bundle.
     * @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
     */
    getExistingBundle(bundleId: string, previewService?: ThreeDPreviewService, 
    /**
     * @deprecated use GetBundleOptions instead. This attribute will be removed in the future.
     */
    graphqlOptions?: GetBundleGraphqlOptions, options?: GetBundleOptions): Promise<Bundle$1>;
    /**
     * @param bundleId The id of the bundle to copy. The current context must have write access to the this bundle in order to duplicate it.
     * @param template Optional: Whether to mark the new bundle as a template. Default is false.
     * @param duplicateTransactions Optional: Whether to also duplicate the original bundle's transactions. Default is true.
     * @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
     */
    duplicateBundle(bundleId: string, template?: boolean, duplicateTransactions?: boolean, options?: GetBundleOptions): Promise<Bundle$1>;
    /**
     * Fetches information about the currently authenticated customer's bundles.
     * NOTE: This does not initialize a bundle for active use.
     * You must call either `getExistingBundle` or `duplicateBundle` to actually interact with a bundle.
     * @param options Options to configure the request.
     * @returns A promise that resolves with an object containing:
     * `items` - The bundles that matched the request.
     * `total` - The total number of bundles on the server that match this query.
     */
    getBundlesForCustomer(options: {
        /** Whether to include each bundle's metadata in the response. */
        includeMetadata?: boolean;
        /** The maximum amount of bundles to return in the response. */
        limit: number;
        /** The amount of items to skip over in the server query. */
        offset: number;
        /** Undefined: Any bundle, template or not. True: The bundle must be a template. False: The bundle must not be a template */
        template?: boolean;
        /** The status of the bundle template; "Active" or "Draft". */
        templateStatus?: BundleTemplateStatus;
    }): Promise<BundlesFeed>;
    /**
     * Retrieves all existing bundle stakeholders from the API, for the currently authenticated customer.
     * @returns An array of bundle stakeholders.
     */
    getBundleStakeholders(): Promise<BundleStakeholder[]>;
    /**
     * Creates a new instance of WorkflowExperience. A high level wrapper for workflows.
     * @param options Options to configure loading the transaction and workflow.
     * @param previewServiceConstructor A function called during initialization. Takes a class implementing ThreeDPreviewService in return.
     * @returns A workflow experience configured as requested.
     */
    getWorkflowExperience(options: GetWorkflowOptions, previewServiceConstructor?: (workflow: Workflow) => ThreeDPreviewService): Promise<WorkflowExperience>;
    /**
     * Gets multiple workflow experiences at once.
     * @param optionsArray An array of options to configure loading the transactions and workflows.
     * NOTE: The `previewService` field on the option is currently unsupported in this function, as loading multiple models at once will likely cause performance issues.
     * @param graphqlOptions Options to configure loading the workflows.
     * @returns An array of workflow experiences configured as requested.
     */
    getWorkflowExperiences(optionsArray: GetWorkflowOptions[], graphqlOptions?: GetWorkflowGraphqlOptions): Promise<WorkflowExperience[]>;
    /**
     * A function used to synchronize transaction state with the server.
     * @param options New state details. To be spread into the query.
     * @returns
     */
    private updateTransactionState;
    storeCustomer(customer: Customer): void;
    getIntegrationProductById(integrationProductId: string): Promise<IntegrationProduct>;
    getIntegrationProductFromExternalIds(externalIntegrationId: string, externalProductId: string): Promise<IntegrationProduct>;
    getIntegrationProduct(options: Extendable<{
        type: "integration";
        integrationProductId: string;
    }> | Extendable<{
        type: "external";
        externalIntegrationId: string;
        externalProductId: string;
    }>): Promise<IntegrationProduct>;
    getShareActionsForTransaction(transactionId: string): Promise<ShareAction[] | undefined>;
    placeOrder(orderItems: OrderItem[]): Promise<Order>;
}
declare const getIntegration: (applicationKey: string, themeConfigurationId?: string) => Promise<Integration>;
declare const getTransaction: (transactionId: string) => Promise<Transaction | undefined>;
declare const getOverrideThemeConfiguration: (overrideThemeConfigurationId: string, overrideThemeInstallId: string) => Promise<ThemeInstallConfigurationGraphQl | undefined>;
declare const getBundleThemeConfiguration: (bundleId: string) => Promise<ThemeInstallConfigurationGraphQl | undefined>;
declare const getTransactionThemeConfiguration: (transactionId: string) => Promise<ThemeInstallConfigurationGraphQl | undefined>;

interface SilentIllustrationStepData extends SilentStepData, Placeable {
}
interface EditedSteps {
    [stepName: string]: boolean;
}
interface MandatorySteps {
    [stepName: string]: boolean;
}
type StepElements = {
    [key: string]: RegionElement[];
};
type StepInitialised = {
    [key: string]: boolean;
};
type StepMetadata = FrameMetadata | IllustrationMetadata | ModuleMetadata | TextMetadata;
interface WorkflowStorage {
    [stepName: string]: StepStorage;
}
interface WorkflowMetadata {
    [stepName: string]: StepMetadata;
}
interface WorkflowSelections {
    [stepName: string]: {
        selections: VariantResource[];
    };
}
interface InformationResult {
    message: string;
    messageType: InformationMessageType;
    stepID: string;
}
declare enum InformationMessageType {
    Error = "Error",
    Warning = "Warning",
    Info = "Info"
}
/**
 * Services required for the operation of individual steps.
 */
interface StepSpecificServices {
    frameService?: FrameService;
    module?: ModuleProduct;
}
interface ValidationErrors {
    steps: Map<string, Map<string, string>>;
}
type DesignCreationProgressUpdate = (message: string) => void;
type ConfirmCallback = (isConfirmed: boolean) => void;
type EditedCallback = (editedSteps: EditedSteps) => void;
type ElementsCallback = (elements: StepElements) => void;
type InformationResultCallback = (messages: InformationResult[]) => void;
type InitCallback = (stepInitialised: StepInitialised) => void;
type MakingAdjustmentsCallback = (makingAdjustments: string) => void;
type MandatoryCallback = (mandatorySteps: MandatorySteps) => void;
type MetadataCallback = (metadata: WorkflowMetadata) => void;
type SelectionCallback = (callbackOptions: {
    selectionCost: number;
    selections: StepSelections;
    traversableScenes: WorkflowScene[];
}) => void;
type StepSpecificStorageCallback = (selections: StepStorage) => void;
type StorageCallback = (storage: WorkflowStorage) => void;
type ValidationCallback = (validationErrors: ValidationErrors) => void;
type StateMutationFunc = (options?: Omit<MutationOptions, "mutation">) => Promise<FetchResult<any, Record<string, any>, Record<string, any>>>;
interface WorkflowManager {
    addPoller: (poller: Poller) => void;
    addConfirmCallback: (callback: ConfirmCallback) => void;
    addEditedCallback: (callback: EditedCallback) => void;
    addElementsCallback: (callback: ElementsCallback) => void;
    addInformationResultCallback: (callback: InformationResultCallback) => void;
    addInitCallback: (callback: InitCallback) => void;
    addMakingAdjustmentsCallback: (callback: MakingAdjustmentsCallback) => void;
    addMandatoryCallback: (callback: MandatoryCallback) => void;
    addMetadataCallback: (callback: MetadataCallback) => void;
    addSelectionCallback: (callback: SelectionCallback) => void;
    addStepSpecificStorageCallback: (callback: StepSpecificStorageCallback, stepName: string) => void;
    addStorageCallback: (callback: StorageCallback) => void;
    addValidationCallback: (callback: ValidationCallback) => void;
    getCommandDispatcher: () => (command: CanvasCommand) => void;
    getCommandContext: () => CommandContext;
    getLayouts: () => ILayout[];
    getAllLayoutData: () => LayoutState[];
    getLayoutPreviewService: () => LayoutPreviewService | undefined;
    getPreviewService: () => ThreeDPreviewService | undefined;
    getProfanities: () => string[];
    getRegionElements: (stepName: string) => RegionElement[];
    getSerializedStep: (stepName: string, serializedSteps: SerializableStep[]) => SerializableStep | undefined;
    getStepSpecificServices: (stepName: string) => StepSpecificServices | undefined;
    getStepStorage: (stepName: string) => StepStorage | undefined;
    getMetadata: (stepName: string) => StepMetadata | undefined;
    getWorkflowMetadata: () => WorkflowMetadata;
    getInformationResults(): InformationResult[];
    getTransaction: () => Transaction;
    getTransactionCustomer: () => Customer | undefined;
    setTransactionCustomer: (customer: Customer) => void;
    /**
     * @deprecated Use setTransactionCustomer instead.
     */
    setTransactionCustomerDetails: (details: {
        email: string;
    }) => void;
    getWorkflow: () => Workflow;
    getWorkflowSelections: () => WorkflowSelections;
    getStepSelections: () => StepSelections;
    getProduct: () => Product;
    /**
     * A promise resolving when the initial state of the workflow has completed loading.
     */
    getInitializationPromise: () => Promise<void>;
    /**
     * Returns true when the initial state of the workflow has been loaded and settled.
     */
    isInitialized(): boolean;
    markStepsAsInitialised: (stepNames: string[]) => void;
    getUpdatesPending: () => boolean;
    markUpdateCompleted: (id: string) => void;
    markUpdatePending: () => string;
    outstandingRequestsPromise: () => Promise<void>;
    reset: () => Promise<void>;
    setCurrentAdjustingStepId: (stepId: string) => void;
    setEditedStatus: (stepName: string, status: boolean) => void;
    setInformationResults: (results: InformationResult[]) => void;
    setMandatoryFulfilled: (stepName: string, status: boolean) => void;
    setSelectionsAndElements: (stepName: string, variants: VariantResource[], elements: RegionElement[], callback?: () => Promise<void>) => Promise<void>;
    setStepError: (stepName: string, field: string, error: string | undefined) => void;
    /** Gets any validation errors for a specific step, or `undefined` if there are none. */
    getStepErrors: (stepName: string) => Map<string, string> | undefined;
    /** Gets validation errors for all steps. Only steps with errors will be present. */
    getValidationErrors: () => ValidationErrors;
    toggleDesignConfirmed: () => void;
    updateMetadata: (stepName: string, update: any) => void;
    /**
     * @deprecated State updates are being pulled internally. This function will be removed in the future.
     */
    updateStateWithServerImmediate: (getReducerState: () => CommandState) => Promise<void>;
    updateStorage: (stepName: string, update: StepStorage) => void;
    getModelContainer: () => ModelContainer | undefined;
    setModelContainer: (container: ModelContainer) => void;
    /**
     * Injects the model of this product into the preview service.
     * This also overwrites the internal preview service.
     * @param previewService The preview service to inject into.
     * @param refocusCamera Optional: Run camera focus Defaults to `true`.
     */
    injectIntoPreviewService(previewService: ThreeDPreviewService, refocusCamera?: boolean): Promise<void>;
    /**
     * Ejects the model of this product from the preview service. This also sets the internal preview service to undefined.
     */
    ejectFromPreviewService(): void;
    /**
     * Enables or disables uploading of workflow state to the server.
     * @param enabled When true, workflow state will be uploaded to the server.
     */
    setWorkflowStateSyncEnabled: (enabled: boolean) => void;
    /**
     * Returns the client that was responsible for spawning this manager.
     */
    getClient(): SpiffCommerceClient;
    /**
     * Returns the workflow experience that was responsible for creating this manager.
     */
    getWorkflowExperience(): WorkflowExperience;
    /**
     * Re-fetches the transactionShareActions for this WorkflowManager's Transaction object.
     * The updated transactionShareActions overwrite the existing values on the Transaction object returned by `getTransaction()`.
     */
    updateTransactionShareActions(): Promise<void>;
    /**
     * Re-fetches the stakeholders and currentStakeholder for this WorkflowManager's Transaction object.
     * The updated stakeholders and currentStakeholder overwrite the existing values on the Transaction object returned by `getTransaction()`.
     */
    updateTransactionStakeholders(): Promise<void>;
    /**
     * Returns the tags for a step.
     */
    getStepTags(stepId: string): string[];
    approveTransaction(note?: string): Promise<void>;
    rejectTransaction(note?: string): Promise<void>;
}

declare enum AssetType {
    Data = "Data",
    Font = "Font",
    Frame = "Frame",
    Illustration = "Illustration",
    Image = "Image",
    Model = "Model",
    Material = "Material",
    Color = "Color",
    QuestionnaireCollateral = "QuestionnaireCollateral",
    RequestCollateral = "RequestCollateral",
    SignupCollateral = "SignupCollateral",
    Video = "Video",
    ColorProfile = "ColorProfile",
    Environment = "Environment"
}
interface Asset {
    /**
     * The path of the asset within the bucket.
     */
    key?: string;
    /**
     * The name of this asset, the file name by default, otherwise a name set by the user.
     */
    name?: string;
    /**
     * The time that this asset was uploaded.
     */
    createdAt?: string;
    /**
     * The ID of this asset's license.
     */
    licenseId?: string;
    /**
     * The content type registered with the bucket.
     */
    mimeType?: string;
    /**
     * The ID of the person that uploaded this asset.
     */
    ownerId?: string;
    /**
     * The price to use this asset.
     */
    price?: number;
    /**
     * The asset type being dealt with.
     */
    type?: AssetType;
    /**
     * True when this asset is publicly available to anyone.
     */
    public?: boolean;
    /**
     * All versions for this asset, including the "latest" one which is the default and represented
     * by the key of the asset itself.
     */
    objectVersions?: AssetObjectVersion[];
    /**
     * A list of tags for organisational purposes.
     */
    tags?: AssetTag[];
    hubLink?: string;
    fileLink?: string;
    newVersionLink?: string;
    invalidateLink?: string;
    versions?: AssetVersion[];
    metadata?: AssetMetadata[];
    assetConfiguration?: AssetConfiguration;
}
interface AssetConfiguration {
    colorOption?: OptionResource;
    channelNumbers: {
        id: string;
        number: number;
    }[];
    defaultColorVariants: {
        channelNumber: number;
        variant: VariantResource;
    }[];
}
/**
 * A tag for organisation of assets
 */
interface AssetTag {
    /**
     * A unique ID.
     */
    id: string;
    /**
     * The human friendly display name of the tag.
     */
    name: string;
    /**
     * The key of the asset the tag is associated to.
     */
    assetKey: string;
    /**
     * The partner that owns that asset & tag.
     */
    partnerId: string;
}
interface AssetMetadata {
    key: string;
    value: string;
}
interface AssetVersion {
    name: string;
    link: string;
}
/**
 * An object version is a snapshow of an asset at a given point in time. Each time
 * the user updates the file associated to an asset a new object version is created.
 * Users can then see a timeline of all object versions and switch between them.
 */
interface AssetObjectVersion {
    /**
     * The size of the file in bytes.
     */
    size: number;
    /**
     * A timestamp for when this version was created.
     */
    timestamp: string;
    /**
     * The id of the version, this is required in cases where we want to perform
     * specific operations on a version such as making it the latest one or deleting it.
     */
    versionId: string;
    /**
     * The url that this asset should be called on when we want to get it,
     * instead of the base key. This key is
     */
    versionedKey: string;
}
interface Step<T extends AnyStepData = AnyStepData> {
    conditions?: Condition[];
    data: T;
    globalPropertyAspectConfigurations?: GlobalPropertyAspectConfiguration[];
    helpText?: string;
    mandatory?: boolean;
    relevantPanelName?: string;
    silent?: boolean;
    option?: OptionResource;
    optionId?: string;
    stepName: string;
    stepTitle: string;
    tags?: string[];
    type: StepType;
}
interface GlobalPropertyAspectConfiguration {
    aspectName?: string;
    globalPropertyConfigurationId?: string;
}
interface GlobalPropertyConfiguration {
    id: string;
    aspects: GlobalPropertyConfigurationAspect[];
}
interface GlobalPropertyConfigurationAspect {
    name: string;
    type: AspectType;
    title: string;
    description: string;
    entityId?: string;
    conditions?: GlobalPropertyConfigurationAspectCondition[];
    data?: GlobalPropertyConfigurationAspectData;
}
interface GlobalPropertyConfigurationAspectData {
    fileUpload: GlobalPropertyConfigurationAspectFileUploadData;
}
interface GlobalPropertyConfigurationAspectFileUploadData {
    colorPickerEnabled?: boolean;
    pmsPickerEnabled?: boolean;
    colorOptionId?: string;
}
interface GlobalPropertyConfigurationAspectCondition {
    targetAspectName?: string;
    action: AspectConditionAction;
    requiredVariantSelections: string[];
}
declare enum AspectConditionAction {
    Show = "Show"
}
declare enum AspectType {
    FileUpload = "FileUpload",
    Option = "Option",
    ColorOption = "ColorOption",
    Text = "Text"
}
declare enum StepType {
    Information = "Information",
    Bulk = "Bulk",
    DigitalContent = "DigitalContent",
    Finish = "Finish",
    Frame = "Frame",
    Illustration = "Illustration",
    Introduction = "Introduction",
    Material = "Material",
    Model = "Model",
    Module = "Module",
    Picture = "Picture",
    /**
     * @deprecated Use Frame instead.
     */
    Photo = "Photo",
    ProductOverlay = "ProductOverlay",
    Question = "Question",
    Shape = "Shape",
    SilentIllustration = "SilentIllustration",
    Text = "Text"
}
interface StepAspect {
    stepName: string;
    stepType: StepType;
    aspectType: StepAspectType;
}
declare enum StepAspectType {
    Color = "Color",
    Colors = "Colors",
    Selection = "Selection",
    Selections = "Selections",
    Text = "Text",
    Upload = "Upload"
}
interface Region {
    top: number;
    left: number;
    width: number;
    height: number;
    layer?: number;
    layerIndex?: number;
    rotation: number;
    panelId: string;
    immutable?: boolean;
    adjustmentBoundary?: {
        x: number;
        y: number;
        height: number;
        width: number;
    };
}
interface Condition {
    requiredVariantSelections: string[];
    action: string;
    targetStepName: string;
}
interface StepAsset {
    key: string;
    previewKey?: string;
}
interface OptionResource {
    id?: string;
    localId?: string;
    name: string;
    type?: string;
    variants?: VariantResource[];
    defaultVariant?: VariantResource;
    workflowId?: string;
    public?: boolean;
    displayType?: string;
    colorProfile?: Asset;
    integrationOptions?: IntegrationOptionResource[];
}
interface VariantResource {
    id?: string;
    name: string;
    enabled: boolean;
    priceModifier: number;
    asset?: Asset;
    material?: MaterialResource;
    thumbnail?: Asset;
    color?: string;
    localId?: string;
    default?: boolean;
    namedColor?: string;
    option?: OptionResource;
}
interface IntegrationOptionResource {
    id?: string;
    localId?: string;
    integrationId: string;
    externalProductId?: string;
}
/**
 * Represents a material resource that can be additively applied to
 * a material targeted in the scene.
 */
type MaterialResource = {
    /**
     * A unique identified for this material.
     */
    id: string;
    /**
     * The name of this material
     */
    name: string;
    /**
     * Defines the base color of a surface before any other calculations are made.
     */
    albedoMapKey?: string;
    /**
     * Defines the transparency of a surface.
     */
    alphaMapKey?: string;
    /**
     * Defines shadowing on a surface.
     */
    ambientMapKey?: string;
    /**
     * Defines the amount of light being emitted from a surface.
     */
    emissionMapKey?: string;
    /**
     * Identical to roughness.
     */
    metallicMapKey?: string;
    /**
     * Defines the direction light will bounce in when it hits a point on a surface.
     */
    normalMapKey?: string;
    /**
     * Used to define how smooth a surface is.
     */
    roughnessMapKey?: string;
    /**
     * Used to define refraction of light on a surface.
     */
    refractionMapKey?: string;
    /**
     * The intensity of refraction, when refraction is enabled via a texture.
     */
    refractionIntensity?: number;
    /**
     * Use to define reflection of light on a surface.
     */
    reflectionMapKey?: string;
    /**
     * The intensity of reflection, when reflection is enabled via a texture.
     */
    reflectionIntensity?: number;
    /**
     * The rotation of the reflection map (around the up axis, in degrees), when reflection is enabled via a texture.
     */
    reflectionRotation?: number;
    /**
     * When enabled the material will be displayed with a clearcoat affect for simulating coated plastic surfaces.
     */
    clearCoat: MaterialEffectMode;
    /**
     * Index of refraction when clear coat is enabled.
     */
    clearCoatIOR?: number;
    /**
     * The date that this material resource was created
     */
    createdAt: string;
    /**
     * The date that this material resource was last updated.
     */
    updatedAt: string;
};
/**
 * Used to specify the behavior of a material effect such as clearcoat, sheen and translucency.
 */
declare enum MaterialEffectMode {
    /**
     * When a material variant effect specifies 'None' the effect doesn't change in any way. This is the default behavior.
     */
    None = "None",
    /**
     * When a material variant effect specifies 'RemoveWhenSelected' the effect is removed.
     */
    RemoveWhenSelected = "RemoveWhenSelected",
    /**
     * When a material variant effect specifies 'ApplyWhenSelected' the effect is enabled.
     */
    ApplyWhenSelected = "ApplyWhenSelected"
}
type AnyStepData = InformationStepData | BulkStepData | DigitalContentStepData | FinalizeStepData | FrameStepData | IllustrationStepData | MaterialStepData | ModelStepData | ModuleStepData | PictureStepData | QuestionStepData | ShapeStepData | SilentStepData | TextStepData;
interface Animatable {
    lookAtAnimation?: CameraAnimation;
    modelAnimation?: ModelAnimation;
}
interface BulkStepData extends Animatable {
    aspects: StepAspect[];
}
interface InformationStepData extends Animatable, Placeable {
    content: string;
}
interface DigitalContentStepData extends Animatable, Placeable {
    baseUrl: string;
    varyUpload?: boolean;
}
interface FrameStepData extends Animatable, Placeable, Colorable {
    hideSelectionInCart?: boolean;
    hideImageInCart?: boolean;
    colorPickerEnabled?: boolean;
    displaySelectionOnFinishStep?: boolean;
    displayImageOnFinishStep?: boolean;
    disablePlaceholder?: boolean;
    initialZoomLevel?: number;
    markSelectionAsCustomField?: boolean;
    markImageAsCustomField?: boolean;
    maxColors?: number;
    focalBlur?: boolean;
    focalBlurRadius?: number;
    focalBlurStrength?: number;
    forceImageCover?: boolean;
    overlayImageKey?: string;
    placeholderImageKey?: string;
    placeholderImageUrl?: string;
    varySelection?: boolean;
    varyUpload?: boolean;
    whitelistedExtensions: string[];
}
interface IllustrationStepData extends Animatable, Placeable, Colorable {
    hideSelectionInCart?: boolean;
    hideColorsInCart?: boolean;
    displaySelectionOnFinishStep?: boolean;
    displayColorsOnFinishStep?: boolean;
    markSelectionAsCustomField?: boolean;
    markColorsAsCustomField?: boolean;
    assetKeys?: string[];
    assets?: StepAsset[];
    defaultAssetKey?: string;
    colorPickerEnabled?: boolean;
    pmsPickerEnabled?: boolean;
    varySelection?: boolean;
    varyColors?: boolean;
}
interface MaterialStepData extends Animatable {
    hideSelectionInCart?: boolean;
    displaySelectionOnFinishStep?: boolean;
    markSelectionAsCustomField?: boolean;
    targetMaterials: string[];
    varySelection?: boolean;
}
interface ModelStepData extends Animatable {
    replaceProductModel?: boolean;
    hideSelectionInCart?: boolean;
    displaySelectionOnFinishStep?: boolean;
    markSelectionAsCustomField?: boolean;
    varySelection?: boolean;
}
interface ModuleStepData extends Animatable, Placeable {
    hideTextInCart?: boolean;
    displayTextOnFinishStep?: boolean;
    markTextAsCustomField?: boolean;
    module: string;
    maxLength: number;
    varyText?: string;
}
interface PictureStepData extends Animatable, Placeable {
    hideSelectionInCart?: boolean;
    displaySelectionOnFinishStep?: boolean;
    markSelectionAsCustomField?: boolean;
    varySelection?: boolean;
}
interface QuestionStepData extends Animatable {
    hideSelectionsInCart?: boolean;
    displaySelectionsOnFinishStep?: boolean;
    markSelectionsAsCustomField?: boolean;
    varySelections?: boolean;
}
interface ShapeStepData extends Animatable, Placeable {
    hideSelectionInCart?: boolean;
    displaySelectionOnFinishStep?: boolean;
    markSelectionAsCustomField?: boolean;
    defaultColour?: string;
    excludeFromPrint?: boolean;
    varySelection?: boolean;
}
interface TextStepData extends Animatable, Placeable, Colorable {
    hideSelectionInCart?: boolean;
    hideFillImageInCart?: boolean;
    hideColorInCart?: boolean;
    hideStrokeInCart?: boolean;
    hideTextInCart?: boolean;
    displaySelectionOnFinishStep?: boolean;
    displayImageFillOnFinishStep?: boolean;
    displayColorOnFinishStep?: boolean;
    displayTextOnFinishStep?: boolean;
    displayStrokeOnFinishStep?: boolean;
    markSelectionAsCustomField?: boolean;
    markFillImageAsCustomField?: boolean;
    markColorAsCustomField?: boolean;
    markStrokeAsCustomField?: boolean;
    markTextAsCustomField?: boolean;
    allowNewlines?: boolean;
    defaultText: string;
    deleteDefaultOnFocus?: boolean;
    replaceableText?: string;
    font: string;
    colorPickerEnabled?: boolean;
    maxLength: number;
    maxSize?: number;
    minSize?: number;
    size: number;
    textAlign: string;
    colour: string;
    uppercase?: boolean;
    vertical?: boolean;
    verticalAlign: string;
    curved?: boolean;
    paths?: string[];
    userCanReplaceText?: boolean;
    varySelection?: boolean;
    varyText?: boolean;
    varyColor?: boolean;
    imageFillOption?: OptionResource;
    imageFillScale?: number;
    strokeEnabled?: boolean;
    strokeOption?: OptionResource;
    strokeThickness?: string;
}
interface SilentStepData extends Animatable, Placeable {
    asset?: Asset;
    excludeFromPrint?: boolean;
}
type FinalizeStepData = Animatable;
/**
 * A colorable step is a step that can have an optional color option assigned to help drive color palette choices.
 */
interface Colorable {
    colorOption?: OptionResource;
}
/**
 * A placeable step is a step that can be placed on a canvas in a set of specific positions.
 */
interface Placeable {
    regions: Region[];
}
interface StepService<T extends AnyStepData> {
    /**
     * Initialize the given step, or reload from serialized data if present.
     */
    init(stepData: Step<T>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<any>;
}
interface LayoutsState {
    layouts: {
        [id: string]: LayoutState;
    };
    serializableWorkflow: SerializableWorkflow;
}
/**
 * A workflow step in the process of being serialized or deserialized.
 */
interface SerializableStep {
    stepName: string;
    storage?: StepStorage;
    selectedVariants?: SerializableVariant[];
}
interface SerializableWorkflow {
    steps: SerializableStep[];
}
interface SerializableVariant {
    id: string;
    priceModifier: number;
}
interface StepStorage {
    bulkIsConnected?: boolean;
    color?: string;
    colorProfileAssetKey?: string;
    colors?: {
        [key: string]: IllustrationColorObject;
    };
    colour?: string;
    currentFrameSources?: string[];
    customiseAllText?: boolean;
    defaultCleared?: boolean;
    fillImage?: TextFillImage;
    frameOffsetsList?: FrameOffsets[];
    framePatternData?: {
        originalAssetKey?: string;
        backgroundRemovedAssetKey?: string;
        useOriginalAsset?: boolean;
    };
    framePatternSrc?: string;
    inputText?: string;
    overrideGlobalConfiguration?: boolean;
    overrideGlobalConfigurations?: {
        [key: string]: boolean;
    };
    strokeColor?: IllustrationColorObject;
    text?: string;
    videoShortUrl?: string;
    videoUrl?: string;
}
interface IllustrationColorObject {
    browserValue: string;
    spotColor?: {
        profileName: string;
        namedColor: string;
    };
    pmsValue?: string;
}
interface FrameOffsets {
    y: number;
    x: number;
    zoom: number;
}
interface LayoutState {
    /**
     * The elements currently on this layout.
     */
    elements: LayoutElement[];
    /**
     * A file describing the properties of this layout.
     */
    layout: ILayout;
    /**
     * A unique ID regenerated each time this layout is changed.
     */
    modificationID: string;
}
/**
 * Represents an element on the SVG canvas. This may comprise of multiple SVG elements when
 * output such as path elements, defs, etc. All concrete elements must implement this interface.
 */
interface LayoutElement extends Layerable {
    /**
     * The unique identifier for this element.
     */
    id: string;
    /**
     * If the element was made from a workflow step, this is its step name.
     */
    stepName?: string;
    /**
     * If the element was made from a workflow step, this is its region.
     */
    stepRegion?: Region;
    /**
     * The type of this element
     */
    type: LayoutElementType;
    /**
     * Horizontal offset from top left origin point.
     */
    x: number;
    /**
     * Vertical offset from top left origin point.
     */
    y: number;
    /**
     * The height in pixels of the element.
     */
    width: number;
    /**
     * The height in pixels of the element.
     */
    height: number;
    /**
     * The rotation in degrees.
     */
    rotation: number;
    /**
     * The element is considered immutable and shouldn't be modifiable by the user.
     */
    immutable?: boolean;
    /**
     * When true this element should be rendered on top of all other elements always.
     */
    productOverlay?: boolean;
    /**
     * When true, this element will be removed from SVGString output when
     * the removeExcludedElements flag is set to true.
     */
    excludeFromExport?: boolean;
    /**
     * Value to use as the mask attribute if the element does not correspond to a step.
     */
    mask?: string;
    /**
     * Injected by the LayoutsProvider if required. Shouldn't be
     * used by the user. This is a simple way to pass global rendering configuration
     * to individual elements without having to set up a react context.
     */
    _renderingConfiguration?: RenderingConfiguration;
}
/**
 * Represents a layerable entity. Layerable entities can be sorted within our system for rendering purposes.
 */
interface Layerable {
    /**
     * The layer that this element exists on. Elements on a higher layer can never
     * be below an element on a lower layer. 0 by default.
     */
    layer?: number;
    /**
     * The index of this element on the current layer, if no layer is present it is assumed to be 0.
     * For the index 0 is lower, > 0 is higher
     */
    layerIndex?: number;
}
interface TextFillImage {
    src: string;
    width: number;
    height: number;
    scale: number;
}
/**
 * The reason we need to turn a layout into an SVG.
 */
declare enum LayoutRenderingPurpose {
    ThreeD = "ThreeD",
    FreeDesign = "FreeDesign",
    Print = "Print"
}
/**
 * Specifies configuration for rendering a Papyrus canvas as an SVG string.
 */
interface RenderingConfiguration {
    /**
     * Sets the viewbox to a custom value when subregions are desired.
     */
    region?: PreviewRegion;
    /**
     * Excludes marked elements from the SVG output when true.
     */
    removeExcludedElements?: boolean;
    purpose: LayoutRenderingPurpose;
    /**
     * When true any cached data will be ignored and assets will be rendered in full
     * with the properties they are provided.
     */
    omitCachedFields?: boolean;
    /**
     * When true, spot colors will be output, when provided, into any
     * fill or stroke style in an illustration.
     */
    spotColors?: boolean;
    colorProfiles?: ColorProfileProps[];
    /**
     * Allow for debug rendering on elements.
     */
    debug?: boolean;
}
interface ColorProfileProps {
    name: string;
    key: string;
}
/**
 * The possible types for an element.
 */
declare enum LayoutElementType {
    Frame = "frame",
    Group = "group",
    Image = "image",
    Pattern = "pattern",
    Illustration = "illustration",
    Textbox = "textbox"
}
/**
 * Represents a layout contained within a specific user created design.
 */
interface ILayout {
    /**
     * The internal identifier for this layout.
     */
    id: string;
    /**
     * A link to the json resource describing this layout
     */
    layoutPath?: string;
    /**
     * The index this layout appears at in its design
     */
    index: number;
    /**
     * An id for the panel associated to this layout.
     */
    panelId: string;
    /**
     * The date this layout was created.
     */
    createdAt: Date;
    /**
     * The date this layout was last updated.
     */
    updatedAt: Date;
    /**
     * The height of the layout. This matches the background element on the canvas as a convenience.
     */
    height: number;
    /**
     * The width of the layout. This matches the background element on the canvas as a convenience.
     */
    width: number;
    /**
     * When true this layout should contain no background fill.
     */
    transparentBackground?: boolean;
    previewRegion?: {
        height: number;
        width: number;
        top: number;
        left: number;
    };
    useEditableArea?: boolean;
    editableArea?: {
        x: number;
        y: number;
        height: number;
        width: number;
    };
    name: string;
    title?: string;
}
interface FileInfo {
    /**
     * The name of the file.
     */
    name: string;
    /**
     * A blob object representing the
     * data of the file.
     */
    blob: Blob;
}
/**
 * A command along with a function to run afterwards.
 */
interface CommandWithFollowup {
    command?: CanvasCommand;
    followup?: () => Promise<void>;
}
/**
 * The variant selections of a completed step.
 */
interface SelectedVariants {
    [stepName: string]: {
        id: string;
        name: string;
        priceModifier: number;
    }[];
}
interface ExportedData {
    [name: string]: {
        value: string;
        priceModifier: number;
    };
}
interface DesignCreationMessage {
    additionalExternalProductId?: string;
    additionalExternalVariantId?: string;
    baseCost?: number;
    designExternalVariants?: DesignExternalVariant[];
    designProductId?: string;
    designProductVariantId?: string;
    event: string;
    exportedData: ExportedData;
    externalCartProductId?: string;
    externalCartProductVariantId?: string;
    lineItemImageUrl: string;
    metadata?: {
        [stepName: string]: string;
    };
    optionsCost: number;
    processExecutionId?: string;
    quantity?: number;
    selectedVariants?: SelectedVariants;
    sku?: string;
    transactionId: string;
    transactionOwnerId?: string;
    weight?: number;
    workflowViewerLink: string;
    workflowViewerReadOnlyLink: string;
}
declare enum BundleDesignCreationCartAddMode {
    /** Uses default grouping method, which consolidates products into as few line items as possible */
    Default = "Default",
    /** Only adds the first transaction to the cart. */
    FirstTransaction = "FirstTransaction",
    /** Adds each transaction in the Bundle to the cart, without consolidation. */
    OneToOne = "OneToOne"
}
interface BundleDesignCreationMessage {
    bundleId: string;
    items: DesignCreationMessage[];
    bundleOwnerId?: string;
    cartAddMode?: BundleDesignCreationCartAddMode;
}
/**
 * Represents a transaction.
 */
interface Transaction {
    /**
     * A unique identifier for this transaction. Useful for reloading and
     * modifying state of the transaction.
     */
    id: string;
    /**
     * User-supplied name for the associated design.
     */
    designName?: string;
    /**
     * The workflow associated with this transaction.
     */
    workflowId?: string;
    /**
     * Temporary ID that grants write permission to the transaction.
     */
    transactionOwnerId?: string;
    /**
     * The current state of the design.
     */
    workflowState?: string;
    /**
     * URL to a partner-specific logo intended to display during the workflow experience.
     */
    customLogoLink?: string;
    /**
     * URL to a logo intended to display at the periphery of the workflow experience.
     */
    workflowFooterLogoLink?: string;
    /**
     * URL to the corresponding integration in the REST API.
     */
    restApiIntegrationLink?: string;
    /**
     * URL to redirect to when a workflow is finished.
     */
    callbackUrl?: string;
    /**
     * Product that this transaction belongs to.
     */
    product?: Product;
    /**
     * The integration product related to this lineitem.
     */
    integrationProduct?: IntegrationProductResource;
    /**
     * Whether this transaction has previously been ordered.
     */
    isOrdered?: boolean;
    /**
     * @deprecated use isOrdered to check whether transaction has been ordered instead.
     */
    lineItem?: LineItem;
    /**
     * The external product variant ID representing the design product related
     * to this transaction, null unless the createDesignProduct flag was set
     * and the design was finalized using createDesign operation.
     */
    /**@deprecated use externalCartProductVariantId or designExternalVariants[x].externalProductVariantId instead of this moving forward */
    externalDesignProductVariantId?: string;
    /**
     * The external product id representing the design product related
     * to this transaction, null unless the createDesignProduct flag was set
     * and the design was finalized using createDesign operation.
     */
    /**@deprecated use externalCartProductId or designExternalVariants[x].externalProductId instead of this moving forward. */
    externalDesignProductId?: string;
    /**
     * The external product id representing the product related to the transaction.
     * This value can hold any type of transaction such as design and standard products.
     */
    externalCartProductId?: string;
    /**
     * The external product variant id representing the product related to the transaction.
     * This value can hold any type of transaction such as design and standard products.
     */
    externalCartProductVariantId?: string;
    priceModifierTotal?: number;
    /**
     * URL to open the transaction in the workflow viewer.
     */
    workflowViewerLink?: string;
    workflowViewerReadOnlyLink?: string;
    previewImageLink?: string;
    lastSyncedAt?: string;
    /**
     * The users who have access to this transaction.
     */
    stakeholders?: Stakeholder[];
    /** The stakeholder of the currently logged in user, if applicable. */
    currentStakeholder?: Stakeholder;
    /**
     * The amount of this transaction that was, or will be, ordered
     */
    quantity?: number;
    createdAt?: string;
    printFileUrl1?: string;
    printFileUrl2?: string;
    printFileUrl3?: string;
    printFileUrl4?: string;
    printFileUrl5?: string;
    printFileName1?: string;
    printFileName2?: string;
    printFileName3?: string;
    printFileName4?: string;
    printFileName5?: string;
    /**
     * An array of objects containing information on additional products to add to the cart.
     * Typically only available when being passed to {@link DesignCreationMessage}
     */
    designExternalVariants?: DesignExternalVariant[];
    /**
     * A list of actions that have been associated to this transaction. To be used by the client to interact further post design.
     */
    transactionShareActions?: ShareAction[];
    /** Whether any share actions for this Transaction require the user to be authenticated as a stakeholder */
    hasAuthenticatedActions?: boolean;
    marketplaceThemeInstallConfiguration?: ThemeInstallConfigurationGraphQl;
    completed?: boolean;
}
interface ShareAction {
    id: string;
    type: ShareActionType;
    title?: string;
    precedence?: number;
    stakeholderType?: string;
    url?: string;
}
declare enum ShareActionType {
    Hyperlink = "Hyperlink",
    Edit = "Edit",
    Approve = "Approve"
}
/**
 * An object containing ids for an external product/variant that should be added to the cart alongside the base product/variant.
 */
interface DesignExternalVariant {
    id?: string;
    externalProductId?: string;
    externalProductVariantId?: string;
    skuCode?: string;
}
/**
 * An integration product represents the connection of a product in SpiffCommerce with
 * a product on a third party platform.
 */
interface IntegrationProductResource {
    /**
     * The ID of the IntegrationProduct entity. Used internally by SpiffCommerce.
     */
    id: string;
    /**
     * The ID of the product on the third party platform. For example a Shopify product ID.
     */
    externalProductId?: string;
    /**
     * The integration that this product is associated with. For example a Shopify integration.
     */
    integration?: Integration;
    /**
     * The ID of an additional product (on the third party platform) that should be added to the cart.
     */
    additionalExternalProductId?: string;
    /**
     * A supplementary ID for the additional product. Shopify uses the variant ids to add products to the cart.
     */
    additionalExternalVariantId?: string;
    /**
     * When the additionalExternalProductId is set, this is the IntegrationProduct that is associated with it.
     * If no Spiff product has been associated with the additionalExternalProductId, this will be null.
     */
    additionalIntegrationProduct?: IntegrationProductResource;
    /**
     * The product that this integration product is associated with.
     */
    product?: Product;
}
interface Integration {
    id: string;
    enabled: boolean;
    externalIntegrationId?: string;
    type?: IntegrationType;
    isCurrent?: boolean;
    theme: Theme;
    logo: string;
    partner: Partner;
    marketplaceThemeInstallConfiguration?: ThemeInstallConfigurationGraphQl;
}
interface Theme {
    configuration?: string;
    fontAsset?: Asset;
    id?: string;
    name?: string;
    primaryColor?: string;
    secondaryColor?: string;
    textColor?: string;
    themeLayout?: {
        id?: string;
        name?: string;
    };
}
declare enum IntegrationType {
    Hub = "Hub",
    Shopify = "Shopify"
}
/**
 * Fields found in a variant within a line item resource.
 */
interface LineItemVariant {
    currencyCode: string;
    optionName: string;
    priceModifier: number;
    stepName: string;
    variantName: string;
}
interface LineItem {
    id: string;
    transactionId?: string;
    previewImageUrl?: string;
    product: Product;
    quantity: number;
    metadata?: LineItemMetadata[];
    variants: LineItemVariant[];
}
interface LineItemMetadata {
    stepName: string;
    metadata: string;
}
interface ProductWorkflow {
    friendlyName: string;
    id: string;
    index?: number;
    present?: boolean;
    imageUrl: string;
    workflowName: string;
}
interface Partner {
    id?: string;
    name?: string;
    currencyCode?: string;
    customerDetailsPromptMarkdown?: string;
    activeAddons?: AddonHandle[];
}
declare enum AddonHandle {
    BackgroundRemover = "BackgroundRemover",
    ConversionAccelerator = "Conversion Accelerator",
    ProcessBuilder = "ProcessBuilder"
}
interface Product {
    /**
     * ID of the partner owner.
     */
    partnerId?: string;
    partner?: Partner;
    /**
     * Whether a line item for this product is delivered as soon as the order is received.
     */
    autoprint: boolean;
    /**
     * Whether this product can be quickprinted.
     */
    canQuickprint?: boolean;
    /**
     * The internal identifier for this product.
     */
    id: string;
    /**
     * The human friendly name of the product.
     */
    name: string;
    /**
     * A description of the Product, written in Markdown.
     */
    description?: string;
    /**
     * A URL to the image asset associated with this product.
     */
    imageUrl?: string;
    /**
     * A resource url for a 3D model used to represent this product
     * in the 3d editor. If not available we assume the product doesn't support 3D.
     */
    modelUrl?: string;
    /**
     * A URL for the image used as an overlay on any workflows
     * that incorporate a product overlay step.
     */
    overlayImageUrl?: string;
    /**
     * Words which can't be used in a workflow for this product.
     */
    profanities?: {
        id: string;
        createdAt: string;
        userId: string;
        word: string;
    }[];
    /**
     * The max characters that can be typed for quickprint.
     */
    quickprintMaxLength?: number;
    /**
     * The name of the module to use for quickprint.
     */
    quickprintModuleName?: string;
    /**
     * If true, the product should be displayed in the client as if it is available.
     * Should be displayed as if it is unavailable otherwise.
     */
    enabled: boolean;
    /**
     * Workflows which have been assigned to this product.
     */
    workflows?: ProductWorkflow[];
    /**
     * The base price of this product in sub units. Essentially the cost of the
     * product without any customisations applied.
     */
    basePrice?: number;
    /**
     * The weight of this product.
     */
    weight?: number;
    minimumOrderQuantity?: number;
    /**
     * When specified, represents a pre-rendered image of this product to be
     * displayed to customers while the 3D preview is loading.
     */
    preloadImageUrl?: string;
    /**
     * When set the store owner has configured this product to prompt for
     * customer details. In hosted experience, we'll offer to collect this information from the customer. In
     * bespoke UIs created using the Core SDK you will need to check this flag and request the data accordingly.
     * See attachCustomerDetails on the WorkflowExperience for how to supply us with the details you collect.
     */
    promptForCustomerDetails?: boolean;
    /**
     * Configuration for conversion. Optional.
     */
    conversionConfiguration?: ConversionConfiguration;
    integrationProducts?: IntegrationProductResource[];
    productTags?: ProductTag[];
    productImages?: ProductImage[];
    /**
     * The SKU of the product in the merchant's store.
     */
    sku?: string;
    /**
     * The Spiff SKU code for the product.
     */
    skuCode?: string;
    /**
     * Price breaks for this product when dealing with quantity.
     */
    priceBreaks?: ProductPriceBreak[];
}
interface ProductImage {
    id: string;
    precedence?: number;
    asset: Asset;
}
/**
 * A price break represents a minimum quantity of a product and the price that will be charged for that quantity.
 * This can be seen as an override for the base price of the product.
 */
interface ProductPriceBreak {
    /**
     * The id of this price break.
     */
    id: string;
    /**
     * The minimum quantity of this price break. A positive integer.
     */
    minQty: number;
    /**
     * A percentage to apply to the overall price. A value between 0-1 where 1 retains 100% of the original price and 0 completely discounts it to free.
     */
    percentage: number;
}
interface ProductTag {
    id: string;
    name: string;
}
interface ColorOption {
    id?: string;
    fill?: string;
    stroke?: string;
    variant?: VariantResource;
    colorProfileAssetKey?: string;
    pmsValue?: string;
}
interface RegionElement {
    id: string;
    region?: Region;
}
interface FrameMetadata {
    image: string;
}
interface IllustrationMetadata {
    colors: string[];
}
interface ModuleMetadata {
    text: string;
}
interface TextMetadata {
    color?: string;
    text: string;
    fillImage?: string;
    strokeColor?: string;
}
interface SelectionStorage {
    selectedVariants?: VariantResource[];
}
interface TextStepStorage extends SelectionStorage {
    color?: string;
    defaultCleared?: boolean;
    inputText?: string;
    text?: string;
    customiseAllText?: boolean;
}
type StepSelections = {
    [key: string]: SelectionStorage;
};
interface FrameData {
    /**
     * The path data for a frame SVG
     */
    path: string;
    /**
     *  The viewbox width
     */
    width: number;
    /**
     * The viewbox height.
     */
    height: number;
}
interface FrameThresholdSettings {
    useThreshold: boolean;
    invertThreshold: boolean;
    threshold: number;
    thresholdSaturation: number;
}
/**
 * Defines the different behaviors supported by the camera system
 * for control when viewing a product.
 */
declare enum ProductCameraRig {
    Orbit = 0,
    Pan = 1
}
/**
 * Someone who has used a workflow experience and entered their contact details.
 */
interface Customer {
    id?: string;
    emailAddress: string;
    firstName?: string;
    lastName?: string;
    phoneNumber?: string;
    loginToken?: string;
    partner?: Partner;
    stakeholders?: Stakeholder[];
    bundleStakeholders?: BundleStakeholder[];
    hasBundleTemplates?: boolean;
}
interface CustomerDetailsInput {
    emailAddress: string;
    firstName?: string;
    lastName?: string;
    phoneNumber?: string;
}
declare enum StakeholderType {
    Owner = "Owner",
    Approver = "Approver",
    Editor = "Editor",
    Viewer = "Viewer"
}
interface Stakeholder {
    id: string;
    type?: StakeholderType;
    authorizationDate?: string;
    authorizationNote?: string;
    authorizationStatus?: string;
    transaction?: Transaction;
    customer?: Customer;
}
/**
 * A wrapper for a list of bundles returned from the server.
 */
interface BundlesFeed {
    /** The items. The size of this array will typically be limited by the request. */
    items: Bundle[];
    /** The total number of items available on the server that matched the initial request. */
    total: number;
}
declare enum BundleTemplateStatus {
    Draft = "Draft",
    Active = "Active"
}
interface Bundle {
    id?: string;
    bundleOwnerId?: string;
    completed?: boolean;
    currentBundleStakeholder?: BundleStakeholder;
    bundleStakeholders?: BundleStakeholder[];
    bundleStateData?: string;
    globalPropertyState?: GlobalPropertyState;
    metadata?: {
        key: string;
        value: string;
    }[];
    name?: string;
    partner?: Partner;
    productCollection?: ProductCollectionResource;
    transactions?: Transaction[];
    template?: boolean;
    templateStatus?: BundleTemplateStatus;
    bundleShareActions?: ShareAction[];
    workflowViewerLink: string;
    workflowViewerAmendLink: string;
    workflowViewerReadOnlyLink: string;
    quoteId?: string;
}
interface BundleStakeholder {
    id: string;
    bundle?: Bundle;
    customer?: Customer;
    type?: StakeholderType;
    authorizationDate?: string;
    authorizationNote?: string;
    authorizationStatus?: string;
}
interface BundleStakeholderInput {
    type: StakeholderType;
    customerDetails: CustomerDetailsInput;
}
type ProductCollectionResource = {
    id: string;
    globalPropertyConfiguration?: GlobalPropertyConfiguration;
    productCollectionProducts?: ProductCollectionProductResource[];
    productCollectionProductsFeed?: ProductCollectionProductsFeedResource;
    name: string;
    description?: string;
    image?: Asset;
    transformCollection?: TransformCollection;
};
type ProductCollectionProductResource = {
    id: string;
    productCollection?: ProductCollectionResource;
    productCollectionId?: string;
    product: Product;
    productId: string;
    workflowId?: string;
};
type ProductCollectionProductsFeedResource = {
    items: ProductCollectionProductResource[];
    total: number;
};
type GlobalPropertyState = {
    id: string;
    aspects: GlobalPropertyStateAspect[];
};
type GlobalPropertyStateAspect = {
    name: string;
    value: string;
    type?: AspectType;
    storage?: GlobalPropertyStateAspectStorage;
    channel?: number;
};
type GlobalPropertyStateAspectStorage = GlobalPropertyStateFileUploadStorage | GlobalPropertyStateColorOptionStorage;
type GlobalPropertyStateFileUploadStorage = {
    originalAssetKey?: string;
    backgroundRemovedAssetKey?: string;
    useOriginalAsset?: boolean;
    colors?: GlobalPropertyStateIllustrationColor[];
};
type GlobalPropertyStateIllustrationColor = {
    key: string;
    browserValue: string;
    pmsValue?: string;
};
type GlobalPropertyStateColorOptionStorage = {
    customColor?: string;
};
interface BundleStateTransform {
    position: Vector3;
    rotation: Vector3;
    scale: Vector3;
}
interface Vector3 {
    x: number;
    y: number;
    z: number;
}
interface TransformCollection {
    id: string;
    name: string;
    transforms: TransformCollectionTransform[];
}
interface TransformCollectionTransform {
    id: string;
    name: string;
    position: Vector3;
    rotation: Vector3;
    scale: Vector3;
}
type Extendable<T> = T & {
    [key: string]: any;
};
interface Metafield {
    id: string;
    createdAt: string;
    updatedAt: string;
    entityId: string;
    value: string;
    metafieldConfiguration: MetafieldConfiguration;
}
interface MetafieldConfiguration {
    id: string;
    createdAt: string;
    updatedAt: string;
    entityType: string;
    metafieldType: string;
    name: string;
}
declare enum TextAlgorithm {
    /**
     * An algorithm that finds the best size for text based
     * on a range minSize <-> maxSize
     * NOTE: Default, this is how we've calculated historically.
     */
    Autosize = "Autosize",
    /**
     * An algorithm that follows behavior of other popular
     * text editing applications.
     */
    Traditional = "Traditional"
}
interface FrameElement extends LayoutElement {
    path: string;
    /**
     * Assigns the 'data-frame-width' attribute to the frame element. The rasterizer we use has issues with images inside
     * patterns. This is a workaround to ensure that the pattern is correctly sized.
     */
    dataWidth?: number;
    /**
     * Assigns the 'data-frame-height' attribute to the frame element. The rasterizer we use has issues with images inside
     * patterns. This is a workaround to ensure that the pattern is correctly sized.
     */
    dataHeight?: number;
    disablePlaceholder?: boolean;
    scaleX: number;
    scaleY: number;
    opacity?: number;
    pattern?: Pattern;
    focalBlur?: boolean;
    focalBlurStrength?: number;
    focalBlurRadius?: number;
    forceImageCover?: boolean;
    useThreshold?: boolean;
    invertThreshold?: boolean;
    threshold?: number;
    thresholdSaturation?: number;
}
/**
 * A pattern object stores data relevant for displaying an image within a frame, including
 * the source for the image itself and also dimensions and offsets.
 */
interface Pattern extends Omit<LayoutElement, "type"> {
    /**
     * The image to use when a file is generated, this should be an original high resolution source file.
     */
    src: string;
    /**
     * Scaling X of image within frame.
     */
    scaleX: number;
    /**
     * Scaling Y of image within frame.
     */
    scaleY: number;
    /**
     * The SVG document that the src represents. This must be the actual content string of the document, rather than a URL.
     */
    svg?: string;
    /**
     * A map of ID to color code, used to store color selections in the SVG. Only applicable when `svg` is provided.
     */
    colors?: {
        [key: string]: ColorDefinition;
    };
}
interface IllustrationElement extends LayoutElement {
    /**
     * When provided a src will be used to rehyrdrate the svg field. On serialization
     * the svg field will be dropped and only src will remain.
     */
    src?: string;
    /**
     * The string representation of the SVG element. A valid SVG document.
     */
    svg?: string;
    /**
     * A cached image representation of this SVG, to be used for faster
     * rendering in performance critical code.
     */
    cachedObjectURL?: string;
    /**
     * A map of ID to color code, used to store color selections in the SVG.
     */
    colors: {
        [key: string]: ColorDefinition;
    };
}
/**
 * Represents a raster image on the Papyrus canvas.
 */
interface ImageElement extends LayoutElement {
    /**
     * A src for the image. This will be used in place of the data URL in server environments and should
     * be original image quality.
     */
    src: string;
    /**
     * https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio
     */
    preserveAspectRatio?: string;
}
interface TextboxElement extends LayoutElement {
    /**
     * Horizontal alignment of text. eg. left, center, right.
     */
    align?: string;
    /**
     * An image to use as the fill instead of a color.
     */
    textFillImage?: TextFillImage;
    /**
     * Fill color of this text. Any value that can be parsed by css fill should work here.
     */
    fill: string;
    /**
     * The font size.
     */
    fontSize: number;
    /**
     * Information about the font family used to render this text.
     */
    fontData: FontData | undefined;
    /**
     * Text computed for this textbox.
     */
    text?: string;
    /**
     * Per element user input. Not used by the layout engine. Instead
     * used to store user input for textbox to preserve newlines.
     */
    input?: string;
    /**
     * Should the text layout top to bottom.
     */
    vertical?: boolean;
    /**
     * The height between text lines.
     */
    lineHeight?: number;
    /**
     * The alignment of text vertically, top center or bottom.
     */
    verticalAlign: string;
    /**
     * When true the text will be rendered using the provided curve.
     */
    curved?: boolean;
    /**
     * The curve to use when curved = true. Ignored otherwise.
     */
    paths?: string[];
    /**
     * The algorithm to use when laying out text.
     */
    algorithm?: TextAlgorithm;
    fillSpotColorDefinition?: SpotColorDefinition;
    strokeColor?: ColorDefinition;
    strokeThickness?: string;
}
interface FontData {
    assetUrl: string;
    name: string;
}
/**
 * Contains configuration for font sizing.
 *
 * When min/maxSize values are set we interpret the textbox as being
 * in "Variable Mode" which essentially
 * auto sizes the text based on a given region.
 *
 * When only size is set, we interpret the textbox as being in "Fixed Mode" where
 * text is computed at a fixed font size.
 */
interface SizeRange {
    /**
     * Variable Mode: A maximum size
     */
    maxSize?: number;
    /**
     * Variable Mode: Minimum Size
     */
    minSize?: number;
    /**
     * Fixed Mode: A Fixed font size to be used at all times.
     */
    size: number;
}
interface ColorDefinition {
    /**
     * Represents the color value in hex or any other
     * browser supported format. This will be used when rendering the canvas
     * in an environment that doesn't support spot color.
     */
    browserValue: string;
    /**
     * A spot color definition. This is optional and will
     * be applied to the SVG returned by toString when configured allowing
     * filegen to output spot colors.
     */
    spotColor?: SpotColorDefinition;
    /**
     * Represents the color value in the PMS colorspace.
     */
    pmsValue?: string;
}
/**
 * A container for data related to a specific spotcolor. toString
 * can be used to output a string expected by Filegen inside a stroke or fill.
 */
interface SpotColorDefinition {
    /**
     * The name of the profile being used.
     */
    profileName: string;
    /**
     * The named color expected by the profile.
     */
    namedColor: string;
}
/**
 * A container for data related to a specific spotcolor. toString
 * can be used to output a string expected by Filegen inside a stroke or fill.
 */
interface SpotColorDefinition {
    /**
     * The name of the profile being used.
     */
    profileName: string;
    /**
     * The named color expected by the profile.
     */
    namedColor: string;
}
interface TextFillSpotColor$1 {
    profileName: string;
    namedColor: string;
}
interface PatternImageData {
    /**
     * The original src of the image.
     */
    src: string;
    /**
     *  The natural width of the image.
     */
    width: number;
    /**
     * The natural height of the image.
     */
    height: number;
    /**
     * Cached result of the calculation width/height.
     */
    aspect: number;
    /**
     * The SVG document that the src represents. This must be the actual content string of the document, rather than a URL.
     */
    svg?: string;
    /**
     * A map of ID to color code, used to store color selections in the SVG. Only applicable when `svg` is provided.
     */
    colors?: {
        [key: string]: ColorDefinition;
    };
}
/**
 * Defines the direction of scaling, can be used
 * to determine the anchor point of a scale calculation.
 */
declare enum ScaleAxis {
    North = 0,
    Northeast = 1,
    East = 2,
    Southeast = 3,
    South = 4,
    Southwest = 5,
    West = 6,
    Northwest = 7
}
/**
 * A point in a 2D coordinate space.
 */
interface Point {
    x: number;
    y: number;
}
interface Workflow {
    defaultPreviewPanelIndex?: number;
    deletedAt?: Date;
    id: string;
    previewAssetKey?: string;
    previewImageUrl?: string;
    name: string;
    introduction: string;
    panels: WorkflowPanel[];
    showModelOnFinishStep: boolean;
    showPricing?: boolean;
    baseCurrency?: string;
    showPlusInVariantPrices?: boolean;
    allowProofDownload: boolean;
    steps: Step<AnyStepData>[];
    stepGroups: StepGroup[];
    theme?: {
        primaryColour: string;
        textColour: string;
    };
    globalPreviewConfig?: PreviewConfiguration;
    finalizeStepConfig?: FinalizeStepConfig;
    partnerId?: string;
    toggleBulkSourceView?: boolean;
    overrideTheme?: Theme;
    globalPropertyConfiguration?: GlobalPropertyConfiguration;
}
interface WorkflowPanel {
    height: number;
    width: number;
    name: string;
    title?: string;
    index: number;
    transparentBackground?: boolean;
    previewRegion?: PreviewRegion;
    useEditableArea?: boolean;
    editableArea?: {
        x: number;
        y: number;
        height: number;
        width: number;
    };
}
interface StepGroup {
    id?: string;
    name: string;
    stepNames: string[];
}
interface FinalizeStepConfig {
    termsMarkdown?: string;
    modelAnimation?: ModelAnimation;
    lookAtAnimation?: CameraAnimation;
    previewRegion?: {
        left: number;
        top: number;
        width: number;
        height: number;
    };
}
interface PreviewRegion {
    top: number;
    left: number;
    width: number;
    height: number;
}
interface PreviewRegion {
    top: number;
    left: number;
    width: number;
    height: number;
}
interface ModelAnimation {
    /**
     * A value it seconds along the animation timeline to begin at.
     */
    from?: number;
    /**
     * A value in seconds along the animation timeline to end at.
     */
    to?: number;
    /**
     * When true the animation will loop. The only behaviour currently is to reset
     * back to from but we could have it bounce back and forth and/or follow a curve.
     */
    loop?: boolean;
    /**
     * The name of the animation to play.
     */
    name?: string;
}
/**
 * A CameraAnimation specifies a discrete state that the camera should
 * animate to. This state represents the final position of the camera after animations have run.
 */
interface CameraAnimation {
    /**
     * The longitutude in degrees the camera should animate to.
     */
    lonDeg: number;
    /**
     * The lattitude in degrees the camera should animnate to.
     */
    latDeg: number;
    /**
     * An optional target for the camera to focus on in the scene.
     */
    target?: {
        x: number;
        y: number;
        z: number;
    };
    /**
     * A value in scene units specifying camera distance from the target.
     */
    radius?: number;
}
/**
 * Settings related to the 3D preview for use at either a global level or at per step level. The global
 * values can be a default if per step values aren't specified.
 */
interface PreviewConfiguration {
    /**
     * @deprecated Removed in favor of backgroundColor as a simple hexadecimal color value.
     */
    clearColor?: [number, number, number];
    /**
     * The color expected to be seen in the background of the product
     */
    backgroundColor?: string;
    /**
     * The closest zoom the camera can achieve to the product.
     */
    maxZoomOverride?: number;
    /**
     * The furthest zoom the camera can achieve to the product.
     */
    minZoomOverride?: number;
    /**
     * The environment file used to calculate product lighting.
     */
    environmentFile?: string;
    /**
     * The lowest point, vertically, that the camera can rotate to.
     * https://doc.babylonjs.com/divingDeeper/cameras/camera_introduction
     */
    lowerBetaLimitDeg?: number;
    /**
     * The highest point, vertically, that the camera can rotate to.
     * https://doc.babylonjs.com/divingDeeper/cameras/camera_introduction
     */
    upperBetaLimitDeg?: number;
    /**
     * The leftmost point, horizontally, that the camera can rotate to.
     * https://doc.babylonjs.com/divingDeeper/cameras/camera_introduction
     */
    lowerAlphaLimitDeg?: number;
    /**
     * The rightmost point, horizontally, that the camera can rotate to.
     * https://doc.babylonjs.com/divingDeeper/cameras/camera_introduction
     */
    upperAlphaLimitDeg?: number;
    /**
     * When set the product while rotate slowly
     */
    autoRotation?: boolean;
    /**
     * Time in milliseconds before the product starts rotating after a user input has taken control.
     */
    idleTimeBeforeRotation?: number;
    /**
     * When set the 3D preview won't attempt to orient the product automatically to its front view at load.
     */
    disableAutomaticOrientation?: boolean;
    /**
     * When true the action bar won't be displayed to the user.
     */
    disableActionBar?: boolean;
    /**
     * When true the AR button will be displayed to the user.
     */
    enableAR?: boolean;
}
declare enum UnitOfMeasurement {
    Pixel = "px",
    Millimeter = "mm",
    Centimeter = "cm"
}
type PapyrusComponent<T = any> = FunctionComponent<T>;
type PapyrusNode = ReactNode;
interface Order {
    id: string;
    internalId: string;
}
interface OrderItem {
    transactionId: string;
    amountToOrder: number;
}

declare class OptionService {
    /**
     * Allows for retrieving an option, returns the option from a cache if possible.
     * @param id The option ID to be retrieved.
     */
    getOption(id: string): Promise<undefined | OptionResource>;
    getAssetTileImageForVariant(variant: VariantResource): Promise<string>;
    getDefaultVariant(option: OptionResource): VariantResource | undefined;
    /**
     * Returns the first variant marked as selected. This is used by most steps.
     */
    getSelectedVariant: (option: OptionResource | undefined, selectedVariantIds: string[]) => VariantResource | undefined;
}
declare const optionService: OptionService;

declare const setBearerAuthenticationToken: (token: string) => void;
declare class GraphQlManager {
    private shadowGraphqlClient;
    constructor();
    getShadowGraphqlClient(): ApolloClient<any>;
    private constructShadowGraphqlClient;
}
declare const graphQlManager: GraphQlManager;

interface StorageService {
    /**
     * Get a value.
     * @param key The key to lookup the value with.
     */
    get(key: string): string | undefined;
    /**
     * Set a value.
     * @param key The key to set.
     * @param val The new value.
     */
    set(key: string, val: string): void;
    /**
     * Remove a value.
     * @param key The key to remove, does nothing if the key doesn't exist.
     */
    remove(key: string): void;
    /**
     * Get a map from persistence.
     * @param key The key to search by.
     */
    getMap<K = any, V = any>(key: string): Map<K, V> | undefined;
    /**
     * St a map into persistence.
     * @param key The key to set the map at.
     * @param val The map to set.
     */
    setMap<K = any, V = any>(key: string, val: Map<K, V>): void;
}
declare const persistenceService: StorageService;

declare class Configuration {
    private readonly defaultServerUrl;
    private readonly defaultServicesApiUrl;
    private readonly defaultHubUrl;
    private serverUrl;
    private servicesApiUrl;
    private hubUrl;
    private serverUrlCallbacks;
    constructor();
    getServerUrl(): string;
    getServicesApiUrl(): string;
    getHubUrl(): string;
    setServerUrl(serverUrl: string): void;
    setServicesApiUrl(servicesApiUrl: string): void;
    setHubUrl(hubUrl: string): void;
    addServerUrlCallback(callback: () => void): void;
}
declare const spiffCoreConfiguration: Configuration;

type ToastCallback = (callbackOptions: {
    toastMessage: null | string;
    toastType: InformationMessageType | null;
}) => void;
declare class Toast {
    private latestToast;
    private toastType;
    private toastCallbacks;
    constructor();
    addToastCallback(callback: ToastCallback): void;
    removeToastCallback(callback: ToastCallback): void;
    setLatestToast(errorMessage: null | string, errorType: InformationMessageType | null): void;
    private onToastChange;
}
declare const toast: Toast;

interface FrameCreateOpts {
    stepName?: string;
    frameData: FrameData;
    disablePlaceholder?: boolean;
    pattern?: any;
}
declare class FrameStepService implements StepService<FrameStepData> {
    init(stepData: Step<FrameStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
    private reload;
    availableColors(stepData: Step<FrameStepData>, _workflowManager: WorkflowManager): Promise<ColorOption[]>;
    selectImage(stepData: Step<FrameStepData>, asset: Asset, workflowManager: WorkflowManager, recalculateOffsets?: boolean): Promise<void>;
    selectVariant(stepData: Step<FrameStepData>, variant: VariantResource | undefined, elements: RegionElement[], workflowManager: WorkflowManager, setFrameIsUpdating?: (status: boolean) => void): Promise<void>;
    getCreateElementCommand(id: string, region: Region, layout: ILayout, options: FrameCreateOpts): CreateElementCommand<FrameElement>;
    loadPatternFromString(src: string, frameService: FrameService, recalculateOffsets?: boolean, colors?: {
        [key: string]: ColorDefinition;
    } | undefined, colorSafeSvg?: boolean): Promise<void>;
    changeColors(stepData: Step<FrameStepData>, workflowManager: WorkflowManager, newFills: Map<string, ColorDefinition>): void;
    getUniqueColorCount(stepData: Step<FrameStepData>, workflowManager: WorkflowManager): number;
    private calculateColorMetadata;
    private validateColorCount;
    private selectVariantCommand;
    private frameSourceSvg;
    /**
     * Grab the source to be used for a frame from the variant or throw otherwise.
     */
    static patternSource(asset: Asset): string;
    private loadPatternFromAsset;
}
declare const frameStepService: FrameStepService;

interface SVGCreateOpts {
    stepName?: string;
    src: string;
    objectURL: string;
    svg: {
        svg: string;
        colors: {
            [key: string]: ColorDefinition;
        };
    };
}
declare class IllustrationStepService implements StepService<IllustrationStepData> {
    getIllustrationBody(src: string): Promise<string>;
    getCreateElementCommand(id: string, region: Region, layout: ILayout, options: SVGCreateOpts): CreateElementCommand<IllustrationElement>;
    getColors(stepData: Step<IllustrationStepData>, workflowManager: WorkflowManager): never[] | {
        [key: string]: ColorDefinition;
    };
    init(stepData: Step<IllustrationStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
    private reload;
    availableColors(stepData: Step<IllustrationStepData>, _workflowManager: WorkflowManager): Promise<{
        fill: string | undefined;
        stroke: string | undefined;
        variant: VariantResource;
        pmsValue: string;
    }[] | undefined>;
    changeColorsCommand(svg: string, illustrationWidth: number, illustrationHeight: number, elements: string[], newFills: Map<string, string | ColorDefinition>): Promise<CanvasCommand>;
    changeColors(stepData: Step<IllustrationStepData>, elements: RegionElement[], workflowManager: WorkflowManager, getAllLayouts: () => LayoutData[], newFills: Map<string, string | ColorDefinition>): Promise<void>;
    selectVariant(stepData: Step<IllustrationStepData>, variant: VariantResource, elements: RegionElement[], setIsUpdating: (isUpdating: boolean) => void, workflowManager: WorkflowManager): Promise<void>;
    private selectVariantCommand;
}
declare const illustrationStepService: IllustrationStepService;

declare class MaterialStepService implements StepService<MaterialStepData> {
    init(stepData: Step<MaterialStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<null | CommandWithFollowup>;
    private reload;
    selectVariant(step: Step<MaterialStepData>, variant: VariantResource, workflowManager: WorkflowManager, setApplying: (status: boolean) => void): Promise<void>;
    private selectVariantLambda;
}
declare const materialStepService: MaterialStepService;

declare class ModelStepService implements StepService<ModelStepData> {
    init(stepData: Step<ModelStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
    private reload;
    selectVariant(step: Step<ModelStepData>, variant: VariantResource, workflowManager: WorkflowManager, setApplying: (status: boolean) => void): Promise<void>;
    private selectVariantLambda;
}
declare const modelStepService: ModelStepService;

interface TextFillSpotColor {
    profileName: string;
    namedColor: string;
}
interface TextUpdateResult {
    command?: GroupCommand;
    helperData: {
        charactersRemaining?: number;
    };
    errorData?: TextErrorData;
}
interface TextErrorData {
    blockedProfanity?: boolean;
    doesNotFit?: boolean;
    hitCharacterLimit?: boolean;
    illegalMultipleLines?: boolean;
    unsupportedCharacters?: boolean;
}
declare class TextStepService implements StepService<TextStepData> {
    private cachedColors;
    private cachedStrokeColors;
    init(stepData: Step<TextStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
    findLayoutElements(workflowManager: WorkflowManager, step: Step<TextStepData>): TextboxElement[];
    /**
     * Get the colors that can be used for a given text step.
     * @param stepData The text step to get colors for.
     * @returns A list of color objects containing fill, stroke and variant if available.
     */
    availableFillColors(stepData: Step<TextStepData>): ColorOption[];
    changeAlignment(stepData: Step<TextStepData>, alignment: "left" | "center" | "right", elements: RegionElement[], workflowManager: WorkflowManager): void;
    changeFillColor(stepData: Step<TextStepData>, newColor: ColorOption, elements: RegionElement[], workflowManager: WorkflowManager): Promise<void>;
    availableFillImages(stepData: Step<TextStepData>): Promise<TextFillImage[]>;
    changeFillImage(stepData: Step<TextStepData>, fillImage: TextFillImage, elements: RegionElement[], workflowManager: WorkflowManager): Promise<void>;
    /**
     * Get the colors that can be used for a given text step's stroke.
     * @param stepData The text step to get colors for.
     * @returns A list of color objects containing fill, stroke and variant if available.
     */
    availableStrokeColors(stepData: Step<TextStepData>): ColorOption[];
    changeStrokeColor(stepData: Step<TextStepData>, newColor: ColorOption | undefined, elements: RegionElement[], workflowManager: WorkflowManager): Promise<void>;
    /**
     * Given an element and a string, filters any characters from the string that are
     * not supported by the font of the given element.
     * @param text The text string to filter.
     * @param fontData An optional fontData object, when provided, we use the font table to determine glyphs that aren't provided and additionally strip these out also.
     * @returns A new string representing the passed string with unsupported characters removed.
     */
    filterUnsupportedCharacters: (text: string, fontData?: FontData) => string;
    getProcessedInput(input: string, stepData: TextStepData, customiseAllText: boolean): string;
    updateInputText(input: string, elements: TextboxElement[], step: Step<TextStepData>, workflowManager: WorkflowManager): TextUpdateResult;
    selectVariant(step: Step<TextStepData>, variant: VariantResource, workflowManager: WorkflowManager, setError: (status: boolean) => void, setHelperText: (text: string) => void): Promise<void>;
    textAlign: (stepData: TextStepData) => string;
    createTextFillSpotColor(colorOption: OptionResource, variant: VariantResource): TextFillSpotColor | undefined;
    private reload;
    private getDefaultColorVariant;
    private getDefaultColor;
    private getDefaultImageFillVariant;
    private getDefaultStrokeColorVariant;
    /**
     * Validates a string of text based on step configuration.
     * @param text The text to validate
     * @param step The step providing configuration
     * @param workflowManager Workflow manager for access to workflow state
     * @returns A list of errors. Empty if the text passes validation.
     */
    private getErrorsForText;
    private fontDataFromVariant;
    private selectVariantCommand;
    /**
     * When a text step specifies replaceable text, the text input by the user will replace
     * a specific token within a larger string of text specified in the step configuration. Otherwise
     * this function will just return the text it's given when the feature is disabled.
     */
    private injectReplaceableText;
    private createTextboxRegions;
    private generateTextChangeCommandsForRegion;
    /**
     * @deprecated
     */
    private changeInputTextWithRegion;
}
declare const textStepService: TextStepService;

declare class PictureStepService implements StepService<PictureStepData> {
    init(stepData: Step<PictureStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
    private reload;
    selectVariant(stepData: Step<PictureStepData>, variant: VariantResource, workflowManager: WorkflowManager, setIsUpdating: (status: boolean) => void): Promise<void>;
    private selectVariantCommand;
}
declare const pictureStepService: PictureStepService;

declare class QuestionStepService implements StepService<QuestionStepData> {
    init(stepData: Step<QuestionStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
    private reload;
    selectVariant(stepData: Step<QuestionStepData>, variantId: string, workflowManager: WorkflowManager): Promise<void>;
    private selectVariantLambda;
}
declare const questionStepService: QuestionStepService;

declare class ShapeStepService implements StepService<ShapeStepData> {
    readonly shapeFillId = "spiff-fill-shape";
    availableColours(stepData: Step<ShapeStepData>): Promise<{
        fill: string | undefined;
        stroke: string | undefined;
        variant: VariantResource;
    }[]>;
    setCustomColor(color: string, stepData: Step<ShapeStepData>, manager: WorkflowManager): void;
    init(stepData: Step<ShapeStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
    selectVariant(stepData: Step<ShapeStepData>, colourOption: ColorOption, elements: RegionElement[], workflowManager: WorkflowManager): Promise<void>;
    private reload;
    private selectVariantCommand;
}
declare const shapeStepService: ShapeStepService;

declare class ModuleStepService implements StepService<ModuleStepData> {
    init(stepData: Step<ModuleStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
    private reload;
    changeText(stepData: Step<ModuleStepData>, input: string, workflowManager: WorkflowManager, setError: (e: string) => void): Promise<void>;
    private changeTextCommand;
    private validateInput;
}
declare const moduleStepService: ModuleStepService;

declare class DigitalContentStepService implements StepService<DigitalContentStepData> {
    init(stepData: Step<DigitalContentStepData>, workflowManager: WorkflowManager, reducerState?: LayoutsState): Promise<CommandWithFollowup | null>;
    private reload;
    regenerateQRCode(elements: RegionElement[], assetKey: string, workflowManager: WorkflowManager, stepData: Step<DigitalContentStepData>): Promise<string>;
    private regionElements;
    private command;
}
declare const digitalContentStepService: DigitalContentStepService;

declare class MockWorkflowManager implements WorkflowManager {
    approveTransaction(_note?: string): Promise<void>;
    rejectTransaction(_note?: string): Promise<void>;
    private client;
    getClient(): SpiffCommerceClient;
    getWorkflowExperience(): WorkflowExperience;
    setClient(client: SpiffCommerceClient): void;
    getInitializationPromise(): Promise<void>;
    getProduct: () => Product;
    isInitialized(): boolean;
    getCommandContext: () => CommandContext;
    getAllLayoutData: () => LayoutState[];
    getMetadata: (stepName: string) => StepMetadata | undefined;
    getWorkflowMetadata: () => WorkflowMetadata;
    getStepStorage: (stepName: string) => StepStorage | undefined;
    getInformationResults(): InformationResult[];
    reset(): Promise<void>;
    updateStateWithServer(_getReducerState: () => CommandState): void;
    outstandingRequestsPromise(): Promise<void>;
    updateStateWithServerImmediate(_getReducerState: () => CommandState): Promise<void>;
    addPoller(_poller: Poller): void;
    addConfirmCallback(_callback: ConfirmCallback): void;
    addEditedCallback(_callback: EditedCallback): void;
    addElementsCallback(_callback: ElementsCallback): void;
    addInformationResultCallback(_callback: InformationResultCallback): void;
    addInitCallback(_callback: InitCallback): void;
    addMakingAdjustmentsCallback(_callback: MakingAdjustmentsCallback): void;
    addMandatoryCallback(_callback: MandatoryCallback): void;
    addMetadataCallback(_callback: MetadataCallback): void;
    addSelectionCallback(_callback: SelectionCallback): void;
    addStepSpecificStorageCallback(_callback: StepSpecificStorageCallback, _stepName: string): void;
    addStorageCallback(_callback: StorageCallback): void;
    getCommandDispatcher(): (_command: CanvasCommand) => void;
    getLayouts(): never[];
    getLayoutPreviewService(): any;
    getPreviewService(): undefined;
    setModelContainer: (container: any) => void;
    getModelContainer(): undefined;
    getProfanities(): never[];
    getRegionElements(_stepName: string): never[];
    getSerializedStep(_stepName: string, _serializedSteps: SerializableStep[]): undefined;
    getStepSpecificServices(_stepName: string): undefined;
    getTransaction(): {
        id: string;
    };
    getTransactionCustomer(): undefined;
    setTransactionCustomer(): void;
    setTransactionCustomerDetails(): void;
    getWorkflow(): {
        id: string;
        name: string;
        panels: never[];
        steps: never[];
        showModelOnFinishStep: boolean;
        allowProofDownload: boolean;
        introduction: string;
        stepGroups: never[];
    };
    markStepsAsInitialised(_stepNames: string[]): void;
    getUpdatesPending: () => boolean;
    markUpdateCompleted(_update: string): void;
    markUpdatePending(): string;
    getWorkflowSelections(): {};
    getStepSelections(): {};
    setCurrentAdjustingStepId(_stepId: string): void;
    setEditedStatus(_stepName: string, _status: boolean): void;
    setInformationResults(_results: InformationResult[]): void;
    setMandatoryFulfilled(_stepName: string, _status: boolean): void;
    setSelectionsAndElements(_stepName: string, _variants: VariantResource[], _elements: RegionElement[]): Promise<void>;
    toggleDesignConfirmed(): void;
    updateMetadata(_stepName: string, _update: any): void;
    updateStorage(_stepName: string, _update: StepStorage): Promise<void>;
    injectIntoPreviewService(_previewService: any): Promise<void>;
    ejectFromPreviewService(): void;
    setWorkflowStateSyncEnabled(_enabled: boolean): void;
    updateTransactionShareActions(): Promise<void>;
    addValidationCallback(_callback: ValidationCallback): void;
    setStepError(_stepName: string, _field: string, _error: string | undefined): void;
    getStepErrors(_stepName: string): undefined;
    getValidationErrors(): {
        steps: Map<any, any>;
    };
    updateTransactionStakeholders(): Promise<void>;
    getStepTags(_stepId: string): string[];
}

declare const generateCommands: (designInputSteps: DesignInputStep[], workflow: Workflow, layouts: ILayout[], productOverlayImageUrl?: string) => Promise<CanvasCommand[]>;

declare class IllustrationStepHandle extends StepHandle<IllustrationStepData> {
    constructor(manager: WorkflowManager, step: Step<IllustrationStepData>, tags: string[]);
    /**
     * Allows for select a vector from the available vectors configured on this steps base option.
     * @param variant The new vector variant to use for this step.
     * @returns A promise that can be awaited to know when the new vector asset has been updated on the design.
     */
    selectVariant(variant: Variant): Promise<void>;
    /**
     * Get the colors that are in the illustration.
     * @returns A list of color definitions that are currently applied to the illustration.
     */
    getColors(): {
        [key: string]: ColorDefinition;
    } | undefined;
    /**
     * Set color for the illustration.
     */
    setColor(key: string, value: string, pmsValue?: string): Promise<void>;
    getColorOption(): Promise<OptionResource | undefined>;
    getAvailableColors(): Promise<{
        fill: string | undefined;
        stroke: string | undefined;
        variant: VariantResource;
        pmsValue: string;
    }[] | undefined>;
    isColorPickerEnabled(): boolean;
    isPMSPickerEnabled(): boolean;
}

interface TextChangeResult {
    /**
     * The text of the input field.
     */
    input: string;
    /**
     * Data that can be used by the theme to decide what helper text should be.
     */
    helperData: {
        charactersRemaining?: number;
    };
    /**
     * Data that can be used by the theme to decide what error text should be.
     */
    errorData?: TextErrorData;
}
declare class TextStepHandle extends StepHandle<TextStepData> implements CustomColorSupport {
    constructor(manager: WorkflowManager, step: Step<TextStepData>, tags: string[]);
    /**
     * Allows for select a font from the available fonts configured on this steps base option.
     * @param variant The font variant to use.
     */
    selectVariant(variant: Variant): Promise<void>;
    /**
     * @returns A list of colors that can be used to fill the text.
     */
    getAvailableFillColors(): ColorOption[];
    /**
     * Changes the fill of text related to this step to the new fill value.
     * @param fill A new fill value to use.
     */
    setFillColor(fill: ColorOption): Promise<void>;
    /**
     * Gets the color currently applied to the element.
     */
    getFillColor(): string;
    getAvailableFillImages(): Promise<TextFillImage[]>;
    setFillImage(fillImage: TextFillImage): Promise<void>;
    getFillImage(): TextFillImage | undefined;
    getAlignment(): string | undefined;
    setAlignment(alignment: "left" | "center" | "right"): void;
    /**
     * When true & the step has replaceable text configured the user will be
     * abled to edit the entire text string including the non-replaceable text.
     * @param shouldCustomizeAll When true the user can configure the entire text string.
     */
    setFullTextCustomization(shouldCustomizeAll: boolean): TextChangeResult;
    /**
     * Changes the text value of text related to this step to a new value.
     * @param userInput Input from the user.
     */
    setText(userInput: string): TextChangeResult;
    /**
     * Gets the text currently applied to the elements of this step.
     */
    getText(): string;
    isReplaceable(): boolean | undefined;
    /**
     * @returns True if the step allows new lines in the text input.
     */
    newLinesSupported(): boolean;
    /**
     * Inform the step that now is the time to
     * clear default text if it should do so.
     * Returns a text change rwsult if a clear occurred.
     */
    clearDefaultTextIfNecessary(): TextChangeResult | undefined;
    hasColorPicker(): boolean | undefined;
    getRegions(): Region[];
    /**
     * Return the maximum characters allowed for
     * this step, or undefined if there is no limit.
     */
    getCharacterLimit(): number | undefined;
    /**
     * Return the remaining amount of characters that
     * the user is allowed to add, or undefined if there is no limit.
     */
    getCharactersRemaining(): number | undefined;
    setCustomColor(_color: string): void;
    getCustomColor(): string;
    /**
     * @returns A list of colors that can be used for the text's outline.
     */
    getAvailableStrokeColors(): ColorOption[];
    getStrokeColor(): string;
    /**
     * Changes the stroke of text related to this step to the new stroke value.
     * @param stroke A new stroke value to use.
     */
    setStrokeColor(stroke: ColorOption | undefined): Promise<void>;
}

declare class PictureStepHandle extends StepHandle<PictureStepData> {
    constructor(manager: WorkflowManager, step: Step<PictureStepData>, tags: string[]);
    /**
     * Allows the user to select an image variant from the available variants configured on this steps base option.
     * @param variant The new image variant to use.
     * @returns A promise that can be awaited to ensure the new image asset has been updated on the design.
     */
    selectVariant(variant: Variant): Promise<void>;
}

/**
 * A generic base class for custom errors that assigns the name
 * of the error class automatically. All custom errors should extend this.
 */
declare abstract class CustomError extends Error {
    constructor(message: any);
}
/**
 * A custom class for categorising errors related to workflow configuration.
 */
declare abstract class ConfigurationError extends CustomError {
    constructor(message: any);
}
/**
 * Thrown when an option was expected but not found in the workflow configuration or
 * the server returned a 404 for an option we expected.
 */
declare class OptionNotFoundError extends ConfigurationError {
    readonly optionId: string;
    constructor(step: Step<AnyStepData>);
}
/**
 * Thrown when a layout is not found for a given region entity. This
 * can occur when panels are deleted from a workflow but steps are still relying
 * on the layout being present.
 */
declare class LayoutNotFoundError extends ConfigurationError {
    readonly panelId: string;
    constructor(region: Region);
}
/**
 * Thrown when an asset is not found on a specific variant. This can occur when
 * the asset wasn't configured in hub and the variant is loaded in a workflow.
 */
declare class AssetNotFoundError extends ConfigurationError {
    readonly variant: VariantResource;
    constructor(variant: VariantResource);
}
/**
 * Thrown when a resource is not found linked to a specific asset. This
 * can occur when generation of a resource fails or hasn't completed. Or may be
 * a sign of a misconfiguration.
 */
declare class ResourceNotFoundError extends ConfigurationError {
    readonly asset: Asset;
    constructor(asset: Asset);
}
/**
 * Thrown when configuration is missing when it was expected. More generic
 * to cover remaining cases outside of the more specific ones such as options, variants & assets.
 */
declare class MisconfigurationError extends ConfigurationError {
    readonly step: Step<AnyStepData>;
    constructor(step: Step<AnyStepData>, message: string);
}
/**
 * A custom class for categorising errors related to implementation of core.
 */
declare abstract class ImplementationError extends CustomError {
    constructor(message: any);
}
/**
 * Thrown when we hit a case that we didn't expect to happen
 */
declare class UnhandledBehaviorError extends ImplementationError {
    constructor(message: string);
}
/**
 * Thrown when we fail to parse something that we expected to be valid
 */
declare class ParseError extends ImplementationError {
    constructor(message: string);
}

declare class ModelStepHandle extends StepHandle<ModelStepData> {
    constructor(manager: WorkflowManager, step: Step<ModelStepData>, tags: string[]);
    selectVariant(variant: Variant): Promise<void>;
}

declare enum FrameStep {
    SelectFrame = "SelectFrame",
    SelectImage = "SelectImage",
    Position = "Position"
}
declare class FrameStepHandle extends StepHandle<FrameStepData> {
    frameService: FrameService;
    constructor(manager: WorkflowManager, step: Step<FrameStepData>, tags: string[]);
    selectVariant(variant: Variant): Promise<void>;
    onFrameDataChanged(callback: (frameData: FrameData[]) => void): void;
    /**
     * Updates the image selection inside the frame.
     * @param asset The asset to use.
     * @param storeAsOriginal Optional: Store this asset as the original, unmodified version of the image. Default: `true`.
     * @param [recalculateOffsets=true] Optional: Recalculates the offsets of the image inside the frame. Default: `true`.
     */
    selectImage(asset: Asset, storeAsOriginal?: boolean, recalculateOffsets?: boolean): Promise<void>;
    /**
     * Returns `true` if the Background Remover is available for the current session.
     */
    canUseBackgroundRemover(): Promise<boolean>;
    /**
     * Returns `true` if the Background Remover is available for the current session and if the associated frame has a user-supplied raster image.
     */
    canRemoveBackground(): Promise<boolean>;
    /**
     * Removes the background from an image, stores it in the state, and returns the new asset.
     * @param applyNewAsset Optionally applies the new asset as the current image selection. Default: `true`.
     * @returns A promise that resolves with the newly generated Asset.
     */
    removeBackgroundFromImageSelection(applyNewAsset?: boolean): Promise<Asset>;
    changeColors(newFills: Map<string, ColorDefinition>): void;
    getImageData(): PatternImageData | undefined;
    getColorOption(): Promise<OptionResource | undefined>;
    getAvailableColors(): Promise<ColorOption[]>;
    isColorPickerEnabled(): boolean;
    getOriginalImageColors(): Promise<{
        [key: string]: ColorDefinition;
    } | undefined>;
    getMaxAllowedColors(): number | undefined;
    getUniqueColorCount(): number;
    getCurrentFrameStep(frameData: FrameData, uploading?: any, imageUploadComplete?: any, variants?: VariantResource[]): FrameStep;
    getFrameService(): FrameService | undefined;
    hasOverlayImageKey(): string | undefined;
    hasOverlayImageUrl(): any;
    getWhitelistedExtensions(): string[];
    getOriginalImageSelection(): Promise<Asset | undefined>;
    getBackgroundRemovedImageSelection(): Promise<Asset | undefined>;
    hasOriginalImageSelection(): boolean;
    hasBackgroundRemovedImageSelection(): boolean;
    getUseOriginalImageSelection(): boolean;
    setUseOriginalImageSelection(value: boolean): Promise<void>;
    private getFrameStepStorage;
}

declare class MaterialStepHandle extends StepHandle<MaterialStepData> {
    constructor(manager: WorkflowManager, step: Step<MaterialStepData>, tags: string[]);
    selectVariant(variant: Variant): Promise<void>;
}

declare class QuestionStepHandle extends StepHandle<QuestionStepData> {
    constructor(manager: WorkflowManager, step: Step<QuestionStepData>, tags: string[]);
    selectVariant(variant: Variant): Promise<void>;
    /**
     * The way that this step expects to be rendered.
     */
    getDisplayType(): any;
}

declare class ShapeStepHandle extends StepHandle<ShapeStepData> implements CustomColorSupport {
    constructor(manager: WorkflowManager, step: Step<ShapeStepData>, tags: string[]);
    selectVariant(variant: Variant): Promise<void>;
    /**
     * Sets the color of the shape.
     * @param color The color option to use.
     * @returns A promise resolving when the color has changed in the design.
     * @deprecated The shape step can now pass through colors returned by getColors via selectVariant. Please swap setColor for selectVariant.
     */
    setColor(color: ColorOption): Promise<void>;
    /**
     * Get available colors for the shape.
     * @returns A list of color definitions that are currently applied to the illustration.
     */
    getColors(): Promise<{
        fill: string | undefined;
        stroke: string | undefined;
        variant: VariantResource;
    }[]>;
    /**
     * Allows for setting a custom color when the custom variant is selected. Will
     * throw when a non-custom variant is selected.
     */
    setCustomColor(color: string): void;
    getCustomColor(): string;
}

declare const shortenUrl: (longUrl: string) => Promise<string>;

declare class InformationStepHandle extends StepHandle<InformationStepData> {
    constructor(manager: WorkflowManager, step: Step<InformationStepData>, tags: string[]);
    selectVariant(): Promise<void>;
    /**
     * The way that this step expects to be rendered.
     */
    getContent(): string;
}

/**
 * A simple cache for promises. Helpful to avoid making multiple requests for the same data.
 */
declare class PromiseCache {
    private cache;
    private disabled;
    /**
     * Gets a promise from the cache, or undefined if it doesn't exist.
     */
    get(key: object): Promise<any> | undefined;
    /**
     * Sets a promise in the cache and returns it.
     */
    set(key: object, promise: Promise<any>): Promise<any>;
    /**
     * Some environments don't want workflows to be cached. An example is a server
     * that doesn't launch a fresh instance per request. This method allows disabling
     * caching in a transparent way.
     */
    disable(value: boolean): void;
}
declare const promiseCache: PromiseCache;

declare function pmsToRgb(color: string): string;
declare function rgbToPms(color: string): string;
/**
 * Matches an input hex code (RRGGBB) to a number of PMS values. If an exact match is found, it will always be the first value in the resulting array.
 * @param hex A string containing the hexadecimal representation of a color, presented as RRGGBB (case sensitive).
 * @param maxDistance The maximum distance the input can be from a PMS color to be considered a match.
 * @returns An array of PMS color strings.
 */
declare function matchHexToPms(hex: string, maxDistance?: number): {
    pms: string;
    hex: string;
}[];
type PmsSearchResult = FuseResult<{
    pms: string;
    hex: string;
}>;
/**
 * Searches for the input string across all of the known PMS values.
 * @param input The string to find.
 * @returns An array of objects that contain information on the matched PMS values.
 */
declare function findPmsColors(input: string, limit?: number): PmsSearchResult[];
/**
 * Converts an arbitrary browser color value into a hexadecimal string (RRGGBB).
 * If the provided color string is anything other than a hex code, it will use a canvas to determine the hex value.
 * @returns
 */
declare function browserColorToHex(color: string): string;
/**
 * Converts a color value found in an SVG file into a color definition. This
 * logic will split out the browser value eg. "#ffffff" and the spot color value if available eg.
 * icc-named-color(cub, PANTONE_AAA_100_C)
 * @param value A color definition based on the data provided in the value.
 */
declare const svgColorValueToDefinition: (value: string) => ColorDefinition;

/**
 * The digital content step allows for associating uploaded content with a QR code. This code
 * can be displayed on the users design such as in a gift card and people can access
 * the hosted content by scanning the QR.
 */
declare class DigitalContentStepHandle extends StepHandle<DigitalContentStepData> {
    constructor(manager: WorkflowManager, step: Step<DigitalContentStepData>, tags: string[]);
    selectVariant(): Promise<void>;
    /**
     * Returns a preview URL used to show the generated QR code in your UI.
     */
    getPreviewURL(): string;
    /**
     * Turns an asset into a QR code that can be used to access the content.
     * @param asset The asset to use for the QR code.
     * @returns The final URL string for the QR code.
     */
    selectVideo(asset: Asset): Promise<string>;
}

declare class ModuleStepHandle extends StepHandle<ModuleStepData> {
    constructor(manager: WorkflowManager, step: Step<ModuleStepData>, tags: string[]);
    selectVariant(): Promise<void>;
    /**
     * Return the remaining amount of characters that
     * the user is allowed to add, or undefined if there is no limit.
     */
    getCharactersRemaining(): number | undefined;
    /**
     * Return the maximum characters allowed for
     * this step, or undefined if there is no limit.
     */
    getCharacterLimit(): number | undefined;
    getText(): string;
    setText(value: string): void;
}

declare class LayoutElementFactory {
    static getFrame(layout: LayoutData, opts: {
        region?: Region;
        configuration: Partial<FrameStepData>;
        src?: string;
    }): Promise<FrameElement>;
    static getImage(layout: LayoutData, opts: {
        region?: Region;
        layout?: LayoutData;
        configuration: Partial<PictureStepData>;
        src: string;
    }): Promise<ImageElement>;
    static getTextbox(layout: LayoutData, opts: {
        region?: Region;
        configuration: Partial<TextStepData>;
        fontSrc: string;
        designInputStep?: any;
    }): Promise<TextboxElement>;
    static getShape(layout: LayoutData, opts: {
        region?: Region;
        color: string;
    }): Promise<IllustrationElement>;
    static getIllustration(layout: LayoutData, opts: {
        region?: Region;
        src: string;
    }): Promise<IllustrationElement>;
}

/**
 * We use this to register a window in environments where one wouldn't be available.
 */
declare function registerWindowImplementation(impl: any): void;
declare function registerFetchImplementation(impl: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>): void;
declare const domParser: () => any;
declare const fetchAsString: (externalUrl: string, allowCache?: boolean) => Promise<string>;
declare const xmlSerializer: () => XMLSerializer;
declare const dataUrlFromExternalUrl: (url: string) => Promise<string>;
declare const svgToDataUrl: (svgString: string) => string;

declare const findElement: <T extends LayoutElement>(id: string, layouts: LayoutState[]) => T;
declare const rehydrateSerializedLayout: (transactionState: LayoutsState) => Promise<void>;

/**
 * A map of src to pattern image data.
 */
declare const patternImageDataCache: Map<string, PatternImageData>;
/**
 * A map of frame path to frame data relevant to that path.
 */
declare const frameDataCache: Map<string, FrameData>;
declare const getFrameData: (frameSvg: string) => Promise<FrameData>;
/**
 * Return the dimensions of an SVG string.
 */
declare const svgStringDimensions: (svgText: string) => {
    width: number;
    height: number;
};

declare const generate: () => string;

/**
 * Returns an axis aligned bounding box for a given element.
 * @param element The element to calculate an AABB for.
 * @returns The AABB for the element.
 */
declare const getAxisAlignedBoundingBox: (x: number, y: number, width: number, height: number, rotation: number) => {
    minX: number;
    maxX: number;
    minY: number;
    maxY: number;
};
declare const findAngle: (a: Point, b: Point, c: Point) => number;
/**
 * @param a The first value.
 * @param b The second value.
 * @returns Returns true if two values are within a distance to each other.
 */
declare const isCloseToValue: (a: number, b: number, allowableDistance: number) => boolean;
declare const getTrueCoordinates: (point: Point, pointOfRotation: Point, rotation: number) => Point;
declare const getPointOfRotation: (nwPoint: Point, sePoint: Point) => Point;
declare const getNWPoint: (bounds: DOMRect, element: LayoutElement, scaleX: number, scaleY: number) => Point;
declare const getNEPoint: (bounds: DOMRect, element: LayoutElement, scaleX: number, scaleY: number) => Point;
declare const getSEPoint: (bounds: DOMRect, element: LayoutElement, scaleX: number, scaleY: number) => Point;
declare const currentDirection: (originalDirection: ScaleAxis, rotation: number) => ScaleAxis;
/**
 * Computes helpful values about a rotated element, Useful in calculating updated element locations.
 * @param element The element to calculate the vertices for.
 * @returns a, b, c, d starting from top left and moving clockwise. Center represents the point central to
 * all vertices on thge element.
 */
declare const getElementVertices: (element: {
    x: number;
    y: number;
    width: number;
    height: number;
    rotation: number;
}, canvasBounds?: Point, scale?: Point) => {
    a: {
        x: number;
        y: number;
    };
    b: {
        x: number;
        y: number;
    };
    c: {
        x: number;
        y: number;
    };
    d: {
        x: number;
        y: number;
    };
    center: Point;
};
/**
 * Rotates a point around another point by an angle.
 * @param p The point to rotate.
 * @param c The point to rotate around..
 * @param angleRadians The angle to rotate.
 * @returns A new point transformed by the rotation.
 */
declare const rotateAroundPoint: (p: Point, c: Point, angleRadians: number) => {
    x: number;
    y: number;
};

declare const mmPerPixel = 0.352778;
declare const cmPerPixel = 0.035277;

declare const sanitizeSvgTree: (root: Element, preserveAspectRatio?: boolean) => void;
declare const modifySVGColors: (svg: string, colors: {
    [key: string]: ColorDefinition;
}, includeSpotColors?: boolean) => string;
declare const generateSVGWithUnknownColors: (svgBody: string) => Promise<{
    svg: string;
    colors: {
        [key: string]: ColorDefinition;
    };
}>;

interface CustomImage {
    height: number;
    naturalHeight: number;
    naturalWidth: number;
    src: string | ArrayBuffer;
    width: number;
}
interface CustomContext {
    drawImage(image: CustomCanvas | CustomImage, dx: number, dy: number): void;
    drawImage(image: CustomCanvas | CustomImage, dx: number, dy: number, dw: number, dh: number): void;
    drawImage(image: CustomCanvas | CustomImage, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void;
    rotate(angle: number): void;
    scale(x: number, y: number): void;
    translate(x: number, y: number): void;
}
interface CustomCanvas {
    height: number;
    getContext(type: string): CustomContext | null;
    toDataURL(): string;
    toDataURL(type?: string, quality?: number): string;
    width: number;
}
declare const createCanvas: (width?: number, height?: number, type?: "pdf" | "svg") => CustomCanvas;
declare const loadImage: (src: string | ArrayBuffer, allowCrossOrigin?: boolean) => Promise<CustomImage>;
interface CustomCanvasModule {
    createCanvas: typeof createCanvas;
    loadImage: typeof loadImage;
}
declare function setCanvasModule(module?: CustomCanvasModule): void;

declare const getAttributesFromArrayBuffer: (arrayBuffer: ArrayBuffer) => Promise<{
    dataUrl: string;
    height: number;
    width: number;
}>;

/**
 * Determine what the font size for a text element should be,
 * taking autosizing into account.
 * @Deprecated Old Text system, Transition to new system when Autosizing has been brought across in a way that makes sense.
 */
declare const determineCorrectFontSizeAndLines: (curFontSize: number, fontData: FontData, region: Region, linesToBreak: string[], sizeRange: SizeRange) => [number, null | string[], null | number];

/**
 * A function for loading and caching a font
 * @param url The URL to load either a web URL or dataURL
 * @param buffer An optional array buffer for the resource if available
 * @returns An opentype font object.
 */
declare const loadFont: (url: string) => Promise<Font>;
declare const outlineFontsInSvg: (svg: string) => Promise<string>;

declare const nameBundle: (id: string, name: string, context: any) => Promise<_apollo_client_core.FetchResult<object>>;
declare const nameTransaction: (id: string, name: string) => Promise<_apollo_client_core.FetchResult<object>>;
declare const duplicateBundle: (id: string, template: boolean) => Promise<_apollo_client_core.FetchResult<{
    bundleDuplicate: Bundle;
}>>;
declare const duplicateTransaction: (id: string, template: boolean) => Promise<_apollo_client_core.FetchResult<{
    transactionDuplicate: Transaction;
}>>;
declare const getCustomer: (email: string) => Promise<{
    id: string;
}>;
declare const getCustomerBundles: (customerId: string, limit: number, offset: number) => Promise<_apollo_client_core.ApolloQueryResult<{
    customerBundlesFeed: BundlesFeed;
}>>;
declare const getTransactionsForBundle: (id: string, context: any) => Promise<_apollo_client_core.ApolloQueryResult<{
    bundles: {
        id: string;
        transactions: Transaction[];
    }[];
}>>;
declare const getUnorderedTransactions: (customerId: string, limit: number, offset: number) => Promise<Transaction[]>;
declare const getOrderedTransactions: (customerId: string, limit: number, offset: number) => Promise<Transaction[]>;
declare const getTemplateTransactions: (customerId: string, limit: number, offset: number) => Promise<Transaction[]>;
declare const getTemplateBundles: (customerId: string, limit: number, offset: number) => Promise<Bundle[]>;

export { AddonHandle, Animatable, AnyStepData, ArrayInput, AspectType, Asset, AssetConfiguration, AssetNotFoundError, AssetObjectVersion, AssetType, BringForwardCommand, BringToBackCommand, BringToFrontCommand, Bundle$1 as Bundle, BundleDesignCreationCartAddMode, BundleDesignCreationMessage, BundleEvent, BundleEventData, BundleEventType, BundleStakeholder, CanvasCommand, CollectionProduct, ColorDefinition, ColorOption, ColorOptionGlobalPropertyHandle, ColorProfileProps, CommandContext, CommandState, Condition, ConditionalGlobalPropertiesChangedEventData, CreateElementCommand, CreateLayoutCommand, Customer, CustomerDetailsInput, DeleteElementCommand, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, DigitalContentStepData, DigitalContentStepHandle, EditedSteps, FileUploadGlobalPropertyHandle, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FontAlignmentCommand, FontColorCommand, FontSizeCommand, FontSourceCommand, FrameElement, FrameService, FrameStep, FrameStepData, FrameStepHandle, FrameThresholdSettings, GetNewWorkflowOptions, GetWorkflowOptions, GlobalPropertyConfiguration, GlobalPropertyHandle, GroupCommand, ILayout, IllustrationElement, IllustrationStepData, IllustrationStepHandle, ImageElement, InformationMessageType, InformationResult, InformationStepData, InformationStepHandle, Integration, IntegrationOptionResource, IntegrationProduct, IntegrationType, LayoutData, LayoutElement, LayoutElementFactory, LayoutElementType, LayoutNotFoundError, LayoutRenderingPurpose, LayoutState, LayoutsState, MandatorySteps, MaterialEffectMode, MaterialStepData, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, ModelStepData, ModelStepHandle, ModuleStepData, ModuleStepHandle, MoveCommand, NodeType, ObjectInput, ObjectInputType, OptionGlobalPropertyHandle, OptionNotFoundError, OptionResource, Order, OrderItem, PapyrusComponent, ParseError, PictureStepData, PictureStepHandle, Placeable, PmsSearchResult, Point, Product, ProductCameraRig, ProductCollection, ProductWorkflow$1 as ProductWorkflow, promiseCache as PromiseCache, PromiseQueue, QuestionStepData, QuestionStepHandle, QueueablePromise, Region, RegionElement, RenderableScene, ResizeCommand, ResourceNotFoundError, RotateCommand, SavedDesign, ScaleAxis, SelectionStorage, SendBackwardsCommand, ShapeStepData, ShapeStepHandle, ShareAction, ShareActionType, SilentIllustrationStepData, SpiffCommerceClient, Stakeholder, StakeholderType, StateMutationFunc, Step, StepAspect, StepAspectType, StepElements, StepGroup, StepHandle, StepStorage, StepType, TextAlgorithm, TextChangeCommand, TextChangeResult, TextGlobalPropertyHandle, TextInput, TextStepData, TextStepHandle, TextStepStorage, TextboxElement, Theme, ToastCallback, Transaction, Transform, TransformCollection$1 as TransformCollection, UnhandledBehaviorError, UnitOfMeasurement, UpdateImageSourceCommand, Variant, VariantResource, Vector3, Workflow, WorkflowExperience, WorkflowExperienceEventType, WorkflowExperienceHoverEventData, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowPanel, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, browserColorToHex, cmPerPixel, createDesign, currentDirection, dataUrlFromExternalUrl, designService, determineCorrectFontSizeAndLines, digitalContentStepService, domParser, duplicateBundle, duplicateTransaction, fetchAsString, findAngle, findElement, findPmsColors, frameDataCache, frameStepService, generate, generateCommands, generateSVGWithUnknownColors, generateStateFromDesignInputSteps, getAttributesFromArrayBuffer, getAxisAlignedBoundingBox, getBoundedOffsets, getBundleThemeConfiguration, getCustomer, getCustomerBundles, getElementVertices, getFrameData, getIntegration, getNEPoint, getNWPoint, getOrderedTransactions, getOverrideThemeConfiguration, getPointOfRotation, getSEPoint, getSvgElement, getTemplateBundles, getTemplateTransactions, getTransaction, getTransactionThemeConfiguration, getTransactionsForBundle, getTrueCoordinates, getUnorderedTransactions, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, isCloseToValue, loadFont, matchHexToPms, materialStepService, mmPerPixel, modelStepService, modifySVGColors, moduleStepService, nameBundle, nameTransaction, optionService, outlineFontsInSvg, patternImageDataCache, persistenceService, pictureStepService, pmsToRgb, questionStepService, registerFetchImplementation, registerWindowImplementation, rehydrateSerializedLayout, rgbToPms, rotateAroundPoint, sanitizeSvgTree, setBearerAuthenticationToken, setCanvasModule, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, svgColorValueToDefinition, svgStringDimensions, svgToDataUrl, textStepService, toast, xmlSerializer };
