TronDesigner Website Integration
    Preparing search index...

    Interface IWebsiteIntegration

    interface IWebsiteIntegration {
        addCustomProperties(
            customProperties: Record<string, string>,
        ): IEditorArgumentsBuilder;
        addCustomProperty(key: string, value: string): IEditorArgumentsBuilder;
        addExactPrinting(
            printPositionCode: string,
            printTechnologyCode: string,
            positionCodeOverride?: string,
            positionNameOverride?: string,
            technologyCodeOverride?: string,
            technologyNameOverride?: string,
            options?: Partial<
                Pick<
                    EditorOptions,
                    "showSelectedPrintOptions"
                    | "alwaysShowImageSelect",
                >,
            >,
        ): 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,
            backgroundUrls?: string[],
            options?: Partial<
                Pick<
                    EditorOptions,
                    "showSelectedPrintOptions"
                    | "alwaysShowImageSelect",
                >,
            >,
        ): Pick<IEditorArgumentsBuilder, "open" | "addOwnPrinting">;
        getCustomer(): null | Customer;
        getInitialized(): boolean;
        getInitializing(): Promise<void>;
        getLogLevel(): LogLevel;
        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): Promise<undefined | null | Blob>;
        open(options: DesignerOptions): void;
        openDesigner(data: EditorArguments, options: DesignerOptions): void;
        openSinglePrintTaskDesigner(
            supplierCode: string,
            productVariantCodes: string[],
            printPositionCode: string,
            printTechnologyCode: string,
        ): void;
        refreshRegisteredElements(): void;
        setCustomer(user: Omit<Customer, "customerGuid">): Promise<void>;
        setExactProduct(
            supplierCode?: string,
            supplierGuid?: string,
            buildProduct?: (
                productBuilder: IEditorArgumentsExactProductBuilder,
            ) => void,
        ): IEditorArgumentsBuilder;
        setLogLevel(logLevel: LogLevel): 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): Pick<IEditorArgumentsBuilder, "open">;
        setPrintJobCustomer(
            customerIdentity?: string,
            customerPerson?: string,
            customerCompany?: string,
            customerEmail?: 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: "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

      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
      • OptionalbackgroundUrls: string[]
      • Optionaloptions: Partial<
            Pick<
                EditorOptions,
                "showSelectedPrintOptions"
                | "alwaysShowImageSelect",
            >,
        >

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

    • 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
    • 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

      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 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">

        {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

    • 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 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