API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classBrowserPlatform
The PlatformAdapter backed by the browser: a canvas element for the drawing surface, `window` for keyboard and blur, `document` for visibility, `navigator` for gamepads, and `navigator.onLine` plus the `online`/`offline` window events for the network hint. Used automatically by Application when no adapter was injected. Every capability degrades rather than throws when the host does not provide it - pointer capture is rejected by jsdom and by browsers asked to release a pointer they never captured, `navigator.getGamepads` is missing on locked-down hosts, and `document` is absent under SSR. None of those are worth failing an application over, so each is caught and reported as "unavailable".
import { BrowserPlatform } from '@codexo/exojs'The PlatformAdapter backed by the browser: a canvas element for the drawing surface, `window` for keyboard and blur, `document` for visibility, `navigator` for gamepads, and `navigator.onLine` plus the `online`/`offline` window events for the network hint. Used automatically by Application when no adapter was injected.
Every capability degrades rather than throws when the host does not provide it - pointer capture is rejected by jsdom and by browsers asked to release a pointer they never captured, `navigator.getGamepads` is missing on locked-down hosts, and `document` is absent under SSR. None of those are worth failing an application over, so each is caught and reported as "unavailable".
new(canvas: HTMLCanvasElement): BrowserPlatformcancelFrame(handle: number): voidcapturePointer(pointerId: number): voiddestroy(): voidfocusSurface(): voidlockPointer(): voidnow(): numberonNetworkHintChange(listener: (hint: NetworkHintWhat a host reports about network reachability. `'unknown'` is an answer, not a missing one: a host that cannot say whether a network exists is genuinely not s…) => void): PlatformSubscriptionUndo function returned by every `PlatformAdapter` subscription. Calling it twice is a no-op.onPixelRatioChange(listener: (ratio: number) => void): PlatformSubscriptionUndo function returned by every `PlatformAdapter` subscription. Calling it twice is a no-op.onPointerLockChange(listener: (locked: boolean) => void): PlatformSubscriptionUndo function returned by every `PlatformAdapter` subscription. Calling it twice is a no-op.onSurfaceEvent(type: K, listener: (event: PlatformSurfaceEventMapEvents the input pipeline sources from the drawing surface itself. The payload types are the browser's event shapes, narrowed to the fields the engine reads. K…[K]) => void, options?: PlatformListenerOptionsListener flags the input pipeline needs when it subscribes to a platform event.): PlatformSubscriptionUndo function returned by every `PlatformAdapter` subscription. Calling it twice is a no-op.onVisibilityChange(listener: (visible: boolean) => void): PlatformSubscriptionUndo function returned by every `PlatformAdapter` subscription. Calling it twice is a no-op.onWindowEvent(type: K, listener: (event: PlatformWindowEventMapEvents the input pipeline sources from the host window rather than the surface.[K]) => void, options?: PlatformListenerOptionsListener flags the input pipeline needs when it subscribes to a platform event.): PlatformSubscriptionUndo function returned by every `PlatformAdapter` subscription. Calling it twice is a no-op.releasePointer(pointerId: number): voidrequestFrame(callback: (timestamp: number) => void): numbersetCursor(value: string): voidsetTouchAction(value: string): voidunlockPointer(): voiddevicePixelRatio: numberdocumentVisible: booleanpointerLocked: booleansurface: HTMLCanvasElementsurfaceFocused: booleantextInputFocused: boolean