From 735fa844798ffe1165ba3a846324bd3947ec4d53 Mon Sep 17 00:00:00 2001 From: Jack T Date: Sun, 1 Dec 2024 17:01:18 -0800 Subject: [PATCH 1/3] Initial commit --- include/roblox.d.ts | 59 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/include/roblox.d.ts b/include/roblox.d.ts index 9ca666943..f32e65d9b 100644 --- a/include/roblox.d.ts +++ b/include/roblox.d.ts @@ -2850,6 +2850,65 @@ declare namespace buffer { function fill(b: buffer, offset: number, value: number, count?: number): void; } +interface vector { + /** + * **DO NOT USE!** + * + * This field exists to force TypeScript to recognize this as a nominal type + * @hidden + * @deprecated + */ + readonly _nominal_vector: unique symbol; +} + +declare namespace vector { + /** Constant vector with all components set to zero. */ + const zero: vector; + + /** Constant vector with all components set to one. */ + const one: vector; + + /** Creates a new vector with the given component values. */ + function create(x: number, y: number, z: number): vector; + + /** Calculates the magnitude of a given vector. */ + function magnitude(vec: vector): number; + + /** Computes the normalized version (unit vector) of a given vector. */ + function normalize(vec: vector): vector; + + /** Computes the cross product of two vectors. */ + function cross(vec1: vector, vec2: vector): vector; + + /** Computes the dot product of two vectors. */ + function dot(vec1: vector, vec2: vector): number; + + /** Computes the angle between two vectors in radians. The axis, if specified, is used to determine the sign of the angle. */ + function angle(vec1: vector, vec2: vector, axis?: vector): number; + + /** Applies `math.floor` to every component of the input vector. */ + function floor(vec: vector): vector; + + /** Applies `math.ceil` to every component of the input vector. */ + function ceil(vec: vector): vector; + + /** Applies `math.abs` to every component of the input vector. */ + function abs(vec: vector): vector; + + /** Applies `math.sign` to every component of the input vector. */ + function sign(vec: vector): vector; + + /** Applies `math.clamp` to every component of the input vector. */ + function clamp(vec: vector, min: vector, max: vector): vector; + + /** Applies `math.max` to the corresponding components of the input vectors. Equivalent to `vector.create(math.max((...).x), math.max((...).y), math.max((...).z))`. */ + function max(...vecs: Array): vector; + + /** Applies `math.min` to the corresponding components of the input vectors. Equivalent to `vector.create(math.min((...).x), math.min((...).y), math.min((...).z))`. */ + function min(...vecs: Array): vector; +} + + interface GettableCores { AvatarContextMenuEnabled: boolean; PointsNotificationsActive: boolean; From cadee3982646b29070d9eeacdb559eed9eea42ff Mon Sep 17 00:00:00 2001 From: Jack T Date: Sun, 1 Dec 2024 17:03:20 -0800 Subject: [PATCH 2/3] Try fix lint --- include/roblox.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/include/roblox.d.ts b/include/roblox.d.ts index f32e65d9b..b57a24c1c 100644 --- a/include/roblox.d.ts +++ b/include/roblox.d.ts @@ -2908,7 +2908,6 @@ declare namespace vector { function min(...vecs: Array): vector; } - interface GettableCores { AvatarContextMenuEnabled: boolean; PointsNotificationsActive: boolean; From 5f1e013d9d31f1262d6b13c8b4cb20d6a3aa0aa5 Mon Sep 17 00:00:00 2001 From: Jack T Date: Tue, 28 Jan 2025 11:19:51 -0800 Subject: [PATCH 3/3] Whoops, add the x/y/z components as readonly --- include/roblox.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/roblox.d.ts b/include/roblox.d.ts index b57a24c1c..df7331cbb 100644 --- a/include/roblox.d.ts +++ b/include/roblox.d.ts @@ -2859,6 +2859,10 @@ interface vector { * @deprecated */ readonly _nominal_vector: unique symbol; + + readonly x: number; + readonly y: number; + readonly z: number; } declare namespace vector {