From f0b92cd202d345d3494fc3d4885aa096fc82b8f0 Mon Sep 17 00:00:00 2001 From: Thorn Walli Date: Sun, 3 Aug 2025 19:07:32 +0200 Subject: [PATCH 1/2] fix(types): added more missing type declarations --- src/vector.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vector.js b/src/vector.js index 9f337134..17a7b988 100644 --- a/src/vector.js +++ b/src/vector.js @@ -306,6 +306,9 @@ export class Vector extends AVector { return operatorCalc(alg, this); } + /** + * @returns {Vector & number} + */ clone() { return new Vector(this.x, this.y, this.z); } @@ -319,11 +322,18 @@ export class Victor extends AVector { return new Vector(this.x, this.y, this.z); } + /** + * @returns {Vector & number} + */ clone() { return this; } } +/** + * @param {() => number} alg + * @returns {Vector & number} + */ export function calc(alg) { return operatorCalc(alg); } From 97e7d65e52bc90dcd46b4621f9f3ce670ed8350f Mon Sep 17 00:00:00 2001 From: Thorn Walli Date: Sun, 3 Aug 2025 19:12:37 +0200 Subject: [PATCH 2/2] fix(types): more definitions --- src/point.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/point.js b/src/point.js index f5f4557f..c71e17c2 100644 --- a/src/point.js +++ b/src/point.js @@ -208,10 +208,17 @@ export class Point extends APoint { return this[AXES][Y]; } + /** + * @param {() => number} alg + * @returns {Point & number} + */ calc(alg) { return operatorCalc(alg, this); } + /** + * @returns {Point & number} + */ clone() { return new Point(this.x, this.y); }