Skip to main content

Interface: IUserChanges

A structure containing all changes the user made to the product when personalizing it.

Example

// Completing product customization.
let renderingResult = await editor
.finishProductDesign()
// If an error occurred while completing product customization.
.catch((error) =>
console.error(
"Completing product customization failed with exception: ",
error,
),
);

// When product customization has been completed successfully, get the promise properties.
let stateId = renderingResult.stateId;
let userId = renderingResult.userId;
let userChanges = renderingResult.userChanges;
console.log("Text user changes: ", userChanges.texts);

Properties

texts

texts: object[]

An array of texts entered by the user in text elements. For each text element, which was changed by the user, the corresponding object contains its name and new value.

name

name: string

A name of the text element.

usersValue

usersValue: string

A new value of the text element.

isNewItem

isNewItem: boolean

Defines whether the user added this text element to the canvas. This property is true for new elements and false for changed elements.

isRemovedItem?

optional isRemovedItem?: boolean

Defines whether the user removed this text element from the canvas. This property is true for removed elements and false for changed elements.


inStringPlaceholders

inStringPlaceholders: object[]

An array of texts entered by the user in text placeholders. For each text placeholder, which was changed by the user, the corresponding object contains its name and new value.

name

name: string

A name of the in-string placeholder.

usersValue

usersValue: string

A new value of the in-string placeholder.


mockups

mockups: object

An object containing array of mockups that the user set up. For each mockup, which was applied to a surface, the corresponding object contains the surface and mockup names.

Index Signature

[surfaceName: string]: string

The name of a mockup defined for a surface.


surfaces

surfaces: ISurfacesChanges

An object containing user changes on a per-surface basis. Each surface, where the user changes text elements, has texts and inStringPlaceholders arrays with the element name and new value.

Was this page helpful?