diff --git a/types/gl-vec3/angle.d.ts b/types/gl-vec3/angle.d.ts new file mode 100644 index 0000000000..366b1cb4b7 --- /dev/null +++ b/types/gl-vec3/angle.d.ts @@ -0,0 +1,6 @@ +/** + * Get the angle between two 3D vectors. + */ +declare function angle(a: number[], b: number[]): number; + +export default angle; diff --git a/types/gl-vec3/dist.d.ts b/types/gl-vec3/dist.d.ts index 7e3c220300..bb4df7b83f 100644 --- a/types/gl-vec3/dist.d.ts +++ b/types/gl-vec3/dist.d.ts @@ -1,6 +1,6 @@ /** * Calculates the euclidian distance between two number's. Aliased as dist. */ -declare function dist(a: number[], b: number[]): number[]; +declare function dist(a: number[], b: number[]): number; export default dist; diff --git a/types/gl-vec3/dot.d.ts b/types/gl-vec3/dot.d.ts index 38d473e99d..efe2caf624 100644 --- a/types/gl-vec3/dot.d.ts +++ b/types/gl-vec3/dot.d.ts @@ -1,6 +1,6 @@ /** * Calculates the dot product of two number's. */ -declare function dot(a: number[], b: number[]): number[]; +declare function dot(a: number[], b: number[]): number; export default dot; diff --git a/types/gl-vec3/equals.d.ts b/types/gl-vec3/equals.d.ts new file mode 100644 index 0000000000..91aeaa3bbd --- /dev/null +++ b/types/gl-vec3/equals.d.ts @@ -0,0 +1,6 @@ +/** + * Returns whether or not the vectors have approximately the same elements in the same position.. + */ +declare function equals(a: number[], b: number[]): boolean; + +export default equals; diff --git a/types/gl-vec3/exactEquals.d.ts b/types/gl-vec3/exactEquals.d.ts new file mode 100644 index 0000000000..c68b328f69 --- /dev/null +++ b/types/gl-vec3/exactEquals.d.ts @@ -0,0 +1,6 @@ +/** + * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===). + */ +declare function exactEquals(a: number[], b: number[]): boolean; + +export default exactEquals; diff --git a/types/gl-vec3/gl-vec3-tests.ts b/types/gl-vec3/gl-vec3-tests.ts index e21628dc5e..67be9102a9 100644 --- a/types/gl-vec3/gl-vec3-tests.ts +++ b/types/gl-vec3/gl-vec3-tests.ts @@ -1,11 +1,14 @@ import * as GlVec3 from "gl-vec3"; import GLVec3Add from "gl-vec3/add"; +import GLVec3Angle from "gl-vec3/angle"; import GLVec3Clone from "gl-vec3/clone"; import GLVec3Copy from "gl-vec3/copy"; import GLVec3Create from "gl-vec3/create"; import GLVec3Dist from "gl-vec3/dist"; import GLVec3Div from "gl-vec3/div"; import GLVec3Dot from "gl-vec3/dot"; +import GLVec3Equals from "gl-vec3/equals"; +import GLVec3exactEquals from "gl-vec3/exactEquals"; import GLVec3forEach from "gl-vec3/forEach"; import GLVec3fromValues from "gl-vec3/fromValues"; import GLVec3Inverse from "gl-vec3/inverse"; @@ -30,6 +33,9 @@ import GLVec3TransformQuat from "gl-vec3/transformQuat"; GlVec3.add([1, 2, 3], [1, 2, 3], [1, 2, 3]); GLVec3Add([1, 2, 3], [1, 2, 3], [1, 2, 3]); +GlVec3.angle([1, 2, 3], [1, 2, 3]); +GLVec3Angle([1, 2, 3], [1, 2, 3]); + GlVec3.clone([1, 2, 3]); GLVec3Clone([1, 2, 3]); @@ -54,6 +60,12 @@ GLVec3forEach([1, 2, 3], 5, 6, 1, () => [3], {}); GlVec3.fromValues(1, 2, 3); GLVec3fromValues(1, 2, 3); +GlVec3.equals([1, 2, 3], [1, 2, 3]); +GLVec3Equals([1, 2, 3], [1, 2, 3]); + +GlVec3.exactEquals([1, 2, 3], [1, 2, 3]); +GLVec3exactEquals([1, 2, 3], [1, 2, 3]); + GlVec3.inverse([1, 2, 3], [1, 2, 3]); GLVec3Inverse([1, 2, 3], [1, 2, 3]); diff --git a/types/gl-vec3/index.d.ts b/types/gl-vec3/index.d.ts index 74188db27a..0d90cfe981 100644 --- a/types/gl-vec3/index.d.ts +++ b/types/gl-vec3/index.d.ts @@ -12,7 +12,7 @@ export function add(out: number[], a: number[], b: number[]): number[]; /** * Get the angle between two 3D vectors. */ -export function angle(a: number[], b: number[]): number[]; +export function angle(a: number[], b: number[]): number; /** * Creates a new number initialized with values from an existing vector. @@ -42,7 +42,7 @@ export function cross(out: number[], a: number[], b: number[]): number[]; /** * Calculates the euclidian distance between two number's. Aliased as dist. */ -export function dist(a: number[], b: number[]): number[]; +export function dist(a: number[], b: number[]): number; /** * Divides two number's. Aliased as div. @@ -52,17 +52,17 @@ export function div(out: number[], a: number[], b: number[]): number[]; /** * Calculates the dot product of two number's. */ -export function dot(a: number[], b: number[]): number[]; +export function dot(a: number[], b: number[]): number; /** * Returns whether or not the vectors have approximately the same elements in the same position.. */ -export function equals(a: number[], b: number[]): number[]; +export function equals(a: number[], b: number[]): boolean; /** * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===). */ -export function exactEquals(a: number[], b: number[]): number[]; +export function exactEquals(a: number[], b: number[]): boolean; /** * Math.floor the components of a number. @@ -87,7 +87,7 @@ export function inverse(out: number[], a: number[]): number[]; /** * Calculates the length of a number. Aliased as len. */ -export function len(a: number[]): number[]; +export function len(a: number[]): number; /** * Performs a linear interpolation between two number]'s. diff --git a/types/gl-vec3/len.d.ts b/types/gl-vec3/len.d.ts index e049faaf2c..0bd0473614 100644 --- a/types/gl-vec3/len.d.ts +++ b/types/gl-vec3/len.d.ts @@ -1,6 +1,6 @@ /** * Calculates the length of a number. Aliased as len. */ -declare function len(a: number[]): number[]; +declare function len(a: number[]): number; export default len; diff --git a/types/gl-vec3/tsconfig.json b/types/gl-vec3/tsconfig.json index 39aefd13cf..5382911c1a 100644 --- a/types/gl-vec3/tsconfig.json +++ b/types/gl-vec3/tsconfig.json @@ -20,6 +20,7 @@ }, "files": [ "index.d.ts", + "angle.d.ts", "add.d.ts", "clone.d.ts", "copy.d.ts", @@ -27,6 +28,8 @@ "dist.d.ts", "div.d.ts", "dot.d.ts", + "equals.d.ts", + "exactEquals.d.ts", "forEach.d.ts", "fromValues.d.ts", "inverse.d.ts",