Skip to content

Commit

Permalink
Add names to class properties that JSDoc couldn't infer
Browse files Browse the repository at this point in the history
  • Loading branch information
limzykenneth committed Nov 18, 2023
1 parent 508b914 commit 5bba646
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/core/p5.Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,27 @@ p5.Element = class {
* </div>
*
* @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;
}
Expand Down
7 changes: 6 additions & 1 deletion src/image/p5.Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ p5.Image = class {
constructor(width, height) {
/**
* Image width.
* @type {Number}
* @property {Number} width
* @name width
* @readOnly
* @example
* <div>
Expand All @@ -114,7 +116,9 @@ p5.Image = class {
this.width = width;
/**
* Image height.
* @property {Number} height
* @type {Number}
* @property height
* @name height
* @readOnly
* @example
* <div>
Expand Down Expand Up @@ -171,6 +175,7 @@ p5.Image = class {
* called after any changes are made.
*
* @property {Number[]} pixels
* @name pixels
* @example
* <div>
* <code>
Expand Down
8 changes: 6 additions & 2 deletions src/io/p5.Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
* <div class="norender">
* <code>
Expand Down Expand Up @@ -78,7 +80,9 @@ p5.Table = class {
/**
* An array containing the <a href="#/p5.Table">p5.TableRow</a> objects that make up the
* rows of the table. The same result as calling <a href="#/p5/getRows">getRows()</a>
* @property rows {p5.TableRow[]}
* @type {p5.TableRow[]}
* @property rows
* @name rows
*/
this.rows = [];
}
Expand Down
12 changes: 9 additions & 3 deletions src/math/p5.Vector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions src/typography/p5.Font.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ p5.Font = class {
* <a href="https://opentype.js.org/" target="_blank">opentype.js</a>
* font object.
* @property font
* @name font
*/
this.font = undefined;
}
Expand Down

0 comments on commit 5bba646

Please sign in to comment.