Removed old scripted types
This commit is contained in:
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/** Camera projection component. Only one camera is active at a time. */
|
||||
interface Camera extends Component {
|
||||
/** Field of view in radians (perspective only). */
|
||||
fov: number;
|
||||
/** Near clip plane distance. */
|
||||
nearClip: number;
|
||||
/** Far clip plane distance. */
|
||||
farClip: number;
|
||||
/** One of `Camera.PERSPECTIVE`, `Camera.PERSPECTIVE_FLIPPED`, or `Camera.ORTHOGRAPHIC`. */
|
||||
projType: number;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
interface CameraConstructor {
|
||||
readonly PERSPECTIVE: number;
|
||||
readonly PERSPECTIVE_FLIPPED: number;
|
||||
readonly ORTHOGRAPHIC: number;
|
||||
new(): never;
|
||||
}
|
||||
|
||||
declare var Camera: CameraConstructor;
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* Interactable component. Fires a callback when the player activates it.
|
||||
*
|
||||
* Assign a JS function to `onInteract` to handle the event from script.
|
||||
* Call `trigger()` to fire the callback imperatively from C or JS.
|
||||
*/
|
||||
interface Interactable extends Component {
|
||||
/** Called when the player interacts with this entity. Set to null to clear. */
|
||||
onInteract: (() => void) | null;
|
||||
/** Fires the registered callback immediately (no-op if none is set). */
|
||||
trigger(): void;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
interface InteractableConstructor {
|
||||
new(): never;
|
||||
}
|
||||
|
||||
declare var Interactable: InteractableConstructor;
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/** Overworld character component (player or NPC). */
|
||||
interface Overworld extends Component {
|
||||
/**
|
||||
* Entity type - `Overworld.PLAYER` or `Overworld.NPC`.
|
||||
*/
|
||||
type: number;
|
||||
/**
|
||||
* Facing direction - one of the `Overworld.FACING_*` constants.
|
||||
*/
|
||||
facing: number;
|
||||
/** Component ID of the linked Renderable, or INVALID if none. */
|
||||
readonly renderComponentId: number;
|
||||
/** Component ID of the linked Physics body, or INVALID if none. */
|
||||
readonly physicsComponentId: number;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
interface OverworldConstructor {
|
||||
readonly PLAYER: number;
|
||||
readonly NPC: number;
|
||||
|
||||
readonly FACING_DOWN: number;
|
||||
readonly FACING_UP: number;
|
||||
readonly FACING_LEFT: number;
|
||||
readonly FACING_RIGHT: number;
|
||||
readonly FACING_SOUTH: number;
|
||||
readonly FACING_NORTH: number;
|
||||
readonly FACING_WEST: number;
|
||||
readonly FACING_EAST: number;
|
||||
|
||||
new(): never;
|
||||
}
|
||||
|
||||
declare var Overworld: OverworldConstructor;
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* Overworld follow-camera component.
|
||||
* Smoothly tracks a target entity's Position each frame.
|
||||
*/
|
||||
interface OverworldCamera extends Component {
|
||||
/** Entity ID to follow. */
|
||||
targetEntity: number;
|
||||
/** Position component ID on the target entity. */
|
||||
targetPositionComponent: number;
|
||||
/** World-space offset added to the target's position before placing the camera. */
|
||||
targetOffset: Vec3;
|
||||
/** Eye-space offset applied on top of targetOffset. */
|
||||
eyeOffset: Vec3;
|
||||
/** Orthographic scale factor (larger = wider view). */
|
||||
scale: number;
|
||||
/**
|
||||
* Convenience setter - equivalent to assigning `targetEntity` and
|
||||
* `targetPositionComponent` individually.
|
||||
*/
|
||||
setTarget(targetEntityId: number, targetPositionComponentId: number): void;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
interface OverworldCameraConstructor {
|
||||
new(): never;
|
||||
}
|
||||
|
||||
declare var OverworldCamera: OverworldCameraConstructor;
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* Overworld AABB trigger. Fires callbacks as the player enters, stays inside,
|
||||
* exits, or remains outside the defined bounding box each frame.
|
||||
*/
|
||||
interface OverworldTrigger extends Component {
|
||||
/** Minimum corner of the trigger AABB. */
|
||||
min: Vec3;
|
||||
/** Maximum corner of the trigger AABB. */
|
||||
max: Vec3;
|
||||
/** `true` while the player is inside the trigger bounds. */
|
||||
readonly playerInside: boolean;
|
||||
|
||||
/** Fired once when the player first enters the bounds. */
|
||||
onEnter: (() => void) | null;
|
||||
/** Fired once when the player leaves the bounds. */
|
||||
onExit: (() => void) | null;
|
||||
/** Fired every frame while the player remains inside the bounds. */
|
||||
onStay: (() => void) | null;
|
||||
/** Fired every frame while the player remains outside the bounds. */
|
||||
onOutside: (() => void) | null;
|
||||
|
||||
/** Convenience setter for both corners at once. */
|
||||
setBounds(min: Vec3, max: Vec3): void;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
interface OverworldTriggerConstructor {
|
||||
new(): never;
|
||||
}
|
||||
|
||||
declare var OverworldTrigger: OverworldTriggerConstructor;
|
||||
Vendored
-39
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/** Physics body component. */
|
||||
interface Physics extends Component {
|
||||
/** Body simulation type - `Physics.STATIC`, `DYNAMIC`, or `KINEMATIC`. */
|
||||
bodyType: number;
|
||||
/**
|
||||
* Collision shape type - one of the `Physics.SHAPE_*` constants.
|
||||
* Changing the type preserves existing velocity and ground state.
|
||||
*/
|
||||
shape: number;
|
||||
/** Current linear velocity (Vec3). */
|
||||
velocity: Vec3;
|
||||
/** Gravity multiplier. 0 = no gravity, 1 = full, negative = inverted. */
|
||||
gravityScale: number;
|
||||
/** `true` if the body rested on a surface during the last simulation step. */
|
||||
readonly onGround: boolean;
|
||||
/** Applies an instantaneous velocity change. No-op on STATIC bodies. */
|
||||
applyImpulse(impulse: Vec3): void;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
interface PhysicsConstructor {
|
||||
readonly STATIC: number;
|
||||
readonly DYNAMIC: number;
|
||||
readonly KINEMATIC: number;
|
||||
readonly SHAPE_CUBE: number;
|
||||
readonly SHAPE_SPHERE: number;
|
||||
readonly SHAPE_CAPSULE: number;
|
||||
readonly SHAPE_PLANE: number;
|
||||
new(): never;
|
||||
}
|
||||
|
||||
declare var Physics: PhysicsConstructor;
|
||||
Vendored
-21
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/** Player movement component. Controls walk and run speeds. */
|
||||
interface Player extends Component {
|
||||
/** Walk speed in world units per second. */
|
||||
speed: number;
|
||||
/** Run speed in world units per second. */
|
||||
runSpeed: number;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
interface PlayerConstructor {
|
||||
new(): never;
|
||||
}
|
||||
|
||||
declare var Player: PlayerConstructor;
|
||||
Vendored
-41
@@ -1,41 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/** Transform component - local/world PRS with an optional parent hierarchy. */
|
||||
interface Position extends Component {
|
||||
/**
|
||||
* Local-space position. Reading returns a Vec3 copy; assigning a Vec3
|
||||
* writes through to the C transform and marks descendants dirty.
|
||||
*/
|
||||
localPosition: Vec3;
|
||||
/** World-space position (full parent-chain applied). */
|
||||
worldPosition: Vec3;
|
||||
/** Local euler rotation in radians (XYZ order). */
|
||||
localRotation: Vec3;
|
||||
/** World euler rotation in radians. */
|
||||
worldRotation: Vec3;
|
||||
/** Local scale. */
|
||||
localScale: Vec3;
|
||||
/** World scale (extracted from parent-chain matrix). */
|
||||
worldScale: Vec3;
|
||||
/**
|
||||
* Orients the transform so it faces `target`. Uses the current local
|
||||
* position as the eye. `up` defaults to world Y-up.
|
||||
*/
|
||||
lookAt(target: Vec3, up?: Vec3): void;
|
||||
/**
|
||||
* Attaches this transform to a parent. Pass `null` / `undefined` to detach.
|
||||
*/
|
||||
setParent(parent: Position | null | undefined): void;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
interface PositionConstructor {
|
||||
new(): never;
|
||||
}
|
||||
|
||||
declare var Position: PositionConstructor;
|
||||
-52
@@ -1,52 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/** A Renderable component. Returned by `entity.add(Component.RENDERABLE)`. */
|
||||
interface Renderable extends Component {
|
||||
/** Current render type - one of the `Renderable.*` type constants. */
|
||||
type: number;
|
||||
/** Render priority. 0 = auto. Higher = drawn later. */
|
||||
priority: number;
|
||||
/**
|
||||
* Unlit material color. Reading returns a fresh `Color` copy; assigning
|
||||
* a `Color` instance writes through to the C material.
|
||||
*
|
||||
* @example
|
||||
* r.color = Color.RED;
|
||||
* r.color = new Color(255, 128, 0);
|
||||
*/
|
||||
color: Color;
|
||||
/**
|
||||
* The bound texture. Assigning a `Texture` switches the renderable to
|
||||
* `SPRITEBATCH` mode and pins the object against GC. Reading returns the
|
||||
* same `Texture` instance that was assigned, or `undefined` if none.
|
||||
*/
|
||||
texture: Texture | undefined;
|
||||
/**
|
||||
* Sprite list. Reading returns a JS array of 10-element sub-arrays
|
||||
* `[x1,y1,z1, x2,y2,z2, u1,v1, u2,v2]` - one per sprite.
|
||||
*
|
||||
* Assigning an array replaces all sprites. Each element may be:
|
||||
* - 10 numbers (3D): `[x1,y1,z1, x2,y2,z2, u1,v1, u2,v2]`
|
||||
* - 8 numbers (2D, z defaults to 0): `[x1,y1, x2,y2, u1,v1, u2,v2]`
|
||||
*
|
||||
* @example
|
||||
* r.sprites = [[-0.5, 0, 0.5, 1, 0, 0, 1, 1]];
|
||||
* r.sprites = []; // clear
|
||||
*/
|
||||
sprites: number[][];
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
interface RenderableConstructor {
|
||||
readonly SHADER_MATERIAL: number;
|
||||
readonly SPRITEBATCH: number;
|
||||
readonly CUSTOM: number;
|
||||
new(): never;
|
||||
}
|
||||
|
||||
declare var Renderable: RenderableConstructor;
|
||||
Vendored
-25
@@ -1,25 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/** AABB trigger volume. `contains` tests whether a world point is inside. */
|
||||
interface Trigger extends Component {
|
||||
/** Minimum corner of the AABB (Vec3). */
|
||||
min: Vec3;
|
||||
/** Maximum corner of the AABB (Vec3). */
|
||||
max: Vec3;
|
||||
/** Sets both corners at once. */
|
||||
setBounds(min: Vec3, max: Vec3): void;
|
||||
/** Returns `true` if `point` is inside `[min, max]`. */
|
||||
contains(point: Vec3): boolean;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
interface TriggerConstructor {
|
||||
new(): never;
|
||||
}
|
||||
|
||||
declare var Trigger: TriggerConstructor;
|
||||
Reference in New Issue
Block a user