UNPKG

@3dsource/metabox-modular-configurator-api

Version:

API for Metabox MODULAR configurator

950 lines (921 loc) 33.4 kB
import { Observable } from 'rxjs'; type ApplicationDeviceTypes = 'deviceTypeAuto' | 'deviceTypeMobile' | 'deviceTypeDesktop'; type FromMetaboxApiAction = 'bridge' | 'appLoaded'; declare const MetaboxModularConfiguratorActions: { readonly setEnvironment: "setEnvironment"; readonly setEnvironmentMaterialById: "setEnvironmentMaterialById"; readonly setComponent: "setComponent"; readonly setComponentType: "setComponentType"; readonly setComponentMaterialById: "setComponentMaterialById"; readonly getPdf: "getPdf"; readonly getScreenshot: "getScreenshot"; readonly showEmbeddedMenu: "showEmbeddedMenu"; readonly forceSetDeviceType: "forceSetDeviceType"; readonly showOverlayInterface: "showOverlayInterface"; readonly resetCamera: "resetCamera"; readonly applyZoom: "applyZoom"; readonly initShowcase: "initShowcase"; readonly playShowcase: "playShowcase"; readonly pauseShowcase: "pauseShowcase"; readonly stopShowcase: "stopShowcase"; readonly sendCommandToUnreal: "sendCommandToUnreal"; }; type ToMetaBoxActions = (typeof MetaboxModularConfiguratorActions)[keyof typeof MetaboxModularConfiguratorActions]; /** * @internal * @hidden */ type ToMetaboxMessagePayload = ToMetaboxMessagePayloads[keyof ToMetaboxMessagePayloads]; type Test = Record<ToMetaBoxActions, object>; /** * Interface for messages sent from the application to the Metabox Modular Configurator. */ interface ToMetaboxMessagePayloads { [MetaboxModularConfiguratorActions.setEnvironment]: { id: string; }; [MetaboxModularConfiguratorActions.setEnvironmentMaterialById]: { slotId: string; materialId: string; }; [MetaboxModularConfiguratorActions.setComponentType]: { typeId: string; }; [MetaboxModularConfiguratorActions.setComponent]: { id: string; typeId: string; isRoot: boolean; }; [MetaboxModularConfiguratorActions.setComponentMaterialById]: { slotId: string; materialId: string; }; [MetaboxModularConfiguratorActions.getScreenshot]: { format: MimeType; size?: { x: number; y: number; }; }; [MetaboxModularConfiguratorActions.getPdf]: void; [MetaboxModularConfiguratorActions.showEmbeddedMenu]: { visible: boolean; }; [MetaboxModularConfiguratorActions.showOverlayInterface]: { visible: boolean; }; [MetaboxModularConfiguratorActions.forceSetDeviceType]: { deviceType: ApplicationDeviceTypes; }; [MetaboxModularConfiguratorActions.resetCamera]: void; [MetaboxModularConfiguratorActions.applyZoom]: { zoom: number; }; [MetaboxModularConfiguratorActions.initShowcase]: { productId: string; }; [MetaboxModularConfiguratorActions.playShowcase]: void; [MetaboxModularConfiguratorActions.pauseShowcase]: void; [MetaboxModularConfiguratorActions.stopShowcase]: void; [MetaboxModularConfiguratorActions.sendCommandToUnreal]: object; } interface ToMetaBoxMessageEnvelope { action: ToMetaBoxActions; payload?: ToMetaboxMessagePayload | never; } interface ToMetaBoxMessage { host: 'metaBoxHost'; payload: ToMetaBoxMessageEnvelope; } /** * Represents a modular configurator envelope with an initial configurator, and changes contain a configuration tree, * all components by active component type, component selected materials, * and associated environment. */ interface ModularConfiguratorEnvelope { /** Represents the modular configurator api with its components, component types, and environments */ configurator: InitialModularConfigurator; /** The unique tree of components and parent and component type id */ configurationTree: ComponentWithParent[]; /** A record mapping all components by current component type */ componentsByComponentType: Record<string, string>; /** A record mapping component material selection */ componentMaterialsIds: SelectedIds; /** The unique environment identifier */ environmentId: string; /** A record mapping environment material selections */ environmentMaterialsIds: SelectedIds; } /** Represents the modular configurator api with its components, component types, and environments */ interface InitialModularConfigurator { /** Unique identifier for the configurator. */ id: string; /** Client information associated with the configurator. */ /** The name of the configurator. */ name: string; /** A list of components for the configurator. */ components: ModularConfiguratorComponent[]; /** A list of available environments. */ environments: ModularConfiguratorEnvironment[]; /** A list of a component type for the configurator. */ componentTypes: ModularConfiguratorComponentType[]; /** The camera settings used in the configurator. */ /** Indicates if the configurator is active. */ isActive: boolean; connectors: ModularConfiguratorConnector[]; /** GraphQL typename for the Modular Configurator. */ __typename: 'ModularConfigurator'; } /** * Represents a configurator component within the modular configurator. */ interface ModularConfiguratorComponent { /** The id unique identifier. */ id: string; /** The modular configurator component type identifier. */ componentType: ModularConfiguratorComponentType; /** Display the name for the product. */ name: string; /** Position index of the product. */ position: number; /** The detailed product information. */ product: Product; /** Optional camera settings for the product. */ /** Connectors between connectors and virtual sockets. */ virtualSocketToConnectorsMap?: ModularConfiguratorVirtualSocketToConnector[]; /** GraphQL typename for the component. */ __typename: 'ModularConfiguratorComponent'; } /** * Represents a component type within the modular configurator. */ interface ModularConfiguratorComponentType { /** Display the name for the component type. */ name: string; /** Position index of the component type. */ position: number; /** Is root current component type or not. */ isRoot: boolean; /** Is required current component type or not. */ isRequired: boolean; /** The id unique identifier. */ id: string; /** GraphQL typename for the component type. */ __typename: 'ModularConfiguratorComponentType'; } /** * Represents a vur virtual map socket to connectors the modular configurator. */ interface ModularConfiguratorVirtualSocketToConnector { virtualSocketId: string; connectorId: string; /** GraphQL typename for the virtual map socket. */ __typename: 'ModularConfiguratorVirtualSocketToConnector'; } /** * Represents a connector the modular configurator. */ interface ModularConfiguratorConnector { id: string; componentTypeId1: string; componentTypeId2: string; /** GraphQL typename for connector. */ __typename: 'ModularConfiguratorConnector'; } /** * Represents product details including visual assets and configuration. */ interface Product { /** The title of the product. */ title: string; /** List of thumbnails for the product. */ thumbnailList: Thumbnail[]; /** Available slots for the product. */ slots: Slot[]; /** List of metaProperties for the product (optional). */ metaProperties: MetaProperty[]; /** The model information associated with the product. */ /** Unique identifier for the product. */ id: string; /** Unique external id for the product. */ externalId: string; /** Showcase details for the product. */ showcase?: Showcase; /** GraphQL typename for the product. */ __typename: 'Product'; } /** * Represents a thumbnail image entity with dimensions and URL path. */ interface Thumbnail { /** Width of the thumbnail. */ width: number; /** Height of the thumbnail. */ height: number; /** URL path to the thumbnail image. */ urlPath: string; /** GraphQL typename (as a string, flexible type). */ __typename: 'Thumbnail'; } /** * Represents a slot within a product that may allow material customization. */ interface Slot { /** Unique identifier for the slot. */ id: string; /** Display a label for the slot. */ label: string; /** A list of enabled materials for the slot. */ enabledMaterials: Material[]; /** GraphQL typename for the slot. */ __typename: 'Slot'; } /** * Represents a metaProperty within a product that may allow business logic customization. */ interface MetaProperty { /** Unique identifier for the metaProperty. */ id: string; /** Display the name for the metaProperty. */ name: string; /** Value for the metaProperty. */ value: string; /** Type for the metaProperty. */ type: string; /** GraphQL typename for the metaProperty. */ __typename: 'MetaProperty'; } /** * Represents a material that can be applied to a product slot. */ interface Material { /** Unique identifier for the material. */ id: string; /** Title or name of the material. */ title: string; /** Unique external id for the material. */ externalId: string; /** List of thumbnails for the material. */ thumbnailList: Thumbnail[]; /** The model information associated with the material. */ /** GraphQL typename for the material. */ __typename: 'Material'; } /** * Details showcase the presentation of a product. */ interface Showcase { /** A list of low-bandwidth versions for the showcase (optional). */ lowBandwidth?: (Timecode | null)[] | null; /** Duration for the showcase (optional). */ duration?: number; /** GraphQL typename for the showcase. */ __typename: 'Showcase'; } /** * Represents a low-bandwidth entity used in showcases in LBM mode. */ interface Timecode { /** Time marker for the entity. */ time: number; /** Duration of the entity display. */ duration: number; /** GraphQL typename (as a string, flexible type). */ __typename: 'Timecode'; } /** * Represents the environment settings for a modular configurator. */ interface ModularConfiguratorEnvironment { /** Unique identifier for the environment. */ environmentId: string; /** Position index of the environment. */ position: number; /** Display label for the environment. */ label: string; /** Detailed environment configuration. */ environment: Environment; /** GraphQL typename for the environment. */ __typename: 'ModularConfiguratorEnvironment'; } /** * Represents an environment with associated media and configuration. */ interface Environment { /** Unique identifier for the environment. */ id: string; /** Title or name of the environment. */ title: string; /** Flag indicating if UDS is enabled. */ udsEnabled: boolean; /** The north yaw of the sun in the environment. */ sunNorthYaw: number; /** The UDS hour setting for the environment. */ udsHour: number; /** List of thumbnails for the environment (optional). */ thumbnailList: Thumbnail[]; /** List of slots for the environment (optional). */ slots: Slot[]; /** The model associated with the environment. */ /** GraphQL typename for the environment. */ __typename: 'Environment'; } /** * Defines the structure for a component tree where every component has id and parent. */ interface ComponentWithParent { id: string; componentTypeId: string; parentId: string | null; } /** * Defines the structure for a mapping of selected materials. */ type SelectedIds = Record<string, Record<string, string>>; /** * Defines the structure for an available showcase status for the current product on a scene. */ type ShowCaseStatus = 'init' | 'play' | 'pause' | 'stop'; /** * Defines the structure for a video resolution. */ interface VideoResolution { width: number | null; height: number | null; } interface FromMetaboxMessagePayloads { /** * Dispatches every time the configurator data is updated ands . * I.e., when the user changes the configuration. (Material, Component Tree, Components, Component Type, Environment) */ configuratorDataUpdated: ModularConfiguratorEnvelope; /** * Dispatches every time when the configurator showcase status will be changed. */ showcaseStatusChanged: ShowCaseStatus; /** * Dispatches every time when the configurator connected/disconnected with Unreal Engine. */ dataChannelConnected: boolean; /** * Dispatches every time when the Viewport is ready / not ready. */ viewportReady: boolean; /** * Dispatches at the moment while the configurator loads. Shows status information. */ statusMessageChanged: string | null; /** * Dispatches every time when Unreal is sending ordered render with new GetScreenshot() command. */ screenshotReady: string | null; /** * Dispatches every time when Unreal is changing its video stream size. */ videoResolutionChanged: VideoResolution; } /** * @hidden */ type FromMetaBoxApiEvents = keyof FromMetaboxMessagePayloads; /** * @internal * This creates all event envelopes defined in MetaBoxAPIPayloads. */ interface MetaBoxApiEnvelope<T extends FromMetaBoxApiEvents> { action: 'bridge'; eventType: T; payload: FromMetaboxMessagePayloads[T]; } /** * @hidden * @internal * Used for signaling that the app is loaded and ready to open api. */ interface MCAppLoaded { action: 'appLoaded'; eventType?: unknown; payload?: unknown; } /** * @internal * @hidden * This creates a union of all event envelopes defined in MetaBoxAPIPayloads. */ type FromMetaBoxAPIEnvelope = { [K in keyof FromMetaboxMessagePayloads]: MetaBoxApiEnvelope<K>; }[keyof FromMetaboxMessagePayloads] | MCAppLoaded; interface FromMetaBoxMessage { host: 'metabox'; envelope: FromMetaBoxAPIEnvelope; } /** * Base class for commands sent to the Metabox. */ declare class CommandBase { data: ToMetaBoxMessageEnvelope; } /** * Represents a callback listener for specific message types. * Used internally by EventDispatcher to store event listeners. * * @public */ interface Listener { /** The message type this listener is registered for */ messageType: string; /** The callback function to execute when a message of the specified type is received */ callback: (data: unknown) => void; } /** * EventDispatcher is a class that manages event listeners and dispatches events to them. */ declare class EventDispatcher { /** * Storage for callback listeners by message type. */ listeners: Listener[]; destroy(): void; /** * Adds an event listener for receiving specific types of messages. * * @param {string} messageType - The message type to listen for. * @param callback - The callback function to execute when a message is received. */ addEventListener(messageType: string, callback: (data: unknown) => void): this; /** * Dispatches an event to all listeners of a specific message type. * * @param {string} messageType - The message type. * @param data - The data associated with the event. */ dispatchEvent(messageType: string, data: unknown): this; /** * Removes an event listener for a specific type of message. * * @param {string} messageType - The message type. * @param callback - The callback function to remove. */ removeEventListener(messageType: string, callback: (data: unknown) => void): this; } /** * Handles messaging between the host page and embedded to the Metabox content. * @internal Use {@link Communicator.createInstance} or the {@link integrateMetabox} helper to instantiate. */ declare class Communicator extends EventDispatcher { /** * Singleton reference to the current communicator instance. */ static instance: Communicator | null; /** * Bound handler for incoming postMessage events. */ private binder; /** * Constructs a Communicator, replacing any existing instance, and begins listening for messages. * @internal */ constructor(); /** * Listens for to the Metabox to signal readiness, then initializes communicator. * @param apiReadyCallback - Called with the new Communicator once to the Metabox is loaded. */ static createInstance(apiReadyCallback: (api: Communicator) => void): void; /** * Cleans up resources and stops listening for messages. */ destroy(): void; /** * Posts a command to the Metabox iframe. * @param command - An action command containing data to send. */ sendCommandToMetaBox<T extends CommandBase>(command: T): void; /** * Registers an event listener for messages dispatched by Metabox. * @override */ addEventListener<T extends FromMetaBoxApiEvents>(messageType: T, callback: (data: FromMetaboxMessagePayloads[T]) => void): this; /** * Dispatches a typed event to all registered listeners. * @override */ dispatchEvent<T extends FromMetaBoxApiEvents>(messageType: T, data: FromMetaboxMessagePayloads[T]): this; /** * Removes a previously registered event listener. * @override */ removeEventListener<T extends FromMetaBoxApiEvents>(messageType: T, callback: (data: FromMetaboxMessagePayloads[T]) => void): this; /** * Filters and dispatches incoming messages from to the Metabox. * @param messageType - Expected message type for filtering ('metaboxData'). * @param event - The postMessage event received on a window. */ private handleMessageReceived; } /** * Integrates Metabox Modular Configurator into the provided layout. * * @remarks * This function injects an iframe into a specified container element in the DOM and initializes * the communicator for interacting with the Metabox embedded content. * * @param iframeSrc - The source URL of the Metabox iframe. * Additional url parameters: * ```javascript * sidebar=false - disables the internal Metabox menu * introImage=https://example.com/image.png - sets the intro image * ``` * i.e., a final link will look like https://metabox.3dsource.com/metabox-configurator/modular/your-configurator-id?sidebar=false&introImage=https://example.com/image.png * * @param {string} containerId - The ID of the layout element. Defaults to 'embed3DSource'. * @param apiReadyCallback * @throws Error if the container element with the specified ID is not found. * * @example * import { * integrateMetabox, * } from '@3dsource/metabox-modular-configurator-api'; * * integrateMetabox( * 'https://metabox.3dsource.com/metabox-configurator/modular/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false', * 'embed3DSource' * ); */ declare function integrateMetabox(iframeSrc: string, containerId: string | undefined, apiReadyCallback: (api: Communicator) => void): void; /** * Saves an image by triggering a download. * * @remarks * This function creates an anchor element, sets its `href` attribute to the provided image URL, * and triggers a click event to initiate a download with the specified filename. * * @param {string} imageUrl - The URL of the image to save. * @param {string} filename - The name of the file to save. */ declare function saveImage(imageUrl: string, filename: string): void; /** * Wrapper helper function to use it with rxJs the same as `fromEvent` to listen to events from the Communicator. * @param {Communicator} target * @param eventName */ declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: Communicator, eventName: T): Observable<FromMetaboxMessagePayloads[T]>; /** * Represents a command to get a PDF from Metabox. * @remarks * This class sends a message to the Metabox API to generate a PDF based on the current configuration. * This action does not require any parameters. * * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed. * * @example * import { GetPdf, Communicator } from '@3dsource/metabox-modular-configurator-api'; * window.env3DSource.apiReady = (api: Communicator) => { * api.sendCommandToMetaBox(new GetPdf()); * }; */ declare class GetPdf extends CommandBase { /** * Creates an instance of GetPdf. * * @remarks * This constructor does not require any parameters. */ constructor(); } /** * Represents a command to send to unreal and reset camera to initial. * @remarks * This class sends a message to the Metabox API to reset the camera on a scene. * This action does not require any parameters. * * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed. * * @example * import { ResetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api'; * window.env3DSource.apiReady = (api: Communicator) => { * api.sendCommandToMetaBox(new ResetCamera()); * }; */ declare class ResetCamera extends CommandBase { /** * Creates an instance of ResetCamera. * * @remarks * This constructor does not require any parameters. */ constructor(); } /** * Represents a command to ApplyZoom and change zoom camera on a scene. * @remarks * This class sends a command to the Metabox API to change zoom on a scene. * * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed. * * @example * import { ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api'; * window.env3DSource.apiReady = (api: Communicator) => { * api.sendCommandToMetaBox(new ApplyZoom(10)); * api.sendCommandToMetaBox(new ApplyZoom(-10)); * }; */ declare class ApplyZoom extends CommandBase { /** * Creates an instance of ApplyZoom. * * @param {...number} zoom */ constructor(zoom: number); } /** * Represents a command to Init Showcase for a product in a component on a scene and start a sequence for the product. * @remarks * This class sends a command to the Metabox API to init showcase if the product in a component has a sequence. * For check this needs to find a showcase property in current product in a component * If this property exist you can send init showcase command * @internal Use {@link UniversalConfiguratorProduct.product.showcase} * @remarks * You can send init showcase command only for root components, otherwise we will ignore this command * * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed. * * @example * import { InitShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api'; * window.env3DSource.apiReady = (api: Communicator) => { * api.sendCommandToMetaBox(new InitShowcase('ffea6b5c-3a8a-4f56-9417-e605acb5cca3'); * }; */ declare class InitShowcase extends CommandBase { /** * Creates an instance of InitShowcase. * * @param {string} productId */ constructor(productId: string); } /** * @internal * @hidden * Represents a command to send Unreal command. */ declare class UnrealCommand extends CommandBase { constructor(payload: object); } /** * Represents a command to Play Showcase for a product when it already init, and you call pause, for example, before it. * @remarks * This class sends a command to the Metabox API to play showcase for a product if it is already initialized and pause. * * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed. * * @example * import { PlayShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api'; * window.env3DSource.apiReady = (api: Communicator) => { * api.sendCommandToMetaBox(new PlayShowcase()); * }; */ declare class PlayShowcase extends CommandBase { /** * Creates an instance of PlayShowcase. * * @remarks * This constructor does not require any parameters. */ constructor(); } /** * Represents a command to Pause Showcase for a product when it already init and play, and you call pause. * @remarks * This class sends a command to the Metabox API to pause showcase for a product if it is already initialized and play. * * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed. * * @example * import { PauseShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api'; * window.env3DSource.apiReady = (api: Communicator) => { * api.sendCommandToMetaBox(new PauseShowcase()); * }; */ declare class PauseShowcase extends CommandBase { /** * Creates an instance of PauseShowcase. * * @remarks * This constructor does not require any parameters. */ constructor(); } /** * Represents a command to Stop Showcase for a product when it already init, and you want to destroy it. * @remarks * This class sends a command to the Metabox API to Stop showcase for a product if it is already initialized. * * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed. * * @example * import { StopShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api'; * window.env3DSource.apiReady = (api: Communicator) => { * api.sendCommandToMetaBox(new StopShowcase()); * }; */ declare class StopShowcase extends CommandBase { /** * Creates an instance of StopShowcase. * * @remarks * This constructor does not require any parameters. */ constructor(); } /** * Image format. * @remarks * This type represents the allowed image formats. */ type MimeType = 'image/png' | 'image/jpeg' | 'image/webp'; /** * Represents a command to get a screenshot. * * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed. * * @example * import { GetScreenshot, Communicator, saveImage } from '@3dsource/metabox-modular-configurator-api'; * window.env3DSource.apiReady = (api: Communicator) => { * // Listen for events from to the Metabox API * api.addEventListener('screenshot', (data) => { * // Process the get screenshot response * saveImage(data, 'Render.png'); * }); * api.sendCommandToMetaBox(new GetScreenshot('image/png', { x: 1024, y: 1024 })); * }; */ declare class GetScreenshot extends CommandBase { /** * Constructs an instance of GetScreenshot. * @param {MimeType} mimeType - The output format. * @param {{ x: number; y: number }} [size] - Optional size in pixels. */ constructor(mimeType: MimeType, size?: { x: number; y: number; }); } /** * Represents a command to set a component by its data (ID, typeId, isRoot). * * @remarks * This action sends a message to the Metabox API to set a component using the provided component ID and its component type data. * * @example * import { SetComponent, Communicator } from '@3dsource/metabox-modular-configurator-api'; * * //...Assume that the integration is already implemented * window.env3DSource.apiReady = (api: Communicator) => { * api.setCommandToMetaBox(new SetComponent( * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'typeId', true * )); * }; */ declare class SetComponent extends CommandBase { /** * Creates an instance of SetComponent. * * @param {string} id * @param {string} typeId * @param {boolean} isRoot */ constructor(id: string, typeId: string, isRoot: boolean); } /** * Represents a command to set component material by its slot ID and Material ID. * * @example * import { SetComponentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api'; * * //...Assume that the integration is already implemented * window.env3DSource.apiReady = (api: Communicator) => { * api.sendCommandToMetaBox(new SetComponentMaterial( * 'carpaint', * 'dd829d6e-9200-47a7-8d5b-af5df89b7e91', * )); * }; */ declare class SetComponentMaterial extends CommandBase { /** * Creates an instance of SetComponentMaterial. * * @param {string} slotId - The slot ID. * @param {string} materialId - The material ID. */ constructor(slotId: string, materialId: string); } /** * Represents a command to set a component type by its ID. * * @remarks * This action sends a message to the Metabox API to set a component type using the provided component type ID. * * @example * import { SetComponentType, Communicator } from '@3dsource/metabox-modular-configurator-api'; * * //...Assume that the integration is already implemented * window.env3DSource.apiReady = (api: Communicator) => { * api.setCommandToMetaBox(new SetComponentType( * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3' * )); * }; */ declare class SetComponentType extends CommandBase { /** * Creates an instance of SetComponentType. * * @param {string} typeId */ constructor(typeId: string); } /** * Represents a command to set the environment by its ID. * * @example * import { SetEnvironment, Communicator } from '@3dsource/metabox-modular-configurator-api'; * * //...Assume that the integration is already implemented * window.env3DSource.apiReady = (api: Communicator) => { * // Change the environment to '55555555-1234-1234-1234-01234567890' * api.sendCommandToMetaBox(new SetEnvironment('55555555-1234-1234-1234-01234567890')); * }; */ declare class SetEnvironment extends CommandBase { /** * Creates an instance of SetEnvironment. * * @param {string} environmentId - The environment ID. */ constructor(environmentId: string); } /** * Represents a command to set an environment material by its slot ID and Material ID. * * @example * import { SetEnvironmentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api'; * * //...Assume that the integration is already implemented * window.env3DSource.apiReady = (api: Communicator) => { * api.sendCommandToMetaBox(new SetEnvironmentMaterial( * 'carpaint', * 'dd829d6e-9200-47a7-8d5b-af5df89b7e91', * )); * }; */ declare class SetEnvironmentMaterial extends CommandBase { /** * Creates an instance of SetEnvironmentMaterial. * * @param {string} slotId - The slot ID. * @param {string} materialId - The material ID. */ constructor(slotId: string, materialId: string); } /** * Represents a command to toggle the Embedded to the Metabox Menu. * * @example * import { ShowEmbeddedMenu, Communicator } from '@3dsource/metabox-modular-configurator-api'; * * //...Assume that the integration is already implemented * window.env3DSource.apiReady = (api: Communicator) => { * api.setCommandToMetaBox(new ShowEmbeddedMenu(true)); * }; */ declare class ShowEmbeddedMenu extends CommandBase { /** * Creates an instance of ShowEmbeddedMenu. * * @param {boolean} visible - A flag indicating whether the embedded menu should be visible. */ constructor(visible: boolean); } /** * Represents a command to toggle the Unreal Overlay Interface Menu. * * @remarks * This action sends a message to the Metabox API to toggle the visibility of the Unreal overlay UI. * * @example * import { ShowOverlayInterface, Communicator } from '@3dsource/metabox-modular-configurator-api'; * * //...Assume that the integration is already implemented * window.env3DSource.apiReady = (api: Communicator) => { * api.setCommandToMetaBox(new ShowOverlayInterface(true)); * }; */ declare class ShowOverlayInterface extends CommandBase { /** * Creates an instance of ShowOverlayInterface. * * @param {boolean} visible - A flag indicating whether the Unreal overlay UI should be visible. */ constructor(visible: boolean); } export { ApplyZoom, CommandBase, Communicator, EventDispatcher, GetPdf, GetScreenshot, InitShowcase, MetaboxModularConfiguratorActions, PauseShowcase, PlayShowcase, ResetCamera, SetComponent, SetComponentMaterial, SetComponentType, SetEnvironment, SetEnvironmentMaterial, ShowEmbeddedMenu, ShowOverlayInterface, StopShowcase, UnrealCommand, fromCommunicatorEvent, integrateMetabox, saveImage }; export type { ApplicationDeviceTypes, ComponentWithParent, Environment, FromMetaBoxAPIEnvelope, FromMetaBoxApiEvents, FromMetaBoxMessage, FromMetaboxApiAction, FromMetaboxMessagePayloads, InitialModularConfigurator, Listener, MCAppLoaded, Material, MetaBoxApiEnvelope, MetaProperty, MimeType, ModularConfiguratorComponent, ModularConfiguratorComponentType, ModularConfiguratorConnector, ModularConfiguratorEnvelope, ModularConfiguratorEnvironment, ModularConfiguratorVirtualSocketToConnector, Product, SelectedIds, ShowCaseStatus, Slot, Test, Thumbnail, ToMetaBoxActions, ToMetaBoxMessage, ToMetaBoxMessageEnvelope, ToMetaboxMessagePayload, ToMetaboxMessagePayloads, VideoResolution };