import { GraphicsAdapter } from "../graphics"; import { LoadingProgressManager } from "../loading"; import { IMMLScene, PositionAndRotation } from "../scene"; import { MMLDocumentTimeManager } from "../time"; import { VirtualCustomEvent, VirtualHTMLElement } from "../virtual-dom"; import type { RemoteDocument } from "./RemoteDocument"; export declare const MELEMENT_PROPERTY_NAME = "m-element-property"; export declare const consumeEventEventName = "consume-event"; export declare abstract class MElement extends VirtualHTMLElement { /** * Switches MElement's superclass to extend a target window's HTMLElement so that * MML elements can be placed into iframes. Also stores a reference to the target * window so that events can be created using its constructors (native dispatchEvent * rejects cross-realm Event objects). */ static overwriteSuperclass(newSuperclass: { new (): HTMLElement; prototype: HTMLElement; }, targetWindow: Window & typeof globalThis): void; /** * Resets MElement back to virtual (non-DOM) mode by restoring VirtualHTMLElement as * the superclass and clearing the DOM mode window reference. * @internal */ static resetToVirtualMode(): void; /** * Whether MElement has been switched to DOM mode via overwriteSuperclass. * Used instead of `instanceof Element` checks which fail across iframe boundaries * (cross-realm instanceof returns false). * @internal */ private static _isDOMMode; static get isDOMMode(): boolean; /** * The target window for DOM mode. Used to create events in the correct realm * so that native dispatchEvent accepts them. * @internal */ private static _domModeWindow; static get domModeWindow(): (Window & typeof globalThis) | null; /** * Cached reference to the base class (VirtualHTMLElement or HTMLElement) dispatchEvent method. * Invalidated by overwriteSuperclass when the prototype chain changes. * @internal */ private static cachedBaseDispatchEvent; static getBaseDispatchEvent(): (event: Event | VirtualCustomEvent) => boolean; static get observedAttributes(): Array; private mElementGraphics; constructor(); readonly isMElement = true; static isMElement(element: object): element is MElement; static getMElementFromObject(object: unknown): MElement | null; abstract isClickable(): boolean; abstract parentTransformed(): void; addSideEffectChild(child: MElement): void; removeSideEffectChild(child: MElement): void; attributeChangedCallback(name: string, oldValue: string | null, newValue: string): void; getScene(): IMMLScene; getInitiatedRemoteDocument(): RemoteDocument | null; contentSrcToContentAddress(src: string): string; private getDocumentHost; getDocumentTime(): number; getWindowTime(): number; getLoadingProgressManager(): LoadingProgressManager | null; protected getDocumentTimeManager(): MMLDocumentTimeManager | null; addDocumentTimeListener(cb: (documentTime: number) => void): { remove: () => void; }; addDocumentTimeTickListener(cb: (documentTime: number) => void): { remove: () => void; }; getContainer(): G["containerType"]; getUserPositionAndRotation(): PositionAndRotation; static createConsumeEvent(element: MElement | VirtualHTMLElement, originalEvent: Event | VirtualCustomEvent): CustomEvent | VirtualCustomEvent; dispatchEvent(event: Event | VirtualCustomEvent): boolean; getMElementParent(): MElement | null; connectedCallback(): void; disconnectedCallback(): void; } //# sourceMappingURL=MElement.d.ts.map