Skip to content

Commit

Permalink
set public and private annotations before parameters and return state…
Browse files Browse the repository at this point in the history
…ment in jsDoc (#129)
  • Loading branch information
veillette committed Jul 29, 2021
1 parent c3ae621 commit 0f9ba7d
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 16 deletions.
1 change: 0 additions & 1 deletion js/common/model/LightRay.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ class LightRay {
* Processes all the rays (virtual and real) into shape lines.
* @private
* @param {number} distanceTraveled
*
*/
raysToShape( distanceTraveled ) {

Expand Down
10 changes: 4 additions & 6 deletions js/common/model/Optic.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class Optic {
* The returned object contains an outline shape, representing the reflecting coating,
* and a fill shape representing the base backing of the mirror.
* The shapes are drawn using quadratic Bezier curves.
*
* @public
* @param {number} radius - radius of curvature at the center of the mirror
* @param {number} diameter - vertical height of the mirror
* @param {Optic.Curve} curve
Expand All @@ -122,7 +122,6 @@ class Optic {
backShape: null,
middleShape: null
}
* @public
*/
static getMirrorShapes( radius, diameter, curve, options ) {

Expand Down Expand Up @@ -444,8 +443,8 @@ class Optic {

/**
* Returns a normalized value (with a max of 1) for the diameter
* @param {number} diameter - diameter
* @public
* @param {number} diameter
* @returns {number}
*/
getNormalizedDiameter( diameter ) {
Expand Down Expand Up @@ -476,8 +475,8 @@ class Optic {

/**
* Returns a normalized value (between 0 and 1) for the index of refraction
* @param {number} index - index of refraction
* @public
* @param {number} index - index of refraction
* @returns {number}
*/
getNormalizedIndex( index ) {
Expand Down Expand Up @@ -585,7 +584,7 @@ class Optic {
* The front shape is the left facing contour of the optic. This can be used for ray hit testing
* The back shape is the right facing contour of the optic. back shape is null for mirror
* The middle shape is the imaginary vertical line that splits a lens into two halves. Null for mirror.
*
* @public
* @param {number} radius - radius of curvature at the center of the mirror
* @param {number} diameter - vertical height of the mirror
* @param {Optic.Curve} curve
Expand All @@ -597,7 +596,6 @@ class Optic {
backShape: Shape|null,
middleShape: Shape|null
}
* @public
*/
getShapes( radius, diameter, curve, options ) {
if ( this.isLens() ) {
Expand Down
1 change: 0 additions & 1 deletion js/common/model/Ray.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class Ray extends Ray2 {

/**
* Determines if the point is along the ray direction
*
* @public
* @param {Vector2} point
* @param {number} epsilon - tolerance value
Expand Down
4 changes: 2 additions & 2 deletions js/common/model/SourceObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,18 @@ class SourceObject {

/**
* Returns the position of the source
* @returns {Vector2}
* @public
* @returns {Vector2}
*/
getPosition() {
return this.firstPositionProperty.value;
}

/**
* Sets the second source point
* @public
* @param {Property.<Representation>} representationProperty
* @param {Vector2} position
* @public
*/
setSecondPoint( representationProperty, position ) {
if ( representationProperty.value.isObject ) {
Expand Down
2 changes: 1 addition & 1 deletion js/common/model/Target.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ class Target {

/**
* Returns the position of the target point
* @public
* @param {Vector2} objectPosition
* @param {Vector2} opticPosition
* @param {number} focalLength
* @returns {Vector2}
* @public
*/
getPosition( objectPosition, opticPosition, focalLength ) {

Expand Down
5 changes: 2 additions & 3 deletions js/common/view/CurveControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,12 @@ class CurveControl extends RectangularRadioButtonGroup {
}

/**
* Creates centered icon representation of convex/concave, lens/mirror.
*
* Creates a centered icon representation of convex/concave, lens/mirror.
* @public
* @param {Optic.Curve} curve - the curve can be convex or concave
* @param {Optic.Type} type - the type can be lens or mirror
* @param {Object} [options] - see options below
* @returns {Node}
* @public
*/
static createIconNode( curve, type, options ) {

Expand Down
1 change: 1 addition & 0 deletions js/common/view/FocalPointNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class FocalPointNode extends PlusNode {
}

/**
* Returns an icon for the focal point
* @public
* @param {Object} [options]
* @returns {PlusNode}
Expand Down
2 changes: 1 addition & 1 deletion js/common/view/GeometricOpticsRulerNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ class GeometricOpticsRulerNode extends RulerNode {

/**
* Forward an event from the toolbox to start dragging this node
* @param {SceneryEvent} event
* @public
* @param {SceneryEvent} event
*/
startDrag( event ) {

Expand Down
1 change: 0 additions & 1 deletion js/common/view/ToolboxPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class ToolboxPanel extends Panel {

/**
* Returns a small ruler icon
*
* @private
* @param {boolean} isVertical - is the ruler icon along the vertical axis
* @returns {RulerNode} rulerIconNode
Expand Down

0 comments on commit 0f9ba7d

Please sign in to comment.