import { IElementLike } from "@mml-io/networked-dom-web"; import { DebugHelper } from "../debug-helper"; import { Animation, Audio, ChatProbe, Cube, Cylinder, Frame, Image, Interaction, Label, Light, Link, MElement, Model, Overlay, Plane, PositionProbe, Prompt, RemoteDocument, Sphere, TransformableElement, Video } from "../elements"; import { AnimationGraphics, AudioGraphics, ChatProbeGraphics, CubeGraphics, CylinderGraphics, DebugHelperGraphics, FrameGraphics, GraphicsAdapter, ImageGraphics, InteractionGraphics, LabelGraphics, LightGraphics, LinkGraphics, MElementGraphics, ModelGraphics, OverlayGraphics, PlaneGraphics, PositionProbeGraphics, PromptGraphics, RemoteDocumentGraphics, SphereGraphics, StandaloneGraphicsAdapter, TransformableGraphics, VideoGraphics } from "../graphics"; import { LoadingProgressManager } from "../loading"; export interface MMLGraphicsInterface { MMLAnimationGraphicsInterface: (element: Animation) => AnimationGraphics; MMLDebugHelperGraphicsInterface(debugHelper: DebugHelper): DebugHelperGraphics; RemoteDocumentGraphicsInterface: (element: RemoteDocument) => RemoteDocumentGraphics; MElementGraphicsInterface: (element: MElement) => MElementGraphics; MMLTransformableGraphicsInterface: (element: TransformableElement) => TransformableGraphics; MMLImageGraphicsInterface: (element: Image, updateMeshCallback: () => void) => ImageGraphics; MMLVideoGraphicsInterface: (element: Video, updateMeshCallback: () => void) => VideoGraphics; MMLAudioGraphicsInterface: (element: Audio) => AudioGraphics; MMLCubeGraphicsInterface: (element: Cube) => CubeGraphics; MMLLabelGraphicsInterface: (element: Label) => LabelGraphics; MMLLinkGraphicsInterface: (element: Link) => LinkGraphics; MMLOverlayGraphicsInterface: (element: Overlay) => OverlayGraphics; MMLPlaneGraphicsInterface: (element: Plane) => PlaneGraphics; MMLPromptGraphicsInterface: (element: Prompt) => PromptGraphics; MMLInteractionGraphicsInterface: (element: Interaction) => InteractionGraphics; MMLChatProbeGraphicsInterface: (element: ChatProbe) => ChatProbeGraphics; MMLPositionProbeGraphicsInterface: (element: PositionProbe) => PositionProbeGraphics; MMLSphereGraphicsInterface: (element: Sphere) => SphereGraphics; MMLCylinderGraphicsInterface: (element: Cylinder) => CylinderGraphics; MMLLightGraphicsInterface: (element: Light) => LightGraphics; MMLFrameGraphicsInterface: (element: Frame) => FrameGraphics; MMLModelGraphicsInterface: (element: Model, updateMeshCallback: () => void) => ModelGraphics; } export type PositionAndRotation = { position: { x: number; y: number; z: number; }; rotation: { x: number; y: number; z: number; }; }; export type InteractionListener = { addInteraction(interaction: Interaction): void; updateInteraction(interaction: Interaction): void; removeInteraction(interaction: Interaction): void; }; export type ChatProbeListener = { addChatProbe(chatProbe: ChatProbe): void; updateChatProbe(chatProbe: ChatProbe): void; removeChatProbe(chatProbe: ChatProbe): void; }; export type PromptProps = { message?: string; placeholder?: string; prefill?: string; }; export type LinkProps = { href: string; target?: string; popup?: boolean; }; /** * The IMMLScene interface is the public interface for attaching content (E.g. * an MML Document) into the underlyingScene, but it can be implemented by * classes other than MMLScene. */ export type IMMLScene = { getGraphicsAdapter: () => G; hasGraphicsAdapter: () => boolean; addCollider?: (collider: unknown, element: MElement) => void; updateCollider?: (collider: unknown, element: MElement) => void; removeCollider?: (collider: unknown, element: MElement) => void; addInteraction?: (interaction: Interaction) => void; updateInteraction?: (interaction: Interaction) => void; removeInteraction?: (interaction: Interaction) => void; addChatProbe?: (chatProbe: ChatProbe) => void; updateChatProbe?: (chatProbe: ChatProbe) => void; removeChatProbe?: (chatProbe: ChatProbe) => void; getOverlayElement?: () => IElementLike | null; getUserPositionAndRotation(): PositionAndRotation; prompt: (promptProps: PromptProps, abortSignal: AbortSignal, callback: (message: string | null) => void) => void; link: (linkProps: LinkProps, abortSignal: AbortSignal, windowCallback: (openedWindow: Window | null) => void) => void; getLoadingProgressManager?: () => LoadingProgressManager | null; }; /** * The MMLScene class creates a HTML Element that renders a scene and includes the various manager instances * for handling clicks, interaction events, and controls. * * It is the default implementation of the IMMLScene interface and presents a fly camera with drag controls. */ export declare class MMLScene implements IMMLScene { element: HTMLElement; private colliders; private interactions; private interactionListeners; private chatProbes; private chatProbeListeners; private resizeListener; private promptManager; private interactionManager; private resizeObserver; private loadingProgressManager; private graphicsAdapter; constructor(element: HTMLElement); init(graphicsAdapter: G): void; hasGraphicsAdapter(): boolean; getGraphicsAdapter(): G; getUserPositionAndRotation(): PositionAndRotation; fitContainer(): void; dispose(): void; prompt(promptProps: PromptProps, abortSignal: AbortSignal, callback: (message: string | null) => void): void; link(linkProps: LinkProps, abortSignal: AbortSignal, windowCallback: (openedWindow: Window | null) => void): void; addCollider(collider: unknown, element: MElement): void; updateCollider(collider: unknown): void; removeCollider(collider: unknown): void; addInteraction(interaction: Interaction): void; updateInteraction(interaction: Interaction): void; removeInteraction(interaction: Interaction): void; getInteractions(): Set>; addInteractionListener(listener: InteractionListener, addExistingInteractions?: boolean): void; removeInteractionListener(listener: InteractionListener): void; addChatProbe(chatProbe: ChatProbe): void; updateChatProbe(chatProbe: ChatProbe): void; removeChatProbe(chatProbe: ChatProbe): void; getLoadingProgressManager(): LoadingProgressManager; getChatProbes(): Set>; addChatProbeListener(listener: ChatProbeListener, addExistingChatProbes?: boolean): void; removeChatProbeListener(listener: ChatProbeListener): void; } //# sourceMappingURL=MMLScene.d.ts.map