API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

I

interfaceExtension

@codexo/exojs/extensions / extensions / stable

An ExoJS extension: an immutable descriptor that contributes renderer bindings, asset bindings, serializer bindings and/or app-level systems. Holds no Application, backend, GPU, or loader instances. Pass it to the application that should have it, via ApplicationOptions.extensions - that is the only way an extension takes effect, so what an application can do is readable at its construction rather than inferred from which modules were imported. The descriptor is a shared, frozen singleton: the same object equips any number of Applications. Per-application state therefore never belongs on it - it belongs in the closure Extension.install opens, which is also what the returned ExtensionDisposer closes over.

5
props
1
methods
0
events
Import
import { Extension } from '@codexo/exojs/extensions'

An ExoJS extension: an immutable descriptor that contributes renderer bindings, asset bindings, serializer bindings and/or app-level systems. Holds no Application, backend, GPU, or loader instances. Pass it to the application that should have it, via ApplicationOptions.extensions - that is the only way an extension takes effect, so what an application can do is readable at its construction rather than inferred from which modules were imported.

The descriptor is a shared, frozen singleton: the same object equips any number of Applications. Per-application state therefore never belongs on it - it belongs in the closure Extension.install opens, which is also what the returned ExtensionDisposer closes over.

Methods1
Set this application up for whatever the binding arrays cannot express - an app-level System on Application.systems, a subscription on Application.onResize, a MutationObserver, a worker, a debug overlay appended next to the canvas. Runs once per Application, as the final construction step: every core system and every materialised binding already exists, and dependencies listed in Extension.dependencies are installed first. Return an ExtensionDisposer to undo it. The Application holds the disposers of everything it installed and runs them in reverse installation order - during Application.destroy, or, if a later construction step throws, during that constructor's rollback. Return nothing when there is nothing to undo. A disposer that throws is reported and the remaining ones still run. An extension's lifetime is its Application's lifetime: there is no uninstall at runtime, and no scene-level scope - extensions equip an application, not a scene. install throwing aborts construction, and whatever it had already done before throwing is its own to undo: the disposer it never returned cannot be run for it.
Properties5
dependencies?: readonly Extension[]
id: string
Source