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

Enable eslint-jsdoc #12019

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Reset changes
  • Loading branch information
ggetz committed Jun 4, 2024
commit cbb20f1f71c018d8780dec51bf3c88982e356fd5
10 changes: 5 additions & 5 deletions packages/engine/Source/Core/ApproximateTerrainHeights.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ApproximateTerrainHeights = {};

/**
* Initializes the minimum and maximum terrain heights
* @returns {Promise<void>}
* @return {Promise<void>}
*/
ApproximateTerrainHeights.initialize = function () {
let initPromise = ApproximateTerrainHeights._initPromise;
Expand All @@ -56,8 +56,8 @@ ApproximateTerrainHeights.initialize = function () {
/**
* Computes the minimum and maximum terrain heights for a given rectangle
* @param {Rectangle} rectangle The bounding rectangle
* @param {Ellipsoid} [ellipsoid] The ellipsoid
* @returns {{minimumTerrainHeight: number, maximumTerrainHeight: number}}
* @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid
* @return {{minimumTerrainHeight: number, maximumTerrainHeight: number}}
*/
ApproximateTerrainHeights.getMinimumMaximumHeights = function (
rectangle,
Expand Down Expand Up @@ -130,8 +130,8 @@ ApproximateTerrainHeights.getMinimumMaximumHeights = function (
/**
* Computes the bounding sphere based on the tile heights in the rectangle
* @param {Rectangle} rectangle The bounding rectangle
* @param {Ellipsoid} [ellipsoid] The ellipsoid
* @returns {BoundingSphere} The result bounding sphere
* @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid
* @return {BoundingSphere} The result bounding sphere
*/
ApproximateTerrainHeights.getBoundingSphere = function (rectangle, ellipsoid) {
//>>includeStart('debug', pragmas.debug);
Expand Down
28 changes: 22 additions & 6 deletions packages/engine/Source/Core/ArcGISTiledElevationTerrainProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import WebMercatorTilingScheme from "./WebMercatorTilingScheme.js";
const ALL_CHILDREN = 15;

/**
* @typedef {object} ArcGISTiledElevationTerrainProvider.ConstructorOptions
* @typedef {Object} ArcGISTiledElevationTerrainProvider.ConstructorOptions
*
* Initialization options for the ArcGISTiledElevationTerrainProvider constructor
*
* @property {string} [token] The authorization token to use to connect to the service.
* @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified,
* this parameter is ignored and the tiling scheme's ellipsoid is used instead.
Expand All @@ -33,8 +34,10 @@ const ALL_CHILDREN = 15;

/**
* Used to track creation details while fetching initial metadata
* @class
*
* @constructor
* @private
*
* @param {ArcGISTiledElevationTerrainProvider.ConstructorOptions} [options] An object describing initialization options.
*/
function TerrainProviderBuilder(options) {
Expand All @@ -55,7 +58,9 @@ function TerrainProviderBuilder(options) {

/**
* Complete ArcGISTiledElevationTerrainProvider creation based on builder values.
*
* @private
*
* @param {ArcGISTiledElevationTerrainProvider} provider
*/
TerrainProviderBuilder.prototype.build = function (provider) {
Expand Down Expand Up @@ -212,14 +217,18 @@ async function requestMetadata(
*
* A {@link TerrainProvider} that produces terrain geometry by tessellating height maps
* retrieved from Elevation Tiles of an an ArcGIS ImageService.
*
* @alias ArcGISTiledElevationTerrainProvider
* @class
* @constructor
*
* @param {CesiumTerrainProvider.ConstructorOptions} [options] A url or an object describing initialization options
*
* @example
* const terrainProvider = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer", {
* token: "KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg.."
* });
* viewer.terrainProvider = terrainProvider;
*
* @see TerrainProvider
*/
function ArcGISTiledElevationTerrainProvider(options) {
Expand Down Expand Up @@ -327,16 +336,19 @@ Object.defineProperties(ArcGISTiledElevationTerrainProvider.prototype, {
/**
* Creates a {@link TerrainProvider} that produces terrain geometry by tessellating height maps
* retrieved from Elevation Tiles of an an ArcGIS ImageService.
* @param {Resource | string | Promise<Resource> | Promise<string>} url The URL of the ArcGIS ImageServer service.
*
* @param {Resource|String|Promise<Resource>|Promise<String>} url The URL of the ArcGIS ImageServer service.
* @param {ArcGISTiledElevationTerrainProvider.ConstructorOptions} [options] A url or an object describing initialization options.
* @returns {Promise<ArcGISTiledElevationTerrainProvider>}
*
* @example
* const terrainProvider = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer", {
* token: "KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg.."
* });
* viewer.terrainProvider = terrainProvider;
* @throws {RuntimeError} metadata specifies invalid spatial reference
* @throws {RuntimeError} metadata does not specify tileInfo
*
* @exception {RuntimeError} metadata specifies invalid spatial reference
* @exception {RuntimeError} metadata does not specify tileInfo
*/
ArcGISTiledElevationTerrainProvider.fromUrl = async function (url, options) {
//>>includeStart('debug', pragmas.debug);
Expand Down Expand Up @@ -375,6 +387,7 @@ ArcGISTiledElevationTerrainProvider.fromUrl = async function (url, options) {
/**
* Requests the geometry for a given tile. The result includes terrain
* data and indicates that all child tiles are available.
*
* @param {number} x The X coordinate of the tile for which to request geometry.
* @param {number} y The Y coordinate of the tile for which to request geometry.
* @param {number} level The level of the tile for which to request geometry.
Expand Down Expand Up @@ -478,6 +491,7 @@ function isTileAvailable(that, level, x, y) {

/**
* Gets the maximum geometric error allowed in a tile at a given level.
*
* @param {number} level The tile level for which to get the maximum geometric error.
* @returns {number} The maximum geometric error.
*/
Expand All @@ -489,6 +503,7 @@ ArcGISTiledElevationTerrainProvider.prototype.getLevelMaximumGeometricError = fu

/**
* Determines whether data for a tile is available to be loaded.
*
* @param {number} x The X coordinate of the tile for which to request geometry.
* @param {number} y The Y coordinate of the tile for which to request geometry.
* @param {number} level The level of the tile for which to request geometry.
Expand All @@ -515,6 +530,7 @@ ArcGISTiledElevationTerrainProvider.prototype.getTileDataAvailable = function (

/**
* Makes sure we load availability data for a tile
*
* @param {number} x The X coordinate of the tile for which to request geometry.
* @param {number} y The Y coordinate of the tile for which to request geometry.
* @param {number} level The level of the tile for which to request geometry.
Expand Down
4 changes: 4 additions & 0 deletions packages/engine/Source/Core/ArcType.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
/**
* ArcType defines the path that should be taken connecting vertices.
*
* @enum {number}
*/
const ArcType = {
/**
* Straight line that does not conform to the surface of the ellipsoid.
*
* @type {number}
* @constant
*/
NONE: 0,

/**
* Follow geodesic path.
*
* @type {number}
* @constant
*/
GEODESIC: 1,

/**
* Follow rhumb or loxodrome path.
*
* @type {number}
* @constant
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/engine/Source/Core/ArticulationStageType.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/**
* An enum describing the type of motion that is defined by an articulation stage
* in the AGI_articulations extension.
*
* @alias {ArticulationStageType}
* @enum {string}
*
* @private
*/
const ArticulationStageType = {
Expand Down
8 changes: 7 additions & 1 deletion packages/engine/Source/Core/AssociativeArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import DeveloperError from "./DeveloperError.js";
* A collection of key-value pairs that is stored as a hash for easy
* lookup but also provides an array for fast iteration.
* @alias AssociativeArray
* @class
* @constructor
*/
function AssociativeArray() {
this._array = [];
Expand All @@ -16,6 +16,7 @@ Object.defineProperties(AssociativeArray.prototype, {
/**
* Gets the number of items in the collection.
* @memberof AssociativeArray.prototype
*
* @type {number}
*/
length: {
Expand All @@ -28,6 +29,7 @@ Object.defineProperties(AssociativeArray.prototype, {
* This is a live array that will automatically reflect the values in the collection,
* it should not be modified directly.
* @memberof AssociativeArray.prototype
*
* @type {Array}
*/
values: {
Expand All @@ -39,6 +41,7 @@ Object.defineProperties(AssociativeArray.prototype, {

/**
* Determines if the provided key is in the array.
*
* @param {string|number} key The key to check.
* @returns {boolean} <code>true</code> if the key is in the array, <code>false</code> otherwise.
*/
Expand All @@ -54,6 +57,7 @@ AssociativeArray.prototype.contains = function (key) {
/**
* Associates the provided key with the provided value. If the key already
* exists, it is overwritten with the new value.
*
* @param {string|number} key A unique identifier.
* @param {*} value The value to associate with the provided key.
*/
Expand All @@ -74,6 +78,7 @@ AssociativeArray.prototype.set = function (key, value) {

/**
* Retrieves the value associated with the provided key.
*
* @param {string|number} key The key whose value is to be retrieved.
* @returns {*} The associated value, or undefined if the key does not exist in the collection.
*/
Expand All @@ -88,6 +93,7 @@ AssociativeArray.prototype.get = function (key) {

/**
* Removes a key-value pair from the collection.
*
* @param {string|number} key The key to be removed.
* @returns {boolean} True if it was removed, false if the key was not in the collection.
*/
Expand Down
Loading