ExposedApi.ExposedApi

Embedding API Reference / Modules / exposed-api / ExposedApi

Class: ExposedApi

exposed-api.ExposedApi

Table of contents

Constructors

Accessors

Methods

Constructors

constructor

new ExposedApi(sdkConnector, mainMessageHandlers, sdk, exposedCallbacks, store, analytics, globalCallback, intl, libs, eventEmitter): ExposedApi

Parameters

NameType

sdkConnector

mainMessageHandlers

sdk

default | default | default

exposedCallbacks

store

Store<StoreState>

analytics

globalCallback

GlobalCallback

intl

libs

eventEmitter

Returns

ExposedApi

Accessors

callbacks

get callbacks(): ExposedCallbacks

Returns

ExposedCallbacks

Methods

disableEvents

disableEvents(): void

Returns

void


dragInObject

dragInObject(id, x, y, type?): Promise<number>

Use this to start a drag in of an object the coordinates x and y are relative to the iframe. Meaning 0/0 is the top left corner of the iframe

Parameters

NameTypeDefault valueDescription

id

string

undefined

Roomle ID of the object that should be inserted and dragged

x

number

undefined

coordinate of the drag event

y

number

undefined

coordinate of the drag event

type

string

'rml_id'

type of the id, default is 'rml_id' for example: usm:frame, 'rml_serialized' for serialized configurations like {"componentId": "usm:frame"} (currently not supported), 'tc_serialized' for serialized TecConfig Object, 'tc_id' for TecConfig ID (currently not supported)

Returns

Promise<number>

number runtimeId of the dragged object


dragInObjectEnd

dragInObjectEnd(): void

Call this method when the drag ends

Returns

void


enableEvents

enableEvents(): void

Returns

void


getBoundingClientRect

getBoundingClientRect(selector): DOMRect

Parameters

NameType

selector

string

Returns

DOMRect


getDrawerAnimation

getDrawerAnimation(): Object

Returns

Object

NameType

direction

string

transition

string


getDrawerBoundingClientRect

getDrawerBoundingClientRect(): Promise<{ actual: DOMRect ; final: DOMRect }>

Returns

Promise<{ actual: DOMRect ; final: DOMRect }>


getPartListPdf

getPartListPdf(planObject?): Promise<any>

Parameters

NameType

planObject?

KernelPlanObject

Returns

Promise<any>


giveGaConsent

giveGaConsent(): void

call this method if consent of Google Analytics is given later and not already in init-data on boot

Returns

void


insertObject

insertObject(id, position?, rotation?): Promise<void>

Insert an object into the current MOC/planner scene If no position or rotation is set then it will be placed automatically (without overlapping other objects) with rotation 0

Parameters

NameTypeDescription

id

string

position?

Position3

as x (left/right), y (up/down) and z (front/back)

rotation?

number

in radians

Returns

Promise<void>


loadConfigurationString

loadConfigurationString(configurationString): Promise<Nullable<LoadResponse>>

call this method to load the configuration string you want into the 3d Scene

Parameters

NameTypeDescription

configurationString

string

string of the configuration, starts with { and ends with }

Returns

Promise<Nullable<LoadResponse>>

null if configuration can not be loaded


loadObject

loadObject(id): Promise<Nullable<LoadResponse>>

call this method to load the object you want into the 3d Scene

Parameters

NameTypeDescription

id

string

database ID of the object you want to load

Returns

Promise<Nullable<LoadResponse>>


pauseConfiguring

pauseConfiguring(): void

This method can be used to pause configuration If the configurator was called in view-only mode this method triggers the onBackToWebsite callback. To know when the view-only mode is activated see the description of the startConfiguring method

Returns

void


setActiveParameterGroup

setActiveParameterGroup(groupKey): void

Changes the currently selected parameter group to a parameter group containing the specified key.

Parameters

NameTypeDescription

groupKey

string

parameterGroup key.

Returns

void


setPrice

setPrice(currencySymbol, price): void

set the price for the UI to show most likely needed when implementing your own price service

Parameters

NameType

currencySymbol

string

price

number

Returns

void


startConfiguring

startConfiguring(): void

This method can be used to start configuration when 3d scene is only initialized as viewer first, the configurator is automatically instantiated as viewer if the container where the configurator is placed is smaller than 1024px (this breakpoint could change in future) so do not rely on this exact pixel setting

Returns

void


toggleDrawer

toggleDrawer(): void

Returns

void


triggerRequestPlan

triggerRequestPlan(): Promise<void>

call this method to trigger the onRequestPlan event from outside of the iframe. When this method is called the same process is kicked off as if the user would have clicked on request plan. Therefore you can just use the same callback to react on the response

Returns

Promise<void>


triggerRequestProduct

triggerRequestProduct(): Promise<void>

call this method to trigger the onRequestProduct event from outside of the iframe. When this method is called the same process is kicked off as if the user would have clicked on request product. Therefore you can just use the same callback to react on the response

Returns

Promise<void>


triggerSaveDraft

triggerSaveDraft(email?): Promise<void>

call this method to trigger the onSaveDraft event from outside of the iframe. When this method is called the same process is kicked off as if the user would have clicked on save draft in the bottom bar. Therefore you can just use the same callback to react on the response

Parameters

NameTypeDefault value

email

string

''

Returns

Promise<void>


triggerShowOverlay

triggerShowOverlay(overlay): Promise<void>

List of overlays that can be triggered from outside the iframe. These overlays allow for controlled external triggering, ensuring that only specific, predefined overlays can be displayed from external sources.

Each overlay in the set is identified by a unique number:

  • SAVE_DRAFT: 1

  • OPEN_AR: 4

  • EXPORT_3D: 5

  • TUTORIALS: 11

  • LOAD_PRODUCT: 12 (only available in Room Designer)

Parameters

NameType

overlay

Returns

Promise<void>


updateDrag

updateDrag(x, y, options?): void

After you called dragInObject you can call this method to update the drag position the coordinates x and y are relative to the iframe. Meaning 0/0 is the top left corner of the iframe

Parameters

NameTypeDescription

x

number

coordinate of the drag event

y

number

coordinate of the drag event

options

-

Returns

void

void

Last updated