-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathlua-runtime.d.ts
More file actions
55 lines (42 loc) · 1.4 KB
/
lua-runtime.d.ts
File metadata and controls
55 lines (42 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* Lua Runtime Type Definitions
*
* Global APIs available in Lua scripts transpiled from TypeScript.
* These correspond to the Rust Lua API implementations.
*/
/** Entity Transform API */
interface IEntityTransform {
/** Get current position as [x, y, z] */
position(): [number, number, number];
/** Get current rotation as Euler angles in degrees [x, y, z] */
rotation(): [number, number, number];
/** Get current scale as [x, y, z] */
scale(): [number, number, number];
/** Set position */
setPosition(x: number, y: number, z: number): void;
/** Set rotation using Euler angles in degrees */
setRotation(x: number, y: number, z: number): void;
/** Set scale */
setScale(x: number, y: number, z: number): void;
/** Rotate by delta Euler angles in degrees */
rotate(x: number, y: number, z: number): void;
}
/** Entity API - available as global 'entity' in scripts */
interface IEntity {
/** Entity ID */
readonly id: number;
/** Entity name */
readonly name: string;
/** Transform component API */
readonly transform: IEntityTransform;
}
/** Script parameters - available as global 'parameters' */
declare const parameters: Record<string, unknown>;
/** Global entity reference */
declare const entity: IEntity;
/** Console API for logging */
declare const console: {
log(...args: unknown[]): void;
warn(...args: unknown[]): void;
error(...args: unknown[]): void;
};