API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfacePlatformAdapter
Everything the engine touches outside its own state: the drawing surface's focus, cursor, touch-action and geometry, pointer capture, gamepad polling, document visibility, frame scheduling, and the delivery of input events. One adapter serves the whole Application - `app.platform` - and both the InputSystem and the InteractionSystem read it from there, so there is exactly one seam between the engine and its host. BrowserPlatform is the default; pass your own through ApplicationOptions.platform to run the engine somewhere else, or to drive it from a test without monkey-patching globals. Deliberately not a platform kernel: there is nothing here for fetch, storage, audio, workers or display configuration. This adapter covers the mechanics the input and frame pipeline actually needs today, and grows only when a subsystem genuinely needs a seam. The adapter supplies mechanism, never policy. It reports that a pointer moved and captures it on request; whether that movement is a drag, a tap or an action is decided entirely by the input system above it.
import { PlatformAdapter } from '@codexo/exojs'Everything the engine touches outside its own state: the drawing surface's focus, cursor, touch-action and geometry, pointer capture, gamepad polling, document visibility, frame scheduling, and the delivery of input events.
One adapter serves the whole Application - `app.platform` - and both the InputSystem and the InteractionSystem read it from there, so there is exactly one seam between the engine and its host. BrowserPlatform is the default; pass your own through ApplicationOptions.platform to run the engine somewhere else, or to drive it from a test without monkey-patching globals.
Deliberately not a platform kernel: there is nothing here for fetch, storage, audio, workers or display configuration. This adapter covers the mechanics the input and frame pipeline actually needs today, and grows only when a subsystem genuinely needs a seam.
The adapter supplies mechanism, never policy. It reports that a pointer moved and captures it on request; whether that movement is a drag, a tap or an action is decided entirely by the input system above it.
cancelFrame(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: booleansurfaceFocused: booleantextInputFocused?: boolean