Script API
Script authoring surface: ScriptComponent, handler lifecycle and the script-facing signals facade.
Classes
| Class | Description |
|---|---|
| ScriptComponent | Base class for scene scripts; construct through ScriptHost.mount. |
| MapScriptRegistry | Mutable registry used by hosts and tests. |
| ScriptStartTimeoutError | Raised when one script onStart exceeds the configured budget. |
| ScriptHost | Mounts every suity.script component in the runtime scene. |
Interfaces
| Interface | Description |
|---|---|
| ScriptSignals | Node-local state-provider facade exposed to scripts (docs/130 S5). |
| SignalWatchOptions | Options accepted by ScriptSignals.watch*. |
| ScriptSignalsScope | Script-scoped provider registry. Wraps the host ScriptSignals facade and tracks every disposer returned by registerSignalProvider/provideSignal so the script handler can release them on unmount without the script doing bookkeeping. |
| ScriptAssetProvider | Optional engine-provided asset loader; resolve falls back to the scene. |
| ScriptAssets | Lightweight asset facade handed to scripts (this.assets). |
| ScriptContext | Runtime context injected into every script instance. |
| ScriptComponentStatic | Static metadata optionally declared on a ScriptComponent subclass. |
| ScriptRegistry | Resolves a script asset uid to its default-exported constructor. |
| ScriptInstanceInfo | Mounted script descriptor exposed on the host handle. |
| ScriptHostHandle | Handle returned by ScriptHost.mount; update must be driven by the host. |
| ScriptHostOptions | Options for ScriptHost.mount. |
| ScriptSubscriptionScope | - |
| ScriptAssetScene | Scene capabilities used by createScriptAssets. |
Type Aliases
| Type Alias | Description |
|---|---|
| ComponentHandle | - |
| ScriptSignalFields | Concise field map accepted by ScriptSignals.provideSignal(...). |
| ScriptConstructor | Constructor shape used by the runtime; not instanceof based. Subclasses may declare the optional static metadata (runtimeKey/displayName). |
Variables
| Variable | Description |
|---|---|
| SUITY_SDK_VERSION | Unified public SDK version stored in the build manifest (docs/177). |
| DEFAULT_SCRIPT_START_TIMEOUT_MS | Default budget for sequential onStart calls. |
Functions
| Function | Description |
|---|---|
| createScriptSignalsScope | Creates a scoped signals facade over base. Registrations are tracked and released by dispose(); each call still returns its own idempotent disposer. Returns signals: undefined when the host does not expose a provider API. |
| scopeNodeSignals | Returns node with its signals property replaced by a scoped facade. When the host exposes no signals, the original node is returned untouched so identity comparisons and legacy hosts keep working. |
| createScriptRegistry | Creates a mutable script registry seeded from scripts. |
| createScriptAssets | Builds the this.assets facade, forwarding to the scene/engine loader. |
| createSubscriptionScope | - |
| runWithTimeout | - |
| describeError | - |
References
Node
Renames and re-exports ComponentHandle
Scene
Renames and re-exports ComponentHandle
ScriptNodeSignals
Renames and re-exports ComponentHandle
SIGNAL_REFRESH_KEY
Renames and re-exports ComponentHandle
SCRIPT_COMPONENT_TYPE
Renames and re-exports ComponentHandle
ScriptComponentHandler
Renames and re-exports ComponentHandle
ScriptComponentHandlerOptions
Renames and re-exports ComponentHandle
ScriptInstanceState
Renames and re-exports ComponentHandle
