Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

refactor(sdk): unify the public API surface

esengine8e979cc1c795
diff --git a/desktop/src/engine/schema.ts b/desktop/src/engine/schema.ts
index 47c0e000a..5fef3cb49 100644
--- a/desktop/src/engine/schema.ts
+++ b/desktop/src/engine/schema.ts
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
-import { getAllRegisteredComponents, getUserComponents, getComponent, getComponentAssetFieldDescriptors, getComponentSpineFieldDescriptor, getComponentFieldMeta, Light2DType, usesStagger, isHexOrientation } from 'esengine';
+import { getComponentRegistry, getUserComponents, getComponent, getComponentAssetFieldDescriptors, getComponentSpineFieldDescriptor, getComponentFieldMeta, Light2DType, usesStagger, isHexOrientation } from 'esengine';
import type { App, SceneData } from 'esengine';
import type { NodeKind, InspectorField, EnumOption, GradientValue, CurveValue } from '@/types';
@@ -646,7 +646,7 @@ export function modelAddableComponentEntries(
const present = new Set(entity.components.map((c) => c.type));
const userNames = new Set(getUserComponents().keys());
const out: Array<{ name: string; label: string; category: string }> = [];
- for (const [name, def] of getAllRegisteredComponents()) {
+ for (const [name, def] of getComponentRegistry()) {
if (HIDDEN_COMPONENTS.has(name) || name === 'Transform' || present.has(name)) continue;
if (def.transient) continue; // runtime-only state is never authorable
out.push({ name, label: prettyLabel(name), category: componentCategory(name, userNames.has(name)) });
diff --git a/desktop/src/i18n/index.ts b/desktop/src/i18n/index.ts
index 6c61ac27d..0f6420000 100644
--- a/desktop/src/i18n/index.ts
+++ b/desktop/src/i18n/index.ts
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
/**
- * @file index.ts — editor localization, built on the ENGINE's LocalizationApi
+ * @file index.ts — editor localization, built on the ENGINE's LocalizationAPI
* (one i18n engine for games and the editor — no second library). The
* locale is resolved ONCE at module load, before any other editor module
* evaluates: command labels, settings descriptors, and menu titles are
@@ -12,7 +12,7 @@
* t(key) is typed over the merged catalog — a typo'd key or a key
* missing a language is a compile error, not a runtime blank.
*/
-import { LocalizationApi, type TParams } from 'esengine';
+import { LocalizationAPI, type TParams } from 'esengine';
import { editorMessages } from './messages';
export type { Message, MessageMap } from './messages/types';
@@ -63,7 +63,7 @@ export const systemDefaultLocale: EditorLocale = resolveLocale(undefined, system
/** The locale this editor session renders in — fixed for the session's lifetime. */
export const editorLocale: EditorLocale = resolveLocale(readPersistedLanguage(), systemLang);
-const loc = new LocalizationApi(editorLocale, 'en');
+const loc = new LocalizationAPI(editorLocale, 'en');
{
const en: Record<string, string> = {};
const zh: Record<string, string> = {};
diff --git a/desktop/tests/i18n.test.ts b/desktop/tests/i18n.test.ts
index 1c4926507..882f1d00f 100644
--- a/desktop/tests/i18n.test.ts
+++ b/desktop/tests/i18n.test.ts
@@ -10,7 +10,7 @@
import { describe, it, expect } from 'vitest';
import { resolveLocale, t, editorLocale, editorMessages } from '@/i18n';
import { messageModules } from '@/i18n/messages';
-import { LocalizationApi } from 'esengine';
+import { LocalizationAPI } from 'esengine';
describe('resolveLocale', () => {
it('persisted value wins when it is a shipped locale', () => {
@@ -63,10 +63,10 @@ describe('t()', () => {
it('the zh catalog serves the same keys through the shared engine', () => {
// The editor's own t() is boot-locked to en here; drive a second
- // LocalizationApi over the same messages to pin the zh side.
+ // LocalizationAPI over the same messages to pin the zh side.
const zh: Record<string, string> = {};
for (const [k, m] of Object.entries(editorMessages)) zh[k] = m.zh;
- const loc = new LocalizationApi('zh-CN', 'en');
+ const loc = new LocalizationAPI('zh-CN', 'en');
loc.addCatalog('zh-CN', zh);
expect(loc.t('cmd.entity.delete')).toBe('删除');
expect(loc.t('set.layerN', { i: 3 })).toBe('层 3');
diff --git a/docs/astro/src/content/docs/core-concepts/plugins-resources.mdx b/docs/astro/src/content/docs/core-concepts/plugins-resources.mdx
index 28a0f9b3e..767213df6 100644
--- a/docs/astro/src/content/docs/core-concepts/plugins-resources.mdx
+++ b/docs/astro/src/content/docs/core-concepts/plugins-resources.mdx
@@ -41,7 +41,7 @@ Every subsystem's imperative API is reached the same way:
| Localization | `Res(Localization)` | [Localization](/docs/guides/localization/) |
| Camera view | `Res(CameraView)` | [Camera](/docs/guides/camera/) |
| UI events | `Res(UIEvents)` | [UI](/docs/guides/ui/) |
-| Physics | `Res(PhysicsAPI)` — from `esengine/physics` | [Physics](/docs/guides/physics/) |
+| Physics | `Res(Physics)` — from `esengine/physics` | [Physics](/docs/guides/physics/) |
| Spine | `Res(Spine)` — from `esengine/spine` | [Spine](/docs/guides/spine/) |
Physics and Spine are **optional side-modules** loaded on demand, so their APIs
diff --git a/docs/astro/src/content/docs/guides/physics.mdx b/docs/astro/src/content/docs/guides/physics.mdx
index 1c32dbded..2bb300127 100644
--- a/docs/astro/src/content/docs/guides/physics.mdx
+++ b/docs/astro/src/content/docs/guides/physics.mdx
@@ -113,13 +113,13 @@ dedicated layers so the mask narrows what each sensor considers.
## Moving bodies — forces & velocity
-Read the `PhysicsAPI` resource to drive bodies. Every method takes the world entity:
+Read the `Physics` resource to drive bodies. Every method takes the world entity:
```typescript
import { defineSystem, Query, Res, RigidBody } from 'esengine';
-import { PhysicsAPI } from 'esengine/physics';
+import { Physics } from 'esengine/physics';
-const move = defineSystem([Query(RigidBody), Res(PhysicsAPI)], (q, physics) => {
+const move = defineSystem([Query(RigidBody), Res(Physics)], (q, physics) => {
for (const [entity] of q) {
physics.applyForce(entity, { x: 0, y: 20 }); // continuous force
physics.applyImpulse(entity, { x: 0, y: 5 }); // instant kick (jump)
diff --git a/docs/astro/src/content/docs/zh-cn/core-concepts/plugins-resources.mdx b/docs/astro/src/content/docs/zh-cn/core-concepts/plugins-resources.mdx
index 288edb5d4..16df8b1c5 100644
--- a/docs/astro/src/content/docs/zh-cn/core-concepts/plugins-resources.mdx
+++ b/docs/astro/src/content/docs/zh-cn/core-concepts/plugins-resources.mdx
@@ -39,7 +39,7 @@ defineSystem([Res(Audio)], (audio) => {
| 本地化 | `Res(Localization)` | [本地化](/docs/zh-cn/guides/localization/) |
| 相机视图 | `Res(CameraView)` | [相机](/docs/zh-cn/guides/camera/) |
| UI 事件 | `Res(UIEvents)` | [UI](/docs/zh-cn/guides/ui/) |
-| 物理 | `Res(PhysicsAPI)` —— 来自 `esengine/physics` | [物理](/docs/zh-cn/guides/physics/) |
+| 物理 | `Res(Physics)` —— 来自 `esengine/physics` | [物理](/docs/zh-cn/guides/physics/) |
| Spine | `Res(Spine)` —— 来自 `esengine/spine` | [Spine](/docs/zh-cn/guides/spine/) |
物理和 Spine 是**可选 side-module**,按需加载,因此它们的 API 放在子路径上以保持基础
diff --git a/docs/astro/src/content/docs/zh-cn/guides/physics.mdx b/docs/astro/src/content/docs/zh-cn/guides/physics.mdx
index d65e20382..f04db7fb2 100644
--- a/docs/astro/src/content/docs/zh-cn/guides/physics.mdx
+++ b/docs/astro/src/content/docs/zh-cn/guides/physics.mdx
@@ -106,13 +106,13 @@ const LAYER_GROUND = 0x0008;
## 移动刚体 —— 力与速度
-读 `PhysicsAPI` 资源来驱动刚体。每个方法都取世界实体:
+读 `Physics` 资源来驱动刚体。每个方法都取世界实体:
```typescript
import { defineSystem, Query, Res, RigidBody } from 'esengine';
-import { PhysicsAPI } from 'esengine/physics';
+import { Physics } from 'esengine/physics';
-const move = defineSystem([Query(RigidBody), Res(PhysicsAPI)], (q, physics) => {
+const move = defineSystem([Query(RigidBody), Res(Physics)], (q, physics) => {
for (const [entity] of q) {
physics.applyForce(entity, { x: 0, y: 20 }); // continuous force
physics.applyImpulse(entity, { x: 0, y: 5 }); // instant kick (jump)
diff --git a/examples/physics-playground/src/systems/interact.ts b/examples/physics-playground/src/systems/interact.ts
index 6d5645a3d..9ed0cc940 100644
--- a/examples/physics-playground/src/systems/interact.ts
+++ b/examples/physics-playground/src/systems/interact.ts
@@ -3,8 +3,8 @@ import {
Transform, RigidBody, BodyType,
} from 'esengine';
import type { UICameraData, RigidBodyData, TransformData } from 'esengine';
-import { PhysicsAPI, MotorJoint } from 'esengine/physics';
-import type { Physics } from 'esengine/physics';
+import { Physics, MotorJoint } from 'esengine/physics';
+import type { PhysicsAPI } from 'esengine/physics';
const DRAG_BUTTON = 0;
const PICK_RADIUS = 6; // world px around the cursor to grab a body
@@ -12,8 +12,8 @@ const PICK_RADIUS = 6; // world px around the cursor to grab a body
// Click-and-drag any dynamic body with a mouse joint: pick on press, follow the
// cursor while held, release on up. Only one drag is live at a time.
export const dragSystem = defineSystem(
- [Res(Input), Res(UICameraInfo), Res(PhysicsAPI), Query(RigidBody)],
- (input, camera: UICameraData, physics: Physics, bodies) => {
+ [Res(Input), Res(UICameraInfo), Res(Physics), Query(RigidBody)],
+ (input, camera: UICameraData, physics: PhysicsAPI, bodies) => {
if (!camera.valid) return;
const target = { x: camera.worldMouseX, y: camera.worldMouseY };
@@ -41,8 +41,8 @@ const SHUTTLE_MAX_X = 290;
const shuttleDir = new Map<number, number>();
export const shuttleSystem = defineSystem(
- [Res(PhysicsAPI), Query(Transform, MotorJoint)],
- (physics: Physics, shuttles) => {
+ [Res(Physics), Query(Transform, MotorJoint)],
+ (physics: PhysicsAPI, shuttles) => {
for (const [entity, transform] of shuttles as Iterable<[number, TransformData]>) {
let dir = shuttleDir.get(entity) ?? 1;
if (transform.position.x > SHUTTLE_MAX_X && dir > 0) {
diff --git a/examples/sprite-animation/src/systems/control.ts b/examples/sprite-animation/src/systems/control.ts
index 8bff2c8ec..b387467cf 100644
--- a/examples/sprite-animation/src/systems/control.ts
+++ b/examples/sprite-animation/src/systems/control.ts
@@ -1,7 +1,7 @@
import {
defineSystem, Query, Mut, Res, Time, Input,
Transform, Sprite, Animator,
- AnimatorController, AnimatorControllerApi,
+ AnimatorController, AnimatorControllerAPI,
} from 'esengine';
import { Player } from '../components';
import {
@@ -14,7 +14,7 @@ import {
// Space into the `hop` trigger — the state machine picks every clip.
export const controlSystem = defineSystem(
[Query(Mut(Transform), Mut(Sprite), Mut(Player), Animator), Res(Input), Res(Time), Res(AnimatorController)],
- (players, input, time, ctrl: AnimatorControllerApi) => {
+ (players, input, time, ctrl: AnimatorControllerAPI) => {
const dir =
(input.isKeyDown('ArrowRight') || input.isKeyDown('KeyD') ? 1 : 0) -
(input.isKeyDown('ArrowLeft') || input.isKeyDown('KeyA') ? 1 : 0);
diff --git a/examples/sprite-animation/src/systems/setup.ts b/examples/sprite-animation/src/systems/setup.ts
index c1323d4f3..a7436da5c 100644
--- a/examples/sprite-animation/src/systems/setup.ts
+++ b/examples/sprite-animation/src/systems/setup.ts
@@ -1,7 +1,7 @@
import {
defineSystem, Res,
- AnimatorController, AnimatorControllerApi, type AnimatorControllerDef,
- SpriteAnimation, SpriteAnimationApi,
+ AnimatorController, AnimatorControllerAPI, type AnimatorControllerDef,
+ SpriteAnimation, SpriteAnimationAPI,
} from 'esengine';
import {
CLIP_IDLE, CLIP_WALK, CLIP_HOP, CONTROLLER,
@@ -57,7 +57,7 @@ const alienController: AnimatorControllerDef = {
// footstep listener (inert until events are attached below).
export const setupSystem = defineSystem(
[Res(AnimatorController), Res(SpriteAnimation)],
- (ctrl: AnimatorControllerApi, anim: SpriteAnimationApi) => {
+ (ctrl: AnimatorControllerAPI, anim: SpriteAnimationAPI) => {
ctrl.registerController(CONTROLLER, alienController);
anim.onEventGlobal((event) => {
if (event.name === 'footstep') footsteps.pending++;
@@ -74,7 +74,7 @@ export const setupSystem = defineSystem(
let clipsWired = false;
export const wireClipsSystem = defineSystem(
[Res(SpriteAnimation)],
- (anim: SpriteAnimationApi) => {
+ (anim: SpriteAnimationAPI) => {
if (clipsWired) return;
const idle = anim.getClip(CLIP_IDLE);
const walk = anim.getClip(CLIP_WALK);
diff --git a/sdk/benchmarks/component.bench.ts b/sdk/benchmarks/component.bench.ts
index 6b0139586..26117280d 100644
--- a/sdk/benchmarks/component.bench.ts
+++ b/sdk/benchmarks/component.bench.ts
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
import { bench, describe } from 'vitest';
-import { defineComponent, getComponent, getAllRegisteredComponents, clearUserComponents } from '../src/component';
+import { defineComponent, getComponent, getComponentRegistry, clearUserComponents } from '../src/component';
import { computeQueryCacheKey } from '../src/world';
describe('Component - Definition', () => {
@@ -50,8 +50,8 @@ describe('Component - Registry lookup', () => {
for (let i = 0; i < 1000; i++) getComponent('NonExistent');
});
- bench('getAllRegisteredComponents', () => {
- getAllRegisteredComponents();
+ bench('getComponentRegistry', () => {
+ getComponentRegistry();
});
});
diff --git a/sdk/etc/index.api.md b/sdk/etc/index.api.md
index 998482c78..d548bea68 100644
--- a/sdk/etc/index.api.md
+++ b/sdk/etc/index.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/index
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 1247 stable · 17 beta · 1 deprecated
+Symbols: 1238 stable · 17 beta · 0 deprecated
## ABI_LAYOUT_HASH — const
```
@@ -260,10 +260,10 @@ value: number
## AnimatorController — const
```
-ResourceDef<AnimatorControllerApi>
+ResourceDef<AnimatorControllerAPI>
```
-## AnimatorControllerApi — class
+## AnimatorControllerAPI — class
```
clearControllers: () => void
getBool: (entity: Entity, name: string) => boolean
@@ -278,8 +278,8 @@ setSpineDriver: (driver: SpineAnimationDriver | null) => void
setTrigger: (entity: Entity, name: string) => void
unregisterController: (name: string) => void
update: (world: World) => void
-static new (): AnimatorControllerApi
-static prototype: AnimatorControllerApi
+static new (): AnimatorControllerAPI
+static prototype: AnimatorControllerAPI
```
## AnimatorControllerDef — interface
@@ -1206,17 +1206,17 @@ viewportPixels: Viewport
## CameraView — const
```
-ResourceDef<CameraViewApi>
+ResourceDef<CameraViewAPI>
```
-## CameraViewApi — class
+## CameraViewAPI — class
```
getWorldBounds: () => { left: number; right: number; bottom: number; top: number; } | null
getWorldMousePosition: () => { x: number; y: number; } | null
screenToWorld: (screenX: number, screenY: number) => { x: number; y: number; } | null
worldToScreen: (worldX: number, worldY: number) => { x: number; y: number; } | null
-static new (app_: App): CameraViewApi
-static prototype: CameraViewApi
+static new (app_: App): CameraViewAPI
+static prototype: CameraViewAPI
```
## Canvas — const
@@ -3425,10 +3425,10 @@ version: number
## Localization — const
```
-ResourceDef<LocalizationApi>
+ResourceDef<LocalizationAPI>
```
-## LocalizationApi — class
+## LocalizationAPI — class
```
addCatalog: (locale: string, entries: LocaleCatalog) => void
availableLocales: () => string[]
@@ -3439,8 +3439,8 @@ setFallbackLocale: (locale: string) => void
setLocale: (locale: string) => void
setPluralSelector: (locale: string, selector: PluralSelector) => void
t: (key: string, params?: TParams) => string
-static new (locale?: string, fallback?: string): LocalizationApi
-static prototype: LocalizationApi
+static new (locale?: string, fallback?: string): LocalizationAPI
+static prototype: LocalizationAPI
```
## LocalizationOptions — interface
@@ -4038,81 +4038,9 @@ static prototype: PerceptionPlugin
ComponentDef<{}>
```
-## Physics — class
-```
-applyAngularImpulse: (entity: Entity, impulse: number) => void
-applyForce: (entity: Entity, force: Vec2) => void
-applyImpulse: (entity: Entity, impulse: Vec2) => void
-applyTorque: (entity: Entity, torque: number) => void
-createMouseJoint: (entity: Entity, target: Vec2, opts?: { hertz?: number; dampingRatio?: number; maxForce?: number; }, ppu?: number) => boolean
-createRevoluteJoint: (entityA: Entity, entityB: Entity, anchorA: Vec2, anchorB: Vec2, options?: { enableMotor?: boolean; motorSpeed?: number; maxMotorTorque?: number; enableLimit?: boolean; lowerAngle?: number; upperAngle?: number; collideConnected?: boolean; }) => boolean
-destroyJoint: (entity: Entity) => void
-destroyMouseJoint: () => void
-enableDistanceJointLimit: (entity: Entity, enable: boolean) => void
-enableDistanceJointMotor: (entity: Entity, enable: boolean) => void
-enableDistanceJointSpring: (entity: Entity, enable: boolean) => void
-enablePrismaticJointLimit: (entity: Entity, enable: boolean) => void
-enablePrismaticJointMotor: (entity: Entity, enable: boolean) => void
-enablePrismaticJointSpring: (entity: Entity, enable: boolean) => void
-enableRevoluteLimit: (entity: Entity, enable: boolean) => void
-enableRevoluteMotor: (entity: Entity, enable: boolean) => void
-enableWheelJointLimit: (entity: Entity, enable: boolean) => void
-enableWheelJointMotor: (entity: Entity, enable: boolean) => void
-enableWheelJointSpring: (entity: Entity, enable: boolean) => void
-getAngularVelocity: (entity: Entity) => number
-getCenterOfMass: (entity: Entity, ppu?: number) => Vec2
-getDistanceJointCurrentLength: (entity: Entity, ppu?: number) => number
-getDistanceJointLength: (entity: Entity, ppu?: number) => number
-getDistanceJointMotorForce: (entity: Entity) => number
-getGravity: () => Vec2
-getInertia: (entity: Entity) => number
-getLinearVelocity: (entity: Entity) => Vec2
-getMass: (entity: Entity) => number
-getMassData: (entity: Entity, ppu?: number) => MassData
-getPixelsPerUnit: () => number
-getPrismaticJointMotorForce: (entity: Entity) => number
-getPrismaticJointSpeed: (entity: Entity, ppu?: number) => number
-getPrismaticJointTranslation: (entity: Entity, ppu?: number) => number
-getRevoluteAngle: (entity: Entity) => number
-getRevoluteMotorTorque: (entity: Entity) => number
-getWheelJointMotorTorque: (entity: Entity) => number
-hasMouseJoint: () => boolean
-isAwake: (entity: Entity) => boolean
-moveCharacter: (pos: Vec2, c1: Vec2, c2: Vec2, radius: number, velocity: Vec2, dt: number, up: Vec2, floorCos: number, maskBits: number, self: Entity, ppu?: number) => MoverResult | null
-overlapAABB: (min: Vec2, max: Vec2, maskBits?: number, ppu?: number) => Entity[]
-overlapCircle: (center: Vec2, radius: number, maskBits?: number, ppu?: number) => Entity[]
-raycast: (origin: Vec2, direction: Vec2, maxDistance: number, maskBits?: number, ppu?: number) => RaycastHit[]
-setAngularVelocity: (entity: Entity, omega: number) => void
-setAwake: (entity: Entity, awake: boolean) => void
-setDistanceJointLength: (entity: Entity, length: number, ppu?: number) => void
-setDistanceJointLimits: (entity: Entity, minLength: number, maxLength: number, ppu?: number) => void
-setDistanceJointMaxMotorForce: (entity: Entity, force: number) => void
-setDistanceJointMotorSpeed: (entity: Entity, speed: number) => void
-setGravity: (gravity: Vec2) => void
-setLinearVelocity: (entity: Entity, velocity: Vec2) => void
-setMotorJointAngularVelocity: (entity: Entity, omega: number) => void
-setMotorJointLinearVelocity: (entity: Entity, velocity: Vec2, ppu?: number) => void
-setMotorJointMaxVelocityForce: (entity: Entity, force: number) => void
-setMotorJointMaxVelocityTorque: (entity: Entity, torque: number) => void
-setMouseTarget: (target: Vec2, ppu?: number) => void
-setPixelsPerUnit: (ppu: number) => void
-setPrismaticJointLimits: (entity: Entity, lower: number, upper: number, ppu?: number) => void
-setPrismaticJointMaxMotorForce: (entity: Entity, force: number) => void
-setPrismaticJointMotorSpeed: (entity: Entity, speed: number) => void
-setRevoluteLimits: (entity: Entity, lower: number, upper: number) => void
-setRevoluteMaxMotorTorque: (entity: Entity, torque: number) => void
-setRevoluteMotorSpeed: (entity: Entity, speed: number) => void
-setWheelJointLimits: (entity: Entity, lower: number, upper: number, ppu?: number) => void
-setWheelJointMaxMotorTorque: (entity: Entity, torque: number) => void
-setWheelJointMotorSpeed: (entity: Entity, speed: number) => void
-shapeCastBox: (center: Vec2, halfExtents: Vec2, angle: number, translation: Vec2, maskBits?: number, ppu?: number) => ShapeCastHit[]
-shapeCastCapsule: (center1: Vec2, center2: Vec2, radius: number, translation: Vec2, maskBits?: number, ppu?: number) => ShapeCastHit[]
-shapeCastCircle: (center: Vec2, radius: number, translation: Vec2, maskBits?: number, ppu?: number) => ShapeCastHit[]
-static _fromModule: (module: PhysicsWasmModule) => Physics
-static new (app: App): Physics
-static prototype: Physics
-static setDebugDraw: (app: App, enabled: boolean) => void
-static setDebugDrawConfig: (app: App, config: Partial<PhysicsDebugDrawConfig>) => void
+## Physics — const
+```
+ResourceDef<PhysicsAPI>
```
## PhysicsEvents — const
@@ -4474,10 +4402,10 @@ startTime: number
## PostProcess — const
```
-ResourceDef<PostProcessApi>
+ResourceDef<PostProcessAPI>
```
-## PostProcessApi — class
+## PostProcessAPI — class
```
_applyForCamera: (camera: Entity) => void
_applyScreenStack: () => void
@@ -4502,8 +4430,8 @@ state: PostProcessState
unbind: (camera: Entity) => void
volumeShaders: Map<string, number>
volumeStacks: Map<number, PostProcessStack>
-static new (): PostProcessApi
-static prototype: PostProcessApi
+static new (): PostProcessAPI
+static prototype: PostProcessAPI
```
## PostProcessPlugin — class
@@ -4867,7 +4795,7 @@ endScreenCapture: () => void
render: (params: RenderParams) => void
renderCamera: (params: CameraRenderParams) => void
setActiveScenes: (scenes: Set<string> | null) => void
-setPostProcess: (pp: PostProcessApi | null) => void
+setPostProcess: (pp: PostProcessAPI | null) => void
submitScene: (registry: { _cpp: CppRegistry; }, viewProjection: Float32Array, viewport: Viewport, _elapsed: number) => void
static new (): RenderPipeline
static prototype: RenderPipeline
@@ -5671,6 +5599,11 @@ refDistance: number
rolloff: number
```
+## Spine — const
+```
+ResourceDef<SpineManager>
+```
+
## SpineAnimation — const
```
BuiltinComponentDef<SpineAnimationData>
@@ -5699,12 +5632,29 @@ timeScale: number
setAnimation: (entity: Entity, animation: string, loop: boolean) => void
```
+## SpineEvents — const
+```
+ResourceDef<SpineEventsData>
+```
+
## SpineLoadResult — interface
```
error: string | undefined
success: boolean
```
+## SpinePlugin — class
+```
+build: (app: App) => void
+cleanup: () => void
+finish: (app: App) => void
+name: string
+setSpineManager: (manager: SpineManager) => void
+spineManager: SpineManager | null
+static new (manager?: SpineManager): SpinePlugin
+static prototype: SpinePlugin
+```
+
## SpineTrack — interface
```
blendIn: number
@@ -5760,10 +5710,10 @@ type: "spriteAnim"
## SpriteAnimation — const
```
-ResourceDef<SpriteAnimationApi>
+ResourceDef<SpriteAnimationAPI>
```
-## SpriteAnimationApi — class
+## SpriteAnimationAPI — class
```
aliasClip: (name: string, clip: SpriteAnimClip) => void
clearClips: () => void
@@ -5776,8 +5726,8 @@ registerClip: (clip: SpriteAnimClip) => void
removeEntityListeners: (entity: Entity) => void
unregisterClip: (name: string) => void
update: (world: World, deltaTime: number) => void
-static new (): SpriteAnimationApi
-static prototype: SpriteAnimationApi
+static new (): SpriteAnimationAPI
+static prototype: SpriteAnimationAPI
```
## SpriteAnimator — const
@@ -6623,10 +6573,10 @@ frameCount: number
## Timeline — const
```
-ResourceDef<TimelineApi>
+ResourceDef<TimelineAPI>
```
-## TimelineApi — class
+## TimelineAPI — class
```
clearStates: () => void
ensureState: (entity: Entity, wrapMode: WrapMode, speed: number) => TimelineState
@@ -6638,8 +6588,8 @@ play: (entity: Entity) => void
removeState: (entity: Entity) => void
setTime: (entity: Entity, time: number) => void
stop: (entity: Entity) => void
-static new (flags_?: PlayerFlagChannel | null): TimelineApi
-static prototype: TimelineApi
+static new (flags_?: PlayerFlagChannel | null): TimelineAPI
+static prototype: TimelineAPI
```
## TimelineAsset — interface
@@ -8320,11 +8270,6 @@ FsmPlugin
(): EffectDef[]
```
-## getAllRegisteredComponents — function @deprecated
-```
-(): Map<string, AnyComponentDef>
-```
-
## getAssetBuildTransform — function
```
(extensionOrPath: string): AssetBuildTransform | undefined
@@ -8495,26 +8440,6 @@ FsmPlugin
(category: string, message: string, data?: unknown): void
```
-## initDrawAPI — function
-```
-(wasmModule: ESEngineModule): void
-```
-
-## initGLDebugAPI — function
-```
-(wasmModule: ESEngineModule): void
-```
-
-## initGeometryAPI — function
-```
-(wasmModule: ESEngineModule): void
-```
-
-## initMaterialAPI — function
-```
-(wasmModule: ESEngineModule): void
-```
-
## initPlayRealmRuntime — function
```
(config: PlayRealmRuntimeConfig): Promise<void>
@@ -8525,31 +8450,11 @@ FsmPlugin
(config: PlayableRuntimeConfig): Promise<void>
```
-## initPostProcessAPI — function
-```
-(wasmModule: ESEngineModule): void
-```
-
-## initRendererAPI — function
-```
-(wasmModule: ESEngineModule): void
-```
-
-## initResourceManager — function
-```
-(rm: CppResourceManager, module?: ESEngineModule): void
-```
-
## initRuntime — function
```
(config: RuntimeInitConfig): Promise<void>
```
-## initTilemapAPI — function
-```
-(m: ESEngineModule): void
-```
-
## inputPlugin — const
```
InputPlugin
@@ -8742,7 +8647,7 @@ Logger
## makeLosCheck — function
```
-(physics: Physics): LosCheck
+(physics: PhysicsAPI): LosCheck
```
## makeWidgetInteractable — function
@@ -9415,16 +9320,6 @@ Plugin
(shape: ColliderShape): Vec2
```
-## shutdownDrawAPI — function
-```
-(): void
-```
-
-## shutdownGLDebugAPI — function
-```
-(): void
-```
-
## shutdownGeometryAPI — function
```
(): void
@@ -9435,21 +9330,11 @@ Plugin
(): void
```
-## shutdownPostProcessAPI — function
-```
-(): void
-```
-
## shutdownRendererAPI — function
```
(): void
```
-## shutdownResourceManager — function
-```
-(): void
-```
-
## shutdownTilemapAPI — function
```
(): void
diff --git a/sdk/etc/index.node.api.md b/sdk/etc/index.node.api.md
index 51a71aa4a..ba76fcb4a 100644
--- a/sdk/etc/index.node.api.md
+++ b/sdk/etc/index.node.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/index.node
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 1246 stable · 19 beta · 1 deprecated
+Symbols: 1237 stable · 19 beta · 0 deprecated
## ANCHOR_AXES — const
```
@@ -255,10 +255,10 @@ value: number
## AnimatorController — const
```
-ResourceDef<AnimatorControllerApi>
+ResourceDef<AnimatorControllerAPI>
```
-## AnimatorControllerApi — class
+## AnimatorControllerAPI — class
```
clearControllers: () => void
getBool: (entity: Entity, name: string) => boolean
@@ -273,8 +273,8 @@ setSpineDriver: (driver: SpineAnimationDriver | null) => void
setTrigger: (entity: Entity, name: string) => void
unregisterController: (name: string) => void
update: (world: World) => void
-static new (): AnimatorControllerApi
-static prototype: AnimatorControllerApi
+static new (): AnimatorControllerAPI
+static prototype: AnimatorControllerAPI
```
## AnimatorControllerDef — interface
@@ -1201,17 +1201,17 @@ viewportPixels: Viewport
## CameraView — const
```
-ResourceDef<CameraViewApi>
+ResourceDef<CameraViewAPI>
```
-## CameraViewApi — class
+## CameraViewAPI — class
```
getWorldBounds: () => { left: number; right: number; bottom: number; top: number; } | null
getWorldMousePosition: () => { x: number; y: number; } | null
screenToWorld: (screenX: number, screenY: number) => { x: number; y: number; } | null
worldToScreen: (worldX: number, worldY: number) => { x: number; y: number; } | null
-static new (app_: App): CameraViewApi
-static prototype: CameraViewApi
+static new (app_: App): CameraViewAPI
+static prototype: CameraViewAPI
```
## Canvas — const
@@ -3420,10 +3420,10 @@ version: number
## Localization — const
```
-ResourceDef<LocalizationApi>
+ResourceDef<LocalizationAPI>
```
-## LocalizationApi — class
+## LocalizationAPI — class
```
addCatalog: (locale: string, entries: LocaleCatalog) => void
availableLocales: () => string[]
@@ -3434,8 +3434,8 @@ setFallbackLocale: (locale: string) => void
setLocale: (locale: string) => void
setPluralSelector: (locale: string, selector: PluralSelector) => void
t: (key: string, params?: TParams) => string
-static new (locale?: string, fallback?: string): LocalizationApi
-static prototype: LocalizationApi
+static new (locale?: string, fallback?: string): LocalizationAPI
+static prototype: LocalizationAPI
```
## LocalizationOptions — interface
@@ -4033,81 +4033,9 @@ static prototype: PerceptionPlugin
ComponentDef<{}>
```
-## Physics — class
-```
-applyAngularImpulse: (entity: Entity, impulse: number) => void
-applyForce: (entity: Entity, force: Vec2) => void
-applyImpulse: (entity: Entity, impulse: Vec2) => void
-applyTorque: (entity: Entity, torque: number) => void
-createMouseJoint: (entity: Entity, target: Vec2, opts?: { hertz?: number; dampingRatio?: number; maxForce?: number; }, ppu?: number) => boolean
-createRevoluteJoint: (entityA: Entity, entityB: Entity, anchorA: Vec2, anchorB: Vec2, options?: { enableMotor?: boolean; motorSpeed?: number; maxMotorTorque?: number; enableLimit?: boolean; lowerAngle?: number; upperAngle?: number; collideConnected?: boolean; }) => boolean
-destroyJoint: (entity: Entity) => void
-destroyMouseJoint: () => void
-enableDistanceJointLimit: (entity: Entity, enable: boolean) => void
-enableDistanceJointMotor: (entity: Entity, enable: boolean) => void
-enableDistanceJointSpring: (entity: Entity, enable: boolean) => void
-enablePrismaticJointLimit: (entity: Entity, enable: boolean) => void
-enablePrismaticJointMotor: (entity: Entity, enable: boolean) => void
-enablePrismaticJointSpring: (entity: Entity, enable: boolean) => void
-enableRevoluteLimit: (entity: Entity, enable: boolean) => void
-enableRevoluteMotor: (entity: Entity, enable: boolean) => void
-enableWheelJointLimit: (entity: Entity, enable: boolean) => void
-enableWheelJointMotor: (entity: Entity, enable: boolean) => void
-enableWheelJointSpring: (entity: Entity, enable: boolean) => void
-getAngularVelocity: (entity: Entity) => number
-getCenterOfMass: (entity: Entity, ppu?: number) => Vec2
-getDistanceJointCurrentLength: (entity: Entity, ppu?: number) => number
-getDistanceJointLength: (entity: Entity, ppu?: number) => number
-getDistanceJointMotorForce: (entity: Entity) => number
-getGravity: () => Vec2
-getInertia: (entity: Entity) => number
-getLinearVelocity: (entity: Entity) => Vec2
-getMass: (entity: Entity) => number
-getMassData: (entity: Entity, ppu?: number) => MassData
-getPixelsPerUnit: () => number
-getPrismaticJointMotorForce: (entity: Entity) => number
-getPrismaticJointSpeed: (entity: Entity, ppu?: number) => number
-getPrismaticJointTranslation: (entity: Entity, ppu?: number) => number
-getRevoluteAngle: (entity: Entity) => number
-getRevoluteMotorTorque: (entity: Entity) => number
-getWheelJointMotorTorque: (entity: Entity) => number
-hasMouseJoint: () => boolean
-isAwake: (entity: Entity) => boolean
-moveCharacter: (pos: Vec2, c1: Vec2, c2: Vec2, radius: number, velocity: Vec2, dt: number, up: Vec2, floorCos: number, maskBits: number, self: Entity, ppu?: number) => MoverResult | null
-overlapAABB: (min: Vec2, max: Vec2, maskBits?: number, ppu?: number) => Entity[]
-overlapCircle: (center: Vec2, radius: number, maskBits?: number, ppu?: number) => Entity[]
-raycast: (origin: Vec2, direction: Vec2, maxDistance: number, maskBits?: number, ppu?: number) => RaycastHit[]
-setAngularVelocity: (entity: Entity, omega: number) => void
-setAwake: (entity: Entity, awake: boolean) => void
-setDistanceJointLength: (entity: Entity, length: number, ppu?: number) => void
-setDistanceJointLimits: (entity: Entity, minLength: number, maxLength: number, ppu?: number) => void
-setDistanceJointMaxMotorForce: (entity: Entity, force: number) => void
-setDistanceJointMotorSpeed: (entity: Entity, speed: number) => void
-setGravity: (gravity: Vec2) => void
-setLinearVelocity: (entity: Entity, velocity: Vec2) => void
-setMotorJointAngularVelocity: (entity: Entity, omega: number) => void
-setMotorJointLinearVelocity: (entity: Entity, velocity: Vec2, ppu?: number) => void
-setMotorJointMaxVelocityForce: (entity: Entity, force: number) => void
-setMotorJointMaxVelocityTorque: (entity: Entity, torque: number) => void
-setMouseTarget: (target: Vec2, ppu?: number) => void
-setPixelsPerUnit: (ppu: number) => void
-setPrismaticJointLimits: (entity: Entity, lower: number, upper: number, ppu?: number) => void
-setPrismaticJointMaxMotorForce: (entity: Entity, force: number) => void
-setPrismaticJointMotorSpeed: (entity: Entity, speed: number) => void
-setRevoluteLimits: (entity: Entity, lower: number, upper: number) => void
-setRevoluteMaxMotorTorque: (entity: Entity, torque: number) => void
-setRevoluteMotorSpeed: (entity: Entity, speed: number) => void
-setWheelJointLimits: (entity: Entity, lower: number, upper: number, ppu?: number) => void
-setWheelJointMaxMotorTorque: (entity: Entity, torque: number) => void
-setWheelJointMotorSpeed: (entity: Entity, speed: number) => void
-shapeCastBox: (center: Vec2, halfExtents: Vec2, angle: number, translation: Vec2, maskBits?: number, ppu?: number) => ShapeCastHit[]
-shapeCastCapsule: (center1: Vec2, center2: Vec2, radius: number, translation: Vec2, maskBits?: number, ppu?: number) => ShapeCastHit[]
-shapeCastCircle: (center: Vec2, radius: number, translation: Vec2, maskBits?: number, ppu?: number) => ShapeCastHit[]
-static _fromModule: (module: PhysicsWasmModule) => Physics
-static new (app: App): Physics
-static prototype: Physics
-static setDebugDraw: (app: App, enabled: boolean) => void
-static setDebugDrawConfig: (app: App, config: Partial<PhysicsDebugDrawConfig>) => void
+## Physics — const
+```
+ResourceDef<PhysicsAPI>
```
## PhysicsEvents — const
@@ -4469,10 +4397,10 @@ startTime: number
## PostProcess — const
```
-ResourceDef<PostProcessApi>
+ResourceDef<PostProcessAPI>
```
-## PostProcessApi — class
+## PostProcessAPI — class
```
_applyForCamera: (camera: Entity) => void
_applyScreenStack: () => void
@@ -4497,8 +4425,8 @@ state: PostProcessState
unbind: (camera: Entity) => void
volumeShaders: Map<string, number>
volumeStacks: Map<number, PostProcessStack>
-static new (): PostProcessApi
-static prototype: PostProcessApi
+static new (): PostProcessAPI
+static prototype: PostProcessAPI
```
## PostProcessPlugin — class
@@ -4862,7 +4790,7 @@ endScreenCapture: () => void
render: (params: RenderParams) => void
renderCamera: (params: CameraRenderParams) => void
setActiveScenes: (scenes: Set<string> | null) => void
-setPostProcess: (pp: PostProcessApi | null) => void
+setPostProcess: (pp: PostProcessAPI | null) => void
submitScene: (registry: { _cpp: CppRegistry; }, viewProjection: Float32Array, viewport: Viewport, _elapsed: number) => void
static new (): RenderPipeline
static prototype: RenderPipeline
@@ -5666,6 +5594,11 @@ refDistance: number
rolloff: number
```
+## Spine — const
+```
+ResourceDef<SpineManager>
+```
+
## SpineAnimation — const
```
BuiltinComponentDef<SpineAnimationData>
@@ -5694,12 +5627,29 @@ timeScale: number
setAnimation: (entity: Entity, animation: string, loop: boolean) => void
```
+## SpineEvents — const
+```
+ResourceDef<SpineEventsData>
+```
+
## SpineLoadResult — interface
```
error: string | undefined
success: boolean
```
+## SpinePlugin — class
+```
+build: (app: App) => void
+cleanup: () => void
+finish: (app: App) => void
+name: string
+setSpineManager: (manager: SpineManager) => void
+spineManager: SpineManager | null
+static new (manager?: SpineManager): SpinePlugin
+static prototype: SpinePlugin
+```
+
## SpineTrack — interface
```
blendIn: number
@@ -5755,10 +5705,10 @@ type: "spriteAnim"
## SpriteAnimation — const
```
-ResourceDef<SpriteAnimationApi>
+ResourceDef<SpriteAnimationAPI>
```
-## SpriteAnimationApi — class
+## SpriteAnimationAPI — class
```
aliasClip: (name: string, clip: SpriteAnimClip) => void
clearClips: () => void
@@ -5771,8 +5721,8 @@ registerClip: (clip: SpriteAnimClip) => void
removeEntityListeners: (entity: Entity) => void
unregisterClip: (name: string) => void
update: (world: World, deltaTime: number) => void
-static new (): SpriteAnimationApi
-static prototype: SpriteAnimationApi
+static new (): SpriteAnimationAPI
+static prototype: SpriteAnimationAPI
```
## SpriteAnimator — const
@@ -6618,10 +6568,10 @@ frameCount: number
## Timeline — const
```
-ResourceDef<TimelineApi>
+ResourceDef<TimelineAPI>
```
-## TimelineApi — class
+## TimelineAPI — class
```
clearStates: () => void
ensureState: (entity: Entity, wrapMode: WrapMode, speed: number) => TimelineState
@@ -6633,8 +6583,8 @@ play: (entity: Entity) => void
removeState: (entity: Entity) => void
setTime: (entity: Entity, time: number) => void
stop: (entity: Entity) => void
-static new (flags_?: PlayerFlagChannel | null): TimelineApi
-static prototype: TimelineApi
+static new (flags_?: PlayerFlagChannel | null): TimelineAPI
+static prototype: TimelineAPI
```
## TimelineAsset — interface
@@ -8315,11 +8265,6 @@ FsmPlugin
(): EffectDef[]
```
-## getAllRegisteredComponents — function @deprecated
-```
-(): Map<string, AnyComponentDef>
-```
-
## getAssetBuildTransform — function
```
(extensionOrPath: string): AssetBuildTransform | undefined
@@ -8490,26 +8435,6 @@ FsmPlugin
(category: string, message: string, data?: unknown): void
```
-## initDrawAPI — function
-```
-(wasmModule: ESEngineModule): void
-```
-
-## initGLDebugAPI — function
-```
-(wasmModule: ESEngineModule): void
-```
-
-## initGeometryAPI — function
-```
-(wasmModule: ESEngineModule): void
-```
-
-## initMaterialAPI — function
-```
-(wasmModule: ESEngineModule): void
-```
-
## initPlayRealmRuntime — function
```
(config: PlayRealmRuntimeConfig): Promise<void>
@@ -8520,31 +8445,11 @@ FsmPlugin
(config: PlayableRuntimeConfig): Promise<void>
```
-## initPostProcessAPI — function
-```
-(wasmModule: ESEngineModule): void
-```
-
-## initRendererAPI — function
-```
-(wasmModule: ESEngineModule): void
-```
-
-## initResourceManager — function
-```
-(rm: CppResourceManager, module?: ESEngineModule): void
-```
-
## initRuntime — function
```
(config: RuntimeInitConfig): Promise<void>
```
-## initTilemapAPI — function
-```
-(m: ESEngineModule): void
-```
-
## inputPlugin — const
```
InputPlugin
@@ -8742,7 +8647,7 @@ Logger
## makeLosCheck — function
```
-(physics: Physics): LosCheck
+(physics: PhysicsAPI): LosCheck
```
## makeWidgetInteractable — function
@@ -9420,16 +9325,6 @@ Plugin
(shape: ColliderShape): Vec2
```
-## shutdownDrawAPI — function
-```
-(): void
-```
-
-## shutdownGLDebugAPI — function
-```
-(): void
-```
-
## shutdownGeometryAPI — function
```
(): void
@@ -9440,21 +9335,11 @@ Plugin
(): void
```
-## shutdownPostProcessAPI — function
-```
-(): void
-```
-
## shutdownRendererAPI — function
```
(): void
```
-## shutdownResourceManager — function
-```
-(): void
-```
-
## shutdownTilemapAPI — function
```
(): void
diff --git a/sdk/etc/physics.api.md b/sdk/etc/physics.api.md
index dd448a521..39c2805c7 100644
--- a/sdk/etc/physics.api.md
+++ b/sdk/etc/physics.api.md
@@ -247,7 +247,12 @@ enabled: boolean
normal: Vec2
```
-## Physics — class
+## Physics — const
+```
+ResourceDef<PhysicsAPI>
+```
+
+## PhysicsAPI — class
```
applyAngularImpulse: (entity: Entity, impulse: number) => void
applyForce: (entity: Entity, force: Vec2) => void
@@ -317,18 +322,13 @@ setWheelJointMotorSpeed: (entity: Entity, speed: number) => void
shapeCastBox: (center: Vec2, halfExtents: Vec2, angle: number, translation: Vec2, maskBits?: number, ppu?: number) => ShapeCastHit[]
shapeCastCapsule: (center1: Vec2, center2: Vec2, radius: number, translation: Vec2, maskBits?: number, ppu?: number) => ShapeCastHit[]
shapeCastCircle: (center: Vec2, radius: number, translation: Vec2, maskBits?: number, ppu?: number) => ShapeCastHit[]
-static _fromModule: (module: PhysicsWasmModule) => Physics
-static new (app: App): Physics
-static prototype: Physics
+static _fromModule: (module: PhysicsWasmModule) => PhysicsAPI
+static new (app: App): PhysicsAPI
+static prototype: PhysicsAPI
static setDebugDraw: (app: App, enabled: boolean) => void
static setDebugDrawConfig: (app: App, config: Partial<PhysicsDebugDrawConfig>) => void
```
-## PhysicsAPI — const
-```
-ResourceDef<Physics>
-```
-
## PhysicsDebugDraw — const
```
ResourceDef<PhysicsDebugDrawConfig>
diff --git a/sdk/src/ai/perception/PerceptionPlugin.ts b/sdk/src/ai/perception/PerceptionPlugin.ts
index 2dccf0e2a..784e4e5fa 100644
--- a/sdk/src/ai/perception/PerceptionPlugin.ts
+++ b/sdk/src/ai/perception/PerceptionPlugin.ts
@@ -7,7 +7,7 @@
* decision system reads a fresh Perception the same frame.
*
* `stepPerception` is extracted to unit-test against a fake world. Line
- * of sight uses a physics raycast when a PhysicsAPI is present, and is
+ * of sight uses a physics raycast when a Physics is present, and is
* skipped (range + FOV only) otherwise — no hard physics dependency.
*/
@@ -17,7 +17,7 @@ import { defineSystem, Schedule, GetWorld } from '../../system';
import { playModeOnly } from '../../env';
import { Transform } from '../../component';
import type { AnyComponentDef, ComponentData } from '../../component';
-import { PhysicsAPI, type Physics } from '../../physics';
+import { Physics, type PhysicsAPI } from '../../physics';
import { senseTarget, facingFromQuat } from './sense';
import { Perceiver, Perception, PerceptionTarget, type PerceptionData } from './components';
@@ -66,7 +66,7 @@ export function stepPerception(world: PerceptionWorldView, isBlocked?: LosCheck)
}
/** Build a raycast-backed line-of-sight check. Occluded if anything is hit before the target. */
-export function makeLosCheck(physics: Physics): LosCheck {
+export function makeLosCheck(physics: PhysicsAPI): LosCheck {
return (ox, oy, tx, ty) => {
const dx = tx - ox;
const dy = ty - oy;
@@ -87,7 +87,7 @@ export class PerceptionPlugin implements Plugin {
defineSystem(
[GetWorld()],
world => {
- const physics = app.hasResource(PhysicsAPI) ? app.getResource<Physics>(PhysicsAPI) : null;
+ const physics = app.hasResource(Physics) ? app.getResource<PhysicsAPI>(Physics) : null;
stepPerception(world as PerceptionWorldView, physics ? makeLosCheck(physics) : undefined);
},
{ name: 'PerceptionSystem' },
diff --git a/sdk/src/animation/AnimationPlugin.ts b/sdk/src/animation/AnimationPlugin.ts
index 9d57b2d61..c517ae6ae 100644
--- a/sdk/src/animation/AnimationPlugin.ts
+++ b/sdk/src/animation/AnimationPlugin.ts
@@ -12,8 +12,8 @@ import { Time, type TimeData } from '../resource';
import type { Entity } from '../types';
import type { ESEngineModule, CppRegistry } from '../wasm';
import { Tween, TweenAPI } from './Tween';
-import { SpriteAnimation, SpriteAnimationApi } from './SpriteAnimator';
-import { AnimatorController, AnimatorControllerApi } from './Animator';
+import { SpriteAnimation, SpriteAnimationAPI } from './SpriteAnimator';
+import { AnimatorController, AnimatorControllerAPI } from './Animator';
import { playModeOnly } from '../env';
import { SystemLabel } from '../systemLabels';
@@ -25,9 +25,9 @@ export class AnimationPlugin implements Plugin {
const registry = app.world.getCppRegistry() as CppRegistry;
const tween = new TweenAPI(module, registry);
app.insertResource(Tween, tween);
- const anim = new SpriteAnimationApi();
+ const anim = new SpriteAnimationAPI();
app.insertResource(SpriteAnimation, anim);
- const animator = new AnimatorControllerApi();
+ const animator = new AnimatorControllerAPI();
app.insertResource(AnimatorController, animator);
const world = app.world;
@@ -49,7 +49,7 @@ export class AnimationPlugin implements Plugin {
// clip switch applies the same frame it fires.
app.addSystemToSchedule(Schedule.Update, defineSystem(
[Res(AnimatorController)],
- (ctrl: AnimatorControllerApi) => {
+ (ctrl: AnimatorControllerAPI) => {
ctrl.update(world);
},
{ name: 'AnimatorSystem' }
@@ -57,7 +57,7 @@ export class AnimationPlugin implements Plugin {
app.addSystemToSchedule(Schedule.Update, defineSystem(
[Res(Time), Res(SpriteAnimation)],
- (time: TimeData, animApi: SpriteAnimationApi) => {
+ (time: TimeData, animApi: SpriteAnimationAPI) => {
animApi.update(world, time.delta);
},
{ name: 'SpriteAnimatorSystem' }
diff --git a/sdk/src/animation/Animator.ts b/sdk/src/animation/Animator.ts
index 1ac14bc43..a40261823 100644
--- a/sdk/src/animation/Animator.ts
+++ b/sdk/src/animation/Animator.ts
@@ -9,7 +9,7 @@
* over the existing animation channels — it does not run its own clip playback.
* A state names a sprite clip; when a transition fires, the Animator switches the
* entity's {@link SpriteAnimator}.clip. Frame playback stays the single
- * responsibility of {@link SpriteAnimationApi}. Parameters/triggers drive
+ * responsibility of {@link SpriteAnimationAPI}. Parameters/triggers drive
* transitions, mirroring the Unity Animator's SetFloat/SetBool/SetTrigger model.
*
* The transition evaluator ({@link evaluateAnimatorTransitions}) is pure — no
@@ -337,7 +337,7 @@ export function resolveParams(
// =============================================================================
export interface AnimatorData {
- /** Registered controller name (see AnimatorControllerApi.registerController). */
+ /** Registered controller name (see AnimatorControllerAPI.registerController). */
controller: string;
/** Active state; empty until the first update seeds it from initialState. */
currentState: string;
@@ -360,7 +360,7 @@ export const Animator: ComponentDef<AnimatorData> = defineComponent('Animator',
* SpriteAnimator clip on state changes. Published as the {@link AnimatorController}
* resource; read it as `app.getResource(AnimatorController)`.
*/
-export class AnimatorControllerApi {
+export class AnimatorControllerAPI {
private readonly controllers = new Map<string, AnimatorControllerDef>();
private readonly params = new Map<Entity, Map<string, number | boolean>>();
private readonly triggers = new Map<Entity, Set<string>>();
@@ -537,4 +537,4 @@ const EMPTY_TRIGGERS: ReadonlySet<string> = new Set();
* Per-App animator resource (controller registry + per-entity parameters),
* published by `AnimationPlugin`. Read as `app.getResource(AnimatorController)`.
*/
-export const AnimatorController = defineResource<AnimatorControllerApi>(null!, 'AnimatorController');
+export const AnimatorController = defineResource<AnimatorControllerAPI>(null!, 'AnimatorController');
diff --git a/sdk/src/animation/SpriteAnimator.ts b/sdk/src/animation/SpriteAnimator.ts
index ee7ea05d9..2dd0f5132 100644
--- a/sdk/src/animation/SpriteAnimator.ts
+++ b/sdk/src/animation/SpriteAnimator.ts
@@ -60,7 +60,7 @@ export function shouldFireEvent(eventFrame: number, prevFrame: number, newFrame:
* the {@link SpriteAnimation} resource; read it as
* `app.getResource(SpriteAnimation)`.
*/
-export class SpriteAnimationApi {
+export class SpriteAnimationAPI {
private readonly clips = new Map<string, SpriteAnimClip>();
private readonly entityListeners = new Map<Entity, SpriteAnimEventHandler[]>();
private readonly globalListeners: SpriteAnimEventHandler[] = [];
@@ -237,7 +237,7 @@ export class SpriteAnimationApi {
* Per-App sprite-animation resource (clip registry + frame-event listeners),
* published by `AnimationPlugin`. Read as `app.getResource(SpriteAnimation)`.
*/
-export const SpriteAnimation = defineResource<SpriteAnimationApi>(null!, 'SpriteAnimation');
+export const SpriteAnimation = defineResource<SpriteAnimationAPI>(null!, 'SpriteAnimation');
// =============================================================================
// SpriteAnimator Component
diff --git a/sdk/src/animation/index.ts b/sdk/src/animation/index.ts
index 43fdd1214..5b68df1c5 100644
--- a/sdk/src/animation/index.ts
+++ b/sdk/src/animation/index.ts
@@ -32,7 +32,7 @@ export {
export {
SpriteAnimator,
SpriteAnimation,
- SpriteAnimationApi,
+ SpriteAnimationAPI,
type SpriteAnimatorData,
type SpriteAnimClip,
type SpriteAnimFrame,
@@ -43,7 +43,7 @@ export {
export {
Animator,
AnimatorController,
- AnimatorControllerApi,
+ AnimatorControllerAPI,
evaluateAnimatorTransitions,
evaluateAnimatorPath,
enterStatePath,
diff --git a/sdk/src/asset/AssetFieldRegistry.ts b/sdk/src/asset/AssetFieldRegistry.ts
index 0c32863fd..212886825 100644
--- a/sdk/src/asset/AssetFieldRegistry.ts
+++ b/sdk/src/asset/AssetFieldRegistry.ts
@@ -46,7 +46,7 @@ export function getCompoundAssetFields(componentType: string): CompoundFieldDesc
return registry_.get(componentType)?.compounds ?? [];
}
-export function getAllRegisteredComponents(): string[] {
+export function getAssetFieldComponents(): string[] {
return Array.from(registry_.keys());
}
diff --git a/sdk/src/asset/AssetLoader.ts b/sdk/src/asset/AssetLoader.ts
index 2906832a0..857875b1c 100644
--- a/sdk/src/asset/AssetLoader.ts
+++ b/sdk/src/asset/AssetLoader.ts
@@ -101,14 +101,14 @@ export interface LoadContext {
* Sprite-animation API for the owning app (clip registry), resolved lazily
* like {@link getAudio}. Returns null when no AnimationPlugin is installed.
*/
- getSpriteAnimation(): import('../animation/SpriteAnimator').SpriteAnimationApi | null;
+ getSpriteAnimation(): import('../animation/SpriteAnimator').SpriteAnimationAPI | null;
/**
* Localization service for the owning app, resolved lazily like
* {@link getAudio}. Returns null when no LocalizationPlugin is installed —
* loading a `.eslocale` then fails loud (a table with nowhere to register
* is a setup error, not a soft skip).
*/
- getLocalization(): import('../i18n/Localization').LocalizationApi | null;
+ getLocalization(): import('../i18n/Localization').LocalizationAPI | null;
}
export interface AssetLoader<T> {
diff --git a/sdk/src/asset/AssetPlugin.ts b/sdk/src/asset/AssetPlugin.ts
index 5ec6cdee7..2042c948c 100644
--- a/sdk/src/asset/AssetPlugin.ts
+++ b/sdk/src/asset/AssetPlugin.ts
@@ -8,8 +8,8 @@ import { transcoderFromModule, type BasisWasmModule } from './basisTranscoder';
import { initBuiltinAssetFields } from './AssetFieldRegistry';
import { AssetRefCounter } from './AssetRefCounter';
import { Audio, type AudioAPI } from '../audio/Audio';
-import { SpriteAnimation, type SpriteAnimationApi } from '../animation/SpriteAnimator';
-import { Localization, type LocalizationApi } from '../i18n/Localization';
+import { SpriteAnimation, type SpriteAnimationAPI } from '../animation/SpriteAnimator';
+import { Localization, type LocalizationAPI } from '../i18n/Localization';
import { log } from '../logger';
export type AssetsData = AssetsClass;
@@ -36,9 +36,9 @@ export class AssetPlugin implements Plugin {
module,
getAudio: (): AudioAPI | null =>
app.hasResource(Audio) ? app.getResource(Audio) : null,
- getSpriteAnimation: (): SpriteAnimationApi | null =>
+ getSpriteAnimation: (): SpriteAnimationAPI | null =>
app.hasResource(SpriteAnimation) ? app.getResource(SpriteAnimation) : null,
- getLocalization: (): LocalizationApi | null =>
+ getLocalization: (): LocalizationAPI | null =>
app.hasResource(Localization) ? app.getResource(Localization) : null,
});
diff --git a/sdk/src/asset/Assets.ts b/sdk/src/asset/Assets.ts
index 3a9b434c1..418eb5da2 100644
--- a/sdk/src/asset/Assets.ts
+++ b/sdk/src/asset/Assets.ts
@@ -97,10 +97,10 @@ export interface AssetsOptions {
* in any order. Pass null (or omit) if no audio support is needed.
*/
getAudio?: () => import('../audio/Audio').AudioAPI | null;
- getSpriteAnimation?: () => import('../animation/SpriteAnimator').SpriteAnimationApi | null;
+ getSpriteAnimation?: () => import('../animation/SpriteAnimator').SpriteAnimationAPI | null;
/** Lazy accessor for the owning app's Localization service, same contract
* as {@link getAudio} — `.eslocale` tables register through it. */
- getLocalization?: () => import('../i18n/Localization').LocalizationApi | null;
+ getLocalization?: () => import('../i18n/Localization').LocalizationAPI | null;
}
export interface AssetBundle {
@@ -158,8 +158,8 @@ export class Assets {
private module_: ESEngineModule;
private manifestModel_: ManifestModel | null = null;
private getAudio_: () => import('../audio/Audio').AudioAPI | null;
- private getSpriteAnimation_: () => import('../animation/SpriteAnimator').SpriteAnimationApi | null;
- private getLocalization_: () => import('../i18n/Localization').LocalizationApi | null;
+ private getSpriteAnimation_: () => import('../animation/SpriteAnimator').SpriteAnimationAPI | null;
+ private getLocalization_: () => import('../i18n/Localization').LocalizationAPI | null;
private loaders_ = new Map<string, AssetLoader<unknown>>();
private textureLoader_: TextureLoader;
private textureImportResolver_: TextureImportSettingsResolver | null = null;
diff --git a/sdk/src/camera/Camera.ts b/sdk/src/camera/Camera.ts
index b0339c57f..f19aa2485 100644
--- a/sdk/src/camera/Camera.ts
+++ b/sdk/src/camera/Camera.ts
@@ -14,7 +14,7 @@ import { screenToWorld, worldToScreen, createInvVPCache } from '../ui/util/math'
* inverse-view-projection cache, so two Apps running at once never share a
* single cached `app` or clobber each other's cache.
*/
-export class CameraViewApi {
+export class CameraViewAPI {
private readonly invVPCache = createInvVPCache();
constructor(private readonly app_: App) {}
@@ -57,4 +57,4 @@ export class CameraViewApi {
* `app.getResource(CameraView)` to convert screen<->world etc. (Named
* `CameraView` rather than `Camera` because `Camera` is the ECS component.)
*/
-export const CameraView = defineResource<CameraViewApi>(null!, 'CameraView');
+export const CameraView = defineResource<CameraViewAPI>(null!, 'CameraView');
diff --git a/sdk/src/component.ts b/sdk/src/component.ts
index 314e648d1..cffd0528e 100644
--- a/sdk/src/component.ts
+++ b/sdk/src/component.ts
@@ -414,11 +414,6 @@ export function getComponentRegistry(): Map<string, AnyComponentDef> {
return all;
}
-/** @deprecated Alias of {@link getComponentRegistry}; kept for back-compat. */
-export function getAllRegisteredComponents(): Map<string, AnyComponentDef> {
- return getComponentRegistry();
-}
-
/** Just the current context's user/script components (excludes builtins). */
export function getUserComponents(): Map<string, AnyComponentDef> {
return userComponents();
diff --git a/sdk/src/core-content.ts b/sdk/src/core-content.ts
index 375cd95a6..2a7177fd7 100644
--- a/sdk/src/core-content.ts
+++ b/sdk/src/core-content.ts
@@ -233,10 +233,10 @@ export {
ValueTweenHandle,
SpriteAnimator,
SpriteAnimation,
- SpriteAnimationApi,
+ SpriteAnimationAPI,
Animator,
AnimatorController,
- AnimatorControllerApi,
+ AnimatorControllerAPI,
evaluateAnimatorTransitions,
resolveParams,
selectBlendClip,
@@ -382,7 +382,6 @@ export {
TilemapLayer,
TilemapAPI,
Tilemaps,
- initTilemapAPI,
shutdownTilemapAPI,
TilemapPlugin,
tilemapPlugin,
@@ -623,3 +622,27 @@ export {
type PerceiverData,
type PerceptionData,
} from './ai';
+
+// =============================================================================
+// Timeline (Sequencer)
+// =============================================================================
+
+export {
+ TimelinePlugin,
+ timelinePlugin,
+ registerTimelineAsset,
+ parseTimelineAsset,
+ Timeline,
+ TimelineAPI,
+ TimelinePlayer,
+ type TimelinePlayerData,
+} from './timeline';
+// Authoring + pure-TS evaluation surface for the editor Sequencer.
+export {
+ sampleTimeline, sampleTimelineInWorld, evaluateChannel, applyWrapMode,
+ serializeTimelineAsset, serializeTimelineToJson, resolveChildEntity, parseAnimationClip,
+ TrackType, InterpType, WrapMode,
+ type SampleWorld, type SampleDeps, type SampleOptions,
+ type TimelineAsset, type Track, type PropertyTrack, type PropertyChannel, type Keyframe,
+ type SpriteAnimTrack, type AudioTrack, type ActivationTrack, type SpineTrack, type AnimFramesTrack,
+} from './timeline';
diff --git a/sdk/src/core-plugins.ts b/sdk/src/core-plugins.ts
new file mode 100644
index 000000000..090fce61d
--- /dev/null
+++ b/sdk/src/core-plugins.ts
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
+/**
+ * @file core-plugins.ts
+ * @brief ESEngine SDK — plugin wiring surface (manual plugin composition)
+ *
+ * Everything a host needs to compose an App plugin-by-plugin instead of using
+ * the batteries-included factories in `webAppFactory.ts`. Content-module
+ * plugins that double as feature surfaces (audio, video, particles, …) live in
+ * their domain barrels (`core-content` / `core-sys`); this file holds the UI
+ * pipeline and the side-module plugins, whose only job is wiring.
+ *
+ * Side-module policy: physics and spine ship as separate wasm side-modules.
+ * Their full APIs live on the `esengine/physics` / `esengine/spine` subpaths;
+ * the main barrel mirrors exactly the wiring layer (plugin, events, resource,
+ * loader) so `createWebApp`-style hosts can register them without a subpath
+ * import.
+ */
+
+// The single composed UI pipeline; the concept plugins below are
+// re-exported for granular/advanced wiring.
+export { uiPlugins } from './uiPlugins';
+export { uiPlugin, UIPlugin } from './ui/ui-plugin';
+export { textPlugin, TextPlugin } from './ui/text/plugin';
+export { uiMaskPlugin, UIMaskPlugin } from './ui/render/mask';
+export { uiInteractionPlugin, UIInteractionPlugin } from './ui/input/interaction';
+export { uiLayoutPlugin, UILayoutPlugin } from './ui/layout/layout';
+export { uiRenderOrderPlugin, UIRenderOrderPlugin } from './ui/render/render-order';
+export { textInputPlugin, TextInputPlugin } from './ui/text/text-input-plugin';
+export { dragPlugin, DragPlugin } from './ui/input/drag';
+export { focusPlugin, FocusPlugin } from './ui/input/focus';
+export { safeAreaPlugin, SafeAreaPlugin } from './ui/layout/safe-area';
+
+export { PhysicsPlugin, PhysicsEvents, Physics, loadPhysicsModule } from './physics';
+export { SpinePlugin, SpineEvents, Spine } from './spine';
+
+export { PostProcessPlugin, postProcessPlugin } from './postprocess';
diff --git a/sdk/src/core-render.ts b/sdk/src/core-render.ts
index 915b90653..ff25a39eb 100644
--- a/sdk/src/core-render.ts
+++ b/sdk/src/core-render.ts
@@ -39,7 +39,7 @@ export { TextureFilter, TextureWrap, setTextureFilter, setTextureWrap, setTextur
// Camera
// =============================================================================
-export { CameraView, CameraViewApi } from './camera/Camera';
+export { CameraView, CameraViewAPI } from './camera/Camera';
export { EditorView, DEFAULT_EDITOR_VIEW } from './camera/EditorView';
export type { EditorViewData } from './camera/EditorView';
export { ScreenScaling, DEFAULT_SCREEN_SCALING, SCREEN_FIT_OFF } from './camera/ScreenScaling';
@@ -62,8 +62,6 @@ export type { CameraExtents, CanvasScale, WorldRect } from './camera/uiLayoutRec
export {
Draw,
BlendMode,
- initDrawAPI,
- shutdownDrawAPI,
type DrawAPI,
} from './draw';
@@ -74,7 +72,6 @@ export {
export {
Material,
ShaderSources,
- initMaterialAPI,
shutdownMaterialAPI,
isTextureRef,
CullMode,
@@ -117,7 +114,6 @@ export {
export {
Geometry,
DataType,
- initGeometryAPI,
shutdownGeometryAPI,
type GeometryHandle,
type GeometryOptions,
@@ -130,10 +126,8 @@ export {
export {
PostProcess,
- PostProcessApi,
+ PostProcessAPI,
PostProcessStack,
- initPostProcessAPI,
- shutdownPostProcessAPI,
type EffectDef,
type EffectUniformDef,
getEffectDef,
@@ -149,7 +143,6 @@ export {
Renderer,
RenderStage,
SubmitSkipFlags,
- initRendererAPI,
shutdownRendererAPI,
type RenderTargetHandle,
type RenderStats,
diff --git a/sdk/src/core-runtime.ts b/sdk/src/core-runtime.ts
index 7e7cb0031..09a7cab47 100644
--- a/sdk/src/core-runtime.ts
+++ b/sdk/src/core-runtime.ts
@@ -71,7 +71,6 @@ export {
getComponentFieldMeta,
getReplicatedFields,
getComponentRegistry,
- getAllRegisteredComponents,
getUserComponents,
getUserComponentFingerprint,
enumOptions,
diff --git a/sdk/src/core-sys.ts b/sdk/src/core-sys.ts
index 31be4d778..c288fef12 100644
--- a/sdk/src/core-sys.ts
+++ b/sdk/src/core-sys.ts
@@ -24,7 +24,7 @@ export { scalar, v2, v3, col } from './math';
export {
Localization,
- LocalizationApi,
+ LocalizationAPI,
LocalizationPlugin,
localizationPlugin,
interpolate,
@@ -146,8 +146,6 @@ export {
export {
GLDebug,
- initGLDebugAPI,
- shutdownGLDebugAPI,
} from './glDebug';
// =============================================================================
@@ -241,8 +239,6 @@ export {
// =============================================================================
export {
- initResourceManager,
- shutdownResourceManager,
requireResourceManager,
getResourceManager,
evictTextureDimensions,
diff --git a/sdk/src/core-ui.ts b/sdk/src/core-ui.ts
index 2d233b9f2..083a463f8 100644
--- a/sdk/src/core-ui.ts
+++ b/sdk/src/core-ui.ts
@@ -26,7 +26,6 @@ export {
UIVisualType,
UILayoutGeneration,
UIMask,
- textPlugin,
measureText,
type MeasureTextOptions,
type TextMetrics,
diff --git a/sdk/src/core.ts b/sdk/src/core.ts
index d688e7685..c581fdb91 100644
--- a/sdk/src/core.ts
+++ b/sdk/src/core.ts
@@ -14,6 +14,7 @@
*/
export * from './core-runtime';
+export * from './core-plugins';
export * from './core-render';
export * from './core-ui';
export * from './core-content';
diff --git a/sdk/src/corePlugin.ts b/sdk/src/corePlugin.ts
index 64c759dd4..5784311e7 100644
--- a/sdk/src/corePlugin.ts
+++ b/sdk/src/corePlugin.ts
@@ -11,7 +11,7 @@ import { initGeometryAPI, shutdownGeometryAPI } from './geometry';
import { initPostProcessAPI, shutdownPostProcessAPI } from './postprocess';
import { initRendererAPI, shutdownRendererAPI } from './renderer';
import { initGLDebugAPI, shutdownGLDebugAPI } from './glDebug';
-import { CameraView, CameraViewApi } from './camera/Camera';
+import { CameraView, CameraViewAPI } from './camera/Camera';
let offMemoryWarning: (() => void) | null = null;
@@ -36,7 +36,7 @@ export const corePlugin: Plugin = {
initPostProcessAPI(module);
initRendererAPI(module);
initGLDebugAPI(module);
- app.insertResource(CameraView, new CameraViewApi(app));
+ app.insertResource(CameraView, new CameraViewAPI(app));
},
cleanup() {
diff --git a/sdk/src/draw.ts b/sdk/src/draw.ts
index 314c7525a..439c56e51 100644
--- a/sdk/src/draw.ts
+++ b/sdk/src/draw.ts
@@ -39,6 +39,7 @@ const IDENTITY_TRANSFORM = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0,
// Initialization
// =============================================================================
+/** @internal Wired by the engine plugins — not part of the public API. */
export function initDrawAPI(wasmModule: ESEngineModule): void {
bridge.connect(wasmModule);
module = bridge.module;
@@ -47,6 +48,7 @@ export function initDrawAPI(wasmModule: ESEngineModule): void {
uniformsPtr = module._malloc(UNIFORMS_BUFFER_SIZE * 4);
}
+/** @internal Wired by the engine plugins — not part of the public API. */
export function shutdownDrawAPI(): void {
if (module) {
if (viewProjectionPtr) {
diff --git a/sdk/src/geometry.ts b/sdk/src/geometry.ts
index 36a43d751..51a6a2102 100644
--- a/sdk/src/geometry.ts
+++ b/sdk/src/geometry.ts
@@ -57,6 +57,7 @@ const LAYOUT_BUFFER_SIZE = 64;
// Initialization
// =============================================================================
+/** @internal Wired by the engine plugins — not part of the public API. */
export function initGeometryAPI(wasmModule: ESEngineModule): void {
bridge.connect(wasmModule);
module = bridge.module;
diff --git a/sdk/src/glDebug.ts b/sdk/src/glDebug.ts
index fdea16c6b..fdfc4f072 100644
--- a/sdk/src/glDebug.ts
+++ b/sdk/src/glDebug.ts
@@ -11,11 +11,13 @@ import { CoreApiBridge } from './CoreApiBridge';
const bridge = new CoreApiBridge('glDebug');
let module: ESEngineModule | null = null;
+/** @internal Wired by the engine plugins — not part of the public API. */
export function initGLDebugAPI(wasmModule: ESEngineModule): void {
bridge.connect(wasmModule);
module = bridge.module;
}
+/** @internal Wired by the engine plugins — not part of the public API. */
export function shutdownGLDebugAPI(): void {
bridge.disconnect();
module = null;
diff --git a/sdk/src/i18n/Localization.ts b/sdk/src/i18n/Localization.ts
index ec7ea7867..496f2466a 100644
--- a/sdk/src/i18n/Localization.ts
+++ b/sdk/src/i18n/Localization.ts
@@ -54,7 +54,7 @@ export function selectPluralForm(forms: PluralForms, count: number, selector: Pl
* fallback, and `t()` resolution (active → fallback → the key itself). Published
* as the {@link Localization} resource; read it as `app.getResource(Localization)`.
*/
-export class LocalizationApi {
+export class LocalizationAPI {
private readonly catalogs = new Map<string, Map<string, LocaleEntry>>();
private readonly selectors = new Map<string, PluralSelector>();
private locale_: string;
@@ -117,7 +117,7 @@ export class LocalizationApi {
* Per-App localization resource, published by `LocalizationPlugin`. Read as
* `app.getResource(Localization)`.
*/
-export const Localization = defineResource<LocalizationApi>(null!, 'Localization');
+export const Localization = defineResource<LocalizationAPI>(null!, 'Localization');
// =============================================================================
// String-table asset (`.eslocale`)
diff --git a/sdk/src/i18n/LocalizationPlugin.ts b/sdk/src/i18n/LocalizationPlugin.ts
index 48eb7f5b0..342aeacea 100644
--- a/sdk/src/i18n/LocalizationPlugin.ts
+++ b/sdk/src/i18n/LocalizationPlugin.ts
@@ -9,7 +9,7 @@ import type { App, Plugin } from '../app';
import { Schedule, defineSystem } from '../system';
import { Assets } from '../asset/AssetPlugin';
import { log } from '../logger';
-import { Localization, LocalizationApi, type LocaleCatalog } from './Localization';
+import { Localization, LocalizationAPI, type LocaleCatalog } from './Localization';
export interface LocalizationOptions {
/** Active locale (default 'en'). */
@@ -32,7 +32,7 @@ export class LocalizationPlugin implements Plugin {
constructor(private readonly opts: LocalizationOptions = {}) {}
build(app: App): void {
- const loc = new LocalizationApi(this.opts.locale, this.opts.fallback);
+ const loc = new LocalizationAPI(this.opts.locale, this.opts.fallback);
if (this.opts.catalogs) {
for (const locale of Object.keys(this.opts.catalogs)) {
loc.addCatalog(locale, this.opts.catalogs[locale]);
diff --git a/sdk/src/i18n/index.ts b/sdk/src/i18n/index.ts
index aa6c18cf6..2f4e4921f 100644
--- a/sdk/src/i18n/index.ts
+++ b/sdk/src/i18n/index.ts
@@ -7,7 +7,7 @@
export {
Localization,
- LocalizationApi,
+ LocalizationAPI,
interpolate,
selectPluralForm,
defaultPluralSelector,
diff --git a/sdk/src/material.ts b/sdk/src/material.ts
index 2fed86cb2..778be2275 100644
--- a/sdk/src/material.ts
+++ b/sdk/src/material.ts
@@ -147,6 +147,7 @@ const childrenOf = new Map<MaterialHandle, Set<MaterialHandle>>();
// Initialization
// =============================================================================
+/** @internal Wired by the engine plugins — not part of the public API. */
export function initMaterialAPI(wasmModule: ESEngineModule): void {
bridge.connect(wasmModule);
module = bridge.module;
diff --git a/sdk/src/physics/CharacterController.ts b/sdk/src/physics/CharacterController.ts
index 4c2378a3f..bf21339fe 100644
--- a/sdk/src/physics/CharacterController.ts
+++ b/sdk/src/physics/CharacterController.ts
@@ -6,7 +6,7 @@
* of Box2D v3's native kinematic mover.
*
* The controller reads the entity's own collider, derives a capsule mover from it,
- * and advances one step via `Physics.moveCharacter` — Box2D's `b2World_CollideMover`
+ * and advances one step via `PhysicsAPI.moveCharacter` — Box2D's `b2World_CollideMover`
* + `b2SolvePlanes`, which collides the capsule into contact *planes* and solves a
* depenetrating slide. That resolves a character resting on the ground with valid
* normals (a generic shape cast reports the resting contact as a zero-normal
@@ -18,7 +18,7 @@
* (and for its tests); the live system uses the native mover.
*
* Units: `velocity`/positions are world pixels (matching `Transform`); collider
- * dimensions are meters and are scaled to pixels via `Physics.getPixelsPerUnit()`.
+ * dimensions are meters and are scaled to pixels via `PhysicsAPI.getPixelsPerUnit()`.
*/
import type { App } from '../app';
import type { Entity, Vec2 } from '../types';
@@ -27,7 +27,7 @@ import { Schedule, defineSystem, GetWorld } from '../system';
import { Query, Mut } from '../query';
import { Res, Time, type TimeData } from '../resource';
import { playModeOnly } from '../env';
-import { PhysicsAPI, type Physics } from './Physics';
+import { Physics, type PhysicsAPI } from './Physics';
import { BoxCollider, CircleCollider, CapsuleCollider } from './PhysicsComponents';
import type {
BoxColliderData, CircleColliderData, CapsuleColliderData,
@@ -284,11 +284,11 @@ export function registerCharacterControllerSystem(app: App): void {
app.addSystemToSchedule(
Schedule.FixedUpdate,
defineSystem(
- [Query(Mut(CharacterController)), Res(Time), Res(PhysicsAPI), GetWorld()],
+ [Query(Mut(CharacterController)), Res(Time), Res(Physics), GetWorld()],
(
query: Iterable<[Entity, CharacterControllerData]>,
time: TimeData,
- physics: Physics,
+ physics: PhysicsAPI,
world: World,
) => {
const dt = time.fixedDelta;
diff --git a/sdk/src/physics/Physics.ts b/sdk/src/physics/Physics.ts
index 5327b02f3..00702f739 100644
--- a/sdk/src/physics/Physics.ts
+++ b/sdk/src/physics/Physics.ts
@@ -2,11 +2,11 @@
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
/**
* @file Physics.ts
- * @brief User-facing physics API + PhysicsAPI resource
+ * @brief User-facing physics API + Physics resource
*
- * `Physics` is the ergonomic wrapper game code uses to drive bodies
+ * `PhysicsAPI` is the ergonomic wrapper game code uses to drive bodies
* (forces, impulses, joints, raycasts). It is published as the
- * `PhysicsAPI` resource once `PhysicsPlugin` finishes loading the
+ * `Physics` resource once `PhysicsPlugin` finishes loading the
* wasm module; instantiation before that throws.
*/
@@ -28,7 +28,15 @@ import {
// Physics API Helper
// =============================================================================
-export class Physics {
+/**
+ * Unit contract: Box2D simulates in meters; the engine converts at the
+ * pixels-per-unit (PPU) boundary. Spatial *queries* (`raycast` / `shapeCast` /
+ * `overlapCircle` / `moveCharacter`) take and return **world pixels**, scaled by
+ * the live PPU. Everything that talks to the solver directly — forces, impulses,
+ * velocities, `setGravity` — is in **meters** (m/s, m/s²), matching the collider
+ * component dimensions. Convert with {@link getPixelsPerUnit} when mixing the two.
+ */
+export class PhysicsAPI {
private module_: PhysicsWasmModule;
// Live pixels-per-unit, pushed each frame by PhysicsSystem from the Canvas, so
// a query that omits `ppu` is scaled correctly instead of silently assuming 100.
@@ -59,8 +67,8 @@ export class Physics {
}
/** @internal */
- static _fromModule(module: PhysicsWasmModule): Physics {
- const instance = Object.create(Physics.prototype) as Physics;
+ static _fromModule(module: PhysicsWasmModule): PhysicsAPI {
+ const instance = Object.create(PhysicsAPI.prototype) as PhysicsAPI;
instance.module_ = module;
return instance;
}
@@ -83,6 +91,7 @@ export class Physics {
return { x: this.module_.HEAPF32[base], y: this.module_.HEAPF32[base + 1] };
}
+ /** World gravity in **meters/s²** (Box2D space), e.g. `{ x: 0, y: -9.81 }`. */
setGravity(gravity: Vec2): void {
this.module_._physics_setGravity(gravity.x, gravity.y);
}
@@ -513,7 +522,7 @@ export class Physics {
/**
* Resource published by `PhysicsPlugin` once the wasm module is ready.
- * Game code reads it as `app.getResource(PhysicsAPI)` to call forces,
+ * Game code reads it as `Res(Physics)` / `app.getResource(Physics)` to call forces,
* impulses, joint helpers, raycasts, etc.
*/
-export const PhysicsAPI = defineResource<Physics>(null!, 'PhysicsAPI');
+export const Physics = defineResource<PhysicsAPI>(null!, 'Physics');
diff --git a/sdk/src/physics/PhysicsPlugin.ts b/sdk/src/physics/PhysicsPlugin.ts
index 1151351b2..3629141c0 100644
--- a/sdk/src/physics/PhysicsPlugin.ts
+++ b/sdk/src/physics/PhysicsPlugin.ts
@@ -2,10 +2,10 @@
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
/**
* @file PhysicsPlugin.ts
- * @brief Physics plugin — async wasm load + resource wiring
+ * @brief PhysicsAPI plugin — async wasm load + resource wiring
*
* Thin orchestration layer. Types live in `PhysicsTypes.ts`,
- * the Physics API class in `Physics.ts`, and the per-frame loop
+ * the PhysicsAPI API class in `PhysicsAPI.ts`, and the per-frame loop
* + entity-tracking state in `PhysicsSystem.ts`. This file just
* loads the wasm module, wires resources, and hands off to the
* system layer.
@@ -20,7 +20,7 @@ import {
import { setupPhysicsDebugDraw } from './PhysicsDebugDraw';
import { PhysicsBridge } from './PhysicsBridge';
import { PhysicsRuntime } from './PhysicsRuntime';
-import { Physics, PhysicsAPI } from './Physics';
+import { PhysicsAPI, Physics } from './Physics';
import { registerPhysicsSystem } from './PhysicsSystem';
import { registerCharacterControllerSystem } from './CharacterController';
import {
@@ -34,8 +34,8 @@ import { handleWasmError } from '../wasmError';
// existing `import from './physics/PhysicsPlugin'` sites keep working.
export {
PhysicsEvents,
- PhysicsAPI,
Physics,
+ PhysicsAPI,
};
export type {
PhysicsPluginConfig,
@@ -110,7 +110,7 @@ export class PhysicsPlugin implements Plugin {
// the terminal-abort guard and yields a guarded view in which
// every `_physics_*` call short-circuits after an abort. The
// guarded module has the same type, so every downstream call
- // site (PhysicsSystem closures, the Physics API wrapper) gains
+ // site (PhysicsSystem closures, the PhysicsAPI API wrapper) gains
// abort safety without changing a single call.
this.bridge_.connect(loaded);
const module = this.bridge_.module;
@@ -135,9 +135,9 @@ export class PhysicsPlugin implements Plugin {
registerPhysicsSystem(app, module, this.config_);
app.getResource(PhysicsRuntime).module = module;
- app.insertResource(PhysicsAPI, Physics._fromModule(module));
+ app.insertResource(Physics, PhysicsAPI._fromModule(module));
registerCharacterControllerSystem(app);
- setupPhysicsDebugDraw(app, PhysicsAPI, PhysicsEvents);
+ setupPhysicsDebugDraw(app, Physics, PhysicsEvents);
app.setFixedTimestep(this.config_.fixedTimestep);
// Module loaded, world initialized, systems registered.
app.subsystems.transition('physics', 'ready');
diff --git a/sdk/src/physics/PhysicsSystem.ts b/sdk/src/physics/PhysicsSystem.ts
index 7e3c7cd37..f4b7c5a55 100644
--- a/sdk/src/physics/PhysicsSystem.ts
+++ b/sdk/src/physics/PhysicsSystem.ts
@@ -18,7 +18,7 @@ import { Res, Time, type TimeData } from '../resource';
import { Schedule, defineSystem } from '../system';
import { playModeOnly } from '../env';
import type { PhysicsWasmModule } from './PhysicsModuleLoader';
-import { PhysicsAPI } from './Physics';
+import { Physics } from './Physics';
import {
RigidBody, BoxCollider, CircleCollider, CapsuleCollider,
SegmentCollider, PolygonCollider, ChainCollider, OneWayPlatform,
@@ -514,7 +514,7 @@ interface EventAccum {
}
/**
- * Drain this fixed step's events into the per-frame accumulator. Physics may step
+ * Drain this fixed step's events into the per-frame accumulator. PhysicsAPI may step
* several times per rendered frame; accumulating (rather than overwriting) keeps
* every collision — the interpolation system publishes + clears once per frame.
*/
@@ -722,7 +722,7 @@ export function registerPhysicsSystem(
const invPpu = 1 / ppu;
// Keep the query API's default scale in sync with the live Canvas,
// so raycast/overlap that omit `ppu` aren't silently scaled to 100.
- if (app.hasResource(PhysicsAPI)) app.getResource(PhysicsAPI).setPixelsPerUnit(ppu);
+ if (app.hasResource(Physics)) app.getResource(Physics).setPixelsPerUnit(ppu);
// Steady-state fast path: skip the full entity reconcile unless
// something structural changed (spawn/despawn/add-remove component →
// structuralVersion) OR a physics component was edited (O(1) gate).
diff --git a/sdk/src/postprocess.ts b/sdk/src/postprocess.ts
index 5c827aedb..bc4a1aa3c 100644
--- a/sdk/src/postprocess.ts
+++ b/sdk/src/postprocess.ts
@@ -2,7 +2,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
export {
PostProcess,
- PostProcessApi,
+ PostProcessAPI,
PostProcessStack,
postProcessEffects,
initPostProcessAPI,
diff --git a/sdk/src/postprocess/PostProcessAPI.ts b/sdk/src/postprocess/PostProcessAPI.ts
index 4639d1ce0..65da0b2e2 100644
--- a/sdk/src/postprocess/PostProcessAPI.ts
+++ b/sdk/src/postprocess/PostProcessAPI.ts
@@ -11,11 +11,13 @@ import { PostProcessStack, PostProcessState } from './PostProcessStack';
const bridge = new CoreApiBridge('postprocess');
let module: ESEngineModule | null = null;
+/** @internal Wired by the engine plugins — not part of the public API. */
export function initPostProcessAPI(wasmModule: ESEngineModule): void {
bridge.connect(wasmModule);
module = bridge.module;
}
+/** @internal Wired by the engine plugins — not part of the public API. */
export function shutdownPostProcessAPI(): void {
// Per-App state dies with its App; here we only tear down the shared module.
if (module) {
@@ -93,7 +95,7 @@ export function syncStackToWasm(stack: PostProcessStack): void {
* B2b-3a: a single default instance is exported to keep call sites unchanged;
* B2b-3b flips this to a per-App `defineResource` injected into the pipeline.
*/
-export class PostProcessApi {
+export class PostProcessAPI {
readonly state = new PostProcessState();
/** Volume-system bookkeeping (per-App): camera → the stack it created, and shared effect shaders. */
@@ -292,4 +294,4 @@ export class PostProcessApi {
* Per-App post-process resource. Published + injected into the render pipeline
* by `PostProcessPlugin`; read as `app.getResource(PostProcess)`.
*/
-export const PostProcess = defineResource<PostProcessApi>(null!, 'PostProcess');
+export const PostProcess = defineResource<PostProcessAPI>(null!, 'PostProcess');
diff --git a/sdk/src/postprocess/PostProcessPlugin.ts b/sdk/src/postprocess/PostProcessPlugin.ts
index 9e77cfa44..777ea90ea 100644
--- a/sdk/src/postprocess/PostProcessPlugin.ts
+++ b/sdk/src/postprocess/PostProcessPlugin.ts
@@ -3,7 +3,7 @@
import type { App, Plugin } from '../app';
import { Schedule } from '../system';
import { Assets } from '../asset/AssetPlugin';
-import { PostProcess, PostProcessApi } from './PostProcessAPI';
+import { PostProcess, PostProcessAPI } from './PostProcessAPI';
import { postProcessVolumeSystem, cleanupVolumeSystem, setVolumeTextureResolver, PostProcessVolumeConfigResource } from './volumeSystem';
export class PostProcessPlugin implements Plugin {
@@ -12,7 +12,7 @@ export class PostProcessPlugin implements Plugin {
build(app: App): void {
// Per-App post-process API, injected into the render pipeline as an
// optional stage (the pipeline has no hard dependency on it).
- const api = new PostProcessApi();
+ const api = new PostProcessAPI();
app.insertResource(PostProcess, api);
app.pipeline?.setPostProcess(api);
diff --git a/sdk/src/postprocess/PostProcessStack.ts b/sdk/src/postprocess/PostProcessStack.ts
index 7abc30676..d7d4341a9 100644
--- a/sdk/src/postprocess/PostProcessStack.ts
+++ b/sdk/src/postprocess/PostProcessStack.ts
@@ -16,7 +16,7 @@ export interface PassConfig {
/**
* Owns one App's post-process stacks, camera bindings, screen stack, and id
* counter. A stack registers into the state it is created with — no global.
- * Held by {@link PostProcessApi} (a per-App resource in B2b-3b).
+ * Held by {@link PostProcessAPI} (a per-App resource in B2b-3b).
*/
export class PostProcessState {
nextStackId = 1;
diff --git a/sdk/src/postprocess/index.ts b/sdk/src/postprocess/index.ts
index 125eeec0c..88fd1d8f1 100644
--- a/sdk/src/postprocess/index.ts
+++ b/sdk/src/postprocess/index.ts
@@ -2,7 +2,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
export { PostProcessStack } from './PostProcessStack';
export type { PassConfig } from './PostProcessStack';
-export { PostProcess, PostProcessApi, initPostProcessAPI, shutdownPostProcessAPI, syncStackToWasm } from './PostProcessAPI';
+export { PostProcess, PostProcessAPI, initPostProcessAPI, shutdownPostProcessAPI, syncStackToWasm } from './PostProcessAPI';
export { postProcessEffects } from './postProcessEffects';
export { POSTPROCESS_VERTEX } from './shaders';
export {
diff --git a/sdk/src/postprocess/volumeSystem.ts b/sdk/src/postprocess/volumeSystem.ts
index 347337f30..027d716f4 100644
--- a/sdk/src/postprocess/volumeSystem.ts
+++ b/sdk/src/postprocess/volumeSystem.ts
@@ -5,7 +5,7 @@ import { defineResource, Res } from '../resource';
import { Query } from '../query';
import type { Entity } from '../types';
import { PostProcessVolume, Transform, Camera, type PostProcessVolumeData, type TransformData, type CameraData } from '../component';
-import { PostProcess, type PostProcessApi } from './PostProcessAPI';
+import { PostProcess, type PostProcessAPI } from './PostProcessAPI';
import { getEffectDef } from './effects';
import { blendVolumeEffects, computeVolumeFactor, type ActiveVolume, type VolumeTransform } from './volumeBlending';
import type { ShaderHandle } from '../material';
@@ -28,7 +28,7 @@ export function setVolumeTextureResolver(resolver: ((ref: string) => number) | n
volumeTextureResolver = resolver;
}
-function getOrCreateShader(api: PostProcessApi, key: string, factory: () => ShaderHandle): ShaderHandle {
+function getOrCreateShader(api: PostProcessAPI, key: string, factory: () => ShaderHandle): ShaderHandle {
const existing = api.volumeShaders.get(key);
if (existing !== undefined) return existing;
@@ -38,7 +38,7 @@ function getOrCreateShader(api: PostProcessApi, key: string, factory: () => Shad
}
function applyTextures(
- stack: ReturnType<PostProcessApi['createStack']>,
+ stack: ReturnType<PostProcessAPI['createStack']>,
passName: string,
textures: Map<string, string>,
): void {
@@ -50,7 +50,7 @@ function applyTextures(
}
function applyBlendedEffects(
- api: PostProcessApi,
+ api: PostProcessAPI,
camera: Entity,
effects: Map<string, { enabled: boolean; uniforms: Map<string, number>; textures: Map<string, string> }>,
): void {
@@ -107,7 +107,7 @@ function applyBlendedEffects(
export const postProcessVolumeSystem = defineSystem(
[Res(PostProcess), Query(PostProcessVolume, Transform), Query(Camera, Transform)],
(
- api: PostProcessApi,
+ api: PostProcessAPI,
volumeQuery: Iterable<[Entity, PostProcessVolumeData, TransformData]>,
cameraQuery: Iterable<[Entity, CameraData, TransformData]>,
) => {
@@ -139,7 +139,7 @@ export const postProcessVolumeSystem = defineSystem(
{ name: 'PostProcessVolumeSystem' }
);
-export function cleanupVolumeSystem(api: PostProcessApi): void {
+export function cleanupVolumeSystem(api: PostProcessAPI): void {
for (const [camera, stack] of api.volumeStacks) {
api.unbind(camera);
stack.destroy();
diff --git a/sdk/src/renderPipeline.ts b/sdk/src/renderPipeline.ts
index f970ebc24..7aec8a997 100644
--- a/sdk/src/renderPipeline.ts
+++ b/sdk/src/renderPipeline.ts
@@ -8,7 +8,7 @@
import type { CppRegistry } from './wasm';
import type { Entity } from './types';
import { Renderer } from './renderer';
-import type { PostProcessApi } from './postprocess';
+import type { PostProcessAPI } from './postprocess';
import { Draw } from './draw';
import {
getDrawCallbacks,
@@ -51,7 +51,7 @@ export class RenderPipeline {
private lastHeight_ = 0;
private activeScenes_: Set<string> | null = null;
private preFlushCallbacks_: ((registry: { _cpp: CppRegistry }) => void)[] = [];
- private postProcess_: PostProcessApi | null = null;
+ private postProcess_: PostProcessAPI | null = null;
setActiveScenes(scenes: Set<string> | null): void {
this.activeScenes_ = scenes;
@@ -62,7 +62,7 @@ export class RenderPipeline {
* pipeline does no post-processing — it has no hard dependency on the
* post-process subsystem.
*/
- setPostProcess(pp: PostProcessApi | null): void {
+ setPostProcess(pp: PostProcessAPI | null): void {
this.postProcess_ = pp;
}
diff --git a/sdk/src/renderer.ts b/sdk/src/renderer.ts
index d94323801..e0e18e880 100644
--- a/sdk/src/renderer.ts
+++ b/sdk/src/renderer.ts
@@ -35,6 +35,7 @@ const bridge = new CoreApiBridge('renderer');
let module: ESEngineModule | null = null;
let viewProjectionPtr: number = 0;
+/** @internal Wired by the engine plugins — not part of the public API. */
export function initRendererAPI(wasmModule: ESEngineModule): void {
bridge.connect(wasmModule);
module = bridge.module;
diff --git a/sdk/src/resourceManager.ts b/sdk/src/resourceManager.ts
index d831789d2..576498363 100644
--- a/sdk/src/resourceManager.ts
+++ b/sdk/src/resourceManager.ts
@@ -23,6 +23,7 @@ const bridge = new ResourceManagerBridge();
let rm_: CppResourceManager | null = null;
const dimsCache_ = new Map<number, TextureDimensions>();
+/** @internal Wired by the engine plugins — not part of the public API. */
export function initResourceManager(rm: CppResourceManager, module?: ESEngineModule): void {
// Production (corePlugin) passes the main module → guarded calls. Tests pass
// only a mock rm → kept raw (unguarded), since they don't exercise abort.
@@ -36,6 +37,7 @@ export function initResourceManager(rm: CppResourceManager, module?: ESEngineMod
dimsCache_.clear();
}
+/** @internal Wired by the engine plugins — not part of the public API. */
export function shutdownResourceManager(): void {
bridge.disconnect();
rm_ = null;
diff --git a/sdk/src/tilemap/tilemapAPI.ts b/sdk/src/tilemap/tilemapAPI.ts
index 6861cafbe..11f9f52f4 100644
--- a/sdk/src/tilemap/tilemapAPI.ts
+++ b/sdk/src/tilemap/tilemapAPI.ts
@@ -59,6 +59,7 @@ interface TilemapModule {
const bridge = new CoreApiBridge('tilemap');
let module_: TilemapModule | null = null;
+/** @internal Wired by the engine plugins — not part of the public API. */
export function initTilemapAPI(m: ESEngineModule): void {
bridge.connect(m);
module_ = bridge.module as unknown as TilemapModule;
diff --git a/sdk/src/timeline/TimelineControl.ts b/sdk/src/timeline/TimelineControl.ts
index 0a6676b05..ed0fd1b6d 100644
--- a/sdk/src/timeline/TimelineControl.ts
+++ b/sdk/src/timeline/TimelineControl.ts
@@ -31,7 +31,7 @@ export interface PlayerFlagChannel {
* {@link TimelineState} every frame; these methods flip/seek that state and
* write the play flags through to the entity's `TimelinePlayer` component.
*/
-export class TimelineApi {
+export class TimelineAPI {
private readonly states_ = new Map<Entity, TimelineState>();
constructor(private readonly flags_: PlayerFlagChannel | null = null) {}
@@ -104,4 +104,4 @@ export class TimelineApi {
* Per-App timeline control resource, published by `TimelinePlugin`. Drive
* playback as `app.getResource(Timeline).play(entity)`.
*/
-export const Timeline = defineResource<TimelineApi>(null!, 'Timeline');
+export const Timeline = defineResource<TimelineAPI>(null!, 'Timeline');
diff --git a/sdk/src/timeline/TimelinePlugin.ts b/sdk/src/timeline/TimelinePlugin.ts
index c58464614..aa48387ee 100644
--- a/sdk/src/timeline/TimelinePlugin.ts
+++ b/sdk/src/timeline/TimelinePlugin.ts
@@ -10,7 +10,7 @@ import { Assets } from '../asset/AssetPlugin';
import { resolveAssetKey } from '../asset/resolveAssetKey';
import { Audio, type AudioAPI } from '../audio/Audio';
import { wrapModeFromName, TrackType, type TimelineAsset, type AnimFramesTrack } from './TimelineTypes';
-import { Timeline, TimelineApi } from './TimelineControl';
+import { Timeline, TimelineAPI } from './TimelineControl';
import { resolveChildEntity } from './TimelineRuntime';
import { advanceTimelineTS, applyPlayerFlags, latchPlayerFinish } from './TimelineDrive';
import type { SampleDeps } from './TimelineEvaluator';
@@ -103,7 +103,7 @@ export class TimelinePlugin implements Plugin {
if (clearFinished) player.finished = false;
world.insert(entity, TimelinePlayer, player);
};
- app.insertResource(Timeline, new TimelineApi({
+ app.insertResource(Timeline, new TimelineAPI({
raise: entity => setFlags(entity, true, false),
lower: entity => setFlags(entity, false, false),
reset: entity => setFlags(entity, false, true),
diff --git a/sdk/src/timeline/index.ts b/sdk/src/timeline/index.ts
index ffa251a5e..7859946ff 100644
--- a/sdk/src/timeline/index.ts
+++ b/sdk/src/timeline/index.ts
@@ -32,7 +32,7 @@ export {
export {
Timeline,
- TimelineApi,
+ TimelineAPI,
type PlayerFlagChannel,
} from './TimelineControl';
diff --git a/sdk/src/ui/text/localize.ts b/sdk/src/ui/text/localize.ts
index 37986f5c0..f9e49d0dd 100644
--- a/sdk/src/ui/text/localize.ts
+++ b/sdk/src/ui/text/localize.ts
@@ -13,7 +13,7 @@
* bound label on the very next frame with zero extra bookkeeping.
*/
import type { Entity } from '../../types';
-import type { LocalizationApi } from '../../i18n/Localization';
+import type { LocalizationAPI } from '../../i18n/Localization';
import { Text, type TextData } from '../core/text';
/** The slice of World the binding needs — mirrors FsmWorldView so tests can
@@ -29,7 +29,7 @@ export interface TextWorldView {
* `content` when it differs (missing keys resolve to the key itself — the
* catalogs' visible, greppable fallback). Returns how many contents changed.
*/
-export function applyTextLocalization(world: TextWorldView, i18n: LocalizationApi): number {
+export function applyTextLocalization(world: TextWorldView, i18n: LocalizationAPI): number {
let changed = 0;
for (const e of world.getEntitiesWithComponents([Text])) {
const entity = e as Entity;
diff --git a/sdk/src/webAppFactory.ts b/sdk/src/webAppFactory.ts
index fabd08a64..ed49ca645 100644
--- a/sdk/src/webAppFactory.ts
+++ b/sdk/src/webAppFactory.ts
@@ -23,39 +23,6 @@ import { replicationPlugin } from './net/replication';
import { SpinePlugin } from './spine';
import { createFetchSideModuleHost, type SideModuleHost } from './sideModules';
-export { uiPlugins };
-// The single composed UI pipeline; the concept plugins below are
-// re-exported for granular/advanced wiring.
-export { uiPlugin, UIPlugin } from './ui/ui-plugin';
-export { textPlugin, TextPlugin } from './ui/text/plugin';
-export { uiMaskPlugin, UIMaskPlugin } from './ui/render/mask';
-export { uiInteractionPlugin, UIInteractionPlugin } from './ui/input/interaction';
-export { uiLayoutPlugin, UILayoutPlugin } from './ui/layout/layout';
-export { uiRenderOrderPlugin, UIRenderOrderPlugin } from './ui/render/render-order';
-export { textInputPlugin, TextInputPlugin } from './ui/text/text-input-plugin';
-
-export { dragPlugin, DragPlugin } from './ui/input/drag';
-export { focusPlugin, FocusPlugin } from './ui/input/focus';
-export { safeAreaPlugin, SafeAreaPlugin } from './ui/layout/safe-area';
-
-export { PhysicsPlugin, PhysicsEvents, Physics, loadPhysicsModule } from './physics';
-export { AnimationPlugin, animationPlugin } from './animation';
-export { AudioPlugin, audioPlugin } from './audio';
-export { VideoPlugin, videoPlugin, VideoAPI, VideoPlayer, Video } from './video';
-export { ParticlePlugin, particlePlugin } from './particle';
-export { TrailPlugin, trailPlugin } from './trail';
-export { Mesh2DPlugin, mesh2dPlugin } from './mesh2d';
-export { PostProcessPlugin, postProcessPlugin } from './postprocess';
-export { TimelinePlugin, timelinePlugin, registerTimelineAsset, parseTimelineAsset, Timeline, TimelineApi, TimelinePlayer, type TimelinePlayerData } from './timeline';
-// Authoring + pure-TS evaluation surface for the editor Sequencer.
-export {
- sampleTimeline, sampleTimelineInWorld, evaluateChannel, applyWrapMode,
- serializeTimelineAsset, serializeTimelineToJson, resolveChildEntity, parseAnimationClip,
- TrackType, InterpType, WrapMode,
- type SampleWorld, type SampleDeps, type SampleOptions,
- type TimelineAsset, type Track, type PropertyTrack, type PropertyChannel, type Keyframe,
- type SpriteAnimTrack, type AudioTrack, type ActivationTrack, type SpineTrack, type AnimFramesTrack,
-} from './timeline';
export interface CreateWebAppOptions extends WebAppOptions {
/**
diff --git a/sdk/src/world.ts b/sdk/src/world.ts
index 0db323018..18cbd07c8 100644
--- a/sdk/src/world.ts
+++ b/sdk/src/world.ts
@@ -6,7 +6,7 @@
*/
import { Entity, entityGeneration, entityIndex, makeEntity, INVALID_ENTITY } from './types';
-import { AnyComponentDef, ComponentDef, ComponentData, BuiltinComponentDef, isBuiltinComponent, getAllRegisteredComponents, getUserComponents, getComponent, Name, Parent, Children } from './component';
+import { AnyComponentDef, ComponentDef, ComponentData, BuiltinComponentDef, isBuiltinComponent, getComponentRegistry, getUserComponents, getComponent, Name, Parent, Children } from './component';
import type { CppRegistry, ESEngineModule } from './wasm';
import { handleWasmError } from './wasmError';
import { BuiltinBridge, convertFromWasm, convertForWasm, type BridgeConnectOptions, type BuiltinMethods } from './ecs/BuiltinBridge';
@@ -605,7 +605,7 @@ export class World {
try { if (methods.has(entity)) types.add(name); } catch (e) { log.warn('world', `Component check failed for ${name}`, e); }
}
if (this.builtin_.hasCpp) {
- for (const [name, comp] of getAllRegisteredComponents()) {
+ for (const [name, comp] of getComponentRegistry()) {
if (isBuiltinComponent(comp) && !types.has(name)) {
try {
const m = this.builtin_.getBuiltinMethods(comp._cppName);
diff --git a/sdk/tests/animator-substate.test.ts b/sdk/tests/animator-substate.test.ts
index 133481f61..95cbe706b 100644
--- a/sdk/tests/animator-substate.test.ts
+++ b/sdk/tests/animator-substate.test.ts
@@ -3,7 +3,7 @@
import { describe, it, expect } from 'vitest';
import {
Animator,
- AnimatorControllerApi,
+ AnimatorControllerAPI,
evaluateAnimatorPath,
enterStatePath,
leafStateOf,
@@ -125,7 +125,7 @@ describe('evaluateAnimatorPath', () => {
});
// ---------------------------------------------------------------------------
-// Integration: AnimatorControllerApi.update drives the leaf clip through nesting
+// Integration: AnimatorControllerAPI.update drives the leaf clip through nesting
// ---------------------------------------------------------------------------
function makeWorld() {
@@ -146,10 +146,10 @@ function makeWorld() {
} as any;
}
-describe('AnimatorControllerApi.update — nested machine', () => {
+describe('AnimatorControllerAPI.update — nested machine', () => {
const E = 1;
function setup() {
- const ctrl = new AnimatorControllerApi();
+ const ctrl = new AnimatorControllerAPI();
ctrl.registerController('hero', nestedController());
const world = makeWorld();
world.insert(E, Animator, { controller: 'hero', currentState: '', enabled: true } as AnimatorData);
diff --git a/sdk/tests/animator.test.ts b/sdk/tests/animator.test.ts
index d14a2a9af..0a56abdcb 100644
--- a/sdk/tests/animator.test.ts
+++ b/sdk/tests/animator.test.ts
@@ -3,7 +3,7 @@
import { describe, it, expect } from 'vitest';
import {
Animator,
- AnimatorControllerApi,
+ AnimatorControllerAPI,
evaluateAnimatorTransitions,
resolveParams,
selectBlendClip,
@@ -153,7 +153,7 @@ describe('selectBlendClip', () => {
});
// ---------------------------------------------------------------------------
-// AnimatorControllerApi.update drives SpriteAnimator (mock World)
+// AnimatorControllerAPI.update drives SpriteAnimator (mock World)
// ---------------------------------------------------------------------------
function makeWorld() {
@@ -178,11 +178,11 @@ function spriteData(over: Partial<SpriteAnimatorData> = {}): SpriteAnimatorData
return { clip: '', speed: 1, playing: false, loop: true, enabled: true, currentFrame: 5, frameTimer: 0.3, ...over };
}
-describe('AnimatorControllerApi.update', () => {
+describe('AnimatorControllerAPI.update', () => {
const E = 1;
function setup() {
- const ctrl = new AnimatorControllerApi();
+ const ctrl = new AnimatorControllerAPI();
ctrl.registerController('hero', heroController());
const world = makeWorld();
world.insert(E, Animator, { controller: 'hero', currentState: '', enabled: true } as AnimatorData);
@@ -249,7 +249,7 @@ describe('AnimatorControllerApi.update', () => {
});
it('auto-advances on exit time when the current clip finishes', () => {
- const ctrl = new AnimatorControllerApi();
+ const ctrl = new AnimatorControllerAPI();
ctrl.registerController('atk', {
parameters: [],
initialState: 'attack',
@@ -271,7 +271,7 @@ describe('AnimatorControllerApi.update', () => {
ctrl.update(world);
expect((world.get(E, Animator) as AnimatorData).currentState).toBe('attack');
- // Simulate the non-looping clip ending (SpriteAnimationApi clears playing).
+ // Simulate the non-looping clip ending (SpriteAnimationAPI clears playing).
const sp = world.get(E, SpriteAnimator) as SpriteAnimatorData;
sp.playing = false;
world.insert(E, SpriteAnimator, sp);
@@ -283,7 +283,7 @@ describe('AnimatorControllerApi.update', () => {
it('drives the Spine driver on entry to a spine state (and not every frame)', () => {
const setAnimation = vi.fn();
- const ctrl = new AnimatorControllerApi();
+ const ctrl = new AnimatorControllerAPI();
ctrl.setSpineDriver({ setAnimation });
ctrl.registerController('caster', {
parameters: [{ name: 'cast', type: 'trigger' }],
@@ -313,7 +313,7 @@ describe('AnimatorControllerApi.update', () => {
});
it('spine states are inert without a driver (no throw)', () => {
- const ctrl = new AnimatorControllerApi();
+ const ctrl = new AnimatorControllerAPI();
ctrl.registerController('s', {
parameters: [], initialState: 'a',
states: [{ name: 'a', spine: { animation: 'a' }, transitions: [] }],
@@ -325,7 +325,7 @@ describe('AnimatorControllerApi.update', () => {
});
it('a 1D-blend state switches clip within the state as the parameter crosses thresholds', () => {
- const ctrl = new AnimatorControllerApi();
+ const ctrl = new AnimatorControllerAPI();
ctrl.registerController('loco', {
parameters: [{ name: 'speed', type: 'float', default: 0 }],
initialState: 'move',
diff --git a/sdk/tests/asset-field-registry.test.ts b/sdk/tests/asset-field-registry.test.ts
index a29f30966..d965868f4 100644
--- a/sdk/tests/asset-field-registry.test.ts
+++ b/sdk/tests/asset-field-registry.test.ts
@@ -6,7 +6,7 @@ import {
registerCompoundAssetFields,
getAssetFields,
getCompoundAssetFields,
- getAllRegisteredComponents,
+ getAssetFieldComponents,
clearAssetFieldRegistry,
initBuiltinAssetFields,
} from '../src/asset/AssetFieldRegistry';
@@ -49,7 +49,7 @@ describe('AssetFieldRegistry', () => {
registerAssetFields('Sprite', [{ field: 'texture', type: 'texture' }]);
registerAssetFields('Image', [{ field: 'texture', type: 'texture' }]);
- const components = getAllRegisteredComponents();
+ const components = getAssetFieldComponents();
expect(components).toContain('Sprite');
expect(components).toContain('Image');
});
@@ -57,7 +57,7 @@ describe('AssetFieldRegistry', () => {
it('initBuiltinAssetFields registers all known components', () => {
initBuiltinAssetFields();
- const components = getAllRegisteredComponents();
+ const components = getAssetFieldComponents();
expect(components).toContain('Sprite');
expect(components).toContain('SpineAnimation');
expect(components).toContain('BitmapText');
diff --git a/sdk/tests/camera-utils.test.ts b/sdk/tests/camera-utils.test.ts
index c9f5ebe21..73acb1ee2 100644
--- a/sdk/tests/camera-utils.test.ts
+++ b/sdk/tests/camera-utils.test.ts
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
import { describe, it, expect, vi } from 'vitest';
-import { CameraViewApi } from '../src/camera/Camera';
+import { CameraViewAPI } from '../src/camera/Camera';
const mockUICameraData = {
viewProjection: new Float32Array([
@@ -25,12 +25,12 @@ const mockUICameraData = {
valid: true,
};
-function makeCamera(cameraData = mockUICameraData): CameraViewApi {
+function makeCamera(cameraData = mockUICameraData): CameraViewAPI {
const app = { getResource: vi.fn(() => cameraData) } as any;
- return new CameraViewApi(app);
+ return new CameraViewAPI(app);
}
-describe('CameraViewApi', () => {
+describe('CameraViewAPI', () => {
it('returns null when the camera is invalid', () => {
const cam = makeCamera({ ...mockUICameraData, valid: false });
expect(cam.screenToWorld(400, 300)).toBeNull();
@@ -63,7 +63,7 @@ describe('CameraViewApi', () => {
});
});
- // The whole point of F3: two Apps each have their own CameraViewApi reading
+ // The whole point of F3: two Apps each have their own CameraViewAPI reading
// their own UICameraInfo — no shared global `app_` to bleed between them.
it('is isolated per App', () => {
const a = makeCamera({ ...mockUICameraData, worldMouseX: 1, worldMouseY: 2 });
diff --git a/sdk/tests/component-fieldmeta-golden.test.ts b/sdk/tests/component-fieldmeta-golden.test.ts
index 5af0c3198..ed67bc569 100644
--- a/sdk/tests/component-fieldmeta-golden.test.ts
+++ b/sdk/tests/component-fieldmeta-golden.test.ts
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
import { describe, it, expect } from 'vitest';
-import { getAllRegisteredComponents, getComponentFieldMeta } from '../src/component';
+import { getComponentRegistry, getComponentFieldMeta } from '../src/component';
// Equivalence gate for RC9-1 (rich reflection metadata, single authoring source).
// P2 moves the authority for builtin field presentation metadata from the
@@ -10,7 +10,7 @@ import { getAllRegisteredComponents, getComponentFieldMeta } from '../src/compon
// this snapshot fails if any field's resolved metadata drifts during the move.
describe('builtin FieldMeta (RC9-1 equivalence gate)', () => {
it('matches the golden snapshot of every builtin with declared field metadata', () => {
- const names = [...getAllRegisteredComponents().keys()].sort();
+ const names = [...getComponentRegistry().keys()].sort();
const golden: Record<string, Readonly<Record<string, unknown>>> = {};
for (const name of names) {
const meta = getComponentFieldMeta(name);
diff --git a/sdk/tests/component.test.ts b/sdk/tests/component.test.ts
index 0630845e8..cb42ad456 100644
--- a/sdk/tests/component.test.ts
+++ b/sdk/tests/component.test.ts
@@ -10,7 +10,6 @@ import {
getUserComponent,
getUserComponents,
getComponentRegistry,
- getAllRegisteredComponents,
getComponentDefaults,
clearUserComponents,
unregisterComponent,
@@ -249,8 +248,8 @@ describe('Component registry tiers (builtins global, user per-context)', () => {
const all = getComponentRegistry();
expect(all.get('TierBuiltin')).toBe(Builtin);
expect(all.get('TierUser')).toBe(User);
- // getAllRegisteredComponents is an alias of the complete view.
- expect(getAllRegisteredComponents().get('TierBuiltin')).toBe(Builtin);
+ // getComponentRegistry is an alias of the complete view.
+ expect(getComponentRegistry().get('TierBuiltin')).toBe(Builtin);
// getComponent resolves both tiers.
expect(getComponent('TierBuiltin')).toBe(Builtin);
expect(getComponent('TierUser')).toBe(User);
diff --git a/sdk/tests/editor-bridge.test.ts b/sdk/tests/editor-bridge.test.ts
index 91f690c5d..e61631055 100644
--- a/sdk/tests/editor-bridge.test.ts
+++ b/sdk/tests/editor-bridge.test.ts
@@ -5,7 +5,7 @@ import {
clearUserComponents,
defineComponent,
defineTag,
- getAllRegisteredComponents,
+ getComponentRegistry,
getComponent,
isBuiltinComponent,
} from '../src/component';
@@ -13,7 +13,7 @@ import { getDefaultContext } from '../src/context';
/**
* Confirms that the SDK-side `editorBridge` hook and the exports the
- * editor uses for initial-replay (`getAllRegisteredComponents`,
+ * editor uses for initial-replay (`getComponentRegistry`,
* `isBuiltinComponent`) behave as the bridge plugin expects.
*
* These tests don't cover the editor plugin itself — that's wired in
@@ -79,9 +79,9 @@ describe('editor bridge', () => {
expect(defPresent).toBe(true);
});
- it('getAllRegisteredComponents exposes both builtins and user-defined', () => {
+ it('getComponentRegistry exposes both builtins and user-defined', () => {
defineComponent('BridgeTestUser1', { z: 0 });
- const all = getAllRegisteredComponents();
+ const all = getComponentRegistry();
expect(all.has('BridgeTestUser1')).toBe(true);
// Transform is one of the core builtins — it must be present and
diff --git a/sdk/tests/fsm-sprite-anim.test.ts b/sdk/tests/fsm-sprite-anim.test.ts
index e453a24dd..c83fa751e 100644
--- a/sdk/tests/fsm-sprite-anim.test.ts
+++ b/sdk/tests/fsm-sprite-anim.test.ts
@@ -16,7 +16,7 @@ import { createBtRunState, tickBt } from '../src/ai/bt/BtRunner';
import type { BtDefinition } from '../src/ai/bt/types';
import type { FsmDefinition } from '../src/ai/fsm/types';
import {
- SpriteAnimator, SpriteAnimationApi, type SpriteAnimatorData, type SpriteAnimClip,
+ SpriteAnimator, SpriteAnimationAPI, type SpriteAnimatorData, type SpriteAnimClip,
} from '../src/animation/SpriteAnimator';
import type { World } from '../src/world';
@@ -110,7 +110,7 @@ describe('action argument plumbing', () => {
});
describe('finished-latch flag contract (system side)', () => {
- /** Minimal World for SpriteAnimationApi.update: one entity, two components.
+ /** Minimal World for SpriteAnimationAPI.update: one entity, two components.
* `get` returns the live object (the real World's semantic — frame-timer
* accrual persists between ticks without an insert). */
function makeWorld(comps: Map<string, unknown>): World {
@@ -128,7 +128,7 @@ describe('finished-latch flag contract (system side)', () => {
};
it('one-shot completion latches finished; raising playing replays from frame 0', () => {
- const api = new SpriteAnimationApi();
+ const api = new SpriteAnimationAPI();
api.registerClip(clip);
const comps = new Map<string, unknown>([
['SpriteAnimator', animator({ clip: 'attack.esanim', loop: false, playing: true })],
diff --git a/sdk/tests/i18n.test.ts b/sdk/tests/i18n.test.ts
index efac281da..e1de1ab87 100644
--- a/sdk/tests/i18n.test.ts
+++ b/sdk/tests/i18n.test.ts
@@ -2,7 +2,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
import { describe, it, expect } from 'vitest';
import {
- LocalizationApi,
+ LocalizationAPI,
interpolate,
selectPluralForm,
defaultPluralSelector,
@@ -39,9 +39,9 @@ describe('selectPluralForm', () => {
});
});
-describe('LocalizationApi', () => {
+describe('LocalizationAPI', () => {
function setup() {
- const loc = new LocalizationApi('en', 'en');
+ const loc = new LocalizationAPI('en', 'en');
loc.addCatalog('en', {
greeting: 'Hello {name}',
apples: { zero: 'no apples', one: 'one apple', other: '{count} apples' },
diff --git a/sdk/tests/locale-table.test.ts b/sdk/tests/locale-table.test.ts
index 59df379fe..8e52e9f74 100644
--- a/sdk/tests/locale-table.test.ts
+++ b/sdk/tests/locale-table.test.ts
@@ -7,7 +7,7 @@
* `i18nKey` into live `content` and re-flows it on locale switch.
*/
import { describe, it, expect } from 'vitest';
-import { LocalizationApi, parseLocaleTable, matchLocale } from '../src/i18n/Localization';
+import { LocalizationAPI, parseLocaleTable, matchLocale } from '../src/i18n/Localization';
import { LocaleAssetLoader } from '../src/asset/loaders/LocaleAssetLoader';
import type { LoadContext } from '../src/asset/AssetLoader';
import { applyTextLocalization, type TextWorldView } from '../src/ui/text/localize';
@@ -104,7 +104,7 @@ describe('sceneUsesI18n', () => {
// LocaleAssetLoader
// =============================================================================
-function loaderCtx(text: string, i18n: LocalizationApi | null): LoadContext {
+function loaderCtx(text: string, i18n: LocalizationAPI | null): LoadContext {
return {
catalog: { getBuildPath: (p: string) => p },
loadText: async () => text,
@@ -114,7 +114,7 @@ function loaderCtx(text: string, i18n: LocalizationApi | null): LoadContext {
describe('LocaleAssetLoader', () => {
it('merges the table into the app catalogs and reports locale + key count', async () => {
- const i18n = new LocalizationApi('en', 'en');
+ const i18n = new LocalizationAPI('en', 'en');
const loader = new LocaleAssetLoader();
const result = await loader.load('i18n/zh-CN.eslocale', loaderCtx(JSON.stringify({
version: 1,
@@ -133,7 +133,7 @@ describe('LocaleAssetLoader', () => {
});
it('propagates table validation errors (bad content never half-registers)', async () => {
- const i18n = new LocalizationApi('en', 'en');
+ const i18n = new LocalizationAPI('en', 'en');
const loader = new LocaleAssetLoader();
await expect(loader.load('i18n/en.eslocale', loaderCtx('{"entries":{}}', i18n)))
.rejects.toThrow(/'locale'/);
@@ -174,7 +174,7 @@ class FakeWorld implements TextWorldView {
describe('applyTextLocalization', () => {
function setup() {
const world = new FakeWorld();
- const i18n = new LocalizationApi('en', 'en');
+ const i18n = new LocalizationAPI('en', 'en');
i18n.addCatalog('en', { play: 'Play' });
i18n.addCatalog('zh-CN', { play: '开始' });
return { world, i18n };
diff --git a/sdk/tests/postprocess.test.ts b/sdk/tests/postprocess.test.ts
index 9f5a745ad..e9e08bca2 100644
--- a/sdk/tests/postprocess.test.ts
+++ b/sdk/tests/postprocess.test.ts
@@ -9,7 +9,7 @@ vi.mock('../src/material', () => ({
}));
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
-import { PostProcessApi, PostProcessStack, postProcessEffects, initPostProcessAPI, shutdownPostProcessAPI, getEffectDef } from '../src/postprocess';
+import { PostProcessAPI, PostProcessStack, postProcessEffects, initPostProcessAPI, shutdownPostProcessAPI, getEffectDef } from '../src/postprocess';
import { Material } from '../src/material';
import type { ESEngineModule } from '../src/wasm';
@@ -42,13 +42,13 @@ type MockModule = ReturnType<typeof createPostProcessMockModule>;
describe('PostProcess API', () => {
let mock: MockModule;
- let pp: PostProcessApi;
+ let pp: PostProcessAPI;
beforeEach(() => {
mock = createPostProcessMockModule();
initPostProcessAPI(mock as unknown as ESEngineModule);
vi.clearAllMocks();
- pp = new PostProcessApi();
+ pp = new PostProcessAPI();
});
afterEach(() => {
diff --git a/sdk/tests/sprite-animator-events.test.ts b/sdk/tests/sprite-animator-events.test.ts
index 8eb170a81..e18ebaddb 100644
--- a/sdk/tests/sprite-animator-events.test.ts
+++ b/sdk/tests/sprite-animator-events.test.ts
@@ -2,7 +2,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
import { describe, it, expect, beforeEach, vi } from 'vitest';
import {
- SpriteAnimationApi,
+ SpriteAnimationAPI,
type SpriteAnimClip,
type SpriteAnimEvent,
} from '../src/animation/SpriteAnimator';
@@ -10,10 +10,10 @@ import {
import { shouldFireEvent } from '../src/animation/SpriteAnimator';
describe('SpriteAnimator Frame Events', () => {
- let anim: SpriteAnimationApi;
+ let anim: SpriteAnimationAPI;
beforeEach(() => {
- anim = new SpriteAnimationApi();
+ anim = new SpriteAnimationAPI();
});
describe('shouldFireEvent', () => {
diff --git a/sdk/tests/sprite-animator-goto.test.ts b/sdk/tests/sprite-animator-goto.test.ts
index 4f382c816..f5d1e37f4 100644
--- a/sdk/tests/sprite-animator-goto.test.ts
+++ b/sdk/tests/sprite-animator-goto.test.ts
@@ -2,7 +2,7 @@
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
import { describe, it, expect, vi, beforeEach } from 'vitest';
import {
- SpriteAnimationApi,
+ SpriteAnimationAPI,
type SpriteAnimClip,
type SpriteAnimatorData,
} from '../src/animation/SpriteAnimator';
@@ -38,10 +38,10 @@ function createAnimatorData(): SpriteAnimatorData {
}
describe('SpriteAnimator goto', () => {
- let anim: SpriteAnimationApi;
+ let anim: SpriteAnimationAPI;
beforeEach(() => {
- anim = new SpriteAnimationApi();
+ anim = new SpriteAnimationAPI();
anim.registerClip(createTestClip());
});
diff --git a/sdk/tests/sprite-animator.test.ts b/sdk/tests/sprite-animator.test.ts
index 949815580..3c3a52ff8 100644
--- a/sdk/tests/sprite-animator.test.ts
+++ b/sdk/tests/sprite-animator.test.ts
@@ -7,7 +7,7 @@ import type { CppRegistry, ESEngineModule } from '../src/wasm';
import type { Entity } from '../src/types';
import {
SpriteAnimator,
- SpriteAnimationApi,
+ SpriteAnimationAPI,
type SpriteAnimatorData,
type SpriteAnimClip,
} from '../src/animation/SpriteAnimator';
@@ -48,12 +48,12 @@ function createAnimTestWorld(): { world: World; registry: CppRegistry } {
describe('SpriteAnimator', () => {
let world: World;
- let anim: SpriteAnimationApi;
+ let anim: SpriteAnimationAPI;
beforeEach(() => {
const ctx = createAnimTestWorld();
world = ctx.world;
- anim = new SpriteAnimationApi();
+ anim = new SpriteAnimationAPI();
});
// =========================================================================
diff --git a/sdk/tests/timeline-drive.test.ts b/sdk/tests/timeline-drive.test.ts
index e7aa656a6..853c943fb 100644
--- a/sdk/tests/timeline-drive.test.ts
+++ b/sdk/tests/timeline-drive.test.ts
@@ -11,7 +11,7 @@ import {
type TimelineState,
} from '../src/timeline/TimelineDrive';
import { TimelineEventType } from '../src/timeline/TimelineRuntime';
-import { TimelineApi } from '../src/timeline/TimelineControl';
+import { TimelineAPI } from '../src/timeline/TimelineControl';
import { WrapMode, TrackType, InterpType, type TimelineAsset } from '../src/timeline/TimelineTypes';
import type { SampleDeps } from '../src/timeline/TimelineEvaluator';
@@ -210,10 +210,10 @@ describe('TimelinePlayer flag contract (applyPlayerFlags / latchPlayerFinish)',
});
});
-describe('TimelineApi write-through (play/pause/stop reach the component flags)', () => {
+describe('TimelineAPI write-through (play/pause/stop reach the component flags)', () => {
it('routes to raise/lower/reset so the flag survives the per-tick reconcile', () => {
const calls: string[] = [];
- const api = new TimelineApi({
+ const api = new TimelineAPI({
raise: e => calls.push(`raise:${e}`),
lower: e => calls.push(`lower:${e}`),
reset: e => calls.push(`reset:${e}`),
@@ -225,7 +225,7 @@ describe('TimelineApi write-through (play/pause/stop reach the component flags)'
});
it('stop also rewinds the clock state', () => {
- const api = new TimelineApi();
+ const api = new TimelineAPI();
const s = api.ensureState(ROOT, WrapMode.Once, 1);
s.playing = true;
s.time = 1.5;
diff --git a/sdk/tests/timeline-tilemap-ui-bridge.test.ts b/sdk/tests/timeline-tilemap-ui-bridge.test.ts
index f5062020a..0013dd3ca 100644
--- a/sdk/tests/timeline-tilemap-ui-bridge.test.ts
+++ b/sdk/tests/timeline-tilemap-ui-bridge.test.ts
@@ -12,7 +12,7 @@ import { WasmModuleAborted } from '../src/moduleHealth';
import { CoreApiBridge } from '../src/CoreApiBridge';
import { TilemapAPI, initTilemapAPI, shutdownTilemapAPI } from '../src/tilemap/tilemapAPI';
import { initUIHelpers, getUINodeWidth } from '../src/ui/util/helpers';
-import { TimelineApi } from '../src/timeline/TimelineControl';
+import { TimelineAPI } from '../src/timeline/TimelineControl';
import type { ESEngineModule, CppRegistry } from '../src/wasm';
import type { Entity } from '../src/types';