API reference

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

T

typeSynchronous

@codexo/exojs / core / stable

Return type of the engine hooks that must not be asynchronous: Scene.init, the frame hooks Scene.fixedUpdate / Scene.update / Scene.draw, and the SystemMethods phases. Write these overrides exactly as before - a body that returns nothing satisfies `Synchronous`, `override update(delta: Seconds): void` remains the idiomatic annotation, and the engine's fluent `update(delta): this` convention still fits. It is deliberately *not* a bare `void`. TypeScript makes a `void`-returning signature assignable from a signature returning **anything at all**, so `override async update()` compiles clean against a `void` base - the exact mistake this contract exists to prevent. The union above keeps `void`, keeps every ordinary object return, and rejects only thenables: `then` is pinned to `never`, so any type carrying a callable `then` (a `Promise`, or a hand-rolled thenable) fails to match. `object &` is what makes the remaining constituent non-weak, so a return type with no `then` property at all is still accepted rather than tripping TypeScript's weak-type check. Nothing here exists at runtime; no engine code reads `then` off a hook result to decide anything (the always-on runtime guard does its own check). Hooks the engine genuinely awaits - Scene.load and Scene.unload - are typed `Promise<void> | void` instead and stay asynchronous.

0
props
0
methods
0
events
Import
import { Synchronous } from '@codexo/exojs'

Return type of the engine hooks that must not be asynchronous: Scene.init, the frame hooks Scene.fixedUpdate / Scene.update / Scene.draw, and the SystemMethods phases. Write these overrides exactly as before - a body that returns nothing satisfies `Synchronous`, `override update(delta: Seconds): void` remains the idiomatic annotation, and the engine's fluent `update(delta): this` convention still fits.

It is deliberately *not* a bare `void`. TypeScript makes a `void`-returning signature assignable from a signature returning **anything at all**, so `override async update()` compiles clean against a `void` base - the exact mistake this contract exists to prevent. The union above keeps `void`, keeps every ordinary object return, and rejects only thenables: `then` is pinned to `never`, so any type carrying a callable `then` (a `Promise`, or a hand-rolled thenable) fails to match. `object &` is what makes the remaining constituent non-weak, so a return type with no `then` property at all is still accepted rather than tripping TypeScript's weak-type check.

Nothing here exists at runtime; no engine code reads `then` off a hook result to decide anything (the always-on runtime guard does its own check).

Hooks the engine genuinely awaits - Scene.load and Scene.unload - are typed `Promise<void> | void` instead and stay asynchronous.

Definition1
object & { then?: never } | void
Source