@mafiahub/types 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/color.d.ts CHANGED
@@ -1,55 +1,53 @@
1
- declare namespace Core {
2
- /**
3
- * RGBA color. Components are stored as floats in [0, 1] range.
4
- * Use `Color.fromRGB()` to construct from 0-255 values.
5
- */
6
- class Color {
7
- /** Create a color from normalized components; alpha defaults to 1. */
8
- constructor(r: number, g: number, b: number, a?: number);
1
+ /**
2
+ * RGBA color. Components are stored as floats in [0, 1] range.
3
+ * Use `Color.fromRGB()` to construct from 0-255 values.
4
+ */
5
+ declare class Color {
6
+ /** Create a color from normalized components; alpha defaults to 1. */
7
+ constructor(r: number, g: number, b: number, a?: number);
9
8
 
10
- /** Mutable normalized red component. */
11
- r: number;
12
- /** Mutable normalized green component. */
13
- g: number;
14
- /** Mutable normalized blue component. */
15
- b: number;
16
- /** Mutable normalized alpha component. */
17
- a: number;
9
+ /** Mutable normalized red component. */
10
+ r: number;
11
+ /** Mutable normalized green component. */
12
+ g: number;
13
+ /** Mutable normalized blue component. */
14
+ b: number;
15
+ /** Mutable normalized alpha component. */
16
+ a: number;
18
17
 
19
- /** Interpolate every component toward `target`, mutating this color. */
20
- lerp(target: Color, t: number): this;
21
- /** Replace normalized components; alpha defaults to 1 when omitted. */
22
- set(r: number, g: number, b: number, a?: number): this;
23
- /** Create an independent copy. */
24
- clone(): Color;
25
- /** Return uppercase `#RRGGBB`, or `#RRGGBBAA` when alpha is requested. */
26
- toHex(includeAlpha?: boolean): string;
27
- /** Format as `Color(r, g, b, a)` for logging. */
28
- toString(): string;
29
- /** Convert to a plain normalized component object for `JSON.stringify`. */
30
- toJSON(): { r: number; g: number; b: number; a: number };
18
+ /** Interpolate every component toward `target`, mutating this color. */
19
+ lerp(target: Color, t: number): this;
20
+ /** Replace normalized components; alpha defaults to 1 when omitted. */
21
+ set(r: number, g: number, b: number, a?: number): this;
22
+ /** Create an independent copy. */
23
+ clone(): Color;
24
+ /** Return uppercase `#RRGGBB`, or `#RRGGBBAA` when alpha is requested. */
25
+ toHex(includeAlpha?: boolean): string;
26
+ /** Format as `Color(r, g, b, a)` for logging. */
27
+ toString(): string;
28
+ /** Convert to a plain normalized component object for `JSON.stringify`. */
29
+ toJSON(): { r: number; g: number; b: number; a: number };
31
30
 
32
- /** Parse `#RGB`, `#RGBA`, `#RRGGBB`, or `#RRGGBBAA`; invalid input returns opaque white. */
33
- static fromHex(hex: string): Color;
34
- /** Construct from 0-255 component values; alpha defaults to 255. */
35
- static fromRGB(r: number, g: number, b: number, a?: number): Color;
36
- /** Create opaque white. */
37
- static white(): Color;
38
- /** Create opaque black. */
39
- static black(): Color;
40
- /** Create opaque red. */
41
- static red(): Color;
42
- /** Create opaque green. */
43
- static green(): Color;
44
- /** Create opaque blue. */
45
- static blue(): Color;
46
- /** Create opaque yellow. */
47
- static yellow(): Color;
48
- /** Create opaque cyan. */
49
- static cyan(): Color;
50
- /** Create opaque magenta. */
51
- static magenta(): Color;
52
- /** Create fully transparent black. */
53
- static transparent(): Color;
54
- }
31
+ /** Parse `#RGB`, `#RGBA`, `#RRGGBB`, or `#RRGGBBAA`; invalid input returns opaque white. */
32
+ static fromHex(hex: string): Color;
33
+ /** Construct from 0-255 component values; alpha defaults to 255. */
34
+ static fromRGB(r: number, g: number, b: number, a?: number): Color;
35
+ /** Create opaque white. */
36
+ static white(): Color;
37
+ /** Create opaque black. */
38
+ static black(): Color;
39
+ /** Create opaque red. */
40
+ static red(): Color;
41
+ /** Create opaque green. */
42
+ static green(): Color;
43
+ /** Create opaque blue. */
44
+ static blue(): Color;
45
+ /** Create opaque yellow. */
46
+ static yellow(): Color;
47
+ /** Create opaque cyan. */
48
+ static cyan(): Color;
49
+ /** Create opaque magenta. */
50
+ static magenta(): Color;
51
+ /** Create fully transparent black. */
52
+ static transparent(): Color;
55
53
  }
package/core/events.d.ts CHANGED
@@ -1,70 +1,68 @@
1
- declare namespace Core {
1
+ /**
2
+ * Global event bus with async support.
3
+ *
4
+ * Reserved events (framework-only, cannot be emitted from JS):
5
+ * `resourceStart`, `resourceStop`, `resourceError`,
6
+ * `playerConnect`, `playerDisconnect`, `playerSpawn`,
7
+ * `serverStart`, `serverStop`
8
+ */
9
+ declare const Events: {
2
10
  /**
3
- * Global event bus with async support.
4
- *
5
- * Reserved events (framework-only, cannot be emitted from JS):
6
- * `resourceStart`, `resourceStop`, `resourceError`,
7
- * `playerConnect`, `playerDisconnect`, `playerSpawn`,
8
- * `serverStart`, `serverStop`
11
+ * Register a persistent listener owned by the calling resource.
12
+ * @param eventName Case-sensitive shared event name.
13
+ * @param handler Callback invoked with the emitted arguments; asynchronous results are awaited by emitters.
14
+ * @returns An unsubscribe function.
9
15
  */
10
- const Events: {
11
- /**
12
- * Register a persistent listener owned by the calling resource.
13
- * @param eventName Case-sensitive shared event name.
14
- * @param handler Callback invoked with the emitted arguments; asynchronous results are awaited by emitters.
15
- * @returns An unsubscribe function.
16
- */
17
- on(eventName: string, handler: (...args: any[]) => void): () => void;
16
+ on(eventName: string, handler: (...args: any[]) => void): () => void;
18
17
 
19
- /**
20
- * Register a listener removed before its first invocation.
21
- * @param eventName Case-sensitive shared event name.
22
- * @param handler Resource-owned callback invoked once.
23
- */
24
- once(eventName: string, handler: (...args: any[]) => void): void;
18
+ /**
19
+ * Register a listener removed before its first invocation.
20
+ * @param eventName Case-sensitive shared event name.
21
+ * @param handler Resource-owned callback invoked once.
22
+ */
23
+ once(eventName: string, handler: (...args: any[]) => void): void;
25
24
 
26
- /**
27
- * Remove a matching listener owned by the calling resource.
28
- * @param eventName Case-sensitive shared event name.
29
- * @param handler Exact function passed to `on` or `once`.
30
- */
31
- off(eventName: string, handler: (...args: any[]) => void): void;
25
+ /**
26
+ * Remove a matching listener owned by the calling resource.
27
+ * @param eventName Case-sensitive shared event name.
28
+ * @param handler Exact function passed to `on` or `once`.
29
+ */
30
+ off(eventName: string, handler: (...args: any[]) => void): void;
32
31
 
33
- /**
34
- * Emit an event globally. Reserved events cannot be emitted.
35
- * Resolves when all handlers complete; rejects with
36
- * `AggregateError` if any handler fails.
37
- * @param eventName Shared event name; framework-reserved names cannot be emitted by scripts.
38
- * @param args Arguments delivered to every matching handler.
39
- */
40
- emit(eventName: string, ...args: any[]): Promise<void>;
32
+ /**
33
+ * Emit an event globally. Reserved events cannot be emitted.
34
+ * Resolves when all handlers complete; rejects with
35
+ * `AggregateError` if any handler fails.
36
+ * @param eventName Shared event name; framework-reserved names cannot be emitted by scripts.
37
+ * @param args Arguments delivered to every matching handler.
38
+ */
39
+ emit(eventName: string, ...args: any[]): Promise<void>;
41
40
 
42
- /**
43
- * Emit an event targeting listeners owned by one resource.
44
- * @param resourceName Destination running resource.
45
- * @param eventName Shared event name.
46
- * @param args Arguments delivered to matching destination handlers.
47
- */
48
- emitTo(resourceName: string, eventName: string, ...args: any[]): Promise<void>;
41
+ /**
42
+ * Emit an event targeting listeners owned by one resource.
43
+ * @param resourceName Destination running resource.
44
+ * @param eventName Shared event name.
45
+ * @param args Arguments delivered to matching destination handlers.
46
+ */
47
+ emitTo(resourceName: string, eventName: string, ...args: any[]): Promise<void>;
49
48
 
50
- /**
51
- * Register a listener in the calling resource's private event namespace.
52
- * @param eventName Private event name.
53
- * @param handler Callback invoked only by the same resource's `emitLocal` calls.
54
- */
55
- onLocal(eventName: string, handler: (...args: any[]) => void): void;
49
+ /**
50
+ * Register a listener in the calling resource's private event namespace.
51
+ * @param eventName Private event name.
52
+ * @param handler Callback invoked only by the same resource's `emitLocal` calls.
53
+ */
54
+ onLocal(eventName: string, handler: (...args: any[]) => void): void;
56
55
 
57
- /**
58
- * Emit within the calling resource's private event namespace.
59
- * @param eventName Private event name.
60
- * @param args Arguments delivered to local handlers.
61
- */
62
- emitLocal(eventName: string, ...args: any[]): Promise<void>;
56
+ /**
57
+ * Emit within the calling resource's private event namespace.
58
+ * @param eventName Private event name.
59
+ * @param args Arguments delivered to local handlers.
60
+ */
61
+ emitLocal(eventName: string, ...args: any[]): Promise<void>;
63
62
 
64
- /**
65
- * Count persistent and one-shot listeners across resources.
66
- * @param eventName Shared event name to inspect.
67
- */
68
- listenerCount(eventName: string): number;
69
- };
70
- }
63
+ /**
64
+ * Count persistent and one-shot listeners across resources.
65
+ * @param eventName Shared event name to inspect.
66
+ */
67
+ listenerCount(eventName: string): number;
68
+ };
@@ -1,48 +1,46 @@
1
- declare namespace Core {
2
- /** Mutable quaternion used to compose and apply three-dimensional rotations. */
3
- class Quaternion {
4
- /** Create a quaternion in scalar-first `(w, x, y, z)` order. */
5
- constructor(w: number, x: number, y: number, z: number);
1
+ /** Mutable quaternion used to compose and apply three-dimensional rotations. */
2
+ declare class Quaternion {
3
+ /** Create a quaternion in scalar-first `(w, x, y, z)` order. */
4
+ constructor(w: number, x: number, y: number, z: number);
6
5
 
7
- /** Mutable scalar component. */
8
- w: number;
9
- /** Mutable X imaginary component. */
10
- x: number;
11
- /** Mutable Y imaginary component. */
12
- y: number;
13
- /** Mutable Z imaginary component. */
14
- z: number;
6
+ /** Mutable scalar component. */
7
+ w: number;
8
+ /** Mutable X imaginary component. */
9
+ x: number;
10
+ /** Mutable Y imaginary component. */
11
+ y: number;
12
+ /** Mutable Z imaginary component. */
13
+ z: number;
15
14
 
16
- /** Compose this rotation with `other`, mutating this quaternion. */
17
- multiply(other: Quaternion): this;
18
- /** Normalize this quaternion in place. */
19
- normalize(): this;
20
- /** Spherically interpolate toward `target`; `t=0` keeps this rotation and `t=1` reaches it. */
21
- slerp(target: Quaternion, t: number): this;
22
- /** Return a new conjugated quaternion without modifying this one. */
23
- conjugate(): Quaternion;
24
- /** Return a new inverse rotation without modifying this quaternion. */
25
- inverse(): Quaternion;
26
- /** Compute the scalar quaternion dot product. */
27
- dot(other: Quaternion): number;
28
- /** Apply this rotation and return a new rotated vector. */
29
- rotateVector(v: Vector3): Vector3;
30
- /** Euler angles in radians (x=pitch, y=yaw, z=roll). */
31
- toEuler(): Vector3;
32
- /** Replace every component and return this quaternion for chaining. */
33
- set(w: number, x: number, y: number, z: number): this;
34
- /** Create an independent copy. */
35
- clone(): Quaternion;
36
- /** Format as `Quaternion(w, x, y, z)` for logging. */
37
- toString(): string;
38
- /** Convert to a plain component object for `JSON.stringify`. */
39
- toJSON(): { w: number; x: number; y: number; z: number };
15
+ /** Compose this rotation with `other`, mutating this quaternion. */
16
+ multiply(other: Quaternion): this;
17
+ /** Normalize this quaternion in place. */
18
+ normalize(): this;
19
+ /** Spherically interpolate toward `target`; `t=0` keeps this rotation and `t=1` reaches it. */
20
+ slerp(target: Quaternion, t: number): this;
21
+ /** Return a new conjugated quaternion without modifying this one. */
22
+ conjugate(): Quaternion;
23
+ /** Return a new inverse rotation without modifying this quaternion. */
24
+ inverse(): Quaternion;
25
+ /** Compute the scalar quaternion dot product. */
26
+ dot(other: Quaternion): number;
27
+ /** Apply this rotation and return a new rotated vector. */
28
+ rotateVector(v: Vector3): Vector3;
29
+ /** Euler angles in radians (x=pitch, y=yaw, z=roll). */
30
+ toEuler(): Vector3;
31
+ /** Replace every component and return this quaternion for chaining. */
32
+ set(w: number, x: number, y: number, z: number): this;
33
+ /** Create an independent copy. */
34
+ clone(): Quaternion;
35
+ /** Format as `Quaternion(w, x, y, z)` for logging. */
36
+ toString(): string;
37
+ /** Convert to a plain component object for `JSON.stringify`. */
38
+ toJSON(): { w: number; x: number; y: number; z: number };
40
39
 
41
- /** Create the identity rotation `Quaternion(1, 0, 0, 0)`. */
42
- static identity(): Quaternion;
43
- /** From euler angles in radians. */
44
- static fromEuler(pitch: number, yaw: number, roll: number): Quaternion;
45
- /** Create a rotation of `angle` radians around an axis normalized internally. */
46
- static fromAxisAngle(axis: Vector3, angle: number): Quaternion;
47
- }
40
+ /** Create the identity rotation `Quaternion(1, 0, 0, 0)`. */
41
+ static identity(): Quaternion;
42
+ /** From euler angles in radians. */
43
+ static fromEuler(pitch: number, yaw: number, roll: number): Quaternion;
44
+ /** Create a rotation of `angle` radians around an axis normalized internally. */
45
+ static fromAxisAngle(axis: Vector3, angle: number): Quaternion;
48
46
  }
package/core/vector2.d.ts CHANGED
@@ -1,45 +1,43 @@
1
- declare namespace Core {
2
- class Vector2 {
3
- /** Create a vector from its X and Y components. */
4
- constructor(x: number, y: number);
1
+ declare class Vector2 {
2
+ /** Create a vector from its X and Y components. */
3
+ constructor(x: number, y: number);
5
4
 
6
- /** Mutable X component. */
7
- x: number;
8
- /** Mutable Y component. */
9
- y: number;
10
- /** Euclidean magnitude of this vector. */
11
- readonly length: number;
12
- /** Squared magnitude, avoiding a square-root calculation. */
13
- readonly lengthSquared: number;
5
+ /** Mutable X component. */
6
+ x: number;
7
+ /** Mutable Y component. */
8
+ y: number;
9
+ /** Euclidean magnitude of this vector. */
10
+ readonly length: number;
11
+ /** Squared magnitude, avoiding a square-root calculation. */
12
+ readonly lengthSquared: number;
14
13
 
15
- /** Add another vector component-wise, mutating this vector. */
16
- add(other: Vector2): this;
17
- /** Subtract another vector component-wise, mutating this vector. */
18
- sub(other: Vector2): this;
19
- /** Multiply both components by a scalar, mutating this vector. */
20
- mul(scalar: number): this;
21
- /** Divide both components by a non-zero scalar, mutating this vector. */
22
- div(scalar: number): this;
23
- /** Normalize this vector in place; a zero vector remains unchanged. */
24
- normalize(): this;
25
- /** Compute the scalar dot product without changing either vector. */
26
- dot(other: Vector2): number;
27
- /** Compute Euclidean distance to another vector. */
28
- distance(other: Vector2): number;
29
- /** Interpolate toward `target`; `t=0` keeps this value and `t=1` reaches the target. */
30
- lerp(target: Vector2, t: number): this;
31
- /** Replace both components and return this vector for chaining. */
32
- set(x: number, y: number): this;
33
- /** Create an independent copy. */
34
- clone(): Vector2;
35
- /** Format as `Vector2(x, y)` for logging. */
36
- toString(): string;
37
- /** Convert to a plain component object for `JSON.stringify`. */
38
- toJSON(): { x: number; y: number };
14
+ /** Add another vector component-wise, mutating this vector. */
15
+ add(other: Vector2): this;
16
+ /** Subtract another vector component-wise, mutating this vector. */
17
+ sub(other: Vector2): this;
18
+ /** Multiply both components by a scalar, mutating this vector. */
19
+ mul(scalar: number): this;
20
+ /** Divide both components by a non-zero scalar, mutating this vector. */
21
+ div(scalar: number): this;
22
+ /** Normalize this vector in place; a zero vector remains unchanged. */
23
+ normalize(): this;
24
+ /** Compute the scalar dot product without changing either vector. */
25
+ dot(other: Vector2): number;
26
+ /** Compute Euclidean distance to another vector. */
27
+ distance(other: Vector2): number;
28
+ /** Interpolate toward `target`; `t=0` keeps this value and `t=1` reaches the target. */
29
+ lerp(target: Vector2, t: number): this;
30
+ /** Replace both components and return this vector for chaining. */
31
+ set(x: number, y: number): this;
32
+ /** Create an independent copy. */
33
+ clone(): Vector2;
34
+ /** Format as `Vector2(x, y)` for logging. */
35
+ toString(): string;
36
+ /** Convert to a plain component object for `JSON.stringify`. */
37
+ toJSON(): { x: number; y: number };
39
38
 
40
- /** Create `Vector2(0, 0)`. */
41
- static zero(): Vector2;
42
- /** Create `Vector2(1, 1)`. */
43
- static one(): Vector2;
44
- }
39
+ /** Create `Vector2(0, 0)`. */
40
+ static zero(): Vector2;
41
+ /** Create `Vector2(1, 1)`. */
42
+ static one(): Vector2;
45
43
  }
package/core/vector3.d.ts CHANGED
@@ -1,55 +1,53 @@
1
- declare namespace Core {
2
- class Vector3 {
3
- /** Create a vector from its X, Y, and Z components. */
4
- constructor(x: number, y: number, z: number);
1
+ declare class Vector3 {
2
+ /** Create a vector from its X, Y, and Z components. */
3
+ constructor(x: number, y: number, z: number);
5
4
 
6
- /** Mutable X component. */
7
- x: number;
8
- /** Mutable Y component. */
9
- y: number;
10
- /** Mutable Z component. */
11
- z: number;
12
- /** Euclidean magnitude of this vector. */
13
- readonly length: number;
14
- /** Squared magnitude, avoiding a square-root calculation. */
15
- readonly lengthSquared: number;
5
+ /** Mutable X component. */
6
+ x: number;
7
+ /** Mutable Y component. */
8
+ y: number;
9
+ /** Mutable Z component. */
10
+ z: number;
11
+ /** Euclidean magnitude of this vector. */
12
+ readonly length: number;
13
+ /** Squared magnitude, avoiding a square-root calculation. */
14
+ readonly lengthSquared: number;
16
15
 
17
- /** Add another vector component-wise, mutating this vector. */
18
- add(other: Vector3): this;
19
- /** Subtract another vector component-wise, mutating this vector. */
20
- sub(other: Vector3): this;
21
- /** Multiply every component by a scalar, mutating this vector. */
22
- mul(scalar: number): this;
23
- /** Divide every component by a non-zero scalar, mutating this vector. */
24
- div(scalar: number): this;
25
- /** Normalize this vector in place; a zero vector remains unchanged. */
26
- normalize(): this;
27
- /** Compute the scalar dot product without changing either vector. */
28
- dot(other: Vector3): number;
29
- /** Replace this vector with its cross product against `other`. */
30
- cross(other: Vector3): this;
31
- /** Compute Euclidean distance to another vector. */
32
- distance(other: Vector3): number;
33
- /** Interpolate toward `target`; `t=0` keeps this value and `t=1` reaches the target. */
34
- lerp(target: Vector3, t: number): this;
35
- /** Replace all components and return this vector for chaining. */
36
- set(x: number, y: number, z: number): this;
37
- /** Create an independent copy. */
38
- clone(): Vector3;
39
- /** Format as `Vector3(x, y, z)` for logging. */
40
- toString(): string;
41
- /** Convert to a plain component object for `JSON.stringify`. */
42
- toJSON(): { x: number; y: number; z: number };
16
+ /** Add another vector component-wise, mutating this vector. */
17
+ add(other: Vector3): this;
18
+ /** Subtract another vector component-wise, mutating this vector. */
19
+ sub(other: Vector3): this;
20
+ /** Multiply every component by a scalar, mutating this vector. */
21
+ mul(scalar: number): this;
22
+ /** Divide every component by a non-zero scalar, mutating this vector. */
23
+ div(scalar: number): this;
24
+ /** Normalize this vector in place; a zero vector remains unchanged. */
25
+ normalize(): this;
26
+ /** Compute the scalar dot product without changing either vector. */
27
+ dot(other: Vector3): number;
28
+ /** Replace this vector with its cross product against `other`. */
29
+ cross(other: Vector3): this;
30
+ /** Compute Euclidean distance to another vector. */
31
+ distance(other: Vector3): number;
32
+ /** Interpolate toward `target`; `t=0` keeps this value and `t=1` reaches the target. */
33
+ lerp(target: Vector3, t: number): this;
34
+ /** Replace all components and return this vector for chaining. */
35
+ set(x: number, y: number, z: number): this;
36
+ /** Create an independent copy. */
37
+ clone(): Vector3;
38
+ /** Format as `Vector3(x, y, z)` for logging. */
39
+ toString(): string;
40
+ /** Convert to a plain component object for `JSON.stringify`. */
41
+ toJSON(): { x: number; y: number; z: number };
43
42
 
44
- /** Create `Vector3(0, 0, 0)`. */
45
- static zero(): Vector3;
46
- /** Create `Vector3(1, 1, 1)`. */
47
- static one(): Vector3;
48
- /** Create the framework's positive-Y unit direction. */
49
- static up(): Vector3;
50
- /** Create the framework's positive-Z unit direction. */
51
- static forward(): Vector3;
52
- /** Create the framework's positive-X unit direction. */
53
- static right(): Vector3;
54
- }
43
+ /** Create `Vector3(0, 0, 0)`. */
44
+ static zero(): Vector3;
45
+ /** Create `Vector3(1, 1, 1)`. */
46
+ static one(): Vector3;
47
+ /** Create the framework's positive-Y unit direction. */
48
+ static up(): Vector3;
49
+ /** Create the framework's positive-Z unit direction. */
50
+ static forward(): Vector3;
51
+ /** Create the framework's positive-X unit direction. */
52
+ static right(): Vector3;
55
53
  }
package/core/vector4.d.ts CHANGED
@@ -1,49 +1,47 @@
1
- declare namespace Core {
2
- class Vector4 {
3
- /** Create a vector from its X, Y, Z, and W components. */
4
- constructor(x: number, y: number, z: number, w: number);
1
+ declare class Vector4 {
2
+ /** Create a vector from its X, Y, Z, and W components. */
3
+ constructor(x: number, y: number, z: number, w: number);
5
4
 
6
- /** Mutable X component. */
7
- x: number;
8
- /** Mutable Y component. */
9
- y: number;
10
- /** Mutable Z component. */
11
- z: number;
12
- /** Mutable W component. */
13
- w: number;
14
- /** Euclidean magnitude of this vector. */
15
- readonly length: number;
16
- /** Squared magnitude, avoiding a square-root calculation. */
17
- readonly lengthSquared: number;
5
+ /** Mutable X component. */
6
+ x: number;
7
+ /** Mutable Y component. */
8
+ y: number;
9
+ /** Mutable Z component. */
10
+ z: number;
11
+ /** Mutable W component. */
12
+ w: number;
13
+ /** Euclidean magnitude of this vector. */
14
+ readonly length: number;
15
+ /** Squared magnitude, avoiding a square-root calculation. */
16
+ readonly lengthSquared: number;
18
17
 
19
- /** Add another vector component-wise, mutating this vector. */
20
- add(other: Vector4): this;
21
- /** Subtract another vector component-wise, mutating this vector. */
22
- sub(other: Vector4): this;
23
- /** Multiply every component by a scalar, mutating this vector. */
24
- mul(scalar: number): this;
25
- /** Divide every component by a non-zero scalar, mutating this vector. */
26
- div(scalar: number): this;
27
- /** Normalize this vector in place; a zero vector remains unchanged. */
28
- normalize(): this;
29
- /** Compute the scalar dot product without changing either vector. */
30
- dot(other: Vector4): number;
31
- /** Compute Euclidean distance to another vector. */
32
- distance(other: Vector4): number;
33
- /** Interpolate toward `target`; `t=0` keeps this value and `t=1` reaches the target. */
34
- lerp(target: Vector4, t: number): this;
35
- /** Replace all components and return this vector for chaining. */
36
- set(x: number, y: number, z: number, w: number): this;
37
- /** Create an independent copy. */
38
- clone(): Vector4;
39
- /** Format as `Vector4(x, y, z, w)` for logging. */
40
- toString(): string;
41
- /** Convert to a plain component object for `JSON.stringify`. */
42
- toJSON(): { x: number; y: number; z: number; w: number };
18
+ /** Add another vector component-wise, mutating this vector. */
19
+ add(other: Vector4): this;
20
+ /** Subtract another vector component-wise, mutating this vector. */
21
+ sub(other: Vector4): this;
22
+ /** Multiply every component by a scalar, mutating this vector. */
23
+ mul(scalar: number): this;
24
+ /** Divide every component by a non-zero scalar, mutating this vector. */
25
+ div(scalar: number): this;
26
+ /** Normalize this vector in place; a zero vector remains unchanged. */
27
+ normalize(): this;
28
+ /** Compute the scalar dot product without changing either vector. */
29
+ dot(other: Vector4): number;
30
+ /** Compute Euclidean distance to another vector. */
31
+ distance(other: Vector4): number;
32
+ /** Interpolate toward `target`; `t=0` keeps this value and `t=1` reaches the target. */
33
+ lerp(target: Vector4, t: number): this;
34
+ /** Replace all components and return this vector for chaining. */
35
+ set(x: number, y: number, z: number, w: number): this;
36
+ /** Create an independent copy. */
37
+ clone(): Vector4;
38
+ /** Format as `Vector4(x, y, z, w)` for logging. */
39
+ toString(): string;
40
+ /** Convert to a plain component object for `JSON.stringify`. */
41
+ toJSON(): { x: number; y: number; z: number; w: number };
43
42
 
44
- /** Create `Vector4(0, 0, 0, 0)`. */
45
- static zero(): Vector4;
46
- /** Create `Vector4(1, 1, 1, 1)`. */
47
- static one(): Vector4;
48
- }
43
+ /** Create `Vector4(0, 0, 0, 0)`. */
44
+ static zero(): Vector4;
45
+ /** Create `Vector4(1, 1, 1, 1)`. */
46
+ static one(): Vector4;
49
47
  }
@@ -17,6 +17,9 @@
17
17
  * - Numpad `numpad0`–`numpad9` (aliases `num0`–`num9`)
18
18
  * - Mouse `mouse1` (left) `mouse2` (right) `mouse3` (middle) `mouse4` `mouse5`
19
19
  *
20
+ * Letters and digits identify physical positions on a US keyboard. Use
21
+ * `getLabel` to show the corresponding label in the player's current layout.
22
+ *
20
23
  * @example
21
24
  * // Toggle a HUD on key-down:
22
25
  * Key.bind("f6", "down", () => toggleHud());
@@ -52,4 +55,17 @@ declare const Key: {
52
55
  * game window is in the background (same gate as bind dispatch).
53
56
  */
54
57
  isDown(key: string): boolean;
58
+
59
+ /**
60
+ * Display label for a physical key using the current keyboard layout.
61
+ * For example, `getLabel("y")` returns `"Z"` on German QWERTZ.
62
+ * Works while menus/web views own input and without registering a binding.
63
+ * Query again when refreshing a prompt so layout changes are reflected.
64
+ * Labels are display text; keep using the original key name for bindings.
65
+ * @returns Uppercase printable text, or an English name such as `"Enter"`
66
+ * or `"Mouse 1"`. Falls back to the uppercase canonical key name if the
67
+ * layout cannot translate it. Ignores held modifiers and Caps Lock.
68
+ * @throws If the key is unknown or the argument is not a string.
69
+ */
70
+ getLabel(key: string): string;
55
71
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mafiahub/types",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "TypeScript type definitions for the MafiaHub Framework scripting API",
5
5
  "types": "index.d.ts",
6
6
  "files": [