Skip to main content

Class: UixWindowHost

Defined in: xrblocks-uiextensions/src/host.ts:182

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.

Implements​

Constructors​

Constructor​

new UixWindowHost(options: UixWindowHostOptions): UixWindowHost;

Defined in: xrblocks-uiextensions/src/host.ts:200

Parameters​

ParameterType
optionsUixWindowHostOptions

Returns​

UixWindowHost

Properties​

PropertyModifierTypeDefault valueDescriptionDefined in
managerreadonlyWindowManagerundefined-xrblocks-uiextensions/src/host.ts:185
regionsreadonlyRegionRegistryundefined-xrblocks-uiextensions/src/host.ts:186
supportsStandalonePanelsreadonlybooleantrueBare panels work here - the host does not own a panel lifecycle.xrblocks-uiextensions/src/host.ts:184

Methods​

createPanel()​

createPanel(configJson: unknown): UixPanelDocument;

Defined in: xrblocks-uiextensions/src/host.ts:262

PanelHost - bare panel, unmanaged (used by devtools and tests). Always available here, which is what supportsStandalonePanels reports.

Parameters​

ParameterType
configJsonunknown

Returns​

UixPanelDocument

Implementation of​

WindowHost.createPanel


createRegion()​

createRegion(options: CreateRegionOptions): RegionHandle;

Defined in: xrblocks-uiextensions/src/host.ts:344

Create a dock region anchored in the scene.

Parameters​

ParameterType
optionsCreateRegionOptions

Returns​

RegionHandle


createWindow()​

createWindow(options: CreateWindowOptions): XrBlocksWindowHandle;

Defined in: xrblocks-uiextensions/src/host.ts:425

Spawn a managed window from compiled UIKitML JSON.

Parameters​

ParameterType
optionsCreateWindowOptions

Returns​

XrBlocksWindowHandle


dock()​

dock(windowId: string, regionId: string | undefined): void;

Defined in: xrblocks-uiextensions/src/host.ts:373

Dock a window into a region (or undock it with undefined). A thin forwarder to the manager, kept so existing callers read the same; manager.dockTo / manager.undock are the portable calls.

Parameters​

ParameterType
windowIdstring
regionIdstring | undefined

Returns​

void


onPanelReady()​

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

Defined in: xrblocks-uiextensions/src/host.ts:270

Observe panel readiness. Windows already live are replayed immediately, so wiring code never races window creation.

Parameters​

ParameterType
listener(event: PanelReadyEvent) => void

Returns​

() => void

Implementation of​

WindowHost.onPanelReady


region()​

region(id: string): RegionHandle | undefined;

Defined in: xrblocks-uiextensions/src/host.ts:364

Parameters​

ParameterType
idstring

Returns​

RegionHandle | undefined


spawnRegion()​

spawnRegion(region: SceneRegion): void;

Defined in: xrblocks-uiextensions/src/host.ts:280

Parameters​

ParameterType
regionSceneRegion

Returns​

void

Implementation of​

SceneTarget.spawnRegion


spawnWindow()​

spawnWindow(window: SceneWindow): void;

Defined in: xrblocks-uiextensions/src/host.ts:303

Scene descriptors carry config PATHS; this resolves the path and spawns the window when it arrives. Fire-and-forget by design - subscribe with onPanelReady to wire behaviour once the panel exists.

Parameters​

ParameterType
windowSceneWindow

Returns​

void

Implementation of​

SceneTarget.spawnWindow


update()​

update(deltaSeconds: number): void;

Defined in: xrblocks-uiextensions/src/host.ts:512

Drive per-frame from the engine loop (delta in SECONDS).

Parameters​

ParameterType
deltaSecondsnumber

Returns​

void


window()​

window(id: string):
| XrBlocksWindowHandle
| undefined;

Defined in: xrblocks-uiextensions/src/host.ts:507

Parameters​

ParameterType
idstring

Returns​

| XrBlocksWindowHandle | undefined