The API for the this app. Reason that this was separated out in a class of it's own is to allow for better auto completion. Since the App itself extends HTMLElement, it shows a lot of members during auto completion.

Hierarchy

  • AppApi

Constructors

Properties

_loggerContext: "API" = "API"
isMobile: boolean = MODEL_VIEWER_CONSTANTS.IS_MOBILE
isTouchDevice: boolean = ...

Methods

  • Whether the dimensions are currently rendering within the scene.

    Returns boolean

    Dimensions visibility state.

  • Whether the hotspots are currently visible within the scene.

    Returns boolean

    Hotspots visibility state.

  • Parameters

    • arCompatible: boolean

    Returns Promise<string>

  • Gets the node id for the product that is currently active in the active product class.

    Returns string

    The node id. This is primarily used to target and switch variant.

  • TODO: Why do we have the current product class stored in customiser and the productClasses object? See if we can unify them. Currently, returns the same as api.getCurrentProductClass()

    Returns ProductClass

    Active product class within the scene.

  • Returns null | number

  • Gets a list of all camera View Names available.

    Returns string[]

  • Gets all camera views provided within the experience data.

    Returns ICameraViewCollection

    A colelction of all available camera view configs.

  • Gets information regarding the products that need to be disabled based on the current scene selection.

    Returns IDisabledProductsMap

  • Returns HotspotsConfigMap

  • Gets a reference to the AppEvent object for this session. This could then be used to fire and subscribe to the app wide events.

    Returns AppEvents

    The centralised hub for all app wide events.

  • Gets the current state of session cart.

    Returns ICart

  • Gets the current camera transforms in a generalised object. This object is compatible with almost all camera related inputs to this experience via API.

    Returns CAMERA_TRANSFORMS_FOR_INPUT

  • Returns IDimensionsState

  • Gets the current productClass within the scene.

    Returns ProductClass

    The active product class.

  • Gets current pricing for products within the session. This could later used to set a new pricing at runtime, if need be.

    Returns IOutputSkusMapConfig

    The current pricing of products, sorted by products and their available variants.

  • Scene's current state that could be saved within a database and be used to replicate a session again. Primarily used for Save/Share functionality within the configurator.

    Returns ICurrentSceneState

  • Gets the current state of scene in a JSON format.

    Returns undefined | SceneStructureDetails

    Undefined when the process fails to get the scene structure for some reason.

  • Returns undefined | ICurrentSceneState

  • Gets the experience id that was used to launch this session.

    Returns string

    The experience-id for the current session.

  • Returns IConfigExpSettings

  • Parameters

    • productId: string

    Returns undefined | Product

  • Get the parsed product classes config for this session.

    Returns ProductClassCollection

    Object containing information related to the product classes that are a part of this experience.

  • Returns ProductsMap

  • Parameters

    • relativeUrl: string

    Returns string

  • Returns Promise<string>

  • Returns Promise<string>

  • Returns Promise<undefined | IScreenshotsCollection>

  • Parameters

    • entryId: string

    Returns string

  • Returns string

  • Returns VariantCollection

  • Hide the dimensions within the scene.

    Returns void

  • Convenience wrapper to hide the hiccup screen

    Returns void

  • Hide the hotspots within the scene.

    Returns void

  • Hide the Splash Screen. This is the same overlayed screen that can be seen on startup.

    Returns void

  • Loads a scene state object as current within the scene. Part of save/share feature within the configurator.

    Parameters

    • sceneState: ICurrentSceneState

      Usually the scene state stored using AppApi.getCurrentSceneState.

    Returns Promise<void>

  • Makes the next product class active within the scene.

    Parameters

    • skipCamera: boolean = false

      WHether to skip the camera updates when the class is updated.

    Returns void

  • Makes the previous product class active within the scene.

    Parameters

    • skipCamera: boolean = false

      WHether to skip the camera updates when the class is updated.

    Returns void

  • Sets the given product class id as active within the scene. This product class can be fetched via 'EPIGRAPH_CONFIGURATOR.api.getProductClassesConfig().productClasses'

    Parameters

    • productClassId: string

      A valid product class id that you wish to make active.

    • skipCamera: boolean = false

      WHether to skip the camera updates when the class is updated.

    Returns void

  • Sets the given product class index as active within the scene. This index order is predefined and could be fetched via 'EPIGRAPH_CONFIGURATOR.api.getProductClassesConfig().productClasses'

    Parameters

    • productClassIndex: number

      A valid product class index that you wish to make active.

    • skipCamera: boolean = false

      WHether to skip the camera updates when the class is updated.

    Returns void

  • Make a given product ID active in the current product class.

    Parameters

    • productId: string

      A valid product ID to be made current.

    • skipCamera: boolean = false
    • blockScene: boolean = false

      Whether the scene execution should be blocked while the product loads.

    Returns void

  • Moves the main camera to one of the camera views defined within the experience data.

    Parameters

    • cameraViewId: string

      A valid camera view ID. Use api.getAllCameraViewIds() to a get of valid ids.

    • freezeCamera: boolean = false

    Returns void

  • Moves the scene's main camera to a given camera location config.

    Parameters

    • newCameraTransforms: ObjectTransformsConfig | ObjectTransforms

      Either an instance of ObjectTransforms object or the config for it.

    • newCameraTargetTransforms: ObjectTransformsConfig | ObjectTransforms

      Either an instance of ObjectTransforms object or the config for it.

    • freezeCamera: boolean = false

      Should the camera be frozen from making any further input movements after the transition is complete.

    Returns void

  • A convenience method that allows the user to print scene hierarchy to console at any point.

    Parameters

    • detailMode: boolean = false

      Verbose hierarchy of the scene.

    Returns void

  • Returns void

  • Removed a given node from the scene.

    Parameters

    • nodeId: string

      Id for the node that is to be removed from the scene.

    Returns Promise<void>

  • Parameters

    • productId: string
    • nodeIdToReplace: string

    Returns Promise<ReturnProductNode>

  • Returns void

  • Returns Promise<void>

  • Updates current pricing for products within the session. This expects a map with product id as the primary key. For reference and convenience, use the "getCurrentProductPricings" method from this api.

    Parameters

    • newSessionPricing: IOutputSkusMapConfig

    Returns ReturnNoPayload

    Whether the process failed, or was successful.

  • Show the dimensions within the scene.

    Returns void

  • Convenience wrapper to show the hiccup screen

    Returns void

  • Show the hotspots within the scene.

    Returns void

  • Show the Splash Screen. This is the same overlayed screen that can be seen on startup.

    Returns void

  • DEPRECATED: This method has been renamed to spawnNodeByProductId for naming consistency.

    Parameters

    • productId: string

    Returns Promise<ReturnProductNode>

  • Spawns a 3D product in scene for a given product ID.

    Parameters

    • productId: string

      Unique identifier of the product that needs to be spawned within the scene.

    Returns Promise<ReturnProductNode>

  • Switches the variant for a given nodeId within the scene. Please note that a node is an instance of a product within the scene and a product can be referenced by multiple nodes. It's usually possible to get the node id while spawning the item.

    Parameters

    • nodeId: string

      A valid node id within the scene.

    • variantId: string

      A valid variant ID for the provided node.

    Returns Promise<ReturnNoPayload>

    Reports success or failure. But doesn't return much details yet. Might add more info in the future.

  • Parameters

    • productClassId: string
    • variantId: string

    Returns Promise<ReturnNoPayload>

  • Attempts to evaluate and launches the appropriate view in your space session, based on the device type.

    Returns Promise<void>

Generated using TypeDoc