From f69c46dd20d95b5445b61f5e491aa3b9c6722969 Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Tue, 21 Sep 2021 14:33:10 -0600 Subject: [PATCH] add type expressions, https://github.com/phetsims/fourier-making-waves/issues/176 --- js/waveGame/model/AmplitudesGenerator.js | 6 +++--- js/waveGame/model/WaveGameLevel.js | 8 ++++---- js/waveGame/model/WaveGameSumChart.js | 4 +++- js/waveGame/view/PointsAwardedNode.js | 2 +- js/waveGame/view/WaveGameLevelNode.js | 12 ++++++------ js/waveGame/view/WaveGameLevelSelectionButton.js | 2 +- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/js/waveGame/model/AmplitudesGenerator.js b/js/waveGame/model/AmplitudesGenerator.js index cb8ed3d3..c5372814 100644 --- a/js/waveGame/model/AmplitudesGenerator.js +++ b/js/waveGame/model/AmplitudesGenerator.js @@ -33,9 +33,9 @@ class AmplitudesGenerator { }, options ); // @private - this.numberOfHarmonics = options.numberOfHarmonics; - this.maxAmplitude = options.maxAmplitude; - this.getNumberOfNonZeroHarmonics = options.getNumberOfNonZeroHarmonics; + this.numberOfHarmonics = options.numberOfHarmonics; // {number} + this.maxAmplitude = options.maxAmplitude; // {number} + this.getNumberOfNonZeroHarmonics = options.getNumberOfNonZeroHarmonics; // {function():number} } /** diff --git a/js/waveGame/model/WaveGameLevel.js b/js/waveGame/model/WaveGameLevel.js index cf068320..30df7805 100644 --- a/js/waveGame/model/WaveGameLevel.js +++ b/js/waveGame/model/WaveGameLevel.js @@ -90,12 +90,12 @@ class WaveGameLevel extends PhetioObject { super( config ); // @public (read-only) - this.levelNumber = levelNumber; - this.statusBarMessage = config.statusBarMessage; - this.infoDialogDescription = config.infoDialogDescription; + this.levelNumber = levelNumber; // {number} + this.statusBarMessage = config.statusBarMessage; // {string} + this.infoDialogDescription = config.infoDialogDescription; // {string} // @private - this.defaultNumberOfAmplitudeControls = config.defaultNumberOfAmplitudeControls; + this.defaultNumberOfAmplitudeControls = config.defaultNumberOfAmplitudeControls; // {number} // @public The score is the total number of points that have been awarded for this level. this.scoreProperty = new NumberProperty( 0, { diff --git a/js/waveGame/model/WaveGameSumChart.js b/js/waveGame/model/WaveGameSumChart.js index 1009d1a2..31966ef0 100644 --- a/js/waveGame/model/WaveGameSumChart.js +++ b/js/waveGame/model/WaveGameSumChart.js @@ -58,9 +58,11 @@ class WaveGameSumChart extends SumChart { // @public (read-only) this.guessSeries = guessSeries; + // {Property.} const createGuessDataSet = () => guessSeries.createSumDataSet( xAxisDescription, domain, seriesType, t ); - // @public Data set that displays the waveform for the user's guess. Points are ordered by increasing x value. + // @public {Property.} + // Data set that displays the waveform for the user's guess. Points are ordered by increasing x value. this.guessDataSetProperty = new Property( createGuessDataSet(), { isValidValue: array => Array.isArray( array ) && _.every( array, element => element instanceof Vector2 ) } ); diff --git a/js/waveGame/view/PointsAwardedNode.js b/js/waveGame/view/PointsAwardedNode.js index 23c3839e..4a878d8a 100644 --- a/js/waveGame/view/PointsAwardedNode.js +++ b/js/waveGame/view/PointsAwardedNode.js @@ -47,7 +47,7 @@ class PointsAwardedNode extends HBox { super( options ); // @private - this.pointsNode = pointsNode; + this.pointsNode = pointsNode; // {Text} } /** diff --git a/js/waveGame/view/WaveGameLevelNode.js b/js/waveGame/view/WaveGameLevelNode.js index 8490cfde..f42212f1 100644 --- a/js/waveGame/view/WaveGameLevelNode.js +++ b/js/waveGame/view/WaveGameLevelNode.js @@ -476,15 +476,15 @@ class WaveGameLevelNode extends Node { //------------------------------------------------------------------------------------------------------------------ // @public - this.level = level; + this.level = level; // {WaveGameLevel} // @private - this.layoutBounds = layoutBounds; - this.gameAudioPlayer = gameAudioPlayer; - this.harmonicsChartRectangleLocalBounds = harmonicsChartRectangleLocalBounds; - this.pointsAwardedNode = pointsAwardedNode; + this.layoutBounds = layoutBounds; // {Bounds2} + this.gameAudioPlayer = gameAudioPlayer; // {GameAudioPlayer} + this.harmonicsChartRectangleLocalBounds = harmonicsChartRectangleLocalBounds; // {Bounds2} + this.pointsAwardedNode = pointsAwardedNode; // {PointsAwardedNode} this.pointsAwardedAnimation = null; // {Animation|null} - this.frownyFaceNode = frownyFaceNode; + this.frownyFaceNode = frownyFaceNode; // {FaceNode} this.frownyFaceAnimation = null; // {Animation|null} } diff --git a/js/waveGame/view/WaveGameLevelSelectionButton.js b/js/waveGame/view/WaveGameLevelSelectionButton.js index 64fa8768..3ce4476b 100644 --- a/js/waveGame/view/WaveGameLevelSelectionButton.js +++ b/js/waveGame/view/WaveGameLevelSelectionButton.js @@ -45,7 +45,7 @@ class WaveGameLevelSelectionButton extends LevelSelectionButton { super( icon, level.scoreProperty, options ); // @public - this.level = level; + this.level = level; // {WaveGameLevel} } }