TronDesigner Website Integration
    Preparing search index...

    Interface IWebsiteIntegration

    Builder methods available after an existing print job has been selected. Use these methods to modify the loaded print job before opening it in the editor.

    interface IWebsiteIntegration {
        addCustomProperties(
            customProperties: Record<string, string>,
        ): IEditorArgumentsBuilder;
        addCustomProperty(key: string, value: string): IEditorArgumentsBuilder;
        addEditorButton(button: EditorButton): IEditorArgumentsBuilder;
        addExactPrinting(
            printPositionCode: string,
            printTechnologyCode: string,
            positionCodeOverride?: string,
            positionNameOverride?: string,
            technologyCodeOverride?: string,
            technologyNameOverride?: string,
            options?: Partial<
                Pick<
                    EditorOptions,
                    "showSelectedPrintOptions"
                    | "alwaysShowImageSelect",
                >,
            >,
            maxColorsOverride?: number,
            maxWidthOverride?: number,
            maxHeightOverride?: number,
            maxDiameterOverride?: number,
            maxAreaOverride?: number,
        ): IEditorArgumentsBuilder;
        addExactPrintings(
            options?: Partial<
                Pick<
                    EditorOptions,
                    "showSelectedPrintOptions"
                    | "alwaysShowImageSelect",
                >,
            >,
            ...printings: ArgAddPrinting[],
        ): IEditorArgumentsBuilder;
        addOwnPrinting(
            positionCode: string,
            positionName: string,
            technologyCode: string,
            technologyName: string,
            colorMode: ColorMode,
            maxColors?: number,
            maxWidth?: number,
            maxHeight?: number,
            maxDiameter?: number,
            maxArea?: number,
            backgroundUrls?: string[],
            options?: Partial<
                Pick<
                    EditorOptions,
                    "showSelectedPrintOptions"
                    | "alwaysShowImageSelect",
                >,
            >,
        ): Pick<IEditorArgumentsBuilder, "open" | "addOwnPrinting">;
        addPrintingsToPrintJob(
            ...printings: ArgAddPrinting[],
        ): IEditorArgumentsOpenPrintJobBuilder;
        addPrintingToPrintJob(
            printPositionCode: string,
            printTechnologyCode: string,
            positionCodeOverride?: string,
            positionNameOverride?: string,
            technologyCodeOverride?: string,
            technologyNameOverride?: string,
            options?: Partial<
                Pick<
                    EditorOptions,
                    "showSelectedPrintOptions"
                    | "alwaysShowImageSelect",
                >,
            >,
            maxColorsOverride?: number,
            maxWidthOverride?: number,
            maxHeightOverride?: number,
            maxDiameterOverride?: number,
        ): IEditorArgumentsOpenPrintJobBuilder;
        addProductVariantsToPrintJob(
            ...variants: ArgAddProductVariant[],
        ): IEditorArgumentsOpenPrintJobBuilder;
        addProductVariantToPrintJob(
            productCode: string,
            quantity?: number,
            codeOverride?: string,
            nameOverride?: string,
        ): IEditorArgumentsOpenPrintJobBuilder;
        clearLogo(): Promise<void>;
        clonePrintJob(originalPrintJobGuid: string): Promise<undefined | string>;
        getCustomer(): null | Customer;
        getInitialized(): boolean;
        getInitializing(): Promise<void>;
        getLogLevel(): LogLevel;
        getLogo(): Promise<undefined | ILogoDTO>;
        getPrintingImage(
            printJobGuid: string,
            printingGuid: string,
            productVariantCode?: string,
        ): Promise<undefined | null | Blob>;
        getPrintingMotive(
            printJobGuid: string,
            printingGuid: string,
        ): Promise<undefined | null | Blob>;
        getPrintJob(printJobGuid: string): Promise<undefined | null | IPrintJobDto>;
        getProofreading(
            printJobGuid: string,
            templateTag?: string,
            language?: string,
        ): Promise<undefined | null | Blob>;
        open(options: DesignerOptions): void;
        openDesigner(data: EditorArguments, options: DesignerOptions): void;
        openLogoGallery(options: DesignerOptions): void;
        openLogoUpload(options: DesignerOptions): void;
        openSinglePrintTaskDesigner(
            supplierCode: string,
            productVariantCodes: string[],
            printPositionCode: string,
            printTechnologyCode: string,
        ): void;
        refreshRegisteredElements(): void;
        removePrintingFromPrintJob(
            printPositionCode: string,
            printTechnologyCode: string,
        ): IEditorArgumentsOpenPrintJobBuilder;
        removePrintingsFromPrintJob(
            removedPrintings: {
                printPositionCode: string;
                printTechnologyCode: string;
            }[],
        ): IEditorArgumentsOpenPrintJobBuilder;
        removeProductVariantFromPrintJob(
            productCode: string,
        ): IEditorArgumentsOpenPrintJobBuilder;
        removeProductVariantsFromPrintJob(
            productCodes: string[],
        ): IEditorArgumentsOpenPrintJobBuilder;
        setCustomer(
            user: Omit<Customer, "customerGuid" | "logoGuid">,
        ): Promise<void>;
        setDefaultPrintJobLogo(logo: ArgPrintingLogo): IEditorArgumentsBuilder;
        setEditorButtons(buttons: EditorButton[]): IEditorArgumentsBuilder;
        setExactProduct(
            supplierCode?: string,
            supplierGuid?: string,
            buildProduct?: (
                productBuilder: IEditorArgumentsExactProductBuilder,
            ) => void,
        ): IEditorArgumentsBuilder;
        setLastAddedPrintingLogo(logo: ArgPrintingLogo): IEditorArgumentsBuilder;
        setLogLevel(logLevel: LogLevel): void;
        setLogo(logoGuid: string): Promise<void>;
        setOpenMode(mode: OpenMode): IEditorArgumentsBuilder;
        setOrderInfo(
            orderTitle?: string,
            orderCode?: string,
            orderItemCode?: string,
        ): IEditorArgumentsBuilder;
        setOwnEmptyProduct(): Pick<
            IEditorArgumentsBuilder,
            "open"
            | "addOwnPrinting",
        >;
        setOwnProductSingleDimension(
            modelCode: string,
            modelName: string,
            isDimension1Color: boolean,
            description?: string,
            buildProduct?: (
                productBuilder: IEditorArgumentsOwnSingleDimensionProductBuilder,
            ) => void,
            options?: Partial<
                Pick<EditorOptions, "showSelectedVariants" | "showQuantityInputs">,
            >,
        ): IEditorArgumentsBuilder;
        setOwnProductSingleVariant(
            modelCode: string,
            modelName: string,
            description?: string,
            quantity?: number,
        ): Pick<IEditorArgumentsBuilder, "open" | "addOwnPrinting">;
        setOwnProductTwoDimensions(
            modelCode: string,
            modelName: string,
            isDimension1Color: boolean,
            description?: string,
            buildProduct?: (
                productBuilder: IEditorArgumentsOwnTwoDimensionsProductBuilder,
            ) => void,
        ): IEditorArgumentsBuilder;
        setPartialProduct(
            supplierCode?: string,
            supplierGuid?: string,
            buildProduct?: (
                productBuilder: IEditorArgumentsPartialProductBuilder,
            ) => void,
            options?: Partial<
                Pick<EditorOptions, "showSelectedVariants" | "showQuantityInputs">,
            >,
        ): IEditorArgumentsBuilder;
        setPrintJob(
            printJobGuid: string,
            mode: "Edit",
        ): IEditorArgumentsOpenPrintJobBuilder;
        setPrintJob(
            printJobGuid: string,
            mode?: "View",
        ): Pick<IEditorArgumentsBuilder, "open">;
        setPrintJobCustomer(
            customerIdentity?: string,
            customerPerson?: string,
            customerCompany?: string,
            customerEmail?: string,
        ): IEditorArgumentsBuilder;
        setPrintJobLanguage(languageCode: string): IEditorArgumentsBuilder;
        setPrintJobTitle(title: undefined | string): IEditorArgumentsBuilder;
        setProofreadingTemplateTag(tag: string): IEditorArgumentsBuilder;
        setResultActionCloseEditor(redirectUrl?: string): IEditorArgumentsBuilder;
        setResultActionNone(): IEditorArgumentsBuilder;
        setResultActionShowDialog(
            dialogLocalizations: EditorResultDialog[],
            redirectUrl?: string,
        ): IEditorArgumentsBuilder;
        subscribeDesignerEvent(
            entityType: "printJob",
            eventType: DesignerEventType,
            callback: (event: DesignerEntityEvent<IPrintJobDto>) => void,
        ): void;
        subscribeDesignerEvent(
            entityType: "logo",
            eventType: DesignerEventType,
            callback: (event: DesignerEntityEvent<ILogoDTO>) => void,
        ): void;
        subscribeDesignerEvent(
            entityType: "logo",
            eventType: "selected",
            callback: (
                event: DesignerEntityEvent<{ logoGuid: string; uploaded: boolean }>,
            ) => void,
        ): void;
        subscribeDesignerEvent(
            entityType: "text",
            eventType: "created",
            callback: (event: DesignerEntityEvent<ITextDTO>) => void,
        ): void;
        subscribeDesignerEvent(
            entityType: "proofreading",
            eventType: "created",
            callback: (event: DesignerEntityEvent<Blob>) => void,
        ): void;
        subscribeElementChanges(rootElement: HTMLElement): void;
        unsubscribeDesignerEvent<T = unknown>(
            callback: DesignerEventHandler<T>,
        ): void;
        unsubscribeDesignerEvents(
            entityType?: DesignerEntityType,
            eventType?: DesignerEventType,
        ): void;
        unsubscribeElementChanges(): void;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Adds a new printing with TronCloud position and technology codes.

      Parameters

      • printPositionCode: string

        TronCloud mockup print position code

      • printTechnologyCode: string

        TronCloud mockup print technology code

      • OptionalpositionCodeOverride: string

        Optional override for the position code

      • OptionalpositionNameOverride: string

        Optional override for the position name

      • OptionaltechnologyCodeOverride: string

        Optional override for the technology code

      • OptionaltechnologyNameOverride: string

        Optional override for the technology name

      • Optionaloptions: Partial<
            Pick<
                EditorOptions,
                "showSelectedPrintOptions"
                | "alwaysShowImageSelect",
            >,
        >

        Options for displaying the printing in the editor

      • OptionalmaxColorsOverride: number

        Optional override for maximum number of colors

      • OptionalmaxWidthOverride: number

        Optional override for maximum width

      • OptionalmaxHeightOverride: number

        Optional override for maximum height

      • OptionalmaxDiameterOverride: number

        Optional override for maximum diameter

      • OptionalmaxAreaOverride: number

        Optional override for maximum area

      Returns IEditorArgumentsBuilder

    • Adds multiple printings with exact position and technology codes.

      Parameters

      • Optionaloptions: Partial<
            Pick<
                EditorOptions,
                "showSelectedPrintOptions"
                | "alwaysShowImageSelect",
            >,
        >

        Options for displaying the printings in the editor

      • ...printings: ArgAddPrinting[]

        Array of printings to add

      Returns IEditorArgumentsBuilder

    • Parameters

      • positionCode: string
      • positionName: string
      • technologyCode: string
      • technologyName: string
      • colorMode: ColorMode
      • OptionalmaxColors: number
      • OptionalmaxWidth: number
      • OptionalmaxHeight: number
      • OptionalmaxDiameter: number
      • OptionalmaxArea: number
      • OptionalbackgroundUrls: string[]
      • Optionaloptions: Partial<
            Pick<
                EditorOptions,
                "showSelectedPrintOptions"
                | "alwaysShowImageSelect",
            >,
        >

      Returns Pick<IEditorArgumentsBuilder, "open" | "addOwnPrinting">

    • Adds a print option to the existing print job. If the print option already exists, it is ignored.

      Parameters

      • printPositionCode: string

        Supplier/PTN print position code.

      • printTechnologyCode: string

        Supplier/PTN print technology code.

      • OptionalpositionCodeOverride: string

        Display code shown for the print position.

      • OptionalpositionNameOverride: string

        Display name shown for the print position.

      • OptionaltechnologyCodeOverride: string

        Display code shown for the print technology.

      • OptionaltechnologyNameOverride: string

        Display name shown for the print technology.

      • Optionaloptions: Partial<
            Pick<
                EditorOptions,
                "showSelectedPrintOptions"
                | "alwaysShowImageSelect",
            >,
        >

        Editor options applied while selecting/loading the new printing.

      • OptionalmaxColorsOverride: number

        Maximum color count override.

      • OptionalmaxWidthOverride: number

        Maximum print width override.

      • OptionalmaxHeightOverride: number

        Maximum print height override.

      • OptionalmaxDiameterOverride: number

        Maximum print diameter override.

      Returns IEditorArgumentsOpenPrintJobBuilder

    • Adds or updates a product variant in the existing print job. If the variant already exists, its quantity and display overrides are updated.

      Parameters

      • productCode: string

        Supplier/PTN product variant code.

      • Optionalquantity: number

        Variant quantity.

      • OptionalcodeOverride: string

        Display code shown for the product variant.

      • OptionalnameOverride: string

        Display name shown for the product variant.

      Returns IEditorArgumentsOpenPrintJobBuilder

    • Clears the logo for the current user, removing it from the designer visualizations.

      Returns Promise<void>

    • Completely clone existing print job including the images

      Parameters

      • originalPrintJobGuid: string

      Returns Promise<undefined | string>

      Cloned print job guid

    • Get the current user.

      Returns null | Customer

      User

    • Gets the current initialization status. Only when initialized, the designer can be opened.

      Returns boolean

      boolean

    • Returns a promise that resolves when the initialization process is complete.

      Returns Promise<void>

      • A promise that resolves when initialization is complete.
    • Get the current log level for debugging purposes.

      Returns LogLevel

      • current log level
    • Retrieves the current logo for the user, if available. This method returns a promise that resolves to the logo data.

      Returns Promise<undefined | ILogoDTO>

    • Gets the image of the product variant with the designed printing motive.

      Parameters

      • printJobGuid: string
      • printingGuid: string
      • OptionalproductVariantCode: string

        optional product variant code to get the specific variant image, if not provided, the default variant will be used

      Returns Promise<undefined | null | Blob>

      • the printing image file
    • Gets image of the motive that was designed for this print job in the editor by its GUID.

      Parameters

      • printJobGuid: string
      • printingGuid: string

      Returns Promise<undefined | null | Blob>

      • the printing motive file
    • Gets the print job by its GUID.

      Parameters

      • printJobGuid: string

      Returns Promise<undefined | null | IPrintJobDto>

      • the print job data
    • Gets the proofreading file by its GUID.

      Parameters

      • printJobGuid: string
      • OptionaltemplateTag: string

        specify the proofreading template with a tag

      • Optionallanguage: string

        override customer language

      Returns Promise<undefined | null | Blob>

      • the proofreading file in PDF format
    • Opens the designer either in a dialog or container mode, depending on the configuration.

      Parameters

      • data: EditorArguments

        {EditorArguments} - data to pass to the designer, such as product and print job information

      • options: DesignerOptions

        {DesignerOptions} - options for displaying the designer, either in a dialog or a container

      Returns void

    • Opens the logo gallery, allowing users to select a logo for the visualizations.

      Parameters

      • options: DesignerOptions

        {DesignerOptions} - options for displaying the designer, either in a dialog or a container

      Returns void

    • Opens the logo upload dialog, allowing users to select a logo for the visualizations.

      Parameters

      • options: DesignerOptions

        {DesignerOptions} - options for displaying the designer, either in a dialog or a container

      Returns void

    • Opens the designer for a single print task with specified product variants and one print task specified by print position and print technology.

      Parameters

      • supplierCode: string

        {string} - code of the supplier

      • productVariantCodes: string[]

        {string[]} - array of product variant codes to include in the print task

      • printPositionCode: string

        {string} - code of the print position

      • printTechnologyCode: string

        {string} - code of the print technology

      Returns void

    • Refreshes the registered elements by re-initializing the events in the whole document.

      Returns void

    • Set the current user.

      Parameters

      • user: Omit<Customer, "customerGuid" | "logoGuid">

        {Omit<Customer, 'customerGuid'>} - user data to set.

      Returns Promise<void>

    • Set the current log level for debugging purposes.

      Parameters

      • logLevel: LogLevel

        log level to set. Allowed values: [info, warn, error, debug]

      Returns void

    • Sets the logo for the current user, which will be used in the designer visualizations. The logo is identified by its GUID, which is typically obtained from the logo gallery or upload dialog.

      Parameters

      • logoGuid: string

      Returns Promise<void>

    • Can be used to override the customer info specified by the customer guid attribute.

      Parameters

      • OptionalcustomerIdentity: string
      • OptionalcustomerPerson: string
      • OptionalcustomerCompany: string
      • OptionalcustomerEmail: string

      Returns IEditorArgumentsBuilder

    • Subscribes to print job created event

      Parameters

      Returns void

    • Subscribes to logo updated or deleted event

      Parameters

      Returns void

    • Subscribes to logo selected event, which is triggered when a logo is selected from independently opened gallery

      Parameters

      • entityType: "logo"
      • eventType: "selected"
      • callback: (event: DesignerEntityEvent<{ logoGuid: string; uploaded: boolean }>) => void

      Returns void

    • Subscribes to text created event

      Parameters

      Returns void

    • Subscribes to proofreading created event

      Parameters

      • entityType: "proofreading"
      • eventType: "created"
      • callback: (event: DesignerEntityEvent<Blob>) => void

      Returns void

    • Subscribes to changes in the DOM elements within a specified root element. This is useful for monitoring dynamic content changes.

      Parameters

      • rootElement: HTMLElement

        HTMLElement - the root element to observe for changes

      Returns void

    • Unsubscribes from a specific designer event using the callback function.

      Type Parameters

      • T = unknown

      Parameters

      Returns void

    • Unsubscribes from changes in the DOM elements, stopping the monitoring of dynamic content changes.

      Returns void