Skip to main content

Interface: WindowHost

Defined in: packages/webxr-uiextensions/src/adapter.ts:143

The engine-agnostic surface an app needs to build a UI: spawn windows and regions from portable data, observe when panels become wireable, and reach the shared WindowManager.

Panels load asynchronously on every adapter (IWSDK fetches the config; uikit lays out over following frames), so app code must never assume a panel exists immediately after creating its window. onPanelReady is the portable answer - it replaces engine-specific discovery (ECS queries on IWSDK, polling anywhere else) and fires for panels that became ready before the listener was registered, so wiring order never matters.

Extends

Extended by

Properties

PropertyModifierTypeDescriptionDefined in
supportsStandalonePanelsreadonlybooleanWhether PanelHost.createPanel works on this host. When false the method is not available and throws; spawn a window instead, so the engine owns the panel lifecycle. IWSDK is false, three.js/XR Blocks is true.packages/webxr-uiextensions/src/adapter.ts:150

Methods

createPanel()

createPanel(configJson: unknown): PanelHandle;

Defined in: packages/webxr-uiextensions/src/adapter.ts:105

Create a panel from compiled UIKitML JSON (the { element, classes } shape produced by the build plugin or by @realitycollective/uix-devtools' compilePanelSource).

Parameters

ParameterType
configJsonunknown

Returns

PanelHandle

Inherited from

PanelHost.createPanel


onPanelReady()

onPanelReady(listener: (event: PanelReadyEvent) => void): () => void;

Defined in: packages/webxr-uiextensions/src/adapter.ts:155

Subscribe to panel readiness. Late subscribers are replayed the windows that are already live. Returns an unsubscribe function.

Parameters

ParameterType
listener(event: PanelReadyEvent) => void

Returns

() => void