Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve JSDoc/TypeScript support for Material properties #8904

Merged
merged 4 commits into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
##### Fixes :wrench:

- Fixed a bug with handling of PixelFormat's flipY. [#8893](https://github.com/CesiumGS/cesium/pull/8893)
- Improved `MaterialProperty` JSDoc and TypeScript type definitions, which were missing the ability to take primitive types in addition to Property instances in their constructor.
- Fixed `EllipsoidGeodesic` JSDoc and TypeScript type definitions which incorrectly listed `result` as required.

### 1.70.0 - 2020-06-01

Expand Down
4 changes: 2 additions & 2 deletions Source/Core/EllipsoidGeodesic.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ EllipsoidGeodesic.prototype.setEndPoints = function (start, end) {
* Provides the location of a point at the indicated portion along the geodesic.
*
* @param {Number} fraction The portion of the distance between the initial and final points.
* @param {Cartographic} result The object in which to store the result.
* @param {Cartographic} [result] The object in which to store the result.
* @returns {Cartographic} The location of the point along the geodesic.
*/
EllipsoidGeodesic.prototype.interpolateUsingFraction = function (
Expand All @@ -418,7 +418,7 @@ EllipsoidGeodesic.prototype.interpolateUsingFraction = function (
* Provides the location of a point at the indicated distance along the geodesic.
*
* @param {Number} distance The distance from the inital point to the point of interest along the geodesic
* @param {Cartographic} result The object in which to store the result.
* @param {Cartographic} [result] The object in which to store the result.
* @returns {Cartographic} The location of the point along the geodesic.
*
* @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance
Expand Down
6 changes: 3 additions & 3 deletions Source/DataSources/CheckerboardMaterialProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ var defaultRepeat = new Cartesian2(2.0, 2.0);
* @constructor
*
* @param {Object} [options] Object with the following properties:
* @param {Property} [options.evenColor=Color.WHITE] A Property specifying the first {@link Color}.
* @param {Property} [options.oddColor=Color.BLACK] A Property specifying the second {@link Color}.
* @param {Property} [options.repeat=new Cartesian2(2.0, 2.0)] A {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.
* @param {Property|Color} [options.evenColor=Color.WHITE] A Property specifying the first {@link Color}.
mramato marked this conversation as resolved.
Show resolved Hide resolved
* @param {Property|Color} [options.oddColor=Color.BLACK] A Property specifying the second {@link Color}.
* @param {Property|Cartesian2} [options.repeat=new Cartesian2(2.0, 2.0)] A {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.
*/
function CheckerboardMaterialProperty(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
Expand Down
2 changes: 1 addition & 1 deletion Source/DataSources/ColorMaterialProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Property from "./Property.js";
/**
* A {@link MaterialProperty} that maps to solid color {@link Material} uniforms.
*
* @param {Property} [color=Color.WHITE] The {@link Color} Property to be used.
* @param {Property|Color} [color=Color.WHITE] The {@link Color} Property to be used.
*
* @alias ColorMaterialProperty
* @constructor
Expand Down
10 changes: 5 additions & 5 deletions Source/DataSources/GridMaterialProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ var defaultLineThickness = new Cartesian2(1, 1);
* @alias GridMaterialProperty
*
* @param {Object} [options] Object with the following properties:
* @param {Property} [options.color=Color.WHITE] A Property specifying the grid {@link Color}.
* @param {Property} [options.cellAlpha=0.1] A numeric Property specifying cell alpha values.
* @param {Property} [options.lineCount=new Cartesian2(8, 8)] A {@link Cartesian2} Property specifying the number of grid lines along each axis.
* @param {Property} [options.lineThickness=new Cartesian2(1.0, 1.0)] A {@link Cartesian2} Property specifying the thickness of grid lines along each axis.
* @param {Property} [options.lineOffset=new Cartesian2(0.0, 0.0)] A {@link Cartesian2} Property specifying starting offset of grid lines along each axis.
* @param {Property|Color} [options.color=Color.WHITE] A Property specifying the grid {@link Color}.
* @param {Property|Number} [options.cellAlpha=0.1] A numeric Property specifying cell alpha values.
* @param {Property|Cartesian2} [options.lineCount=new Cartesian2(8, 8)] A {@link Cartesian2} Property specifying the number of grid lines along each axis.
* @param {Property|Cartesian2} [options.lineThickness=new Cartesian2(1.0, 1.0)] A {@link Cartesian2} Property specifying the thickness of grid lines along each axis.
* @param {Property|Cartesian2} [options.lineOffset=new Cartesian2(0.0, 0.0)] A {@link Cartesian2} Property specifying starting offset of grid lines along each axis.
*
* @constructor
*/
Expand Down
8 changes: 4 additions & 4 deletions Source/DataSources/ImageMaterialProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ var defaultColor = Color.WHITE;
* @constructor
*
* @param {Object} [options] Object with the following properties:
* @param {Property} [options.image] A Property specifying the Image, URL, Canvas, or Video.
* @param {Property} [options.repeat=new Cartesian2(1.0, 1.0)] A {@link Cartesian2} Property specifying the number of times the image repeats in each direction.
* @param {Property} [options.color=Color.WHITE] The color applied to the image
* @param {Property} [options.transparent=false] Set to true when the image has transparency (for example, when a png has transparent sections)
* @param {Property|String|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} [options.image] A Property specifying the Image, URL, Canvas, or Video.
* @param {Property|Cartesian2} [options.repeat=new Cartesian2(1.0, 1.0)] A {@link Cartesian2} Property specifying the number of times the image repeats in each direction.
* @param {Property|Color} [options.color=Color.WHITE] The color applied to the image
* @param {Property|Boolean} [options.transparent=false] Set to true when the image has transparency (for example, when a png has transparent sections)
*/
function ImageMaterialProperty(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
Expand Down
2 changes: 1 addition & 1 deletion Source/DataSources/PolylineArrowMaterialProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Property from "./Property.js";
/**
* A {@link MaterialProperty} that maps to PolylineArrow {@link Material} uniforms.
*
* @param {Property} [color=Color.WHITE] The {@link Color} Property to be used.
* @param {Property|Color} [color=Color.WHITE] The {@link Color} Property to be used.
*
* @alias PolylineArrowMaterialProperty
* @constructor
Expand Down
8 changes: 4 additions & 4 deletions Source/DataSources/PolylineDashMaterialProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ var defaultDashPattern = 255.0;
* @constructor
*
* @param {Object} [options] Object with the following properties:
* @param {Property} [options.color=Color.WHITE] A Property specifying the {@link Color} of the line.
* @param {Property} [options.gapColor=Color.TRANSPARENT] A Property specifying the {@link Color} of the gaps in the line.
* @param {Property} [options.dashLength=16.0] A numeric Property specifying the length of the dash pattern in pixels.
* @param {Property} [options.dashPattern=255.0] A numeric Property specifying a 16 bit pattern for the dash
* @param {Property|Color} [options.color=Color.WHITE] A Property specifying the {@link Color} of the line.
* @param {Property|Color} [options.gapColor=Color.TRANSPARENT] A Property specifying the {@link Color} of the gaps in the line.
* @param {Property|Number} [options.dashLength=16.0] A numeric Property specifying the length of the dash pattern in pixels.
* @param {Property|Number} [options.dashPattern=255.0] A numeric Property specifying a 16 bit pattern for the dash
*/
function PolylineDashMaterialProperty(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
Expand Down
6 changes: 3 additions & 3 deletions Source/DataSources/PolylineGlowMaterialProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ var defaultTaperPower = 1.0;
* @constructor
*
* @param {Object} [options] Object with the following properties:
* @param {Property} [options.color=Color.WHITE] A Property specifying the {@link Color} of the line.
* @param {Property} [options.glowPower=0.25] A numeric Property specifying the strength of the glow, as a percentage of the total line width.
* @param {Property} [options.taperPower=1.0] A numeric Property specifying the strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used.
* @param {Property|Color} [options.color=Color.WHITE] A Property specifying the {@link Color} of the line.
* @param {Property|Number} [options.glowPower=0.25] A numeric Property specifying the strength of the glow, as a percentage of the total line width.
* @param {Property|Number} [options.taperPower=1.0] A numeric Property specifying the strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used.
*/
function PolylineGlowMaterialProperty(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
Expand Down
6 changes: 3 additions & 3 deletions Source/DataSources/PolylineOutlineMaterialProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ var defaultOutlineWidth = 1.0;
* @constructor
*
* @param {Object} [options] Object with the following properties:
* @param {Property} [options.color=Color.WHITE] A Property specifying the {@link Color} of the line.
* @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.
* @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline, in pixels.
* @param {Property|Color} [options.color=Color.WHITE] A Property specifying the {@link Color} of the line.
* @param {Property|Color} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.
* @param {Property|Number} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline, in pixels.
*/
function PolylineOutlineMaterialProperty(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
Expand Down
10 changes: 5 additions & 5 deletions Source/DataSources/StripeMaterialProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ var defaultRepeat = 1;
* @constructor
*
* @param {Object} [options] Object with the following properties:
* @param {Property} [options.orientation=StripeOrientation.HORIZONTAL] A Property specifying the {@link StripeOrientation}.
* @param {Property} [options.evenColor=Color.WHITE] A Property specifying the first {@link Color}.
* @param {Property} [options.oddColor=Color.BLACK] A Property specifying the second {@link Color}.
* @param {Property} [options.offset=0] A numeric Property specifying how far into the pattern to start the material.
* @param {Property} [options.repeat=1] A numeric Property specifying how many times the stripes repeat.
* @param {Property|StripeOrientation} [options.orientation=StripeOrientation.HORIZONTAL] A Property specifying the {@link StripeOrientation}.
* @param {Property|Color} [options.evenColor=Color.WHITE] A Property specifying the first {@link Color}.
* @param {Property|Color} [options.oddColor=Color.BLACK] A Property specifying the second {@link Color}.
* @param {Property|Number} [options.offset=0] A numeric Property specifying how far into the pattern to start the material.
* @param {Property|Number} [options.repeat=1] A numeric Property specifying how many times the stripes repeat.
*/
function StripeMaterialProperty(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
Expand Down