From 5bba6466dce653df3f192e4a835f59a03c3e4c3f Mon Sep 17 00:00:00 2001 From: limzykenneth Date: Sat, 18 Nov 2023 15:18:39 +0000 Subject: [PATCH] Add names to class properties that JSDoc couldn't infer --- src/core/p5.Element.js | 4 ++++ src/image/p5.Image.js | 7 ++++++- src/io/p5.Table.js | 8 ++++++-- src/math/p5.Vector.js | 12 +++++++++--- src/typography/p5.Font.js | 1 + 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/core/p5.Element.js b/src/core/p5.Element.js index 72bb0b7d7d..6ea0acffc5 100644 --- a/src/core/p5.Element.js +++ b/src/core/p5.Element.js @@ -77,23 +77,27 @@ p5.Element = class { * * * @property elt + * @name elt * @readOnly */ this.elt = elt; /** * @private * @type {p5.Element} + * @name _pInst */ this._pInst = this._pixelsState = pInst; this._events = {}; /** * @type {Number} * @property width + * @name width */ this.width = this.elt.offsetWidth; /** * @type {Number} * @property height + * @name height */ this.height = this.elt.offsetHeight; } diff --git a/src/image/p5.Image.js b/src/image/p5.Image.js index 4bc3f100c8..ed14116070 100644 --- a/src/image/p5.Image.js +++ b/src/image/p5.Image.js @@ -88,7 +88,9 @@ p5.Image = class { constructor(width, height) { /** * Image width. + * @type {Number} * @property {Number} width + * @name width * @readOnly * @example *
@@ -114,7 +116,9 @@ p5.Image = class { this.width = width; /** * Image height. - * @property {Number} height + * @type {Number} + * @property height + * @name height * @readOnly * @example *
@@ -171,6 +175,7 @@ p5.Image = class { * called after any changes are made. * * @property {Number[]} pixels + * @name pixels * @example *
* diff --git a/src/io/p5.Table.js b/src/io/p5.Table.js index 4319af58bc..93c4cf35b8 100644 --- a/src/io/p5.Table.js +++ b/src/io/p5.Table.js @@ -43,7 +43,9 @@ p5.Table = class { /** * An array containing the names of the columns in the table, if the "header" the table is * loaded with the "header" parameter. - * @property columns {String[]} + * @type {String[]} + * @property columns + * @name columns * @example *
* @@ -78,7 +80,9 @@ p5.Table = class { /** * An array containing the p5.TableRow objects that make up the * rows of the table. The same result as calling getRows() - * @property rows {p5.TableRow[]} + * @type {p5.TableRow[]} + * @property rows + * @name rows */ this.rows = []; } diff --git a/src/math/p5.Vector.js b/src/math/p5.Vector.js index 8becd7076a..2ccb5fc4f5 100644 --- a/src/math/p5.Vector.js +++ b/src/math/p5.Vector.js @@ -112,17 +112,23 @@ p5.Vector = class { } /** * The x component of the vector - * @property x {Number} + * @type {Number} + * @property x + * @name x */ this.x = x; /** * The y component of the vector - * @property y {Number} + * @type {Number} + * @property y + * @name y */ this.y = y; /** * The z component of the vector - * @property z {Number} + * @type {Number} + * @property z + * @name z */ this.z = z; } diff --git a/src/typography/p5.Font.js b/src/typography/p5.Font.js index c827964a82..15facd22c4 100644 --- a/src/typography/p5.Font.js +++ b/src/typography/p5.Font.js @@ -47,6 +47,7 @@ p5.Font = class { * opentype.js * font object. * @property font + * @name font */ this.font = undefined; }