From 85c78edf31c80eb6d2ce1107ef8e81f1c77e6894 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Tue, 26 May 2020 22:40:05 -0400 Subject: [PATCH] Generate official TypeScript type definitions It's been a long requested feature for us to have official TypeScript type definitions. While the community has done a yeoman's job of manually supporting various efforts, the most recent incarnation of which is `@types/cesium`, the sheer scale and ever-evolving nature of Cesium's code base makes manual maintenance a Sisyphean task. Thankfully, our decision to maintain meticulous JSDoc API documentation continues to pay dividends and is what makes automatically generating TypeScript definitions possible. Using the excellent https://github.com/englercj/tsd-jsdoc project we can now automatically generate and even partially validate official definitions as part of the build process. (Thanks to @bampakoa who contributed some early PRs to both CesiumJS and tsd-jsdoc over a year ago and is how I learned about tsd-jsdoc) While tsd-jsdoc output is mostly where we need it to be, we do post-processing on it as well. This lets us clean up the output and also make sure these definitions work whether users include cesium via module, i.e. `import { Cartesian3 } from 'cesium'`, or individual files, i.e. `'import Cartesian3 from 'cesium/Source/Core/Cartesian3'`. There were also some quirks of tsd-jsdoc output we fixed that may eventually turn into a PR into that project from us. The post-processing is part typescript compiler API, part string manipulation. It works and is straightforward but we might want to go full TS api in the future if we decide we need to do more complicated tasks. The output of tsd-jsdoc is currently a little noisy because of some incorrect error reporting, but I'm talking with the maintainer in https://github.com/englercj/tsd-jsdoc/issues/133 to get them fixed. No need to hold up this PR for it though. The definition is generated as a single `Cesium.d.ts` file in Source, so it lives alongside Cesium.js. It is ignored by git but generated by a separate `build-ts` task as part of CI and makeZipFile. This task also validates the file by compiling it with TypeScript, so if a developer does anything too egregious, the build will fail. Definitions are automatically included in our npm packages and release zips and will be automatically used by IDEs thanks to the `types` setting in package.json. This means that IDEs such as VS Code will prefer these types over the existing `@types/cesium` version by default. I didn't want to slow the `build` step down, so I made this a separate step, but in the future we could consider running it by default and we could also unignore this file in Git so that PR reviewers can see the impact, if any, our code changes have on the generated definitions. This might be a good idea as an additional sanity check and should only actually change when the public API itself changes. But the issue would be remembering to run it before submitting the code (or we could use git hooks I suppose?) I just don't want to slow down devs so I'm hesitant to do anything like this out of the gate. We can definitely revisit in the future. A particular exciting thing about this approach is that it exposed a ton of badness in our current JSDoc markup, which is now fixed. Previously, our only concern was "does the doc look right" and we didn't pay attention to whether the meta information generated by JSDoc correctly captured type information (because up until it didn't matter). We leaned particular hard on `@exports` which acted as a catch-all but has now been completely removed from the codebase. All this means is that our documentation as a whole has now improved greatly and will continue to be maintained at this new higher level thanks to incorporating TS definition creation into our pipeline! One minor caveat here is that obviously we changed our JSDoc usage to both make it correct and also accommodate TypeScript. The main drawback to these fixes is that enums are now generated as globals in the doc, rather than modules. This means they no longer have their own dedicated page and are instead on the globals page, but I changed the code to ensure they are still in the table of contents that we generate. I think this trade-off is perfectly fine, but I wanted to mention it since it does change the doc some. We can certainly look into whether we can generate enums on their own page if we think that makes sense. (I actually like this approach a little better personally). Last major piece, the actual code. 99% of the changes in this PR only affect the JSDoc. There are two exceptions: A few of our enums also have private functions tacked onto them. I had to move these functions to be outside the initializer but otherwise they are unchanged. This ensures that a valid TS enum is generated from our code, since you can't have functions globbed onto enums in the TS world. If we were writing TS code by hand, we could use declaration merging with a namespace, but the toolchain we are using doesn't have a way to express that right now. There were two cases where these extra functions weren't private, `ComponentDataType` and `IndexDataType`. That means that as far as the TS definitions goes, the helper methods don't exist. I consder this an edge case and we can write up issues to investigate later. I'm actually not even sure if these functions are public on purposes, @lilleyse can you confirm? We had a few places where we had method signatures with optional parameters that came _before_ required parameters, which is silly. This is invalid TypeScript (and not good API design no matter the language). In 99% of cases this was `equalsEpsilon` style functions where the lhs/rhs were optional but the epsilon was not. I remember the discussion around this when we first did it because we were paranoid about defaulting to 0, but it's an edge case and it's silly so I just changed the epsilon functions to default to zero now, problem solved. Here's a high level summary of the JS changes: * Use proper `@enum` notation instead of `@exports` for enums. * Use proper `@namespace` instead of `@exports` for static classes. * Use proper `@function` instead of `@exports` for standalone functions. * Fix `Promise` markup to actually include the type in all cases, i.e. `Promise` => `Promise` or `Promise`. * Fix bad markup that referenced types that do not exist (or no longer exist) at the spec level, `Image` => `HTMLImageElement`, `Canvas` => `HTMLCanvasElement`, etc.. `TypedArray` in particular does not exist and much be expressed as a lsit of all applicable types, `Int8Array|Uint8Array|Int16Array|Uint16Array...`. * Use dot notation instead of tilde in callbacks, to better support TypeScript, i.e. `EasingFunction~Callback` becomes `EasingFunction.Callback`. The only exception is when we had a callback type that was i.e. `exportKml~ModelCallback` becomes `exportKmlModelCallback` (a module global type rather than a type on exportKml). This is because it's not possible to have exportKml be both a function and a namespace in this current toolchain. Not a big deal either way since these are meta-types used for defining callbacks but I wanted to mention it. * There were some edge cases where private types that were referenced in the public API but don't exist in the JSDoc. These were trivial to fix by either tweaking the JSDoc to avoid leaking the type or in some cases, just as `PixelDataType`, simply exposing the private type as public. I also found a few cases where things were accidentally public, I marked these as private (these were extreme edge cases so I'm not concerned about breaking changes). Appearances took an optional `RenderState` in their options, I just changed the type to `Object` which we can clean up further later if we need to. * Lots of other little misc JSDoc issues that became obvious once we started to generate definitions (duplicate parameters for example). Thanks again to the community for helping generate ideas and discussions around TS definitions over the last few years and a big thanks to @javagl for helping behind the scenes on this specific effort by evaluating a few different approaches and workaround before we settled on this one (I'm working on a blog with all of the gory details for those interested). Finally, while I'm thrilled with how this turned out (all ~41000 lines and 1.9MB of it), I can guarantee we will uncover some issues with the type definitions as more people use it. The good news is that improving it is now just a matter of fixing the JSDoc, which will benefit the community as a whole and not just TS users. Fixes #2730 Fixes #5717 --- .gitignore | 1 + .travis.yml | 1 + Apps/Sandcastle/gallery/Custom Geocoder.html | 2 +- .../Contributors/DocumentationGuide/README.md | 21 +- Source/Core/ApproximateTerrainHeights.js | 2 +- .../ArcGISTiledElevationTerrainProvider.js | 2 +- Source/Core/ArcType.js | 2 +- Source/Core/AttributeCompression.js | 2 +- Source/Core/BingMapsApi.js | 2 +- Source/Core/BingMapsGeocoderService.js | 2 +- Source/Core/Cartesian2.js | 4 +- Source/Core/Cartesian3.js | 4 +- Source/Core/Cartesian4.js | 4 +- Source/Core/Cartographic.js | 8 +- Source/Core/CartographicGeocoderService.js | 2 +- Source/Core/CesiumTerrainProvider.js | 4 +- Source/Core/ClockRange.js | 2 +- Source/Core/ClockStep.js | 2 +- Source/Core/ComponentDatatype.js | 4 +- Source/Core/CornerType.js | 2 +- Source/Core/CubicRealPolynomial.js | 2 +- Source/Core/EarthOrientationParameters.js | 2 +- Source/Core/EasingFunction.js | 66 +-- Source/Core/EllipsoidTerrainProvider.js | 2 +- Source/Core/Event.js | 4 +- Source/Core/EventHelper.js | 4 +- Source/Core/ExtrapolationType.js | 2 +- Source/Core/FeatureDetection.js | 7 +- Source/Core/Fullscreen.js | 5 +- Source/Core/GeocodeType.js | 2 +- Source/Core/GeocoderService.js | 4 +- Source/Core/GeometryAttribute.js | 4 +- Source/Core/GeometryPipeline.js | 2 +- Source/Core/GoogleEarthEnterpriseMetadata.js | 2 +- .../Core/GoogleEarthEnterpriseTerrainData.js | 2 +- .../GoogleEarthEnterpriseTerrainProvider.js | 4 +- Source/Core/GroundPolylineGeometry.js | 4 +- Source/Core/HeadingPitchRoll.js | 4 +- Source/Core/Heap.js | 6 +- Source/Core/HeightmapEncoding.js | 2 +- Source/Core/HeightmapTerrainData.js | 4 +- Source/Core/HeightmapTessellator.js | 4 +- Source/Core/HermitePolynomialApproximation.js | 2 +- Source/Core/Iau2000Orientation.js | 3 +- Source/Core/Iau2006XysData.js | 2 +- Source/Core/IauOrientationAxes.js | 5 +- Source/Core/IauOrientationParameters.js | 2 +- Source/Core/IndexDatatype.js | 2 +- Source/Core/InterpolationAlgorithm.js | 2 +- Source/Core/Intersect.js | 2 +- Source/Core/IntersectionTests.js | 3 +- Source/Core/Intersections2D.js | 2 +- Source/Core/Ion.js | 2 +- Source/Core/IonGeocoderService.js | 3 +- Source/Core/Iso8601.js | 2 +- Source/Core/JulianDate.js | 10 +- Source/Core/KeyboardEventModifier.js | 2 +- .../Core/LagrangePolynomialApproximation.js | 2 +- Source/Core/LinearApproximation.js | 2 +- Source/Core/MapboxApi.js | 2 +- Source/Core/Math.js | 9 +- Source/Core/Matrix2.js | 9 +- Source/Core/Matrix3.js | 8 +- Source/Core/Matrix4.js | 22 +- Source/Core/OpenCageGeocoderService.js | 6 +- Source/Core/Packable.js | 2 +- Source/Core/PackableForInterpolation.js | 4 +- Source/Core/PeliasGeocoderService.js | 2 +- Source/Core/PinBuilder.js | 8 +- Source/Core/PixelFormat.js | 426 +++++++++--------- Source/Core/PrimitiveType.js | 31 +- Source/Core/QuadraticRealPolynomial.js | 2 +- Source/Core/QuantizedMeshTerrainData.js | 2 +- Source/Core/QuarticRealPolynomial.js | 2 +- Source/Core/Quaternion.js | 13 +- Source/Core/Queue.js | 4 +- Source/Core/Rectangle.js | 12 +- Source/Core/ReferenceFrame.js | 2 +- Source/Core/Request.js | 23 +- Source/Core/RequestScheduler.js | 3 +- Source/Core/RequestState.js | 2 +- Source/Core/RequestType.js | 2 +- Source/Core/Resource.js | 38 +- Source/Core/ScreenSpaceEventHandler.js | 2 +- Source/Core/ScreenSpaceEventType.js | 2 +- Source/Core/Simon1994PlanetaryPositions.js | 2 +- Source/Core/TerrainData.js | 2 +- Source/Core/TerrainProvider.js | 2 +- Source/Core/TerrainQuantization.js | 2 +- Source/Core/TileProviderError.js | 4 +- Source/Core/TimeConstants.js | 2 +- Source/Core/TimeInterval.js | 29 +- Source/Core/TimeIntervalCollection.js | 8 +- Source/Core/TimeStandard.js | 2 +- Source/Core/Tipsify.js | 2 +- Source/Core/Transforms.js | 15 +- Source/Core/TridiagonalSystemSolver.js | 2 +- Source/Core/TrustedServers.js | 2 +- Source/Core/VRTheWorldTerrainProvider.js | 2 +- Source/Core/Visibility.js | 2 +- Source/Core/WebGLConstants.js | 2 +- Source/Core/WindingOrder.js | 21 +- Source/Core/barycentricCoordinates.js | 2 +- Source/Core/binarySearch.js | 6 +- Source/Core/cancelAnimationFrame.js | 2 +- Source/Core/clone.js | 2 +- Source/Core/combine.js | 2 +- Source/Core/createGuid.js | 2 +- Source/Core/createWorldTerrain.js | 2 +- Source/Core/defaultValue.js | 4 +- Source/Core/defined.js | 2 +- Source/Core/deprecationWarning.js | 2 +- Source/Core/destroyObject.js | 2 +- Source/Core/formatError.js | 2 +- Source/Core/getAbsoluteUri.js | 2 +- Source/Core/getBaseUri.js | 2 +- Source/Core/getExtensionFromUri.js | 2 +- Source/Core/getFilenameFromUri.js | 2 +- Source/Core/getImagePixels.js | 6 +- Source/Core/getTimestamp.js | 2 +- Source/Core/isBlobUri.js | 2 +- Source/Core/isDataUri.js | 2 +- Source/Core/isLeapYear.js | 2 +- Source/Core/loadCRN.js | 2 +- Source/Core/loadKTX.js | 2 +- Source/Core/mergeSort.js | 6 +- Source/Core/objectToQuery.js | 2 +- Source/Core/oneTimeWarning.js | 2 +- Source/Core/parseResponseHeaders.js | 2 +- Source/Core/pointInsideTriangle.js | 2 +- Source/Core/queryToObject.js | 2 +- Source/Core/requestAnimationFrame.js | 6 +- Source/Core/sampleTerrain.js | 2 +- Source/Core/sampleTerrainMostDetailed.js | 2 +- Source/Core/scaleToGeodeticSurface.js | 2 +- Source/Core/subdivideArray.js | 2 +- Source/Core/writeTextToCanvas.js | 4 +- Source/DataSources/BoundingSphereState.js | 2 +- Source/DataSources/BoxGeometryUpdater.js | 1 + Source/DataSources/CallbackProperty.js | 6 +- Source/DataSources/CylinderGeometryUpdater.js | 1 + Source/DataSources/DataSourceDisplay.js | 6 +- .../DataSources/EllipsoidGeometryUpdater.js | 1 + Source/DataSources/EntityCluster.js | 4 +- Source/DataSources/GeoJsonDataSource.js | 4 +- Source/DataSources/GeometryUpdater.js | 1 + Source/DataSources/GroundGeometryUpdater.js | 1 + Source/DataSources/KmlDataSource.js | 98 ++-- Source/DataSources/KmlTourFlyTo.js | 4 +- Source/DataSources/KmlTourWait.js | 4 +- Source/DataSources/PolylineGeometryUpdater.js | 1 + Source/DataSources/Rotation.js | 8 +- Source/DataSources/StripeOrientation.js | 2 +- Source/DataSources/TerrainOffsetProperty.js | 2 +- Source/DataSources/exportKml.js | 6 +- Source/Renderer/AutomaticUniforms.js | 294 ------------ Source/Renderer/PixelDatatype.js | 89 ++-- Source/Renderer/Texture.js | 4 +- Source/Renderer/TextureMagnificationFilter.js | 30 +- Source/Renderer/TextureMinificationFilter.js | 46 +- Source/Renderer/UniformState.js | 2 +- Source/Renderer/loadCubeMap.js | 2 +- Source/Scene/Appearance.js | 2 +- .../Scene/ArcGisMapServerImageryProvider.js | 4 +- Source/Scene/AttributeType.js | 2 +- Source/Scene/Axis.js | 2 +- Source/Scene/BatchTable.js | 8 +- Source/Scene/Billboard.js | 6 +- Source/Scene/BingMapsImageryProvider.js | 4 +- Source/Scene/BingMapsStyle.js | 2 +- Source/Scene/BlendEquation.js | 2 +- Source/Scene/BlendFunction.js | 2 +- Source/Scene/BlendOption.js | 2 +- Source/Scene/BlendingState.js | 2 +- Source/Scene/Camera.js | 18 +- Source/Scene/CameraEventAggregator.js | 2 +- Source/Scene/CameraEventType.js | 2 +- Source/Scene/Cesium3DTileColorBlendMode.js | 2 +- Source/Scene/Cesium3DTileOptimizationHint.js | 2 +- Source/Scene/Cesium3DTileOptimizations.js | 2 +- Source/Scene/Cesium3DTileRefine.js | 2 +- Source/Scene/Cesium3DTileset.js | 11 +- Source/Scene/ClassificationType.js | 12 +- Source/Scene/ColorBlendMode.js | 2 +- Source/Scene/CullFace.js | 2 +- Source/Scene/DebugAppearance.js | 2 +- Source/Scene/DepthFunction.js | 2 +- Source/Scene/DiscardEmptyTileImagePolicy.js | 4 +- Source/Scene/DiscardMissingTileImagePolicy.js | 2 +- Source/Scene/EllipsoidSurfaceAppearance.js | 2 +- Source/Scene/FrameState.js | 122 +++-- .../GoogleEarthEnterpriseImageryProvider.js | 9 +- .../GoogleEarthEnterpriseMapsProvider.js | 4 +- Source/Scene/GridImageryProvider.js | 4 +- Source/Scene/GroundPolylinePrimitive.js | 2 +- Source/Scene/GroundPrimitive.js | 2 +- Source/Scene/HeightReference.js | 2 +- Source/Scene/HorizontalOrigin.js | 2 +- Source/Scene/ImageryProvider.js | 6 +- Source/Scene/ImagerySplitDirection.js | 2 +- Source/Scene/IonImageryProvider.js | 2 +- Source/Scene/IonWorldImageryStyle.js | 2 +- Source/Scene/LabelStyle.js | 2 +- Source/Scene/MapMode2D.js | 2 +- Source/Scene/MapboxImageryProvider.js | 4 +- Source/Scene/MapboxStyleImageryProvider.js | 4 +- Source/Scene/MaterialAppearance.js | 19 +- Source/Scene/ModelAnimationLoop.js | 2 +- Source/Scene/NeverTileDiscardPolicy.js | 2 +- Source/Scene/OctahedralProjectedCubeMap.js | 2 +- Source/Scene/ParticleSystem.js | 6 +- Source/Scene/PerInstanceColorAppearance.js | 2 +- Source/Scene/PointCloud3DTileContent.js | 4 - Source/Scene/Polyline.js | 2 +- Source/Scene/PolylineColorAppearance.js | 2 +- Source/Scene/PolylineMaterialAppearance.js | 2 +- Source/Scene/PostProcessStageLibrary.js | 2 +- Source/Scene/PostProcessStageSampleMode.js | 2 +- Source/Scene/QuadtreeTileLoadState.js | 2 +- Source/Scene/Scene.js | 4 +- Source/Scene/SceneMode.js | 3 +- Source/Scene/SceneTransforms.js | 2 +- Source/Scene/ShadowMode.js | 13 +- Source/Scene/SingleTileImageryProvider.js | 4 +- Source/Scene/StencilFunction.js | 2 +- Source/Scene/StencilOperation.js | 2 +- Source/Scene/TextureAtlas.js | 6 +- Source/Scene/TileBoundingVolume.js | 7 +- .../Scene/TileCoordinatesImageryProvider.js | 4 +- Source/Scene/TileDiscardPolicy.js | 2 +- Source/Scene/TimeDynamicImagery.js | 2 +- Source/Scene/Tonemapper.js | 2 +- Source/Scene/TweenCollection.js | 34 +- Source/Scene/UrlTemplateImageryProvider.js | 4 +- Source/Scene/Vector3DTileGeometry.js | 2 +- Source/Scene/Vector3DTilePoints.js | 2 +- Source/Scene/Vector3DTilePolygons.js | 2 +- Source/Scene/Vector3DTilePolylines.js | 2 +- Source/Scene/VerticalOrigin.js | 2 +- Source/Scene/WebMapServiceImageryProvider.js | 4 +- .../Scene/WebMapTileServiceImageryProvider.js | 4 +- Source/Scene/createBillboardPointCallback.js | 6 +- Source/Scene/createOsmBuildings.js | 2 +- .../Scene/createTangentSpaceDebugPrimitive.js | 2 +- Source/Scene/createWorldImagery.js | 2 +- .../Widgets/Animation/AnimationViewModel.js | 12 +- .../BaseLayerPicker/ProviderViewModel.js | 4 +- .../CesiumInspectorViewModel.js | 2 +- Source/Widgets/CesiumWidget/CesiumWidget.js | 2 +- Source/Widgets/Geocoder/Geocoder.js | 4 +- Source/Widgets/Geocoder/GeocoderViewModel.js | 6 +- .../SelectionIndicatorViewModel.js | 4 +- Source/Widgets/SvgPathBindingHandler.js | 5 +- Source/Widgets/Viewer/Viewer.js | 6 +- .../viewerCesium3DTilesInspectorMixin.js | 2 +- .../Viewer/viewerCesiumInspectorMixin.js | 2 +- Source/Widgets/Viewer/viewerDragDropMixin.js | 4 +- .../Viewer/viewerPerformanceWatchdogMixin.js | 2 +- Source/Widgets/createCommand.js | 2 +- Source/Widgets/subscribeAndEvaluate.js | 2 +- .../WorkersES6/createTaskProcessorWorker.js | 10 +- Specs/Core/Cartesian2Spec.js | 6 - Specs/Core/Cartesian3Spec.js | 6 - Specs/Core/Cartesian4Spec.js | 6 - Specs/Core/CartographicSpec.js | 6 - Specs/Core/MathSpec.js | 6 - Specs/Core/Matrix2Spec.js | 6 - Specs/Core/Matrix3Spec.js | 6 - Specs/Core/Matrix4Spec.js | 21 - Specs/Core/QuaternionSpec.js | 6 - Specs/Core/RectangleSpec.js | 8 - Specs/Core/TimeIntervalSpec.js | 16 - Tools/jsdoc/cesium_template/publish.js | 6 + Tools/jsdoc/conf.json | 15 +- Tools/jsdoc/ts-conf.json | 32 ++ gulpfile.cjs | 139 +++++- package.json | 4 + 277 files changed, 1150 insertions(+), 1363 deletions(-) create mode 100644 Tools/jsdoc/ts-conf.json diff --git a/.gitignore b/.gitignore index c4ef272a1e2c..240b38f501bf 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ Thumbs.db /Apps/Sandcastle/templates/bucket.css /Source/Cesium.js +/Source/Cesium.d.ts /Specs/SpecList.js /Source/Shaders/**/*.js diff --git a/.travis.yml b/.travis.yml index 2460cac0b634..0011687bc9b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ script: - npm --silent run prettier-check - npm --silent run build + - npm --silent run build-ts - npm --silent run coverage -- --browsers FirefoxHeadless --webgl-stub --failTaskOnError --suppressPassed - travis_wait 20 npm --silent run makeZipFile -- --concurrency 1 diff --git a/Apps/Sandcastle/gallery/Custom Geocoder.html b/Apps/Sandcastle/gallery/Custom Geocoder.html index eaec37884faf..f145f240a408 100644 --- a/Apps/Sandcastle/gallery/Custom Geocoder.html +++ b/Apps/Sandcastle/gallery/Custom Geocoder.html @@ -56,7 +56,7 @@ * The function called to geocode using this geocoder service. * * @param {String} input The query to be sent to the geocoder service - * @returns {Promise} + * @returns {Promise} */ OpenStreetMapNominatimGeocoder.prototype.geocode = function (input) { var endpoint = "https://nominatim.openstreetmap.org/search"; diff --git a/Documentation/Contributors/DocumentationGuide/README.md b/Documentation/Contributors/DocumentationGuide/README.md index d20b1884d9e3..788700a900d7 100644 --- a/Documentation/Contributors/DocumentationGuide/README.md +++ b/Documentation/Contributors/DocumentationGuide/README.md @@ -25,6 +25,7 @@ Generally, just follow the patterns that are already in comparable parts of the - [Property](#property) - [Property Getter/Setter](#property-gettersetter) - [Standalone Function](#standalone-function) +- [TypeScript type definitions](#typescript) ## Building the Doc @@ -52,7 +53,7 @@ Consider one of the simplest functions in CesiumJS, `defined`: ```javascript /** - * @exports defined + * @function * * @param {*} value The object. * @returns {Boolean} Returns true if the object is defined, returns false otherwise. @@ -70,7 +71,7 @@ function defined(value) { ``` - The doc for `defined` is in the comment starting with `/**`. JSDoc tags begin with `@`. -- `@exports` describes the name of the function that is exported from the module. +- `@function` tells JSDoc that this is a function. - `@param` describes the function's parameters, and `@returns` describes the function's return value. - `@example` describes a code sample. @@ -379,7 +380,7 @@ Cartesian4.fromArray = Cartesian4.unpack; /** * Sort the items in the queue in-place. * - * @param {Queue~Comparator} compareFunction A function that defines the sort order. + * @param {Queue.Comparator} compareFunction A function that defines the sort order. */ Queue.prototype.sort = function (compareFunction) { if (this._offset > 0) { @@ -393,7 +394,7 @@ Queue.prototype.sort = function (compareFunction) { /** * A function used to compare two items while sorting a queue. - * @callback Queue~Comparator + * @callback Queue.Comparator * * @param {*} a An item in the array. * @param {*} b An item in the array. @@ -535,7 +536,7 @@ DESCRIPTION. ``` DESCRIPTION. -@exports NAME +@function @param {TYPE} NAME DESCRIPTION. @param {TYPE|OTHER_TYPE} NAME DESCRIPTION WITH LONG @@ -552,3 +553,13 @@ DESCRIPTION. [@private] ``` + +# TypeScript + +We also use JSDoc to build official TypeScript type definitions. Normally this behavior is transparent to the developer and happens as part of CI, however incorrect or non-standard JSDoc can lead to failures. If CI is failing because of the `build-ts` step, you can debug it locally by running: + +``` +npm run build-ts +``` + +In most cases, the TypeScript compiler will provide a very obvious error and line number which will help you track down the offending, most likely incorrect, JSDoc. diff --git a/Source/Core/ApproximateTerrainHeights.js b/Source/Core/ApproximateTerrainHeights.js index 76138aa5a333..c571d4dadf09 100644 --- a/Source/Core/ApproximateTerrainHeights.js +++ b/Source/Core/ApproximateTerrainHeights.js @@ -36,7 +36,7 @@ var ApproximateTerrainHeights = {}; /** * Initializes the minimum and maximum terrain heights - * @return {Promise} + * @return {Promise} */ ApproximateTerrainHeights.initialize = function () { var initPromise = ApproximateTerrainHeights._initPromise; diff --git a/Source/Core/ArcGISTiledElevationTerrainProvider.js b/Source/Core/ArcGISTiledElevationTerrainProvider.js index f60d5d4d6e6b..5284fa54226d 100644 --- a/Source/Core/ArcGISTiledElevationTerrainProvider.js +++ b/Source/Core/ArcGISTiledElevationTerrainProvider.js @@ -459,7 +459,7 @@ ArcGISTiledElevationTerrainProvider.prototype.getTileDataAvailable = function ( * @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. - * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ ArcGISTiledElevationTerrainProvider.prototype.loadTileDataAvailability = function ( x, diff --git a/Source/Core/ArcType.js b/Source/Core/ArcType.js index be4685caba9f..2c53d3b539cd 100644 --- a/Source/Core/ArcType.js +++ b/Source/Core/ArcType.js @@ -1,7 +1,7 @@ /** * ArcType defines the path that should be taken connecting vertices. * - * @exports ArcType + * @enum {Number} */ var ArcType = { /** diff --git a/Source/Core/AttributeCompression.js b/Source/Core/AttributeCompression.js index e50ee42734f1..dcabcdcb617d 100644 --- a/Source/Core/AttributeCompression.js +++ b/Source/Core/AttributeCompression.js @@ -11,7 +11,7 @@ var LEFT_SHIFT = 256.0; /** * Attribute compression and decompression functions. * - * @exports AttributeCompression + * @namespace AttributeCompression * * @private */ diff --git a/Source/Core/BingMapsApi.js b/Source/Core/BingMapsApi.js index aa98a5c11a07..6b2cbad640b2 100644 --- a/Source/Core/BingMapsApi.js +++ b/Source/Core/BingMapsApi.js @@ -7,7 +7,7 @@ import defined from "./defined.js"; * or {@link BingMapsGeocoderService}. You can create your own key at * {@link https://www.bingmapsportal.com/}. * - * @exports BingMapsApi + * @namespace BingMapsApi */ var BingMapsApi = {}; diff --git a/Source/Core/BingMapsGeocoderService.js b/Source/Core/BingMapsGeocoderService.js index 9c612328ed7d..82ba8af08a2c 100644 --- a/Source/Core/BingMapsGeocoderService.js +++ b/Source/Core/BingMapsGeocoderService.js @@ -58,7 +58,7 @@ Object.defineProperties(BingMapsGeocoderService.prototype, { * @function * * @param {String} query The query to be sent to the geocoder service - * @returns {Promise} + * @returns {Promise} */ BingMapsGeocoderService.prototype.geocode = function (query) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/Core/Cartesian2.js b/Source/Core/Cartesian2.js index 012eed00c8ad..64a5ca0422bf 100644 --- a/Source/Core/Cartesian2.js +++ b/Source/Core/Cartesian2.js @@ -665,7 +665,7 @@ Cartesian2.equalsArray = function (cartesian, array, offset) { * * @param {Cartesian2} [left] The first Cartesian. * @param {Cartesian2} [right] The second Cartesian. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ @@ -745,7 +745,7 @@ Cartesian2.prototype.equals = function (right) { * false otherwise. * * @param {Cartesian2} [right] The right hand side Cartesian. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ diff --git a/Source/Core/Cartesian3.js b/Source/Core/Cartesian3.js index ea2b96056caf..fa224fbf6490 100644 --- a/Source/Core/Cartesian3.js +++ b/Source/Core/Cartesian3.js @@ -742,7 +742,7 @@ Cartesian3.equalsArray = function (cartesian, array, offset) { * * @param {Cartesian3} [left] The first Cartesian. * @param {Cartesian3} [right] The second Cartesian. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ @@ -1152,7 +1152,7 @@ Cartesian3.prototype.equals = function (right) { * false otherwise. * * @param {Cartesian3} [right] The right hand side Cartesian. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ diff --git a/Source/Core/Cartesian4.js b/Source/Core/Cartesian4.js index 82087c3bcd9b..3309b0749536 100644 --- a/Source/Core/Cartesian4.js +++ b/Source/Core/Cartesian4.js @@ -735,7 +735,7 @@ Cartesian4.equalsArray = function (cartesian, array, offset) { * * @param {Cartesian4} [left] The first Cartesian. * @param {Cartesian4} [right] The second Cartesian. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ @@ -843,7 +843,7 @@ Cartesian4.prototype.equals = function (right) { * false otherwise. * * @param {Cartesian4} [right] The right hand side Cartesian. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ diff --git a/Source/Core/Cartographic.js b/Source/Core/Cartographic.js index 42cb40cf9c5b..d0b7b144c463 100644 --- a/Source/Core/Cartographic.js +++ b/Source/Core/Cartographic.js @@ -233,13 +233,11 @@ Cartographic.equals = function (left, right) { * * @param {Cartographic} [left] The first cartographic. * @param {Cartographic} [right] The second cartographic. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ Cartographic.equalsEpsilon = function (left, right, epsilon) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("epsilon", epsilon); - //>>includeEnd('debug'); + epsilon = defaultValue(epsilon, 0); return ( left === right || @@ -286,7 +284,7 @@ Cartographic.prototype.equals = function (right) { * false otherwise. * * @param {Cartographic} [right] The second cartographic. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ Cartographic.prototype.equalsEpsilon = function (right, epsilon) { diff --git a/Source/Core/CartographicGeocoderService.js b/Source/Core/CartographicGeocoderService.js index 68b090f8ede6..dabaa326886b 100644 --- a/Source/Core/CartographicGeocoderService.js +++ b/Source/Core/CartographicGeocoderService.js @@ -15,7 +15,7 @@ function CartographicGeocoderService() {} * @function * * @param {String} query The query to be sent to the geocoder service - * @returns {Promise} + * @returns {Promise} */ CartographicGeocoderService.prototype.geocode = function (query) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/Core/CesiumTerrainProvider.js b/Source/Core/CesiumTerrainProvider.js index d7dfee685e15..587611b98e29 100644 --- a/Source/Core/CesiumTerrainProvider.js +++ b/Source/Core/CesiumTerrainProvider.js @@ -485,7 +485,7 @@ function CesiumTerrainProvider(options) { * When using the Quantized-Mesh format, a tile may be returned that includes additional extensions, such as PerVertexNormals, watermask, etc. * This enumeration defines the unique identifiers for each type of extension data that has been appended to the standard mesh data. * - * @exports QuantizedMeshExtensionIds + * @namespace QuantizedMeshExtensionIds * @see CesiumTerrainProvider * @private */ @@ -1201,7 +1201,7 @@ CesiumTerrainProvider.prototype.getTileDataAvailable = function (x, y, level) { * @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. - * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ CesiumTerrainProvider.prototype.loadTileDataAvailability = function ( x, diff --git a/Source/Core/ClockRange.js b/Source/Core/ClockRange.js index c4aeb2255b39..adc12d477499 100644 --- a/Source/Core/ClockRange.js +++ b/Source/Core/ClockRange.js @@ -2,7 +2,7 @@ * Constants used by {@link Clock#tick} to determine behavior * when {@link Clock#startTime} or {@link Clock#stopTime} is reached. * - * @exports ClockRange + * @enum {Number} * * @see Clock * @see ClockStep diff --git a/Source/Core/ClockStep.js b/Source/Core/ClockStep.js index 4675cf7f4551..269fbddaf8bf 100644 --- a/Source/Core/ClockStep.js +++ b/Source/Core/ClockStep.js @@ -2,7 +2,7 @@ * Constants to determine how much time advances with each call * to {@link Clock#tick}. * - * @exports ClockStep + * @enum {Number} * * @see Clock * @see ClockRange diff --git a/Source/Core/ComponentDatatype.js b/Source/Core/ComponentDatatype.js index b4cdf116f70d..56c73c4099a8 100644 --- a/Source/Core/ComponentDatatype.js +++ b/Source/Core/ComponentDatatype.js @@ -7,7 +7,7 @@ import WebGLConstants from "./WebGLConstants.js"; * WebGL component datatypes. Components are intrinsics, * which form attributes, which form vertices. * - * @exports ComponentDatatype + * @enum {Number} */ var ComponentDatatype = { /** @@ -137,7 +137,7 @@ ComponentDatatype.getSizeInBytes = function (componentDatatype) { /** * Gets the {@link ComponentDatatype} for the provided TypedArray instance. * - * @param {TypedArray} array The typed array. + * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} array The typed array. * @returns {ComponentDatatype} The ComponentDatatype for the provided array, or undefined if the array is not a TypedArray. */ ComponentDatatype.fromTypedArray = function (array) { diff --git a/Source/Core/CornerType.js b/Source/Core/CornerType.js index 0260a53fe8a0..202d36dac32a 100644 --- a/Source/Core/CornerType.js +++ b/Source/Core/CornerType.js @@ -4,7 +4,7 @@ * @demo The {@link https://sandcastle.cesium.com/index.html?src=Corridor.html&label=Geometries|Corridor Demo} * demonstrates the three corner types, as used by {@link CorridorGraphics}. * - * @exports CornerType + * @enum {Number} */ var CornerType = { /** diff --git a/Source/Core/CubicRealPolynomial.js b/Source/Core/CubicRealPolynomial.js index c4b3390444f7..c87a43497238 100644 --- a/Source/Core/CubicRealPolynomial.js +++ b/Source/Core/CubicRealPolynomial.js @@ -4,7 +4,7 @@ import QuadraticRealPolynomial from "./QuadraticRealPolynomial.js"; /** * Defines functions for 3rd order polynomial functions of one variable with only real coefficients. * - * @exports CubicRealPolynomial + * @namespace CubicRealPolynomial */ var CubicRealPolynomial = {}; diff --git a/Source/Core/EarthOrientationParameters.js b/Source/Core/EarthOrientationParameters.js index 27ddc9eeefa7..11b697533d42 100644 --- a/Source/Core/EarthOrientationParameters.js +++ b/Source/Core/EarthOrientationParameters.js @@ -136,7 +136,7 @@ EarthOrientationParameters.NONE = Object.freeze({ * Gets a promise that, when resolved, indicates that the EOP data has been loaded and is * ready to use. * - * @returns {Promise} The promise. + * @returns {Promise} The promise. */ EarthOrientationParameters.prototype.getPromiseToLoad = function () { return when(this._downloadPromise); diff --git a/Source/Core/EasingFunction.js b/Source/Core/EasingFunction.js index d3573cf158e9..c38aeddabad7 100644 --- a/Source/Core/EasingFunction.js +++ b/Source/Core/EasingFunction.js @@ -5,13 +5,13 @@ import Tween from "../ThirdParty/Tween.js"; * {@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner. See the * {@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}. * - * @exports EasingFunction + * @namespace */ var EasingFunction = { /** * Linear easing. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ LINEAR_NONE: Tween.Easing.Linear.None, @@ -19,21 +19,21 @@ var EasingFunction = { /** * Quadratic in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUADRACTIC_IN: Tween.Easing.Quadratic.In, /** * Quadratic out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUADRACTIC_OUT: Tween.Easing.Quadratic.Out, /** * Quadratic in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUADRACTIC_IN_OUT: Tween.Easing.Quadratic.InOut, @@ -41,21 +41,21 @@ var EasingFunction = { /** * Cubic in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ CUBIC_IN: Tween.Easing.Cubic.In, /** * Cubic out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ CUBIC_OUT: Tween.Easing.Cubic.Out, /** * Cubic in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ CUBIC_IN_OUT: Tween.Easing.Cubic.InOut, @@ -63,21 +63,21 @@ var EasingFunction = { /** * Quartic in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUARTIC_IN: Tween.Easing.Quartic.In, /** * Quartic out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUARTIC_OUT: Tween.Easing.Quartic.Out, /** * Quartic in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUARTIC_IN_OUT: Tween.Easing.Quartic.InOut, @@ -85,21 +85,21 @@ var EasingFunction = { /** * Quintic in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUINTIC_IN: Tween.Easing.Quintic.In, /** * Quintic out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUINTIC_OUT: Tween.Easing.Quintic.Out, /** * Quintic in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUINTIC_IN_OUT: Tween.Easing.Quintic.InOut, @@ -107,21 +107,21 @@ var EasingFunction = { /** * Sinusoidal in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ SINUSOIDAL_IN: Tween.Easing.Sinusoidal.In, /** * Sinusoidal out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ SINUSOIDAL_OUT: Tween.Easing.Sinusoidal.Out, /** * Sinusoidal in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ SINUSOIDAL_IN_OUT: Tween.Easing.Sinusoidal.InOut, @@ -129,21 +129,21 @@ var EasingFunction = { /** * Exponential in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ EXPONENTIAL_IN: Tween.Easing.Exponential.In, /** * Exponential out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ EXPONENTIAL_OUT: Tween.Easing.Exponential.Out, /** * Exponential in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ EXPONENTIAL_IN_OUT: Tween.Easing.Exponential.InOut, @@ -151,21 +151,21 @@ var EasingFunction = { /** * Circular in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ CIRCULAR_IN: Tween.Easing.Circular.In, /** * Circular out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ CIRCULAR_OUT: Tween.Easing.Circular.Out, /** * Circular in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ CIRCULAR_IN_OUT: Tween.Easing.Circular.InOut, @@ -173,21 +173,21 @@ var EasingFunction = { /** * Elastic in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ ELASTIC_IN: Tween.Easing.Elastic.In, /** * Elastic out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ ELASTIC_OUT: Tween.Easing.Elastic.Out, /** * Elastic in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ ELASTIC_IN_OUT: Tween.Easing.Elastic.InOut, @@ -195,21 +195,21 @@ var EasingFunction = { /** * Back in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ BACK_IN: Tween.Easing.Back.In, /** * Back out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ BACK_OUT: Tween.Easing.Back.Out, /** * Back in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ BACK_IN_OUT: Tween.Easing.Back.InOut, @@ -217,21 +217,21 @@ var EasingFunction = { /** * Bounce in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ BOUNCE_IN: Tween.Easing.Bounce.In, /** * Bounce out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ BOUNCE_OUT: Tween.Easing.Bounce.Out, /** * Bounce in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ BOUNCE_IN_OUT: Tween.Easing.Bounce.InOut, @@ -239,7 +239,7 @@ var EasingFunction = { /** * Function interface for implementing a custom easing function. - * @callback EasingFunction~Callback + * @callback EasingFunction.Callback * @param {Number} time The time in the range [0, 1]. * @returns {Number} The value of the function at the given time. * diff --git a/Source/Core/EllipsoidTerrainProvider.js b/Source/Core/EllipsoidTerrainProvider.js index 4f35102553d1..d22b4f58f63d 100644 --- a/Source/Core/EllipsoidTerrainProvider.js +++ b/Source/Core/EllipsoidTerrainProvider.js @@ -199,7 +199,7 @@ EllipsoidTerrainProvider.prototype.getTileDataAvailable = function ( * @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. - * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ EllipsoidTerrainProvider.prototype.loadTileDataAvailability = function ( x, diff --git a/Source/Core/Event.js b/Source/Core/Event.js index 8f952750c521..32d0919cc9b4 100644 --- a/Source/Core/Event.js +++ b/Source/Core/Event.js @@ -49,7 +49,7 @@ Object.defineProperties(Event.prototype, { * @param {Function} listener The function to be executed when the event is raised. * @param {Object} [scope] An optional object scope to serve as the this * pointer in which the listener function will execute. - * @returns {Event~RemoveCallback} A function that will remove this event listener when invoked. + * @returns {Event.RemoveCallback} A function that will remove this event listener when invoked. * * @see Event#raiseEvent * @see Event#removeEventListener @@ -157,6 +157,6 @@ Event.prototype.raiseEvent = function () { /** * A function that removes a listener. - * @callback Event~RemoveCallback + * @callback Event.RemoveCallback */ export default Event; diff --git a/Source/Core/EventHelper.js b/Source/Core/EventHelper.js index ed9e73fe184b..bf928ae5f335 100644 --- a/Source/Core/EventHelper.js +++ b/Source/Core/EventHelper.js @@ -32,7 +32,7 @@ function EventHelper() { * @param {Function} listener The function to be executed when the event is raised. * @param {Object} [scope] An optional object scope to serve as the this * pointer in which the listener function will execute. - * @returns {EventHelper~RemoveCallback} A function that will remove this event listener when invoked. + * @returns {EventHelper.RemoveCallback} A function that will remove this event listener when invoked. * * @see Event#addEventListener */ @@ -69,6 +69,6 @@ EventHelper.prototype.removeAll = function () { /** * A function that removes a listener. - * @callback EventHelper~RemoveCallback + * @callback EventHelper.RemoveCallback */ export default EventHelper; diff --git a/Source/Core/ExtrapolationType.js b/Source/Core/ExtrapolationType.js index 43d01df39e27..58d1e2db16f1 100644 --- a/Source/Core/ExtrapolationType.js +++ b/Source/Core/ExtrapolationType.js @@ -2,7 +2,7 @@ * Constants to determine how an interpolated value is extrapolated * when querying outside the bounds of available data. * - * @exports ExtrapolationType + * @enum {Number} * * @see SampledProperty */ diff --git a/Source/Core/FeatureDetection.js b/Source/Core/FeatureDetection.js index d5265a72330e..7cc66fa3f561 100644 --- a/Source/Core/FeatureDetection.js +++ b/Source/Core/FeatureDetection.js @@ -3,7 +3,6 @@ import defaultValue from "./defaultValue.js"; import defined from "./defined.js"; import DeveloperError from "./DeveloperError.js"; import Fullscreen from "./Fullscreen.js"; -/*global CanvasPixelArray*/ var theNavigator; if (typeof navigator !== "undefined") { @@ -276,8 +275,8 @@ if (typeof ArrayBuffer !== "undefined") { typedArrayTypes.push(Uint8ClampedArray); } - if (typeof CanvasPixelArray !== "undefined") { - typedArrayTypes.push(CanvasPixelArray); + if (typeof Uint8ClampedArray !== "undefined") { + typedArrayTypes.push(Uint8ClampedArray); } } @@ -285,7 +284,7 @@ if (typeof ArrayBuffer !== "undefined") { * A set of functions to detect whether the current browser supports * various features. * - * @exports FeatureDetection + * @namespace FeatureDetection */ var FeatureDetection = { isChrome: isChrome, diff --git a/Source/Core/Fullscreen.js b/Source/Core/Fullscreen.js index 85574b3c7d66..15426970af2a 100644 --- a/Source/Core/Fullscreen.js +++ b/Source/Core/Fullscreen.js @@ -13,8 +13,7 @@ var _names = { /** * Browser-independent functions for working with the standard fullscreen API. * - * @exports Fullscreen - * @namespace + * @namespace Fullscreen * * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification} */ @@ -216,7 +215,7 @@ Fullscreen.supportsFullscreen = function () { * If fullscreen mode is not supported by the browser, does nothing. * * @param {Object} element The HTML element which will be placed into fullscreen mode. - * @param {HMDVRDevice} [vrDevice] The VR device. + * @param {Object} [vrDevice] The HMDVRDevice device. * * @example * // Put the entire page into fullscreen. diff --git a/Source/Core/GeocodeType.js b/Source/Core/GeocodeType.js index c38d80365a44..956a2047665f 100644 --- a/Source/Core/GeocodeType.js +++ b/Source/Core/GeocodeType.js @@ -1,6 +1,6 @@ /** * The type of geocoding to be performed by a {@link GeocoderService}. - * @exports GeocodeType + * @enum {Number} * @see Geocoder */ var GeocodeType = { diff --git a/Source/Core/GeocoderService.js b/Source/Core/GeocoderService.js index 4576de2fa3d7..5162da37835a 100644 --- a/Source/Core/GeocoderService.js +++ b/Source/Core/GeocoderService.js @@ -1,7 +1,7 @@ import DeveloperError from "./DeveloperError.js"; /** - * @typedef {Object} GeocoderService~Result + * @typedef {Object} GeocoderService.Result * @property {String} displayName The display name for a location * @property {Rectangle|Cartesian3} destination The bounding box for a location */ @@ -23,7 +23,7 @@ function GeocoderService() {} * * @param {String} query The query to be sent to the geocoder service * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform. - * @returns {Promise} + * @returns {Promise} */ GeocoderService.prototype.geocode = DeveloperError.throwInstantiationError; export default GeocoderService; diff --git a/Source/Core/GeometryAttribute.js b/Source/Core/GeometryAttribute.js index 96e293303d46..05a244a4498b 100644 --- a/Source/Core/GeometryAttribute.js +++ b/Source/Core/GeometryAttribute.js @@ -14,7 +14,7 @@ import DeveloperError from "./DeveloperError.js"; * @param {ComponentDatatype} [options.componentDatatype] The datatype of each component in the attribute, e.g., individual elements in values. * @param {Number} [options.componentsPerAttribute] A number between 1 and 4 that defines the number of components in an attributes. * @param {Boolean} [options.normalize=false] When true and componentDatatype is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering. - * @param {TypedArray} [options.values] The values for the attributes stored in a typed array. + * @param {number[]|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} [options.values] The values for the attributes stored in a typed array. * * @exception {DeveloperError} options.componentsPerAttribute must be between 1 and 4. * @@ -120,7 +120,7 @@ function GeometryAttribute(options) { * every three elements in values defines one attributes since * componentsPerAttribute is 3. * - * @type TypedArray + * @type {number[]|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} * * @default undefined * diff --git a/Source/Core/GeometryPipeline.js b/Source/Core/GeometryPipeline.js index b711aea73f1d..32a080a9aea9 100644 --- a/Source/Core/GeometryPipeline.js +++ b/Source/Core/GeometryPipeline.js @@ -27,7 +27,7 @@ import Tipsify from "./Tipsify.js"; /** * Content pipeline functions for geometries. * - * @exports GeometryPipeline + * @namespace GeometryPipeline * * @see Geometry */ diff --git a/Source/Core/GoogleEarthEnterpriseMetadata.js b/Source/Core/GoogleEarthEnterpriseMetadata.js index da939555ae1c..2bd39d9d8efa 100644 --- a/Source/Core/GoogleEarthEnterpriseMetadata.js +++ b/Source/Core/GoogleEarthEnterpriseMetadata.js @@ -148,7 +148,7 @@ Object.defineProperties(GoogleEarthEnterpriseMetadata.prototype, { /** * Gets the proxy used for metadata requests. * @memberof GoogleEarthEnterpriseMetadata.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { diff --git a/Source/Core/GoogleEarthEnterpriseTerrainData.js b/Source/Core/GoogleEarthEnterpriseTerrainData.js index ac8fd12a35d7..f8137464e24f 100644 --- a/Source/Core/GoogleEarthEnterpriseTerrainData.js +++ b/Source/Core/GoogleEarthEnterpriseTerrainData.js @@ -107,7 +107,7 @@ Object.defineProperties(GoogleEarthEnterpriseTerrainData.prototype, { * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. * @memberof GoogleEarthEnterpriseTerrainData.prototype - * @type {Uint8Array|Image|Canvas} + * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement} */ waterMask: { get: function () { diff --git a/Source/Core/GoogleEarthEnterpriseTerrainProvider.js b/Source/Core/GoogleEarthEnterpriseTerrainProvider.js index c952dff0eae5..4402c159f28b 100644 --- a/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +++ b/Source/Core/GoogleEarthEnterpriseTerrainProvider.js @@ -192,7 +192,7 @@ Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof GoogleEarthEnterpriseTerrainProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -619,7 +619,7 @@ GoogleEarthEnterpriseTerrainProvider.prototype.getTileDataAvailable = function ( * @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. - * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ GoogleEarthEnterpriseTerrainProvider.prototype.loadTileDataAvailability = function ( x, diff --git a/Source/Core/GroundPolylineGeometry.js b/Source/Core/GroundPolylineGeometry.js index d51b1a7b5d16..b2e1fcb823c8 100644 --- a/Source/Core/GroundPolylineGeometry.js +++ b/Source/Core/GroundPolylineGeometry.js @@ -1310,7 +1310,7 @@ function generateGeometryAttributes( * - encoded texture coordinate offsets ****************************************/ - /** 3D **/ + /* 3D */ var segmentLength3D = Cartesian3.distance(startTop, endTop); var encodedStart = EncodedCartesian3.fromCartesian( @@ -1348,7 +1348,7 @@ function generateGeometryAttributes( var texcoordNormalization3DX = segmentLength3D / length3D; var texcoordNormalization3DY = lengthSoFar3D / length3D; - /** 2D **/ + /* 2D */ var segmentLength2D = 0.0; var encodedStart2D; var forwardOffset2D; diff --git a/Source/Core/HeadingPitchRoll.js b/Source/Core/HeadingPitchRoll.js index b3b193833eba..cb037c3c41ce 100644 --- a/Source/Core/HeadingPitchRoll.js +++ b/Source/Core/HeadingPitchRoll.js @@ -131,7 +131,7 @@ HeadingPitchRoll.equals = function (left, right) { * * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll. * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ @@ -193,7 +193,7 @@ HeadingPitchRoll.prototype.equals = function (right) { * false otherwise. * * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ diff --git a/Source/Core/Heap.js b/Source/Core/Heap.js index 02d5fb1106b0..8d7d6ebece75 100644 --- a/Source/Core/Heap.js +++ b/Source/Core/Heap.js @@ -10,7 +10,7 @@ import defined from "./defined.js"; * @private * * @param {Object} options Object with the following properties: - * @param {Heap~ComparatorCallback} options.comparator The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index. + * @param {Heap.ComparatorCallback} options.comparator The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index. */ function Heap(options) { //>>includeStart('debug', pragmas.debug); @@ -78,7 +78,7 @@ Object.defineProperties(Heap.prototype, { * * @memberof Heap.prototype * - * @type {Heap~ComparatorCallback} + * @type {Heap.ComparatorCallback} */ comparator: { get: function () { @@ -216,7 +216,7 @@ Heap.prototype.pop = function (index) { /** * The comparator to use for the heap. - * @callback Heap~ComparatorCallback + * @callback Heap.ComparatorCallback * @param {*} a An element in the heap. * @param {*} b An element in the heap. * @returns {Number} If the result of the comparison is less than 0, sort a to a lower index than b, otherwise sort to a higher index. diff --git a/Source/Core/HeightmapEncoding.js b/Source/Core/HeightmapEncoding.js index d09a62705b93..56f56a1b6305 100644 --- a/Source/Core/HeightmapEncoding.js +++ b/Source/Core/HeightmapEncoding.js @@ -1,7 +1,7 @@ /** * The encoding that is used for a heightmap * - * @exports HeightmapEncoding + * @enum {Number} */ var HeightmapEncoding = { /** diff --git a/Source/Core/HeightmapTerrainData.js b/Source/Core/HeightmapTerrainData.js index ee6031b2b8fe..949ce5c1b6d7 100644 --- a/Source/Core/HeightmapTerrainData.js +++ b/Source/Core/HeightmapTerrainData.js @@ -23,7 +23,7 @@ import TerrainProvider from "./TerrainProvider.js"; * @constructor * * @param {Object} options Object with the following properties: - * @param {TypedArray} options.buffer The buffer containing height data. + * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} options.buffer The buffer containing height data. * @param {Number} options.width The width (longitude direction) of the heightmap, in samples. * @param {Number} options.height The height (latitude direction) of the heightmap, in samples. * @param {Number} [options.childTileMask=15] A bit mask indicating which of this tile's four children exist. @@ -167,7 +167,7 @@ Object.defineProperties(HeightmapTerrainData.prototype, { * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. * @memberof HeightmapTerrainData.prototype - * @type {Uint8Array|Image|Canvas} + * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement} */ waterMask: { get: function () { diff --git a/Source/Core/HeightmapTessellator.js b/Source/Core/HeightmapTessellator.js index 00e2c6f50b22..729443340b34 100644 --- a/Source/Core/HeightmapTessellator.js +++ b/Source/Core/HeightmapTessellator.js @@ -18,7 +18,7 @@ import WebMercatorProjection from "./WebMercatorProjection.js"; /** * Contains functions to create a mesh from a heightmap image. * - * @exports HeightmapTessellator + * @namespace HeightmapTessellator * * @private */ @@ -47,7 +47,7 @@ var maximumScratch = new Cartesian3(); * Fills an array of vertices from a heightmap image. * * @param {Object} options Object with the following properties: - * @param {TypedArray} options.heightmap The heightmap to tessellate. + * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} options.heightmap The heightmap to tessellate. * @param {Number} options.width The width of the heightmap, in height samples. * @param {Number} options.height The height of the heightmap, in height samples. * @param {Number} options.skirtHeight The height of skirts to drape at the edges of the heightmap. diff --git a/Source/Core/HermitePolynomialApproximation.js b/Source/Core/HermitePolynomialApproximation.js index 032327e8d096..33c8f4baf38c 100644 --- a/Source/Core/HermitePolynomialApproximation.js +++ b/Source/Core/HermitePolynomialApproximation.js @@ -64,7 +64,7 @@ function calculateCoefficientTerm( /** * An {@link InterpolationAlgorithm} for performing Hermite interpolation. * - * @exports HermitePolynomialApproximation + * @namespace HermitePolynomialApproximation */ var HermitePolynomialApproximation = { type: "Hermite", diff --git a/Source/Core/Iau2000Orientation.js b/Source/Core/Iau2000Orientation.js index b43690f8e723..07f7bc8aa18a 100644 --- a/Source/Core/Iau2000Orientation.js +++ b/Source/Core/Iau2000Orientation.js @@ -9,7 +9,7 @@ import TimeConstants from "./TimeConstants.js"; * The data comes from the Report of the IAU/IAG Working Group on Cartographic * Coordinates and Rotational Elements: 2000. * - * @exports Iau2000Orientation + * @namespace Iau2000Orientation * * @private */ @@ -39,6 +39,7 @@ var dateTT = new JulianDate(); * @param {JulianDate} [date=JulianDate.now()] The date to evaluate the parameters. * @param {IauOrientationParameters} [result] The object onto which to store the result. * @returns {IauOrientationParameters} The modified result parameter or a new instance representing the orientation of the Earth's Moon. + * @private */ Iau2000Orientation.ComputeMoon = function (date, result) { if (!defined(date)) { diff --git a/Source/Core/Iau2006XysData.js b/Source/Core/Iau2006XysData.js index a7810c6e424b..325f7a164195 100644 --- a/Source/Core/Iau2006XysData.js +++ b/Source/Core/Iau2006XysData.js @@ -94,7 +94,7 @@ function getDaysSinceEpoch(xys, dayTT, secondTT) { * the Terrestrial Time (TT) time standard. * @param {Number} stopSecondTT The seconds past noon of the end of the interval to preload, expressed in * the Terrestrial Time (TT) time standard. - * @returns {Promise} A promise that, when resolved, indicates that the requested interval has been + * @returns {Promise} A promise that, when resolved, indicates that the requested interval has been * preloaded. */ Iau2006XysData.prototype.preload = function ( diff --git a/Source/Core/IauOrientationAxes.js b/Source/Core/IauOrientationAxes.js index 88a710d25384..1d24fbd4eb33 100644 --- a/Source/Core/IauOrientationAxes.js +++ b/Source/Core/IauOrientationAxes.js @@ -12,7 +12,7 @@ import Quaternion from "./Quaternion.js"; * @alias IauOrientationAxes * @constructor * - * @param {IauOrientationAxes~ComputeFunction} [computeFunction] The function that computes the {@link IauOrientationParameters} given a {@link JulianDate}. + * @param {IauOrientationAxes.ComputeFunction} [computeFunction] The function that computes the {@link IauOrientationParameters} given a {@link JulianDate}. * * @see Iau2000Orientation * @@ -97,8 +97,9 @@ IauOrientationAxes.prototype.evaluate = function (date, result) { /** * A function that computes the {@link IauOrientationParameters} for a {@link JulianDate}. - * @callback IauOrientationAxes~ComputeFunction + * @callback IauOrientationAxes.ComputeFunction * @param {JulianDate} date The date to evaluate the parameters. * @returns {IauOrientationParameters} The orientation parameters. + * @private */ export default IauOrientationAxes; diff --git a/Source/Core/IauOrientationParameters.js b/Source/Core/IauOrientationParameters.js index 5fd99747659f..361aa7725fd8 100644 --- a/Source/Core/IauOrientationParameters.js +++ b/Source/Core/IauOrientationParameters.js @@ -6,7 +6,7 @@ * except that they are expressed in radians. *

* - * @exports IauOrientationParameters + * @namespace IauOrientationParameters * * @private */ diff --git a/Source/Core/IndexDatatype.js b/Source/Core/IndexDatatype.js index 114e580f9771..3fa2c587262a 100644 --- a/Source/Core/IndexDatatype.js +++ b/Source/Core/IndexDatatype.js @@ -7,7 +7,7 @@ import WebGLConstants from "./WebGLConstants.js"; * Constants for WebGL index datatypes. These corresponds to the * type parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}. * - * @exports IndexDatatype + * @enum {Number} */ var IndexDatatype = { /** diff --git a/Source/Core/InterpolationAlgorithm.js b/Source/Core/InterpolationAlgorithm.js index 10e5a954e665..f512c94c73a4 100644 --- a/Source/Core/InterpolationAlgorithm.js +++ b/Source/Core/InterpolationAlgorithm.js @@ -3,7 +3,7 @@ import DeveloperError from "./DeveloperError.js"; /** * The interface for interpolation algorithms. * - * @exports InterpolationAlgorithm + * @interface InterpolationAlgorithm * * @see LagrangePolynomialApproximation * @see LinearApproximation diff --git a/Source/Core/Intersect.js b/Source/Core/Intersect.js index 28722d5f1765..96effac7107f 100644 --- a/Source/Core/Intersect.js +++ b/Source/Core/Intersect.js @@ -4,7 +4,7 @@ * partially inside the frustum and partially outside (INTERSECTING), or somwhere entirely * outside of the frustum's 6 planes (OUTSIDE). * - * @exports Intersect + * @enum {Number} */ var Intersect = { /** diff --git a/Source/Core/IntersectionTests.js b/Source/Core/IntersectionTests.js index f5ce668b4af5..dba56cf8a3e7 100644 --- a/Source/Core/IntersectionTests.js +++ b/Source/Core/IntersectionTests.js @@ -13,8 +13,7 @@ import Ray from "./Ray.js"; /** * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids. * - * @exports IntersectionTests - * @namespace + * @namespace IntersectionTests */ var IntersectionTests = {}; diff --git a/Source/Core/Intersections2D.js b/Source/Core/Intersections2D.js index 0153ba04fa6e..08c62fc4641c 100644 --- a/Source/Core/Intersections2D.js +++ b/Source/Core/Intersections2D.js @@ -7,7 +7,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Contains functions for operating on 2D triangles. * - * @exports Intersections2D + * @namespace Intersections2D */ var Intersections2D = {}; diff --git a/Source/Core/Ion.js b/Source/Core/Ion.js index 3745f1fe0f10..c85f325cc7d8 100644 --- a/Source/Core/Ion.js +++ b/Source/Core/Ion.js @@ -7,7 +7,6 @@ var defaultAccessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiNWMwZmFjMy04ZmRmLTRhMjktYjUzYi00YWQ4N2ZiNmIwNjUiLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTg4MzQxMTA4fQ.scXa4kn5vzNVSgsEYKNYP0szYXPq1Djx1SH0KcAOrrk"; /** * Default settings for accessing the Cesium ion API. - * @exports Ion * * An ion access token is only required if you are using any ion related APIs. * A default access token is provided for evaluation purposes only. @@ -18,6 +17,7 @@ var defaultAccessToken = * @see IonGeocoderService * @see createWorldImagery * @see createWorldTerrain + * @namespace Ion */ var Ion = {}; diff --git a/Source/Core/IonGeocoderService.js b/Source/Core/IonGeocoderService.js index 8ae06d2c92ea..daf44dc432e0 100644 --- a/Source/Core/IonGeocoderService.js +++ b/Source/Core/IonGeocoderService.js @@ -14,7 +14,6 @@ import Resource from "./Resource.js"; * @param {Object} options Object with the following properties: * @param {Scene} options.scene The scene * @param {String} [options.accessToken=Ion.defaultAccessToken] The access token to use. - * @param {String} [options.accessToken=Ion.defaultAccessToken] The access token to use. * @param {String|Resource} [options.server=Ion.defaultServer] The resource to the Cesium ion API server. * * @see Ion @@ -57,7 +56,7 @@ function IonGeocoderService(options) { * * @param {String} query The query to be sent to the geocoder service * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform. - * @returns {Promise} + * @returns {Promise} */ IonGeocoderService.prototype.geocode = function (query, geocodeType) { return this._pelias.geocode(query, geocodeType); diff --git a/Source/Core/Iso8601.js b/Source/Core/Iso8601.js index 74757520f428..97738cf93470 100644 --- a/Source/Core/Iso8601.js +++ b/Source/Core/Iso8601.js @@ -17,7 +17,7 @@ var MAXIMUM_INTERVAL = Object.freeze( /** * Constants related to ISO8601 support. * - * @exports Iso8601 + * @namespace * * @see {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601 on Wikipedia} * @see JulianDate diff --git a/Source/Core/JulianDate.js b/Source/Core/JulianDate.js index e3b77af8ab09..42388d916217 100644 --- a/Source/Core/JulianDate.js +++ b/Source/Core/JulianDate.js @@ -901,15 +901,11 @@ JulianDate.equals = function (left, right) { * * @param {JulianDate} [left] The first instance. * @param {JulianDate} [right] The second instance. - * @param {Number} epsilon The maximum number of seconds that should separate the two instances. + * @param {Number} [epsilon=0] The maximum number of seconds that should separate the two instances. * @returns {Boolean} true if the two dates are within epsilon seconds of each other; otherwise false. */ JulianDate.equalsEpsilon = function (left, right, epsilon) { - //>>includeStart('debug', pragmas.debug); - if (!defined(epsilon)) { - throw new DeveloperError("epsilon is required."); - } - //>>includeEnd('debug'); + epsilon = defaultValue(epsilon, 0); return ( left === right || @@ -1182,7 +1178,7 @@ JulianDate.prototype.equals = function (right) { * seconds, must be less than epsilon. * * @param {JulianDate} [right] The second instance. - * @param {Number} epsilon The maximum number of seconds that should separate the two instances. + * @param {Number} [epsilon=0] The maximum number of seconds that should separate the two instances. * @returns {Boolean} true if the two dates are within epsilon seconds of each other; otherwise false. */ JulianDate.prototype.equalsEpsilon = function (right, epsilon) { diff --git a/Source/Core/KeyboardEventModifier.js b/Source/Core/KeyboardEventModifier.js index 8d347200957f..0ff50f243cfe 100644 --- a/Source/Core/KeyboardEventModifier.js +++ b/Source/Core/KeyboardEventModifier.js @@ -2,7 +2,7 @@ * This enumerated type is for representing keyboard modifiers. These are keys * that are held down in addition to other event types. * - * @exports KeyboardEventModifier + * @enum {Number} */ var KeyboardEventModifier = { /** diff --git a/Source/Core/LagrangePolynomialApproximation.js b/Source/Core/LagrangePolynomialApproximation.js index 4bc59175b5b9..f43816a698c5 100644 --- a/Source/Core/LagrangePolynomialApproximation.js +++ b/Source/Core/LagrangePolynomialApproximation.js @@ -3,7 +3,7 @@ import defined from "./defined.js"; /** * An {@link InterpolationAlgorithm} for performing Lagrange interpolation. * - * @exports LagrangePolynomialApproximation + * @namespace LagrangePolynomialApproximation */ var LagrangePolynomialApproximation = { type: "Lagrange", diff --git a/Source/Core/LinearApproximation.js b/Source/Core/LinearApproximation.js index ffca6c48fec5..5665e9f34168 100644 --- a/Source/Core/LinearApproximation.js +++ b/Source/Core/LinearApproximation.js @@ -4,7 +4,7 @@ import DeveloperError from "./DeveloperError.js"; /** * An {@link InterpolationAlgorithm} for performing linear interpolation. * - * @exports LinearApproximation + * @namespace LinearApproximation */ var LinearApproximation = { type: "Linear", diff --git a/Source/Core/MapboxApi.js b/Source/Core/MapboxApi.js index 1460fc3d8601..e808890e7d33 100644 --- a/Source/Core/MapboxApi.js +++ b/Source/Core/MapboxApi.js @@ -2,7 +2,7 @@ import Credit from "./Credit.js"; import defined from "./defined.js"; /** - * @exports MapboxApi + * @namespace MapboxApi */ var MapboxApi = {}; diff --git a/Source/Core/Math.js b/Source/Core/Math.js index ea3e31635ece..83fa3d985703 100644 --- a/Source/Core/Math.js +++ b/Source/Core/Math.js @@ -7,7 +7,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Math functions. * - * @exports CesiumMath + * @namespace CesiumMath * @alias Math */ var CesiumMath = {}; @@ -580,7 +580,7 @@ CesiumMath.mod = function (m, n) { * * @param {Number} left The first value to compare. * @param {Number} right The other value to compare. - * @param {Number} relativeEpsilon The maximum inclusive delta between left and right for the relative tolerance test. + * @param {Number} [relativeEpsilon=0] The maximum inclusive delta between left and right for the relative tolerance test. * @param {Number} [absoluteEpsilon=relativeEpsilon] The maximum inclusive delta between left and right for the absolute tolerance test. * @returns {Boolean} true if the values are equal within the epsilon; otherwise, false. * @@ -603,10 +603,9 @@ CesiumMath.equalsEpsilon = function ( if (!defined(right)) { throw new DeveloperError("right is required."); } - if (!defined(relativeEpsilon)) { - throw new DeveloperError("relativeEpsilon is required."); - } //>>includeEnd('debug'); + + relativeEpsilon = defaultValue(relativeEpsilon, 0.0); absoluteEpsilon = defaultValue(absoluteEpsilon, relativeEpsilon); var absDiff = Math.abs(left - right); return ( diff --git a/Source/Core/Matrix2.js b/Source/Core/Matrix2.js index a51bac194da8..1e617774f9e6 100644 --- a/Source/Core/Matrix2.js +++ b/Source/Core/Matrix2.js @@ -725,14 +725,11 @@ Matrix2.equalsArray = function (matrix, array, offset) { * * @param {Matrix2} [left] The first matrix. * @param {Matrix2} [right] The second matrix. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ Matrix2.equalsEpsilon = function (left, right, epsilon) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("epsilon", epsilon); - //>>includeEnd('debug'); - + epsilon = defaultValue(epsilon, 0); return ( left === right || (defined(left) && @@ -849,7 +846,7 @@ Matrix2.prototype.equals = function (right) { * false otherwise. * * @param {Matrix2} [right] The right hand side matrix. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ Matrix2.prototype.equalsEpsilon = function (right, epsilon) { diff --git a/Source/Core/Matrix3.js b/Source/Core/Matrix3.js index bee35156cacb..e6b21a51dd61 100644 --- a/Source/Core/Matrix3.js +++ b/Source/Core/Matrix3.js @@ -1394,13 +1394,11 @@ Matrix3.equals = function (left, right) { * * @param {Matrix3} [left] The first matrix. * @param {Matrix3} [right] The second matrix. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ Matrix3.equalsEpsilon = function (left, right, epsilon) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("epsilon", epsilon); - //>>includeEnd('debug'); + epsilon = defaultValue(epsilon, 0); return ( left === right || @@ -1568,7 +1566,7 @@ Matrix3.equalsArray = function (matrix, array, offset) { * false otherwise. * * @param {Matrix3} [right] The right hand side matrix. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ Matrix3.prototype.equalsEpsilon = function (right, epsilon) { diff --git a/Source/Core/Matrix4.js b/Source/Core/Matrix4.js index 6802b45f874f..16b264197116 100644 --- a/Source/Core/Matrix4.js +++ b/Source/Core/Matrix4.js @@ -943,10 +943,10 @@ Matrix4.computeInfinitePerspectiveOffCenter = function ( /** * Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates. * - * @param {Object}[viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] The viewport's corners as shown in Example 1. - * @param {Number}[nearDepthRange=0.0] The near plane distance in window coordinates. - * @param {Number}[farDepthRange=1.0] The far plane distance in window coordinates. - * @param {Matrix4} result The object in which the result will be stored. + * @param {Object} [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] The viewport's corners as shown in Example 1. + * @param {Number} [nearDepthRange=0.0] The near plane distance in window coordinates. + * @param {Number} [farDepthRange=1.0] The far plane distance in window coordinates. + * @param {Matrix4} [result] The object in which the result will be stored. * @returns {Matrix4} The modified result parameter. * * @example @@ -964,9 +964,9 @@ Matrix4.computeViewportTransformation = function ( farDepthRange, result ) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.object("result", result); - //>>includeEnd('debug'); + if (!defined(result)) { + result = new Matrix4(); + } viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -2257,7 +2257,7 @@ Matrix4.equals = function (left, right) { * * @param {Matrix4} [left] The first matrix. * @param {Matrix4} [right] The second matrix. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. * * @example @@ -2282,9 +2282,7 @@ Matrix4.equals = function (left, right) { * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function (left, right, epsilon) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("epsilon", epsilon); - //>>includeEnd('debug'); + epsilon = defaultValue(epsilon, 0); return ( left === right || @@ -2895,7 +2893,7 @@ Matrix4.equalsArray = function (matrix, array, offset) { * false otherwise. * * @param {Matrix4} [right] The right hand side matrix. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ Matrix4.prototype.equalsEpsilon = function (right, epsilon) { diff --git a/Source/Core/OpenCageGeocoderService.js b/Source/Core/OpenCageGeocoderService.js index aab2515a09be..1a743c4dc259 100644 --- a/Source/Core/OpenCageGeocoderService.js +++ b/Source/Core/OpenCageGeocoderService.js @@ -54,7 +54,7 @@ Object.defineProperties(OpenCageGeocoderService.prototype, { /** * The Resource used to access the OpenCage endpoint. * @type {Resource} - * @memberof {OpenCageGeocoderService.prototype} + * @memberof OpenCageGeocoderService.prototype * @readonly */ url: { @@ -65,7 +65,7 @@ Object.defineProperties(OpenCageGeocoderService.prototype, { /** * Optional params passed to OpenCage in order to customize geocoding * @type {Object} - * @memberof {OpenCageGeocoderService.prototype} + * @memberof OpenCageGeocoderService.prototype * @readonly */ params: { @@ -79,7 +79,7 @@ Object.defineProperties(OpenCageGeocoderService.prototype, { * @function * * @param {String} query The query to be sent to the geocoder service - * @returns {Promise} + * @returns {Promise} */ OpenCageGeocoderService.prototype.geocode = function (query) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/Core/Packable.js b/Source/Core/Packable.js index cda6966f5235..479c91ae64a7 100644 --- a/Source/Core/Packable.js +++ b/Source/Core/Packable.js @@ -5,7 +5,7 @@ import DeveloperError from "./DeveloperError.js"; * elements in an array. These methods and properties are expected to be * defined on a constructor function. * - * @exports Packable + * @interface Packable * * @see PackableForInterpolation */ diff --git a/Source/Core/PackableForInterpolation.js b/Source/Core/PackableForInterpolation.js index 6f3cc9099e2c..c3a0f603162f 100644 --- a/Source/Core/PackableForInterpolation.js +++ b/Source/Core/PackableForInterpolation.js @@ -5,7 +5,7 @@ import DeveloperError from "./DeveloperError.js"; * different representation than their packed value. These methods and * properties are expected to be defined on a constructor function. * - * @exports PackableForInterpolation + * @namespace PackableForInterpolation * * @see Packable */ @@ -23,7 +23,7 @@ var PackableForInterpolation = { * @param {Number[]} packedArray The packed array. * @param {Number} [startingIndex=0] The index of the first element to be converted. * @param {Number} [lastIndex=packedArray.length] The index of the last element to be converted. - * @param {Number[]} result The object into which to store the result. + * @param {Number[]} [result] The object into which to store the result. */ convertPackedArrayForInterpolation: DeveloperError.throwInstantiationError, diff --git a/Source/Core/PeliasGeocoderService.js b/Source/Core/PeliasGeocoderService.js index daf2f211bc12..7377186bae27 100644 --- a/Source/Core/PeliasGeocoderService.js +++ b/Source/Core/PeliasGeocoderService.js @@ -51,7 +51,7 @@ Object.defineProperties(PeliasGeocoderService.prototype, { * * @param {String} query The query to be sent to the geocoder service * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform. - * @returns {Promise} + * @returns {Promise} */ PeliasGeocoderService.prototype.geocode = function (query, type) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/Core/PinBuilder.js b/Source/Core/PinBuilder.js index 3248d0d1bdfc..e0ea7dc05a9d 100644 --- a/Source/Core/PinBuilder.js +++ b/Source/Core/PinBuilder.js @@ -27,7 +27,7 @@ function PinBuilder() { * * @param {Color} color The color of the pin. * @param {Number} size The size of the pin, in pixels. - * @returns {Canvas} The canvas element that represents the generated pin. + * @returns {HTMLCanvasElement} The canvas element that represents the generated pin. */ PinBuilder.prototype.fromColor = function (color, size) { //>>includeStart('debug', pragmas.debug); @@ -47,7 +47,7 @@ PinBuilder.prototype.fromColor = function (color, size) { * @param {Resource|String} url The url of the image to be stamped onto the pin. * @param {Color} color The color of the pin. * @param {Number} size The size of the pin, in pixels. - * @returns {Canvas|Promise.} The canvas element or a Promise to the canvas element that represents the generated pin. + * @returns {HTMLCanvasElement|Promise.} The canvas element or a Promise to the canvas element that represents the generated pin. */ PinBuilder.prototype.fromUrl = function (url, color, size) { //>>includeStart('debug', pragmas.debug); @@ -70,7 +70,7 @@ PinBuilder.prototype.fromUrl = function (url, color, size) { * @param {String} id The id of the maki icon to be stamped onto the pin. * @param {Color} color The color of the pin. * @param {Number} size The size of the pin, in pixels. - * @returns {Canvas|Promise.} The canvas element or a Promise to the canvas element that represents the generated pin. + * @returns {HTMLCanvasElement|Promise.} The canvas element or a Promise to the canvas element that represents the generated pin. */ PinBuilder.prototype.fromMakiIconId = function (id, color, size) { //>>includeStart('debug', pragmas.debug); @@ -100,7 +100,7 @@ PinBuilder.prototype.fromMakiIconId = function (id, color, size) { * @param {String} text The text to be stamped onto the pin. * @param {Color} color The color of the pin. * @param {Number} size The size of the pin, in pixels. - * @returns {Canvas} The canvas element that represents the generated pin. + * @returns {HTMLCanvasElement} The canvas element that represents the generated pin. */ PinBuilder.prototype.fromText = function (text, color, size) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/Core/PixelFormat.js b/Source/Core/PixelFormat.js index 0b3115fbff21..241dbd2569da 100644 --- a/Source/Core/PixelFormat.js +++ b/Source/Core/PixelFormat.js @@ -4,7 +4,7 @@ import WebGLConstants from "./WebGLConstants.js"; /** * The format of a pixel, i.e., the number of components it has and what they represent. * - * @exports PixelFormat + * @enum {Number} */ var PixelFormat = { /** @@ -134,223 +134,239 @@ var PixelFormat = { * @constant */ RGB_ETC1: WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL, +}; - /** - * @private - */ - componentsLength: function (pixelFormat) { - switch (pixelFormat) { - case PixelFormat.RGB: - return 3; - case PixelFormat.RGBA: - return 4; - case PixelFormat.LUMINANCE_ALPHA: - return 2; - case PixelFormat.ALPHA: - case PixelFormat.LUMINANCE: - return 1; - default: - return 1; - } - }, - - /** - * @private - */ - validate: function (pixelFormat) { - return ( - pixelFormat === PixelFormat.DEPTH_COMPONENT || - pixelFormat === PixelFormat.DEPTH_STENCIL || - pixelFormat === PixelFormat.ALPHA || - pixelFormat === PixelFormat.RGB || - pixelFormat === PixelFormat.RGBA || - pixelFormat === PixelFormat.LUMINANCE || - pixelFormat === PixelFormat.LUMINANCE_ALPHA || - pixelFormat === PixelFormat.RGB_DXT1 || - pixelFormat === PixelFormat.RGBA_DXT1 || - pixelFormat === PixelFormat.RGBA_DXT3 || - pixelFormat === PixelFormat.RGBA_DXT5 || - pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || - pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || - pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || - pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 || - pixelFormat === PixelFormat.RGB_ETC1 - ); - }, +/** + * @private + */ +PixelFormat.componentsLength = function (pixelFormat) { + switch (pixelFormat) { + case PixelFormat.RGB: + return 3; + case PixelFormat.RGBA: + return 4; + case PixelFormat.LUMINANCE_ALPHA: + return 2; + case PixelFormat.ALPHA: + case PixelFormat.LUMINANCE: + return 1; + default: + return 1; + } +}; - /** - * @private - */ - isColorFormat: function (pixelFormat) { - return ( - pixelFormat === PixelFormat.ALPHA || - pixelFormat === PixelFormat.RGB || - pixelFormat === PixelFormat.RGBA || - pixelFormat === PixelFormat.LUMINANCE || - pixelFormat === PixelFormat.LUMINANCE_ALPHA - ); - }, +/** + * @private + */ +PixelFormat.validate = function (pixelFormat) { + return ( + pixelFormat === PixelFormat.DEPTH_COMPONENT || + pixelFormat === PixelFormat.DEPTH_STENCIL || + pixelFormat === PixelFormat.ALPHA || + pixelFormat === PixelFormat.RGB || + pixelFormat === PixelFormat.RGBA || + pixelFormat === PixelFormat.LUMINANCE || + pixelFormat === PixelFormat.LUMINANCE_ALPHA || + pixelFormat === PixelFormat.RGB_DXT1 || + pixelFormat === PixelFormat.RGBA_DXT1 || + pixelFormat === PixelFormat.RGBA_DXT3 || + pixelFormat === PixelFormat.RGBA_DXT5 || + pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || + pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || + pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || + pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 || + pixelFormat === PixelFormat.RGB_ETC1 + ); +}; - /** - * @private - */ - isDepthFormat: function (pixelFormat) { - return ( - pixelFormat === PixelFormat.DEPTH_COMPONENT || - pixelFormat === PixelFormat.DEPTH_STENCIL - ); - }, +/** + * @private + */ +PixelFormat.isColorFormat = function (pixelFormat) { + return ( + pixelFormat === PixelFormat.ALPHA || + pixelFormat === PixelFormat.RGB || + pixelFormat === PixelFormat.RGBA || + pixelFormat === PixelFormat.LUMINANCE || + pixelFormat === PixelFormat.LUMINANCE_ALPHA + ); +}; - /** - * @private - */ - isCompressedFormat: function (pixelFormat) { - return ( - pixelFormat === PixelFormat.RGB_DXT1 || - pixelFormat === PixelFormat.RGBA_DXT1 || - pixelFormat === PixelFormat.RGBA_DXT3 || - pixelFormat === PixelFormat.RGBA_DXT5 || - pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || - pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || - pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || - pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 || - pixelFormat === PixelFormat.RGB_ETC1 - ); - }, +/** + * @private + */ +PixelFormat.isDepthFormat = function (pixelFormat) { + return ( + pixelFormat === PixelFormat.DEPTH_COMPONENT || + pixelFormat === PixelFormat.DEPTH_STENCIL + ); +}; - /** - * @private - */ - isDXTFormat: function (pixelFormat) { - return ( - pixelFormat === PixelFormat.RGB_DXT1 || - pixelFormat === PixelFormat.RGBA_DXT1 || - pixelFormat === PixelFormat.RGBA_DXT3 || - pixelFormat === PixelFormat.RGBA_DXT5 - ); - }, +/** + * @private + */ +PixelFormat.isCompressedFormat = function (pixelFormat) { + return ( + pixelFormat === PixelFormat.RGB_DXT1 || + pixelFormat === PixelFormat.RGBA_DXT1 || + pixelFormat === PixelFormat.RGBA_DXT3 || + pixelFormat === PixelFormat.RGBA_DXT5 || + pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || + pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || + pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || + pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 || + pixelFormat === PixelFormat.RGB_ETC1 + ); +}; - /** - * @private - */ - isPVRTCFormat: function (pixelFormat) { - return ( - pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || - pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || - pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || - pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 - ); - }, +/** + * @private + */ +PixelFormat.isDXTFormat = function (pixelFormat) { + return ( + pixelFormat === PixelFormat.RGB_DXT1 || + pixelFormat === PixelFormat.RGBA_DXT1 || + pixelFormat === PixelFormat.RGBA_DXT3 || + pixelFormat === PixelFormat.RGBA_DXT5 + ); +}; - /** - * @private - */ - isETC1Format: function (pixelFormat) { - return pixelFormat === PixelFormat.RGB_ETC1; - }, +/** + * @private + */ +PixelFormat.isPVRTCFormat = function (pixelFormat) { + return ( + pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || + pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || + pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || + pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 + ); +}; - /** - * @private - */ - compressedTextureSizeInBytes: function (pixelFormat, width, height) { - switch (pixelFormat) { - case PixelFormat.RGB_DXT1: - case PixelFormat.RGBA_DXT1: - case PixelFormat.RGB_ETC1: - return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8; - - case PixelFormat.RGBA_DXT3: - case PixelFormat.RGBA_DXT5: - return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16; - - case PixelFormat.RGB_PVRTC_4BPPV1: - case PixelFormat.RGBA_PVRTC_4BPPV1: - return Math.floor( - (Math.max(width, 8) * Math.max(height, 8) * 4 + 7) / 8 - ); - - case PixelFormat.RGB_PVRTC_2BPPV1: - case PixelFormat.RGBA_PVRTC_2BPPV1: - return Math.floor( - (Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8 - ); - - default: - return 0; - } - }, +/** + * @private + */ +PixelFormat.isETC1Format = function (pixelFormat) { + return pixelFormat === PixelFormat.RGB_ETC1; +}; - /** - * @private - */ - textureSizeInBytes: function (pixelFormat, pixelDatatype, width, height) { - var componentsLength = PixelFormat.componentsLength(pixelFormat); - if (PixelDatatype.isPacked(pixelDatatype)) { - componentsLength = 1; - } - return ( - componentsLength * - PixelDatatype.sizeInBytes(pixelDatatype) * - width * - height - ); - }, +/** + * @private + */ +PixelFormat.compressedTextureSizeInBytes = function ( + pixelFormat, + width, + height +) { + switch (pixelFormat) { + case PixelFormat.RGB_DXT1: + case PixelFormat.RGBA_DXT1: + case PixelFormat.RGB_ETC1: + return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8; + + case PixelFormat.RGBA_DXT3: + case PixelFormat.RGBA_DXT5: + return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16; + + case PixelFormat.RGB_PVRTC_4BPPV1: + case PixelFormat.RGBA_PVRTC_4BPPV1: + return Math.floor((Math.max(width, 8) * Math.max(height, 8) * 4 + 7) / 8); + + case PixelFormat.RGB_PVRTC_2BPPV1: + case PixelFormat.RGBA_PVRTC_2BPPV1: + return Math.floor( + (Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8 + ); + + default: + return 0; + } +}; - /** - * @private - */ - alignmentInBytes: function (pixelFormat, pixelDatatype, width) { - var mod = - PixelFormat.textureSizeInBytes(pixelFormat, pixelDatatype, width, 1) % 4; - return mod === 0 ? 4 : mod === 2 ? 2 : 1; - }, +/** + * @private + */ +PixelFormat.textureSizeInBytes = function ( + pixelFormat, + pixelDatatype, + width, + height +) { + var componentsLength = PixelFormat.componentsLength(pixelFormat); + if (PixelDatatype.isPacked(pixelDatatype)) { + componentsLength = 1; + } + return ( + componentsLength * PixelDatatype.sizeInBytes(pixelDatatype) * width * height + ); +}; - /** - * @private - */ - createTypedArray: function (pixelFormat, pixelDatatype, width, height) { - var constructor; - var sizeInBytes = PixelDatatype.sizeInBytes(pixelDatatype); - if (sizeInBytes === Uint8Array.BYTES_PER_ELEMENT) { - constructor = Uint8Array; - } else if (sizeInBytes === Uint16Array.BYTES_PER_ELEMENT) { - constructor = Uint16Array; - } else if ( - sizeInBytes === Float32Array.BYTES_PER_ELEMENT && - pixelDatatype === PixelDatatype.FLOAT - ) { - constructor = Float32Array; - } else { - constructor = Uint32Array; - } +/** + * @private + */ +PixelFormat.alignmentInBytes = function (pixelFormat, pixelDatatype, width) { + var mod = + PixelFormat.textureSizeInBytes(pixelFormat, pixelDatatype, width, 1) % 4; + return mod === 0 ? 4 : mod === 2 ? 2 : 1; +}; - var size = PixelFormat.componentsLength(pixelFormat) * width * height; - return new constructor(size); - }, +/** + * @private + */ +PixelFormat.createTypedArray = function ( + pixelFormat, + pixelDatatype, + width, + height +) { + var constructor; + var sizeInBytes = PixelDatatype.sizeInBytes(pixelDatatype); + if (sizeInBytes === Uint8Array.BYTES_PER_ELEMENT) { + constructor = Uint8Array; + } else if (sizeInBytes === Uint16Array.BYTES_PER_ELEMENT) { + constructor = Uint16Array; + } else if ( + sizeInBytes === Float32Array.BYTES_PER_ELEMENT && + pixelDatatype === PixelDatatype.FLOAT + ) { + constructor = Float32Array; + } else { + constructor = Uint32Array; + } + + var size = PixelFormat.componentsLength(pixelFormat) * width * height; + return new constructor(size); +}; - /** - * @private - */ - flipY: function (bufferView, pixelFormat, pixelDatatype, width, height) { - if (height === 1) { - return bufferView; - } - var flipped = PixelFormat.createTypedArray( - pixelFormat, - pixelDatatype, - width, - height - ); - var numberOfComponents = PixelFormat.componentsLength(pixelFormat); - var textureWidth = width * numberOfComponents; - for (var i = 0; i < height; ++i) { - var row = i * height * numberOfComponents; - var flippedRow = (height - i - 1) * height * numberOfComponents; - for (var j = 0; j < textureWidth; ++j) { - flipped[flippedRow + j] = bufferView[row + j]; - } +/** + * @private + */ +PixelFormat.flipY = function ( + bufferView, + pixelFormat, + pixelDatatype, + width, + height +) { + if (height === 1) { + return bufferView; + } + var flipped = PixelFormat.createTypedArray( + pixelFormat, + pixelDatatype, + width, + height + ); + var numberOfComponents = PixelFormat.componentsLength(pixelFormat); + var textureWidth = width * numberOfComponents; + for (var i = 0; i < height; ++i) { + var row = i * height * numberOfComponents; + var flippedRow = (height - i - 1) * height * numberOfComponents; + for (var j = 0; j < textureWidth; ++j) { + flipped[flippedRow + j] = bufferView[row + j]; } - return flipped; - }, + } + return flipped; }; + export default Object.freeze(PixelFormat); diff --git a/Source/Core/PrimitiveType.js b/Source/Core/PrimitiveType.js index ae090d547ef5..87ee47b4f52d 100644 --- a/Source/Core/PrimitiveType.js +++ b/Source/Core/PrimitiveType.js @@ -3,7 +3,7 @@ import WebGLConstants from "./WebGLConstants.js"; /** * The type of a geometric primitive, i.e., points, lines, and triangles. * - * @exports PrimitiveType + * @enum {Number} */ var PrimitiveType = { /** @@ -65,20 +65,21 @@ var PrimitiveType = { * @constant */ TRIANGLE_FAN: WebGLConstants.TRIANGLE_FAN, +}; - /** - * @private - */ - validate: function (primitiveType) { - return ( - primitiveType === PrimitiveType.POINTS || - primitiveType === PrimitiveType.LINES || - primitiveType === PrimitiveType.LINE_LOOP || - primitiveType === PrimitiveType.LINE_STRIP || - primitiveType === PrimitiveType.TRIANGLES || - primitiveType === PrimitiveType.TRIANGLE_STRIP || - primitiveType === PrimitiveType.TRIANGLE_FAN - ); - }, +/** + * @private + */ +PrimitiveType.validate = function (primitiveType) { + return ( + primitiveType === PrimitiveType.POINTS || + primitiveType === PrimitiveType.LINES || + primitiveType === PrimitiveType.LINE_LOOP || + primitiveType === PrimitiveType.LINE_STRIP || + primitiveType === PrimitiveType.TRIANGLES || + primitiveType === PrimitiveType.TRIANGLE_STRIP || + primitiveType === PrimitiveType.TRIANGLE_FAN + ); }; + export default Object.freeze(PrimitiveType); diff --git a/Source/Core/QuadraticRealPolynomial.js b/Source/Core/QuadraticRealPolynomial.js index 57daad889e36..1922d2cec077 100644 --- a/Source/Core/QuadraticRealPolynomial.js +++ b/Source/Core/QuadraticRealPolynomial.js @@ -4,7 +4,7 @@ import CesiumMath from "./Math.js"; /** * Defines functions for 2nd order polynomial functions of one variable with only real coefficients. * - * @exports QuadraticRealPolynomial + * @namespace QuadraticRealPolynomial */ var QuadraticRealPolynomial = {}; diff --git a/Source/Core/QuantizedMeshTerrainData.js b/Source/Core/QuantizedMeshTerrainData.js index 0e3949cf5a2b..8bd031b9174b 100644 --- a/Source/Core/QuantizedMeshTerrainData.js +++ b/Source/Core/QuantizedMeshTerrainData.js @@ -222,7 +222,7 @@ Object.defineProperties(QuantizedMeshTerrainData.prototype, { * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. * @memberof QuantizedMeshTerrainData.prototype - * @type {Uint8Array|Image|Canvas} + * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement} */ waterMask: { get: function () { diff --git a/Source/Core/QuarticRealPolynomial.js b/Source/Core/QuarticRealPolynomial.js index 61eda3a90c00..ae91fac52a25 100644 --- a/Source/Core/QuarticRealPolynomial.js +++ b/Source/Core/QuarticRealPolynomial.js @@ -6,7 +6,7 @@ import QuadraticRealPolynomial from "./QuadraticRealPolynomial.js"; /** * Defines functions for 4th order polynomial functions of one variable with only real coefficients. * - * @exports QuarticRealPolynomial + * @namespace QuarticRealPolynomial */ var QuarticRealPolynomial = {}; diff --git a/Source/Core/Quaternion.js b/Source/Core/Quaternion.js index eb2c7bcb9e1b..b35bab7812eb 100644 --- a/Source/Core/Quaternion.js +++ b/Source/Core/Quaternion.js @@ -286,7 +286,7 @@ Quaternion.packedInterpolationLength = 3; * @param {Number[]} packedArray The packed array. * @param {Number} [startingIndex=0] The index of the first element to be converted. * @param {Number} [lastIndex=packedArray.length] The index of the last element to be converted. - * @param {Number[]} result The object into which to store the result. + * @param {Number[]} [result] The object into which to store the result. */ Quaternion.convertPackedArrayForInterpolation = function ( packedArray, @@ -330,6 +330,9 @@ Quaternion.convertPackedArrayForInterpolation = function ( sampledQuaternionAxis ); var angle = Quaternion.computeAngle(sampledQuaternionTempQuaternion); + if (!defined(result)) { + result = []; + } result[offset] = sampledQuaternionAxis.x * angle; result[offset + 1] = sampledQuaternionAxis.y * angle; result[offset + 2] = sampledQuaternionAxis.z * angle; @@ -1056,13 +1059,11 @@ Quaternion.equals = function (left, right) { * * @param {Quaternion} [left] The first quaternion. * @param {Quaternion} [right] The second quaternion. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ Quaternion.equalsEpsilon = function (left, right, epsilon) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("epsilon", epsilon); - //>>includeEnd('debug'); + epsilon = defaultValue(epsilon, 0); return ( left === right || @@ -1118,7 +1119,7 @@ Quaternion.prototype.equals = function (right) { * false otherwise. * * @param {Quaternion} [right] The right hand side quaternion. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ Quaternion.prototype.equalsEpsilon = function (right, epsilon) { diff --git a/Source/Core/Queue.js b/Source/Core/Queue.js index 49488468e146..b3186f6af222 100644 --- a/Source/Core/Queue.js +++ b/Source/Core/Queue.js @@ -96,7 +96,7 @@ Queue.prototype.clear = function () { /** * Sort the items in the queue in-place. * - * @param {Queue~Comparator} compareFunction A function that defines the sort order. + * @param {Queue.Comparator} compareFunction A function that defines the sort order. */ Queue.prototype.sort = function (compareFunction) { if (this._offset > 0) { @@ -110,7 +110,7 @@ Queue.prototype.sort = function (compareFunction) { /** * A function used to compare two items while sorting a queue. - * @callback Queue~Comparator + * @callback Queue.Comparator * * @param {*} a An item in the array. * @param {*} b An item in the array. diff --git a/Source/Core/Rectangle.js b/Source/Core/Rectangle.js index 9da1d61235ad..8e10cfaadaaf 100644 --- a/Source/Core/Rectangle.js +++ b/Source/Core/Rectangle.js @@ -370,13 +370,11 @@ Rectangle.clone = function (rectangle, result) { * * @param {Rectangle} [left] The first Rectangle. * @param {Rectangle} [right] The second Rectangle. - * @param {Number} absoluteEpsilon The absolute epsilon tolerance to use for equality testing. + * @param {Number} [absoluteEpsilon=0] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ Rectangle.equalsEpsilon = function (left, right, absoluteEpsilon) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("absoluteEpsilon", absoluteEpsilon); - //>>includeEnd('debug'); + absoluteEpsilon = defaultValue(absoluteEpsilon, 0); return ( left === right || @@ -436,14 +434,10 @@ Rectangle.equals = function (left, right) { * false otherwise. * * @param {Rectangle} [other] The Rectangle to compare. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if the Rectangles are within the provided epsilon, false otherwise. */ Rectangle.prototype.equalsEpsilon = function (other, epsilon) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("epsilon", epsilon); - //>>includeEnd('debug'); - return Rectangle.equalsEpsilon(this, other, epsilon); }; diff --git a/Source/Core/ReferenceFrame.js b/Source/Core/ReferenceFrame.js index a4fd843c52f6..e043a530789f 100644 --- a/Source/Core/ReferenceFrame.js +++ b/Source/Core/ReferenceFrame.js @@ -1,7 +1,7 @@ /** * Constants for identifying well-known reference frames. * - * @exports ReferenceFrame + * @enum {Number} */ var ReferenceFrame = { /** diff --git a/Source/Core/Request.js b/Source/Core/Request.js index 79c0a9563032..d9f219561ea3 100644 --- a/Source/Core/Request.js +++ b/Source/Core/Request.js @@ -8,13 +8,12 @@ import RequestType from "./RequestType.js"; * * @alias Request * @constructor - * @namespace - * @exports Request + * @param {Object} [options] An object with the following properties: * @param {String} [options.url] The url to request. - * @param {Request~RequestCallback} [options.requestFunction] The function that makes the actual data request. - * @param {Request~CancelCallback} [options.cancelFunction] The function that is called when the request is cancelled. - * @param {Request~PriorityCallback} [options.priorityFunction] The function that is called to update the request's priority, which occurs once per frame. + * @param {Request.RequestCallback} [options.requestFunction] The function that makes the actual data request. + * @param {Request.CancelCallback} [options.cancelFunction] The function that is called when the request is cancelled. + * @param {Request.PriorityCallback} [options.priorityFunction] The function that is called to update the request's priority, which occurs once per frame. * @param {Number} [options.priority=0.0] The initial priority of the request. * @param {Boolean} [options.throttle=false] Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the request will be throttled and sent based on priority. * @param {Boolean} [options.throttleByServer=false] Whether to throttle the request by server. @@ -36,21 +35,21 @@ function Request(options) { /** * The function that makes the actual data request. * - * @type {Request~RequestCallback} + * @type {Request.RequestCallback} */ this.requestFunction = options.requestFunction; /** * The function that is called when the request is cancelled. * - * @type {Request~CancelCallback} + * @type {Request.CancelCallback} */ this.cancelFunction = options.cancelFunction; /** * The function that is called to update the request's priority, which occurs once per frame. * - * @type {Request~PriorityCallback} + * @type {Request.PriorityCallback} */ this.priorityFunction = options.priorityFunction; @@ -176,18 +175,18 @@ Request.prototype.clone = function (result) { /** * The function that makes the actual data request. - * @callback Request~RequestCallback - * @returns {Promise} A promise for the requested data. + * @callback Request.RequestCallback + * @returns {Promise} A promise for the requested data. */ /** * The function that is called when the request is cancelled. - * @callback Request~CancelCallback + * @callback Request.CancelCallback */ /** * The function that is called to update the request's priority, which occurs once per frame. - * @callback Request~PriorityCallback + * @callback Request.PriorityCallback * @returns {Number} The updated priority value. */ export default Request; diff --git a/Source/Core/RequestScheduler.js b/Source/Core/RequestScheduler.js index 12ff73f767b3..3b48bde3020d 100644 --- a/Source/Core/RequestScheduler.js +++ b/Source/Core/RequestScheduler.js @@ -44,7 +44,7 @@ var requestCompletedEvent = new Event(); * a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the * number of requests so that newer requests wait in a shorter queue and don't have to compete for bandwidth with requests that have expired. * - * @exports RequestScheduler + * @namespace RequestScheduler * */ function RequestScheduler() {} @@ -66,6 +66,7 @@ RequestScheduler.maximumRequestsPerServer = 6; /** * A per server key list of overrides to use for throttling instead of maximumRequestsPerServer + * @type {Object} * * @example * RequestScheduler.requestsByServer = { diff --git a/Source/Core/RequestState.js b/Source/Core/RequestState.js index 19e2cd1029bd..7dde7663867a 100644 --- a/Source/Core/RequestState.js +++ b/Source/Core/RequestState.js @@ -1,7 +1,7 @@ /** * State of the request. * - * @exports RequestState + * @enum {Number} */ var RequestState = { /** diff --git a/Source/Core/RequestType.js b/Source/Core/RequestType.js index c5f99a70b164..2dc54e96e8bf 100644 --- a/Source/Core/RequestType.js +++ b/Source/Core/RequestType.js @@ -1,7 +1,7 @@ /** * An enum identifying the type of request. Used for finer grained logging and priority sorting. * - * @exports RequestType + * @enum {Number} */ var RequestType = { /** diff --git a/Source/Core/Resource.js b/Source/Core/Resource.js index a95c8746d243..85616a1fd52f 100644 --- a/Source/Core/Resource.js +++ b/Source/Core/Resource.js @@ -224,7 +224,7 @@ function combineQueryParameters(q1, q2, preserveQueryParameters) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @@ -621,7 +621,7 @@ Resource.prototype.setTemplateValues = function (template, useAsDefault) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). These will be combined with those of the current instance. * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The function to call when loading the resource fails. + * @param {Resource.RetryCallback} [options.retryCallback] The function to call when loading the resource fails. * @param {Number} [options.retryAttempts] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {Boolean} [options.preserveQueryParameters=false] If true, this will keep all query parameters from the current resource and derived resource. If false, derived parameters will replace those of the current resource. @@ -783,7 +783,7 @@ Resource.prototype.fetchArrayBuffer = function () { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. @@ -827,7 +827,7 @@ Resource.prototype.fetchBlob = function () { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. @@ -846,7 +846,7 @@ Resource.fetchBlob = function (options) { * @param {Boolean} [options.preferBlob=false] If true, we will load the image via a blob. * @param {Boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an ImageBitmap is returned. * @param {Boolean} [options.flipY=false] If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap. - * @returns {Promise.|Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.|Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. * * * @example @@ -1035,12 +1035,12 @@ function fetchImage(options) { * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. * @param {Boolean} [options.flipY=false] Whether to vertically flip the image during fetch and decode. Only applies when requesting an image and the browser supports createImageBitmap. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {Boolean} [options.preferBlob=false] If true, we will load the image via a blob. * @param {Boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an ImageBitmap is returned. - * @returns {Promise.|Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.|Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ Resource.fetchImage = function (options) { var resource = new Resource(options); @@ -1092,7 +1092,7 @@ Resource.prototype.fetchText = function () { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. @@ -1153,7 +1153,7 @@ Resource.prototype.fetchJson = function () { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. @@ -1202,7 +1202,7 @@ Resource.prototype.fetchXML = function () { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. @@ -1305,7 +1305,7 @@ function fetchJsonp(resource, callbackParameterName, functionName) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.callbackParameterName='callback'] The callback parameter name that the server expects. @@ -1471,7 +1471,7 @@ Resource.prototype.fetch = function (options) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. @@ -1528,7 +1528,7 @@ Resource.prototype.delete = function (options) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. @@ -1585,7 +1585,7 @@ Resource.prototype.head = function (options) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. @@ -1641,7 +1641,7 @@ Resource.prototype.options = function (options) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. @@ -1703,7 +1703,7 @@ Resource.prototype.post = function (data, options) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. @@ -1764,7 +1764,7 @@ Resource.prototype.put = function (data, options) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. @@ -1825,7 +1825,7 @@ Resource.prototype.patch = function (data, options) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. @@ -2202,7 +2202,7 @@ Resource.DEFAULT = Object.freeze( /** * A function that returns the value of the property. - * @callback Resource~RetryCallback + * @callback Resource.RetryCallback * * @param {Resource} [resource] The resource that failed to load. * @param {Error} [error] The error that occurred during the loading of the resource. diff --git a/Source/Core/ScreenSpaceEventHandler.js b/Source/Core/ScreenSpaceEventHandler.js index 050e7edd72c7..db52177dc029 100644 --- a/Source/Core/ScreenSpaceEventHandler.js +++ b/Source/Core/ScreenSpaceEventHandler.js @@ -897,7 +897,7 @@ function handlePointerMove(screenSpaceEventHandler, event) { * * @alias ScreenSpaceEventHandler * - * @param {Canvas} [element=document] The element to add events to. + * @param {HTMLCanvasElement} [element=document] The element to add events to. * * @constructor */ diff --git a/Source/Core/ScreenSpaceEventType.js b/Source/Core/ScreenSpaceEventType.js index 842988855518..406533eb769b 100644 --- a/Source/Core/ScreenSpaceEventType.js +++ b/Source/Core/ScreenSpaceEventType.js @@ -1,7 +1,7 @@ /** * This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down. * - * @exports ScreenSpaceEventType + * @enum {Number} */ var ScreenSpaceEventType = { /** diff --git a/Source/Core/Simon1994PlanetaryPositions.js b/Source/Core/Simon1994PlanetaryPositions.js index 91f9f61ba03c..1517ad39aea6 100644 --- a/Source/Core/Simon1994PlanetaryPositions.js +++ b/Source/Core/Simon1994PlanetaryPositions.js @@ -11,7 +11,7 @@ import TimeStandard from "./TimeStandard.js"; * Contains functions for finding the Cartesian coordinates of the sun and the moon in the * Earth-centered inertial frame. * - * @exports Simon1994PlanetaryPositions + * @namespace Simon1994PlanetaryPositions */ var Simon1994PlanetaryPositions = {}; diff --git a/Source/Core/TerrainData.js b/Source/Core/TerrainData.js index 570418275b0b..a76e95e998f4 100644 --- a/Source/Core/TerrainData.js +++ b/Source/Core/TerrainData.js @@ -29,7 +29,7 @@ Object.defineProperties(TerrainData.prototype, { * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. * @memberof TerrainData.prototype - * @type {Uint8Array|Image|Canvas} + * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement} */ waterMask: { get: DeveloperError.throwInstantiationError, diff --git a/Source/Core/TerrainProvider.js b/Source/Core/TerrainProvider.js index 21b44393f51d..d733d202e89a 100644 --- a/Source/Core/TerrainProvider.js +++ b/Source/Core/TerrainProvider.js @@ -439,7 +439,7 @@ TerrainProvider.prototype.getTileDataAvailable = * @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. - * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ TerrainProvider.prototype.loadTileDataAvailability = DeveloperError.throwInstantiationError; diff --git a/Source/Core/TerrainQuantization.js b/Source/Core/TerrainQuantization.js index 594b59da6672..7e3153f803d7 100644 --- a/Source/Core/TerrainQuantization.js +++ b/Source/Core/TerrainQuantization.js @@ -1,7 +1,7 @@ /** * This enumerated type is used to determine how the vertices of the terrain mesh are compressed. * - * @exports TerrainQuantization + * @enum {Number} * * @private */ diff --git a/Source/Core/TileProviderError.js b/Source/Core/TileProviderError.js index d8c36b2aeb61..a7465cbd711b 100644 --- a/Source/Core/TileProviderError.js +++ b/Source/Core/TileProviderError.js @@ -102,7 +102,7 @@ function TileProviderError( * error is not specific to a particular tile. * @param {Number} level The level-of-detail of the tile that experienced the error, or undefined if the * error is not specific to a particular tile. - * @param {TileProviderError~RetryFunction} retryFunction The function to call to retry the operation. If undefined, the + * @param {TileProviderError.RetryFunction} retryFunction The function to call to retry the operation. If undefined, the * operation will not be retried. * @param {Error} [errorDetails] The error or exception that occurred, if any. * @returns {TileProviderError} The error instance that was passed to the event listeners and that @@ -175,6 +175,6 @@ TileProviderError.handleSuccess = function (previousError) { /** * A function that will be called to retry the operation. - * @callback TileProviderError~RetryFunction + * @callback TileProviderError.RetryFunction */ export default TileProviderError; diff --git a/Source/Core/TimeConstants.js b/Source/Core/TimeConstants.js index caf182f080e1..d6a805af65d9 100644 --- a/Source/Core/TimeConstants.js +++ b/Source/Core/TimeConstants.js @@ -1,7 +1,7 @@ /** * Constants for time conversions like those done by {@link JulianDate}. * - * @exports TimeConstants + * @namespace TimeConstants * * @see JulianDate * diff --git a/Source/Core/TimeInterval.js b/Source/Core/TimeInterval.js index e694e0079a82..679245751d50 100644 --- a/Source/Core/TimeInterval.js +++ b/Source/Core/TimeInterval.js @@ -217,7 +217,7 @@ TimeInterval.clone = function (timeInterval, result) { * * @param {TimeInterval} [left] The first instance. * @param {TimeInterval} [right] The second instance. - * @param {TimeInterval~DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. * @returns {Boolean} true if the dates are equal; otherwise, false. */ TimeInterval.equals = function (left, right, dataComparer) { @@ -243,14 +243,12 @@ TimeInterval.equals = function (left, right, dataComparer) { * * @param {TimeInterval} [left] The first instance. * @param {TimeInterval} [right] The second instance. - * @param {Number} epsilon The maximum number of seconds that should separate the two instances. - * @param {TimeInterval~DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param {Number} [epsilon=0] The maximum number of seconds that should separate the two instances. + * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. * @returns {Boolean} true if the two dates are within epsilon seconds of each other; otherwise false. */ TimeInterval.equalsEpsilon = function (left, right, epsilon, dataComparer) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("epsilon", epsilon); - //>>includeEnd('debug'); + epsilon = defaultValue(epsilon, 0); return ( left === right || @@ -271,14 +269,13 @@ TimeInterval.equalsEpsilon = function (left, right, epsilon, dataComparer) { * * @param {TimeInterval} left The first interval. * @param {TimeInterval} [right] The second interval. - * @param {TimeInterval} result An existing instance to use for the result. - * @param {TimeInterval~MergeCallback} [mergeCallback] A function which merges the data of the two intervals. If omitted, the data from the left interval will be used. + * @param {TimeInterval} [result] An existing instance to use for the result. + * @param {TimeInterval.MergeCallback} [mergeCallback] A function which merges the data of the two intervals. If omitted, the data from the left interval will be used. * @returns {TimeInterval} The modified result parameter. */ TimeInterval.intersect = function (left, right, result, mergeCallback) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("left", left); - Check.typeOf.object("result", result); //>>includeEnd('debug'); if (!defined(right)) { @@ -309,6 +306,10 @@ TimeInterval.intersect = function (left, right, result, mergeCallback) { var rightIsStopIncluded = right.isStopIncluded; var leftLessThanRight = JulianDate.lessThan(leftStop, rightStop); + if (!defined(result)) { + result = new TimeInterval(); + } + result.start = intersectsStartRight ? rightStart : leftStart; result.isStartIncluded = (leftIsStartIncluded && rightIsStartIncluded) || @@ -371,7 +372,7 @@ TimeInterval.prototype.clone = function (result) { * true if they are equal, false otherwise. * * @param {TimeInterval} [right] The right hand side interval. - * @param {TimeInterval~DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. * @returns {Boolean} true if they are equal, false otherwise. */ TimeInterval.prototype.equals = function (right, dataComparer) { @@ -384,8 +385,8 @@ TimeInterval.prototype.equals = function (right, dataComparer) { * false otherwise. * * @param {TimeInterval} [right] The right hand side interval. - * @param {Number} epsilon The epsilon to use for equality testing. - * @param {TimeInterval~DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. + * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ TimeInterval.prototype.equalsEpsilon = function (right, epsilon, dataComparer) { @@ -418,7 +419,7 @@ TimeInterval.EMPTY = Object.freeze( /** * Function interface for merging interval data. - * @callback TimeInterval~MergeCallback + * @callback TimeInterval.MergeCallback * * @param {*} leftData The first data instance. * @param {*} rightData The second data instance. @@ -427,7 +428,7 @@ TimeInterval.EMPTY = Object.freeze( /** * Function interface for comparing interval data. - * @callback TimeInterval~DataComparer + * @callback TimeInterval.DataComparer * @param {*} leftData The first data instance. * @param {*} rightData The second data instance. * @returns {Boolean} true if the provided instances are equal, false otherwise. diff --git a/Source/Core/TimeIntervalCollection.js b/Source/Core/TimeIntervalCollection.js index 7ec77401a76d..f4e1d135a576 100644 --- a/Source/Core/TimeIntervalCollection.js +++ b/Source/Core/TimeIntervalCollection.js @@ -129,7 +129,7 @@ Object.defineProperties(TimeIntervalCollection.prototype, { * true if they are equal, false otherwise. * * @param {TimeIntervalCollection} [right] The right hand side collection. - * @param {TimeInterval~DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. * @returns {Boolean} true if they are equal, false otherwise. */ TimeIntervalCollection.prototype.equals = function (right, dataComparer) { @@ -305,7 +305,7 @@ TimeIntervalCollection.prototype.findInterval = function (options) { * The data in the new interval takes precedence over any existing intervals in the collection. * * @param {TimeInterval} interval The interval to add. - * @param {TimeInterval~DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. */ TimeIntervalCollection.prototype.addInterval = function ( interval, @@ -664,8 +664,8 @@ TimeIntervalCollection.prototype.removeInterval = function (interval) { * Creates a new instance that is the intersection of this collection and the provided collection. * * @param {TimeIntervalCollection} other The collection to intersect with. - * @param {TimeInterval~DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. - * @param {TimeInterval~MergeCallback} [mergeCallback] A function which merges the data of the two intervals. If omitted, the data from the left interval will be used. + * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param {TimeInterval.MergeCallback} [mergeCallback] A function which merges the data of the two intervals. If omitted, the data from the left interval will be used. * @returns {TimeIntervalCollection} A new TimeIntervalCollection which is the intersection of this collection and the provided collection. */ TimeIntervalCollection.prototype.intersect = function ( diff --git a/Source/Core/TimeStandard.js b/Source/Core/TimeStandard.js index a41435ea9424..97f951354a94 100644 --- a/Source/Core/TimeStandard.js +++ b/Source/Core/TimeStandard.js @@ -1,7 +1,7 @@ /** * Provides the type of time standards which JulianDate can take as input. * - * @exports TimeStandard + * @enum {Number} * * @see JulianDate */ diff --git a/Source/Core/Tipsify.js b/Source/Core/Tipsify.js index 6836c7207ba9..575bd76788a5 100644 --- a/Source/Core/Tipsify.js +++ b/Source/Core/Tipsify.js @@ -8,7 +8,7 @@ import DeveloperError from "./DeveloperError.js"; * 'Fast Triangle Reordering for Vertex Locality and Reduced Overdraw.' * The runtime is linear but several passes are made. * - * @exports Tipsify + * @namespace Tipsify * * @see * Fast Triangle Reordering for Vertex Locality and Reduced Overdraw diff --git a/Source/Core/Transforms.js b/Source/Core/Transforms.js index 5bf47eff85f9..26e7f715435f 100644 --- a/Source/Core/Transforms.js +++ b/Source/Core/Transforms.js @@ -23,8 +23,7 @@ import TimeConstants from "./TimeConstants.js"; /** * Contains functions for transforming positions to various reference frames. * - * @exports Transforms - * @namespace + * @namespace Transforms */ var Transforms = {}; @@ -96,7 +95,7 @@ var scratchThirdCartesian = new Cartesian3(); * 'east', 'north', 'up', 'west', 'south' or 'down'. * @param {String} secondAxis name of the second axis of the local reference frame. Must be * 'east', 'north', 'up', 'west', 'south' or 'down'. - * @return {localFrameToFixedFrameGenerator~resultat} The function that will computes a + * @return {Transforms.LocalFrameToFixedFrame} The function that will computes a * 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters, */ Transforms.localFrameToFixedFrameGenerator = function (firstAxis, secondAxis) { @@ -113,7 +112,7 @@ Transforms.localFrameToFixedFrameGenerator = function (firstAxis, secondAxis) { /** * Computes a 4x4 transformation matrix from a reference frame * centered at the provided origin to the provided ellipsoid's fixed reference frame. - * @callback Transforms~LocalFrameToFixedFrame + * @callback Transforms.LocalFrameToFixedFrame * @param {Cartesian3} origin The center point of the local reference frame. * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation. * @param {Matrix4} [result] The object onto which to store the result. @@ -369,7 +368,7 @@ var scratchHPRMatrix4 = new Matrix4(); * @param {Cartesian3} origin The center point of the local reference frame. * @param {HeadingPitchRoll} headingPitchRoll The heading, pitch, and roll. * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation. - * @param {Transforms~LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation + * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation * matrix from a reference frame to the provided ellipsoid's fixed reference frame * @param {Matrix4} [result] The object onto which to store the result. * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided. @@ -424,7 +423,7 @@ var scratchHPRMatrix3 = new Matrix3(); * @param {Cartesian3} origin The center point of the local reference frame. * @param {HeadingPitchRoll} headingPitchRoll The heading, pitch, and roll. * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation. - * @param {Transforms~LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation + * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation * matrix from a reference frame to the provided ellipsoid's fixed reference frame * @param {Quaternion} [result] The object onto which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. @@ -473,7 +472,7 @@ var hprQuaternionScratch = new Quaternion(); * * @param {Matrix4} transform The transform * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation. - * @param {Transforms~LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation + * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation * matrix from a reference frame to the provided ellipsoid's fixed reference frame * @param {HeadingPitchRoll} [result] The object onto which to store the result. * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if none was provided. @@ -654,7 +653,7 @@ var j2000ttDays = 2451545.0; * indicates that the preload has completed. * * @param {TimeInterval} timeInterval The interval to preload. - * @returns {Promise} A promise that, when resolved, indicates that the preload has completed + * @returns {Promise} A promise that, when resolved, indicates that the preload has completed * and evaluation of the transformation between the fixed and ICRF axes will * no longer return undefined for a time inside the interval. * diff --git a/Source/Core/TridiagonalSystemSolver.js b/Source/Core/TridiagonalSystemSolver.js index b4cef5548d7c..dd387a708e34 100644 --- a/Source/Core/TridiagonalSystemSolver.js +++ b/Source/Core/TridiagonalSystemSolver.js @@ -6,7 +6,7 @@ import DeveloperError from "./DeveloperError.js"; * Uses the Tridiagonal Matrix Algorithm, also known as the Thomas Algorithm, to solve * a system of linear equations where the coefficient matrix is a tridiagonal matrix. * - * @exports TridiagonalSystemSolver + * @namespace TridiagonalSystemSolver */ var TridiagonalSystemSolver = {}; diff --git a/Source/Core/TrustedServers.js b/Source/Core/TrustedServers.js index 8393a1adb192..7618506de07e 100644 --- a/Source/Core/TrustedServers.js +++ b/Source/Core/TrustedServers.js @@ -6,7 +6,7 @@ import DeveloperError from "./DeveloperError.js"; * A singleton that contains all of the servers that are trusted. Credentials will be sent with * any requests to these servers. * - * @exports TrustedServers + * @namespace TrustedServers * * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} */ diff --git a/Source/Core/VRTheWorldTerrainProvider.js b/Source/Core/VRTheWorldTerrainProvider.js index 00870f6878ca..dd54dd1ca541 100644 --- a/Source/Core/VRTheWorldTerrainProvider.js +++ b/Source/Core/VRTheWorldTerrainProvider.js @@ -417,7 +417,7 @@ VRTheWorldTerrainProvider.prototype.getTileDataAvailable = function ( * @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. - * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ VRTheWorldTerrainProvider.prototype.loadTileDataAvailability = function ( x, diff --git a/Source/Core/Visibility.js b/Source/Core/Visibility.js index c052f3f4a128..cc20094d549b 100644 --- a/Source/Core/Visibility.js +++ b/Source/Core/Visibility.js @@ -4,7 +4,7 @@ * it has no visibility, may partially block an occludee from view, or may not block it at all, * leading to full visibility. * - * @exports Visibility + * @enum {Number} */ var Visibility = { /** diff --git a/Source/Core/WebGLConstants.js b/Source/Core/WebGLConstants.js index e0923a3d8f8b..32b63443cd2a 100644 --- a/Source/Core/WebGLConstants.js +++ b/Source/Core/WebGLConstants.js @@ -7,7 +7,7 @@ * and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/} * specifications. * - * @exports WebGLConstants + * @enum {Number} */ var WebGLConstants = { DEPTH_BUFFER_BIT: 0x00000100, diff --git a/Source/Core/WindingOrder.js b/Source/Core/WindingOrder.js index a24e50a49b54..2ec8947e6886 100644 --- a/Source/Core/WindingOrder.js +++ b/Source/Core/WindingOrder.js @@ -3,7 +3,7 @@ import WebGLConstants from "./WebGLConstants.js"; /** * Winding order defines the order of vertices for a triangle to be considered front-facing. * - * @exports WindingOrder + * @enum {Number} */ var WindingOrder = { /** @@ -21,15 +21,16 @@ var WindingOrder = { * @constant */ COUNTER_CLOCKWISE: WebGLConstants.CCW, +}; - /** - * @private - */ - validate: function (windingOrder) { - return ( - windingOrder === WindingOrder.CLOCKWISE || - windingOrder === WindingOrder.COUNTER_CLOCKWISE - ); - }, +/** + * @private + */ +WindingOrder.validate = function (windingOrder) { + return ( + windingOrder === WindingOrder.CLOCKWISE || + windingOrder === WindingOrder.COUNTER_CLOCKWISE + ); }; + export default Object.freeze(WindingOrder); diff --git a/Source/Core/barycentricCoordinates.js b/Source/Core/barycentricCoordinates.js index 70b81978626f..61daebcf5530 100644 --- a/Source/Core/barycentricCoordinates.js +++ b/Source/Core/barycentricCoordinates.js @@ -11,7 +11,7 @@ var scratchCartesian3 = new Cartesian3(); /** * Computes the barycentric coordinates for a point with respect to a triangle. * - * @exports barycentricCoordinates + * @function * * @param {Cartesian2|Cartesian3} point The point to test. * @param {Cartesian2|Cartesian3} p0 The first point of the triangle, corresponding to the barycentric x-axis. diff --git a/Source/Core/binarySearch.js b/Source/Core/binarySearch.js index b4866ac34565..20c9655620ea 100644 --- a/Source/Core/binarySearch.js +++ b/Source/Core/binarySearch.js @@ -3,10 +3,10 @@ import Check from "./Check.js"; /** * Finds an item in a sorted array. * - * @exports binarySearch + * @function * @param {Array} array The sorted array to search. * @param {*} itemToFind The item to find in the array. - * @param {binarySearch~Comparator} comparator The function to use to compare the item to + * @param {binarySearchComparator} comparator The function to use to compare the item to * elements in the array. * @returns {Number} The index of itemToFind in the array, if it exists. If itemToFind * does not exist, the return value is a negative number which is the bitwise complement (~) @@ -51,7 +51,7 @@ function binarySearch(array, itemToFind, comparator) { /** * A function used to compare two items while performing a binary search. - * @callback binarySearch~Comparator + * @callback binarySearchComparator * * @param {*} a An item in the array. * @param {*} b The item being searched for. diff --git a/Source/Core/cancelAnimationFrame.js b/Source/Core/cancelAnimationFrame.js index fdfdab4883f7..c0b1cfd58883 100644 --- a/Source/Core/cancelAnimationFrame.js +++ b/Source/Core/cancelAnimationFrame.js @@ -29,7 +29,7 @@ if (typeof cancelAnimationFrame !== "undefined") { /** * A browser-independent function to cancel an animation frame requested using {@link requestAnimationFrame}. * - * @exports cancelAnimationFrame + * @function cancelAnimationFrame * * @param {Number} requestID The value returned by {@link requestAnimationFrame}. * diff --git a/Source/Core/clone.js b/Source/Core/clone.js index 589e026d2a4c..98ae5f2809d5 100644 --- a/Source/Core/clone.js +++ b/Source/Core/clone.js @@ -3,7 +3,7 @@ import defaultValue from "./defaultValue.js"; /** * Clones an object, returning a new object containing the same properties. * - * @exports clone + * @function * * @param {Object} object The object to clone. * @param {Boolean} [deep=false] If true, all properties will be deep cloned recursively. diff --git a/Source/Core/combine.js b/Source/Core/combine.js index 4c589c03ac34..c238e11e226f 100644 --- a/Source/Core/combine.js +++ b/Source/Core/combine.js @@ -30,7 +30,7 @@ import defined from "./defined.js"; * @param {Boolean} [deep=false] Perform a recursive merge. * @returns {Object} The combined object containing all properties from both objects. * - * @exports combine + * @function */ function combine(object1, object2, deep) { deep = defaultValue(deep, false); diff --git a/Source/Core/createGuid.js b/Source/Core/createGuid.js index d141e7df4fb6..882eef2e2950 100644 --- a/Source/Core/createGuid.js +++ b/Source/Core/createGuid.js @@ -1,7 +1,7 @@ /** * Creates a Globally unique identifier (GUID) string. A GUID is 128 bits long, and can guarantee uniqueness across space and time. * - * @exports createGuid + * @function * * @returns {String} * diff --git a/Source/Core/createWorldTerrain.js b/Source/Core/createWorldTerrain.js index a2e7f4572bd4..7b4eccaa20ae 100644 --- a/Source/Core/createWorldTerrain.js +++ b/Source/Core/createWorldTerrain.js @@ -5,7 +5,7 @@ import IonResource from "./IonResource.js"; /** * Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}. * - * @exports createWorldTerrain + * @function * * @param {Object} [options] Object with the following properties: * @param {Boolean} [options.requestVertexNormals=false] Flag that indicates if the client should request additional lighting information from the server if available. diff --git a/Source/Core/defaultValue.js b/Source/Core/defaultValue.js index ad5a279b0658..9a52e51ecfb6 100644 --- a/Source/Core/defaultValue.js +++ b/Source/Core/defaultValue.js @@ -2,7 +2,7 @@ * Returns the first parameter if not undefined, otherwise the second parameter. * Useful for setting a default value for a parameter. * - * @exports defaultValue + * @function * * @param {*} a * @param {*} b @@ -22,6 +22,8 @@ function defaultValue(a, b) { * A frozen empty object that can be used as the default value for options passed as * an object literal. * @type {Object} + * @memberof defaultValue */ defaultValue.EMPTY_OBJECT = Object.freeze({}); + export default defaultValue; diff --git a/Source/Core/defined.js b/Source/Core/defined.js index 837d212e5488..d9125ecd06b0 100644 --- a/Source/Core/defined.js +++ b/Source/Core/defined.js @@ -1,5 +1,5 @@ /** - * @exports defined + * @function * * @param {*} value The object. * @returns {Boolean} Returns true if the object is defined, returns false otherwise. diff --git a/Source/Core/deprecationWarning.js b/Source/Core/deprecationWarning.js index 77efbe1f1d4e..6e762389326f 100644 --- a/Source/Core/deprecationWarning.js +++ b/Source/Core/deprecationWarning.js @@ -7,7 +7,7 @@ import oneTimeWarning from "./oneTimeWarning.js"; * console.log directly since this does not log duplicate messages * unless it is called from multiple workers. * - * @exports deprecationWarning + * @function deprecationWarning * * @param {String} identifier The unique identifier for this deprecated API. * @param {String} message The message to log to the console. diff --git a/Source/Core/destroyObject.js b/Source/Core/destroyObject.js index 8e3f631be348..6a73f626eec8 100644 --- a/Source/Core/destroyObject.js +++ b/Source/Core/destroyObject.js @@ -16,7 +16,7 @@ function returnTrue() { * which then releases the native resource and calls destroyObject to put itself * in a destroyed state. * - * @exports destroyObject + * @function * * @param {Object} object The object to destroy. * @param {String} [message] The message to include in the exception that is thrown if diff --git a/Source/Core/formatError.js b/Source/Core/formatError.js index 9593effbc986..02c2c532be6f 100644 --- a/Source/Core/formatError.js +++ b/Source/Core/formatError.js @@ -4,7 +4,7 @@ import defined from "./defined.js"; * Formats an error object into a String. If available, uses name, message, and stack * properties, otherwise, falls back on toString(). * - * @exports formatError + * @function * * @param {*} object The item to find in the array. * @returns {String} A string containing the formatted error. diff --git a/Source/Core/getAbsoluteUri.js b/Source/Core/getAbsoluteUri.js index 7a0b3c747bf3..fa10178da021 100644 --- a/Source/Core/getAbsoluteUri.js +++ b/Source/Core/getAbsoluteUri.js @@ -5,7 +5,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri. - * @exports getAbsoluteUri + * @function * * @param {String} relative The relative Uri. * @param {String} [base] The base Uri. diff --git a/Source/Core/getBaseUri.js b/Source/Core/getBaseUri.js index 9a50b773c32d..a12482eff87a 100644 --- a/Source/Core/getBaseUri.js +++ b/Source/Core/getBaseUri.js @@ -4,7 +4,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Given a URI, returns the base path of the URI. - * @exports getBaseUri + * @function * * @param {String} uri The Uri. * @param {Boolean} [includeQuery = false] Whether or not to include the query string and fragment form the uri diff --git a/Source/Core/getExtensionFromUri.js b/Source/Core/getExtensionFromUri.js index e961fcd7dfb5..084443c6da38 100644 --- a/Source/Core/getExtensionFromUri.js +++ b/Source/Core/getExtensionFromUri.js @@ -4,7 +4,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Given a URI, returns the extension of the URI. - * @exports getExtensionFromUri + * @function getExtensionFromUri * * @param {String} uri The Uri. * @returns {String} The extension of the Uri. diff --git a/Source/Core/getFilenameFromUri.js b/Source/Core/getFilenameFromUri.js index 20b6f7fd6385..4bb4f6372c18 100644 --- a/Source/Core/getFilenameFromUri.js +++ b/Source/Core/getFilenameFromUri.js @@ -4,7 +4,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Given a URI, returns the last segment of the URI, removing any path or query information. - * @exports getFilenameFromUri + * @function getFilenameFromUri * * @param {String} uri The Uri. * @returns {String} The last segment of the Uri. diff --git a/Source/Core/getImagePixels.js b/Source/Core/getImagePixels.js index 69476755a46d..d6a8044e9c6b 100644 --- a/Source/Core/getImagePixels.js +++ b/Source/Core/getImagePixels.js @@ -6,12 +6,12 @@ var context2DsByWidthAndHeight = {}; * Extract a pixel array from a loaded image. Draws the image * into a canvas so it can read the pixels back. * - * @exports getImagePixels + * @function getImagePixels * - * @param {Image} image The image to extract pixels from. + * @param {HTMLImageElement} image The image to extract pixels from. * @param {Number} width The width of the image. If not defined, then image.width is assigned. * @param {Number} height The height of the image. If not defined, then image.height is assigned. - * @returns {CanvasPixelArray} The pixels of the image. + * @returns {ImageData} The pixels of the image. */ function getImagePixels(image, width, height) { if (!defined(width)) { diff --git a/Source/Core/getTimestamp.js b/Source/Core/getTimestamp.js index b75cbcac3523..664c39aa26c2 100644 --- a/Source/Core/getTimestamp.js +++ b/Source/Core/getTimestamp.js @@ -4,7 +4,7 @@ * measured from. This function uses performance.now() if it is available, or Date.now() * otherwise. * - * @exports getTimestamp + * @function getTimestamp * * @returns {Number} The timestamp in milliseconds since some unspecified reference time. */ diff --git a/Source/Core/isBlobUri.js b/Source/Core/isBlobUri.js index 96ac059334ef..513e448fefdb 100644 --- a/Source/Core/isBlobUri.js +++ b/Source/Core/isBlobUri.js @@ -5,7 +5,7 @@ var blobUriRegex = /^blob:/i; /** * Determines if the specified uri is a blob uri. * - * @exports isBlobUri + * @function isBlobUri * * @param {String} uri The uri to test. * @returns {Boolean} true when the uri is a blob uri; otherwise, false. diff --git a/Source/Core/isDataUri.js b/Source/Core/isDataUri.js index 12c36d108a6d..a32ad5dcef6d 100644 --- a/Source/Core/isDataUri.js +++ b/Source/Core/isDataUri.js @@ -5,7 +5,7 @@ var dataUriRegex = /^data:/i; /** * Determines if the specified uri is a data uri. * - * @exports isDataUri + * @function isDataUri * * @param {String} uri The uri to test. * @returns {Boolean} true when the uri is a data uri; otherwise, false. diff --git a/Source/Core/isLeapYear.js b/Source/Core/isLeapYear.js index 3e180bcafab8..84380496dd7d 100644 --- a/Source/Core/isLeapYear.js +++ b/Source/Core/isLeapYear.js @@ -3,7 +3,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Determines if a given date is a leap year. * - * @exports isLeapYear + * @function isLeapYear * * @param {Number} year The year to be tested. * @returns {Boolean} True if year is a leap year. diff --git a/Source/Core/loadCRN.js b/Source/Core/loadCRN.js index 68b659c2833c..c7676364cc13 100644 --- a/Source/Core/loadCRN.js +++ b/Source/Core/loadCRN.js @@ -17,7 +17,7 @@ var transcodeTaskProcessor = new TaskProcessor( * using XMLHttpRequest, which means that in order to make requests to another origin, * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * - * @exports loadCRN + * @function loadCRN * * @param {Resource|String|ArrayBuffer} resourceOrUrlOrBuffer The URL of the binary data or an ArrayBuffer. * @returns {Promise.|undefined} A promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. diff --git a/Source/Core/loadKTX.js b/Source/Core/loadKTX.js index 48e9ef10c288..6fdab8ae14ec 100644 --- a/Source/Core/loadKTX.js +++ b/Source/Core/loadKTX.js @@ -25,7 +25,7 @@ import WebGLConstants from "./WebGLConstants.js"; * *

* - * @exports loadKTX + * @function loadKTX * * @param {Resource|String|ArrayBuffer} resourceOrUrlOrBuffer The URL of the binary data or an ArrayBuffer. * @returns {Promise.|undefined} A promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. diff --git a/Source/Core/mergeSort.js b/Source/Core/mergeSort.js index 1b1d2341c95a..ffe0b095b420 100644 --- a/Source/Core/mergeSort.js +++ b/Source/Core/mergeSort.js @@ -55,9 +55,9 @@ function sort(array, compare, userDefinedObject, start, end) { /** * A stable merge sort. * - * @exports mergeSort + * @function mergeSort * @param {Array} array The array to sort. - * @param {mergeSort~Comparator} comparator The function to use to compare elements in the array. + * @param {mergeSortComparator} comparator The function to use to compare elements in the array. * @param {*} [userDefinedObject] Any item to pass as the third parameter to comparator. * * @example @@ -94,7 +94,7 @@ function mergeSort(array, comparator, userDefinedObject) { /** * A function used to compare two items while performing a merge sort. - * @callback mergeSort~Comparator + * @callback mergeSortComparator * * @param {*} a An item in the array. * @param {*} b An item in the array. diff --git a/Source/Core/objectToQuery.js b/Source/Core/objectToQuery.js index 598d05242b6e..85ea4fe51261 100644 --- a/Source/Core/objectToQuery.js +++ b/Source/Core/objectToQuery.js @@ -5,7 +5,7 @@ import DeveloperError from "./DeveloperError.js"; * Converts an object representing a set of name/value pairs into a query string, * with names and values encoded properly for use in a URL. Values that are arrays * will produce multiple values with the same name. - * @exports objectToQuery + * @function objectToQuery * * @param {Object} obj The object containing data to encode. * @returns {String} An encoded query string. diff --git a/Source/Core/oneTimeWarning.js b/Source/Core/oneTimeWarning.js index 11f0a043f935..849604bf1eab 100644 --- a/Source/Core/oneTimeWarning.js +++ b/Source/Core/oneTimeWarning.js @@ -9,7 +9,7 @@ var warnings = {}; * console.log directly since this does not log duplicate messages * unless it is called from multiple workers. * - * @exports oneTimeWarning + * @function oneTimeWarning * * @param {String} identifier The unique identifier for this warning. * @param {String} [message=identifier] The message to log to the console. diff --git a/Source/Core/parseResponseHeaders.js b/Source/Core/parseResponseHeaders.js index 5a2f30dd9a60..d6501c19200f 100644 --- a/Source/Core/parseResponseHeaders.js +++ b/Source/Core/parseResponseHeaders.js @@ -2,7 +2,7 @@ * Parses the result of XMLHttpRequest's getAllResponseHeaders() method into * a dictionary. * - * @exports parseResponseHeaders + * @function parseResponseHeaders * * @param {String} headerString The header string returned by getAllResponseHeaders(). The format is * described here: http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders()-method diff --git a/Source/Core/pointInsideTriangle.js b/Source/Core/pointInsideTriangle.js index 19cf0608f9f4..ca4f55b87356 100644 --- a/Source/Core/pointInsideTriangle.js +++ b/Source/Core/pointInsideTriangle.js @@ -6,7 +6,7 @@ var coords = new Cartesian3(); /** * Determines if a point is inside a triangle. * - * @exports pointInsideTriangle + * @function pointInsideTriangle * * @param {Cartesian2|Cartesian3} point The point to test. * @param {Cartesian2|Cartesian3} p0 The first point of the triangle. diff --git a/Source/Core/queryToObject.js b/Source/Core/queryToObject.js index 7668c63dbeb4..bc36e569ae18 100644 --- a/Source/Core/queryToObject.js +++ b/Source/Core/queryToObject.js @@ -5,7 +5,7 @@ import DeveloperError from "./DeveloperError.js"; * Parses a query string into an object, where the keys and values of the object are the * name/value pairs from the query string, decoded. If a name appears multiple times, * the value in the object will be an array of values. - * @exports queryToObject + * @function queryToObject * * @param {String} queryString The query string. * @returns {Object} An object containing the parameters parsed from the query string. diff --git a/Source/Core/requestAnimationFrame.js b/Source/Core/requestAnimationFrame.js index 3c4db07f3ed9..e0fb02d9cb80 100644 --- a/Source/Core/requestAnimationFrame.js +++ b/Source/Core/requestAnimationFrame.js @@ -41,9 +41,9 @@ if (typeof requestAnimationFrame !== "undefined") { * A browser-independent function to request a new animation frame. This is used to create * an application's draw loop as shown in the example below. * - * @exports requestAnimationFrame + * @function requestAnimationFrame * - * @param {requestAnimationFrame~Callback} callback The function to call when the next frame should be drawn. + * @param {requestAnimationFrameCallback} callback The function to call when the next frame should be drawn. * @returns {Number} An ID that can be passed to {@link cancelAnimationFrame} to cancel the request. * * @@ -67,7 +67,7 @@ function requestAnimationFramePolyFill(callback) { /** * A function that will be called when the next frame should be drawn. - * @callback requestAnimationFrame~Callback + * @callback requestAnimationFrameCallback * * @param {Number} timestamp A timestamp for the frame, in milliseconds. */ diff --git a/Source/Core/sampleTerrain.js b/Source/Core/sampleTerrain.js index 8696e1e34ed1..93f2f6f3407c 100644 --- a/Source/Core/sampleTerrain.js +++ b/Source/Core/sampleTerrain.js @@ -15,7 +15,7 @@ import Check from "./Check.js"; * terrain level of detail as input, if you need to get the altitude of the terrain as precisely * as possible (i.e. with maximum level of detail) use {@link sampleTerrainMostDetailed}. * - * @exports sampleTerrain + * @function sampleTerrain * * @param {TerrainProvider} terrainProvider The terrain provider from which to query heights. * @param {Number} level The terrain level-of-detail from which to query terrain heights. diff --git a/Source/Core/sampleTerrainMostDetailed.js b/Source/Core/sampleTerrainMostDetailed.js index f899cbb870d1..21a598632a0e 100644 --- a/Source/Core/sampleTerrainMostDetailed.js +++ b/Source/Core/sampleTerrainMostDetailed.js @@ -9,7 +9,7 @@ var scratchCartesian2 = new Cartesian2(); /** * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset. * - * @exports sampleTerrainMostDetailed + * @function sampleTerrainMostDetailed * * @param {TerrainProvider} terrainProvider The terrain provider from which to query heights. * @param {Cartographic[]} positions The positions to update with terrain heights. diff --git a/Source/Core/scaleToGeodeticSurface.js b/Source/Core/scaleToGeodeticSurface.js index 563d651cb392..04beab4efdc4 100644 --- a/Source/Core/scaleToGeodeticSurface.js +++ b/Source/Core/scaleToGeodeticSurface.js @@ -18,7 +18,7 @@ var scaleToGeodeticSurfaceGradient = new Cartesian3(); * @param {Cartesian3} [result] The object onto which to store the result. * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center. * - * @exports scaleToGeodeticSurface + * @function scaleToGeodeticSurface * * @private */ diff --git a/Source/Core/subdivideArray.js b/Source/Core/subdivideArray.js index 5697a7119afd..a4eed785084c 100644 --- a/Source/Core/subdivideArray.js +++ b/Source/Core/subdivideArray.js @@ -4,7 +4,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Subdivides an array into a number of smaller, equal sized arrays. * - * @exports subdivideArray + * @function subdivideArray * * @param {Array} array The array to divide. * @param {Number} numberOfArrays The number of arrays to divide the provided array into. diff --git a/Source/Core/writeTextToCanvas.js b/Source/Core/writeTextToCanvas.js index 6e13eaac6b70..6c1a8544d1c8 100644 --- a/Source/Core/writeTextToCanvas.js +++ b/Source/Core/writeTextToCanvas.js @@ -21,10 +21,10 @@ var imageSmoothingEnabledName; * @param {Number} [options.strokeWidth=1] The stroke width. * @param {Color} [options.backgroundColor=Color.TRANSPARENT] The background color of the canvas. * @param {Number} [options.padding=0] The pixel size of the padding to add around the text. - * @returns {Canvas} A new canvas with the given text drawn into it. The dimensions object + * @returns {HTMLCanvasElement} A new canvas with the given text drawn into it. The dimensions object * from measureText will also be added to the returned canvas. If text is * blank, returns undefined. - * @exports writeTextToCanvas + * @function writeTextToCanvas */ function writeTextToCanvas(text, options) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/DataSources/BoundingSphereState.js b/Source/DataSources/BoundingSphereState.js index 59eac59561ee..f16ac0be0793 100644 --- a/Source/DataSources/BoundingSphereState.js +++ b/Source/DataSources/BoundingSphereState.js @@ -1,6 +1,6 @@ /** * The state of a BoundingSphere computation being performed by a {@link Visualizer}. - * @exports BoundingSphereState + * @enum {Number} * @private */ var BoundingSphereState = { diff --git a/Source/DataSources/BoxGeometryUpdater.js b/Source/DataSources/BoxGeometryUpdater.js index b9a16b1a83f9..fa45b4d15fc0 100644 --- a/Source/DataSources/BoxGeometryUpdater.js +++ b/Source/DataSources/BoxGeometryUpdater.js @@ -66,6 +66,7 @@ Object.defineProperties(BoxGeometryUpdater.prototype, { * @type {TerrainOffsetProperty} * @memberof BoxGeometryUpdater.prototype * @readonly + * @private */ terrainOffsetProperty: { get: function () { diff --git a/Source/DataSources/CallbackProperty.js b/Source/DataSources/CallbackProperty.js index dd06f384b2db..e353d092bcba 100644 --- a/Source/DataSources/CallbackProperty.js +++ b/Source/DataSources/CallbackProperty.js @@ -8,7 +8,7 @@ import Event from "../Core/Event.js"; * @alias CallbackProperty * @constructor * - * @param {CallbackProperty~Callback} callback The function to be called when the property is evaluated. + * @param {CallbackProperty.Callback} callback The function to be called when the property is evaluated. * @param {Boolean} isConstant true when the callback function returns the same value every time, false if the value will change. */ function CallbackProperty(callback, isConstant) { @@ -60,7 +60,7 @@ CallbackProperty.prototype.getValue = function (time, result) { /** * Sets the callback to be used. * - * @param {CallbackProperty~Callback} callback The function to be called when the property is evaluated. + * @param {CallbackProperty.Callback} callback The function to be called when the property is evaluated. * @param {Boolean} isConstant true when the callback function returns the same value every time, false if the value will change. */ CallbackProperty.prototype.setCallback = function (callback, isConstant) { @@ -101,7 +101,7 @@ CallbackProperty.prototype.equals = function (other) { /** * A function that returns the value of the property. - * @callback CallbackProperty~Callback + * @callback CallbackProperty.Callback * * @param {JulianDate} [time] The time for which to retrieve the value. * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned. diff --git a/Source/DataSources/CylinderGeometryUpdater.js b/Source/DataSources/CylinderGeometryUpdater.js index bcfb95bb6ac0..17b2b0e29b85 100644 --- a/Source/DataSources/CylinderGeometryUpdater.js +++ b/Source/DataSources/CylinderGeometryUpdater.js @@ -75,6 +75,7 @@ Object.defineProperties(CylinderGeometryUpdater.prototype, { * @type {TerrainOffsetProperty} * @memberof CylinderGeometryUpdater.prototype * @readonly + * @private */ terrainOffsetProperty: { get: function () { diff --git a/Source/DataSources/DataSourceDisplay.js b/Source/DataSources/DataSourceDisplay.js index d74732437c31..909057bdd92f 100644 --- a/Source/DataSources/DataSourceDisplay.js +++ b/Source/DataSources/DataSourceDisplay.js @@ -28,7 +28,7 @@ import PolylineVisualizer from "./PolylineVisualizer.js"; * @param {Object} options Object with the following properties: * @param {Scene} options.scene The scene in which to display the data. * @param {DataSourceCollection} options.dataSourceCollection The data sources to display. - * @param {DataSourceDisplay~VisualizersCallback} [options.visualizersCallback=DataSourceDisplay.defaultVisualizersCallback] + * @param {DataSourceDisplay.VisualizersCallback} [options.visualizersCallback=DataSourceDisplay.defaultVisualizersCallback] * A function which creates an array of visualizers used for visualization. * If undefined, all standard visualizers are used. */ @@ -124,7 +124,7 @@ function DataSourceDisplay(options) { * Gets or sets the default function which creates an array of visualizers used for visualization. * By default, this function uses all standard visualizers. * - * @type {DataSourceDisplay~VisualizersCallback} + * @type {DataSourceDisplay.VisualizersCallback} */ DataSourceDisplay.defaultVisualizersCallback = function ( scene, @@ -496,7 +496,7 @@ DataSourceDisplay.prototype._onDataSourceMoved = function ( /** * A function which creates an array of visualizers used for visualization. - * @callback DataSourceDisplay~VisualizersCallback + * @callback DataSourceDisplay.VisualizersCallback * * @param {Scene} scene The scene to create visualizers for. * @param {DataSource} dataSource The data source to create visualizers for. diff --git a/Source/DataSources/EllipsoidGeometryUpdater.js b/Source/DataSources/EllipsoidGeometryUpdater.js index 2718bc8f2179..6531eb18564d 100644 --- a/Source/DataSources/EllipsoidGeometryUpdater.js +++ b/Source/DataSources/EllipsoidGeometryUpdater.js @@ -92,6 +92,7 @@ Object.defineProperties(EllipsoidGeometryUpdater.prototype, { * @type {TerrainOffsetProperty} * @memberof EllipsoidGeometryUpdater.prototype * @readonly + * @private */ terrainOffsetProperty: { get: function () { diff --git a/Source/DataSources/EntityCluster.js b/Source/DataSources/EntityCluster.js index 977483823518..2779deb12142 100644 --- a/Source/DataSources/EntityCluster.js +++ b/Source/DataSources/EntityCluster.js @@ -547,7 +547,7 @@ Object.defineProperties(EntityCluster.prototype, { }, }, /** - * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster~newClusterCallback}. + * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}. * @memberof EntityCluster.prototype * @type {Event} */ @@ -960,7 +960,7 @@ EntityCluster.prototype.destroy = function () { /** * A event listener function used to style clusters. - * @callback EntityCluster~newClusterCallback + * @callback EntityCluster.newClusterCallback * * @param {Entity[]} clusteredEntities An array of the entities contained in the cluster. * @param {Object} cluster An object containing billboard, label, and point properties. The values are the same as diff --git a/Source/DataSources/GeoJsonDataSource.js b/Source/DataSources/GeoJsonDataSource.js index e5d73e80ce41..9f8972fcb0ef 100644 --- a/Source/DataSources/GeoJsonDataSource.js +++ b/Source/DataSources/GeoJsonDataSource.js @@ -888,7 +888,7 @@ Object.defineProperties(GeoJsonDataSource.prototype, { * @param {Resource|String|Object} data A url, GeoJSON object, or TopoJSON object to be loaded. * @param {Object} [options] An object with the following properties: * @param {String} [options.sourceUri] Overrides the url to use for resolving relative links. - * @param {GeoJsonDataSource~describe} [options.describe=GeoJsonDataSource.defaultDescribeProperty] A function which returns a Property object (or just a string), + * @param {GeoJsonDataSource.describe} [options.describe=GeoJsonDataSource.defaultDescribeProperty] A function which returns a Property object (or just a string), * which converts the properties into an html description. * @param {Number} [options.markerSize=GeoJsonDataSource.markerSize] The default size of the map pin created for each point, in pixels. * @param {String} [options.markerSymbol=GeoJsonDataSource.markerSymbol] The default symbol of the map pin created for each point. @@ -1037,7 +1037,7 @@ function load(that, geoJson, options, sourceUri) { /** * This callback is displayed as part of the GeoJsonDataSource class. - * @callback GeoJsonDataSource~describe + * @callback GeoJsonDataSource.describe * @param {Object} properties The properties of the feature. * @param {String} nameProperty The property key that Cesium estimates to have the name of the feature. */ diff --git a/Source/DataSources/GeometryUpdater.js b/Source/DataSources/GeometryUpdater.js index 1377c87dc82c..d23137b4b797 100644 --- a/Source/DataSources/GeometryUpdater.js +++ b/Source/DataSources/GeometryUpdater.js @@ -519,6 +519,7 @@ GeometryUpdater.prototype._onEntityPropertyChanged = function ( * @returns {DynamicGeometryUpdater} The dynamic updater used to update the geometry each frame. * * @exception {DeveloperError} This instance does not represent dynamic geometry. + * @private */ GeometryUpdater.prototype.createDynamicUpdater = function ( primitives, diff --git a/Source/DataSources/GroundGeometryUpdater.js b/Source/DataSources/GroundGeometryUpdater.js index 724b0b04f1c1..2879e88ea059 100644 --- a/Source/DataSources/GroundGeometryUpdater.js +++ b/Source/DataSources/GroundGeometryUpdater.js @@ -54,6 +54,7 @@ Object.defineProperties(GroundGeometryUpdater.prototype, { * @type {TerrainOffsetProperty} * @memberof GroundGeometryUpdater.prototype * @readonly + * @private */ terrainOffsetProperty: { get: function () { diff --git a/Source/DataSources/KmlDataSource.js b/Source/DataSources/KmlDataSource.js index 124298ba9a96..63833fb6a62f 100644 --- a/Source/DataSources/KmlDataSource.js +++ b/Source/DataSources/KmlDataSource.js @@ -3358,7 +3358,7 @@ function load(dataSource, entityCollection, data, options) { * * @param {Object} options An object with the following properties: * @param {Camera} options.camera The camera that is used for viewRefreshModes and sending camera properties to network links. - * @param {Canvas} options.canvas The canvas that is used for sending viewer properties to network links. + * @param {HTMLCanvasElement} options.canvas The canvas that is used for sending viewer properties to network links. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The global ellipsoid used for geographical calculations. * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas. * @@ -3436,7 +3436,7 @@ function KmlDataSource(options) { * @param {Resource|String|Document|Blob} data A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document. * @param {Object} options An object with the following properties: * @param {Camera} options.camera The camera that is used for viewRefreshModes and sending camera properties to network links. - * @param {Canvas} options.canvas The canvas that is used for sending viewer properties to network links. + * @param {HTMLCanvasElement} options.canvas The canvas that is used for sending viewer properties to network links. * @param {String} [options.sourceUri] Overrides the url to use for resolving relative links and other KML network features. * @param {Boolean} [options.clampToGround=false] true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The global ellipsoid used for geographical calculations. @@ -4006,112 +4006,68 @@ KmlDataSource.prototype.update = function (time) { * @constructor */ function KmlFeatureData() { + /** + * @typedef KmlFeatureData.Author + * @type {Object} + * @property {String} name Gets the name. + * @property {String} uri Gets the URI. + * @property {Number} age Gets the email. + */ + /** * Gets the atom syndication format author field. - * @type Object + * @type {KmlFeatureData.Author} */ this.author = { - /** - * Gets the name. - * @type String - * @alias author.name - * @memberof! KmlFeatureData# - * @property author.name - */ name: undefined, - /** - * Gets the URI. - * @type String - * @alias author.uri - * @memberof! KmlFeatureData# - * @property author.uri - */ uri: undefined, - /** - * Gets the email. - * @type String - * @alias author.email - * @memberof! KmlFeatureData# - * @property author.email - */ email: undefined, }; + /** + * @typedef KmlFeatureData.Link + * @type {Object} + * @property {String} href Gets the href. + * @property {String} hreflang Gets the language of the linked resource. + * @property {String} rel Gets the link relation. + * @property {String} type Gets the link type. + * @property {String} title Gets the link title. + * @property {String} length Gets the link length. + */ + /** * Gets the link. - * @type Object + * @type {KmlFeatureData.Link} */ this.link = { - /** - * Gets the href. - * @type String - * @alias link.href - * @memberof! KmlFeatureData# - * @property link.href - */ href: undefined, - /** - * Gets the language of the linked resource. - * @type String - * @alias link.hreflang - * @memberof! KmlFeatureData# - * @property link.hreflang - */ hreflang: undefined, - /** - * Gets the link relation. - * @type String - * @alias link.rel - * @memberof! KmlFeatureData# - * @property link.rel - */ rel: undefined, - /** - * Gets the link type. - * @type String - * @alias link.type - * @memberof! KmlFeatureData# - * @property link.type - */ type: undefined, - /** - * Gets the link title. - * @type String - * @alias link.title - * @memberof! KmlFeatureData# - * @property link.title - */ title: undefined, - /** - * Gets the link length. - * @type String - * @alias link.length - * @memberof! KmlFeatureData# - * @property link.length - */ length: undefined, }; /** * Gets the unstructured address field. - * @type String + * @type {String} */ this.address = undefined; /** * Gets the phone number. - * @type String + * @type {String} */ this.phoneNumber = undefined; /** * Gets the snippet. - * @type String + * @type {String} */ this.snippet = undefined; /** * Gets the extended data, parsed into a JSON object. * Currently only the Data property is supported. * SchemaData and custom data are ignored. - * @type String + * @type {String} */ this.extendedData = undefined; } diff --git a/Source/DataSources/KmlTourFlyTo.js b/Source/DataSources/KmlTourFlyTo.js index 97a3d8cce55b..f2f6b980fda4 100644 --- a/Source/DataSources/KmlTourFlyTo.js +++ b/Source/DataSources/KmlTourFlyTo.js @@ -24,7 +24,7 @@ function KmlTourFlyTo(duration, flyToMode, view) { /** * Play this playlist entry * - * @param {KmlTourFlyTo~DoneCallback} done function which will be called when playback ends + * @param {KmlTourFlyTo.DoneCallback} done function which will be called when playback ends * @param {Camera} camera Cesium camera * @param {Object} [cameraOptions] which will be merged with camera flyTo options. See {@link Camera#flyTo} */ @@ -95,7 +95,7 @@ KmlTourFlyTo.prototype.getCameraOptions = function (cameraOptions) { /** * A function that will be executed when the flight completes. - * @callback KmlTourFlyTo~DoneCallback + * @callback KmlTourFlyTo.DoneCallback * * @param {Boolean} terminated true if {@link KmlTourFlyTo#stop} was * called before entry done playback. diff --git a/Source/DataSources/KmlTourWait.js b/Source/DataSources/KmlTourWait.js index 6a809461ae42..476603d18553 100644 --- a/Source/DataSources/KmlTourWait.js +++ b/Source/DataSources/KmlTourWait.js @@ -16,7 +16,7 @@ function KmlTourWait(duration) { /** * Play this playlist entry * - * @param {KmlTourWait~DoneCallback} done function which will be called when playback ends + * @param {KmlTourWait.DoneCallback} done function which will be called when playback ends */ KmlTourWait.prototype.play = function (done) { var self = this; @@ -40,7 +40,7 @@ KmlTourWait.prototype.stop = function () { /** * A function which will be called when playback ends. * - * @callback KmlTourWait~DoneCallback + * @callback KmlTourWait.DoneCallback * @param {Boolean} terminated true if {@link KmlTourWait#stop} was * called before entry done playback. */ diff --git a/Source/DataSources/PolylineGeometryUpdater.js b/Source/DataSources/PolylineGeometryUpdater.js index b782858b1be8..96fc87575d61 100644 --- a/Source/DataSources/PolylineGeometryUpdater.js +++ b/Source/DataSources/PolylineGeometryUpdater.js @@ -616,6 +616,7 @@ PolylineGeometryUpdater.prototype._onEntityPropertyChanged = function ( * @returns {DynamicGeometryUpdater} The dynamic updater used to update the geometry each frame. * * @exception {DeveloperError} This instance does not represent dynamic geometry. + * @private */ PolylineGeometryUpdater.prototype.createDynamicUpdater = function ( primitives, diff --git a/Source/DataSources/Rotation.js b/Source/DataSources/Rotation.js index 42aa8dbc8883..8273f8d1a3aa 100755 --- a/Source/DataSources/Rotation.js +++ b/Source/DataSources/Rotation.js @@ -9,7 +9,7 @@ import CesiumMath from "../Core/Math.js"; * but is instead passed to the constructor of {@link SampledProperty} * in order to represent a two-dimensional angle of rotation. * - * @exports Rotation + * @interface Rotation * * * @example @@ -87,7 +87,7 @@ var Rotation = { * @param {Number[]} packedArray The packed array. * @param {Number} [startingIndex=0] The index of the first element to be converted. * @param {Number} [lastIndex=packedArray.length] The index of the last element to be converted. - * @param {Number[]} result The object into which to store the result. + * @param {Number[]} [result] The object into which to store the result. */ convertPackedArrayForInterpolation: function ( packedArray, @@ -101,6 +101,10 @@ var Rotation = { } //>>includeEnd('debug'); + if (!defined(result)) { + result = []; + } + startingIndex = defaultValue(startingIndex, 0); lastIndex = defaultValue(lastIndex, packedArray.length); diff --git a/Source/DataSources/StripeOrientation.js b/Source/DataSources/StripeOrientation.js index aed7c398e134..c2da3b8f8810 100644 --- a/Source/DataSources/StripeOrientation.js +++ b/Source/DataSources/StripeOrientation.js @@ -1,7 +1,7 @@ /** * Defined the orientation of stripes in {@link StripeMaterialProperty}. * - * @exports StripeOrientation + * @enum {Number} */ var StripeOrientation = { /** diff --git a/Source/DataSources/TerrainOffsetProperty.js b/Source/DataSources/TerrainOffsetProperty.js index dc6d4d89f48d..ed9c22e13723 100644 --- a/Source/DataSources/TerrainOffsetProperty.js +++ b/Source/DataSources/TerrainOffsetProperty.js @@ -238,7 +238,7 @@ TerrainOffsetProperty.prototype.destroy = function () { /** * A function which creates one or more providers. - * @callback TerrainOffsetProperty~PositionFunction + * @callback TerrainOffsetProperty.PositionFunction * @param {JulianDate} time The clock time at which to retrieve the position * @param {Cartesian3} result The result position * @returns {Cartesian3} The position at which to do the terrain height check diff --git a/Source/DataSources/exportKml.js b/Source/DataSources/exportKml.js index d251de4143b3..bcb9ce080dc8 100644 --- a/Source/DataSources/exportKml.js +++ b/Source/DataSources/exportKml.js @@ -232,12 +232,12 @@ IdManager.prototype.get = function (id) { * as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary * color is used. Canvas objects are exported as PNG images. * - * @exports exportKml + * @function exportKml * * @param {Object} options An object with the following properties: * @param {EntityCollection} options.entities The EntityCollection to export as KML. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for the output file. - * @param {exportKml~ModelCallback} [options.modelCallback] A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection. + * @param {exportKmlModelCallback} [options.modelCallback] A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection. * @param {JulianDate} [options.time=entities.computeAvailability().start] The time value to use to get properties that are not time varying in KML. * @param {TimeInterval} [options.defaultAvailability=entities.computeAvailability()] The interval that will be sampled if an entity doesn't have an availability. * @param {Number} [options.sampleDuration=60] The number of seconds to sample properties that are varying in KML. @@ -1503,7 +1503,7 @@ function colorToString(color) { * It can also be used to add additional files to the externalFiles object, which is the list of files embedded in the exported KMZ, * or otherwise returned with the KML string when exporting. * - * @callback exportKml~ModelCallback + * @callback exportKmlModelCallback * * @param {ModelGraphics} model The ModelGraphics instance for an Entity. * @param {JulianDate} time The time that any properties should use to get the value. diff --git a/Source/Renderer/AutomaticUniforms.js b/Source/Renderer/AutomaticUniforms.js index 89d5c436887f..e72cd6eddb2e 100644 --- a/Source/Renderer/AutomaticUniforms.js +++ b/Source/Renderer/AutomaticUniforms.js @@ -51,10 +51,6 @@ var AutomaticUniforms = { * and height properties in an vec4's x, y, z, * and w components, respectively. * - * @alias czm_viewport - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec4 czm_viewport; @@ -85,10 +81,6 @@ var AutomaticUniforms = { * The former transforms from normalized device coordinates to window coordinates; the later transforms * from window coordinates to clip coordinates, and is often used to assign to gl_Position. * - * @alias czm_viewportOrthographic - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_viewportOrthographic; @@ -124,10 +116,6 @@ var AutomaticUniforms = { * The former transforms from normalized device coordinates to window coordinates; the later transforms * from window coordinates to clip coordinates, and is often used to assign to gl_Position. * - * @alias czm_viewportTransformation - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_viewportTransformation; @@ -157,12 +145,6 @@ var AutomaticUniforms = { * after the globe pass and then updated after the 3D Tiles pass. * The depth is packed into an RGBA texture. * - * @private - * - * @alias czm_globeDepthTexture - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform sampler2D czm_globeDepthTexture; @@ -183,10 +165,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 4x4 model transformation matrix that * transforms model coordinates to world coordinates. * - * @alias czm_model - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_model; @@ -211,10 +189,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 4x4 model transformation matrix that * transforms world coordinates to model coordinates. * - * @alias czm_inverseModel - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseModel; @@ -238,10 +212,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 4x4 view transformation matrix that * transforms world coordinates to eye coordinates. * - * @alias czm_view - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_view; @@ -271,10 +241,6 @@ var AutomaticUniforms = { * as if the camera were at an equivalent location in 3D mode. This is useful for lighting * 2D and Columbus View in the same way that 3D is lit. * - * @alias czm_view3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_view3D; @@ -297,10 +263,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 3x3 view rotation matrix that * transforms vectors in world coordinates to eye coordinates. * - * @alias czm_viewRotation - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_viewRotation; @@ -328,10 +290,6 @@ var AutomaticUniforms = { * as if the camera were at an equivalent location in 3D mode. This is useful for lighting * 2D and Columbus View in the same way that 3D is lit. * - * @alias czm_viewRotation3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_viewRotation3D; @@ -354,10 +312,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 4x4 transformation matrix that * transforms from eye coordinates to world coordinates. * - * @alias czm_inverseView - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseView; @@ -384,10 +338,6 @@ var AutomaticUniforms = { * as if the camera were at an equivalent location in 3D mode. This is useful for lighting * 2D and Columbus View in the same way that 3D is lit. * - * @alias czm_inverseView3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseView3D; @@ -410,10 +360,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 3x3 rotation matrix that * transforms vectors from eye coordinates to world coordinates. * - * @alias czm_inverseViewRotation - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_inverseViewRotation; @@ -441,10 +387,6 @@ var AutomaticUniforms = { * as if the camera were at an equivalent location in 3D mode. This is useful for lighting * 2D and Columbus View in the same way that 3D is lit. * - * @alias czm_inverseViewRotation3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_inverseViewRotation3D; @@ -468,10 +410,6 @@ var AutomaticUniforms = { * transforms eye coordinates to clip coordinates. Clip coordinates is the * coordinate system for a vertex shader's gl_Position output. * - * @alias czm_projection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_projection; @@ -497,10 +435,6 @@ var AutomaticUniforms = { * transforms from clip coordinates to eye coordinates. Clip coordinates is the * coordinate system for a vertex shader's gl_Position output. * - * @alias czm_inverseProjection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseProjection; @@ -526,10 +460,6 @@ var AutomaticUniforms = { * in algorithms like shadow volumes and GPU ray casting with proxy geometry to ensure that triangles * are not clipped by the far plane. * - * @alias czm_infiniteProjection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_infiniteProjection; @@ -556,10 +486,6 @@ var AutomaticUniforms = { * Positions should be transformed to eye coordinates using czm_modelView and * normals should be transformed using {@link czm_normal}. * - * @alias czm_modelView - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_modelView; @@ -594,10 +520,6 @@ var AutomaticUniforms = { * Positions should be transformed to eye coordinates using czm_modelView3D and * normals should be transformed using {@link czm_normal3D}. * - * @alias czm_modelView3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_modelView3D; @@ -624,10 +546,6 @@ var AutomaticUniforms = { * transforms model coordinates, relative to the eye, to eye coordinates. This is used * in conjunction with {@link czm_translateRelativeToEye}. * - * @alias czm_modelViewRelativeToEye - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_modelViewRelativeToEye; @@ -658,10 +576,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 4x4 transformation matrix that * transforms from eye coordinates to model coordinates. * - * @alias czm_inverseModelView - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseModelView; @@ -687,10 +601,6 @@ var AutomaticUniforms = { * as if the camera were at an equivalent location in 3D mode. This is useful for lighting * 2D and Columbus View in the same way that 3D is lit. * - * @alias czm_inverseModelView3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseModelView3D; @@ -715,10 +625,6 @@ var AutomaticUniforms = { * transforms world coordinates to clip coordinates. Clip coordinates is the * coordinate system for a vertex shader's gl_Position output. * - * @alias czm_viewProjection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_viewProjection; @@ -748,10 +654,6 @@ var AutomaticUniforms = { * transforms clip coordinates to world coordinates. Clip coordinates is the * coordinate system for a vertex shader's gl_Position output. * - * @alias czm_inverseViewProjection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseViewProjection; @@ -775,10 +677,6 @@ var AutomaticUniforms = { * transforms model coordinates to clip coordinates. Clip coordinates is the * coordinate system for a vertex shader's gl_Position output. * - * @alias czm_modelViewProjection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_modelViewProjection; @@ -811,10 +709,6 @@ var AutomaticUniforms = { * transforms clip coordinates to model coordinates. Clip coordinates is the * coordinate system for a vertex shader's gl_Position output. * - * @alias czm_inverseModelViewProjection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseModelViewProjection; @@ -839,10 +733,6 @@ var AutomaticUniforms = { * coordinate system for a vertex shader's gl_Position output. This is used in * conjunction with {@link czm_translateRelativeToEye}. * - * @alias czm_modelViewProjectionRelativeToEye - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_modelViewProjectionRelativeToEye; @@ -876,10 +766,6 @@ var AutomaticUniforms = { * the far plane at infinity. This is useful in algorithms like shadow volumes and GPU ray casting with * proxy geometry to ensure that triangles are not clipped by the far plane. * - * @alias czm_modelViewInfiniteProjection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_modelViewInfiniteProjection; @@ -907,9 +793,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform that indicates if the current camera is orthographic in 3D. * - * @alias czm_orthographicIn3D - * @namespace - * @glslUniform * @see UniformState#orthographicIn3D */ czm_orthographicIn3D: new AutomaticUniform({ @@ -927,10 +810,6 @@ var AutomaticUniforms = { * Positions should be transformed to eye coordinates using {@link czm_modelView} and * normals should be transformed using czm_normal. * - * @alias czm_normal - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_normal; @@ -961,10 +840,6 @@ var AutomaticUniforms = { * Positions should be transformed to eye coordinates using {@link czm_modelView3D} and * normals should be transformed using czm_normal3D. * - * @alias czm_normal3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_normal3D; @@ -988,10 +863,6 @@ var AutomaticUniforms = { * transforms normal vectors in eye coordinates to model coordinates. This is * the opposite of the transform provided by {@link czm_normal}. * - * @alias czm_inverseNormal - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_inverseNormal; @@ -1021,10 +892,6 @@ var AutomaticUniforms = { * matrix as if the camera were at an equivalent location in 3D mode. This is useful for lighting * 2D and Columbus View in the same way that 3D is lit. * - * @alias czm_inverseNormal3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_inverseNormal3D; @@ -1047,10 +914,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform containing the height in meters of the * eye (camera) above or below the ellipsoid. * - * @alias czm_eyeHeight - * @namespace - * @glslUniform - * * @see UniformState#eyeHeight */ czm_eyeHeight: new AutomaticUniform({ @@ -1066,10 +929,6 @@ var AutomaticUniforms = { * in meters of the eye (camera) above the 2D world plane. This uniform is only valid * when the {@link SceneMode} is SCENE2D. * - * @alias czm_eyeHeight2D - * @namespace - * @glslUniform - * * @see UniformState#eyeHeight2D */ czm_eyeHeight2D: new AutomaticUniform({ @@ -1085,10 +944,6 @@ var AutomaticUniforms = { * of the frustum defined by the camera. This is the largest possible frustum, not an individual * frustum used for multi-frustum rendering. * - * @alias czm_entireFrustum - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec2 czm_entireFrustum; @@ -1112,10 +967,6 @@ var AutomaticUniforms = { * of the frustum defined by the camera. This is the individual * frustum used for multi-frustum rendering. * - * @alias czm_currentFrustum - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec2 czm_currentFrustum; @@ -1137,10 +988,6 @@ var AutomaticUniforms = { /** * The distances to the frustum planes. The top, bottom, left and right distances are * the x, y, z, and w components, respectively. - * - * @alias czm_frustumPlanes - * @namespace - * @glslUniform */ czm_frustumPlanes: new AutomaticUniform({ size: 1, @@ -1152,10 +999,6 @@ var AutomaticUniforms = { /** * Gets the far plane's distance from the near plane, plus 1.0. - * - * @alias czm_farDepthFromNearPlusOne - * @namespace - * @glslUniform */ czm_farDepthFromNearPlusOne: new AutomaticUniform({ size: 1, @@ -1167,10 +1010,6 @@ var AutomaticUniforms = { /** * Gets the log2 of {@link AutomaticUniforms#czm_farDepthFromNearPlusOne}. - * - * @alias czm_oneOverLog2FarDepthFromNearPlusOne - * @namespace - * @glslUniform */ czm_log2FarDepthFromNearPlusOne: new AutomaticUniform({ size: 1, @@ -1182,10 +1021,6 @@ var AutomaticUniforms = { /** * Gets 1.0 divided by {@link AutomaticUniforms#czm_log2FarDepthFromNearPlusOne}. - * - * @alias czm_oneOverLog2FarDepthFromNearPlusOne - * @namespace - * @glslUniform */ czm_oneOverLog2FarDepthFromNearPlusOne: new AutomaticUniform({ size: 1, @@ -1198,10 +1033,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the sun position in world coordinates. * - * @alias czm_sunPositionWC - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_sunPositionWC; @@ -1221,10 +1052,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the sun position in Columbus view world coordinates. * - * @alias czm_sunPositionColumbusView - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_sunPositionColumbusView; @@ -1243,10 +1070,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the normalized direction to the sun in eye coordinates. * - * @alias czm_sunDirectionEC - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_sunDirectionEC; @@ -1269,10 +1092,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the normalized direction to the sun in world coordinates. * - * @alias czm_sunDirectionWC - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_sunDirectionWC; @@ -1295,10 +1114,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the normalized direction to the moon in eye coordinates. * - * @alias czm_moonDirectionEC - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_moonDirectionEC; @@ -1321,10 +1136,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing the normalized direction to the scene's light source in eye coordinates. * This is commonly used for directional lighting computations. * - * @alias czm_lightDirectionEC - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_lightDirectionEC; @@ -1347,10 +1158,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing the normalized direction to the scene's light source in world coordinates. * This is commonly used for directional lighting computations. * - * @alias czm_lightDirectionWC - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_lightDirectionWC; @@ -1374,10 +1181,6 @@ var AutomaticUniforms = { * is equivalent to the light color multiplied by the light intensity limited to a maximum luminance of 1.0 * suitable for non-HDR lighting. * - * @alias czm_lightColor - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_lightColor; @@ -1400,10 +1203,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform that represents the high dynamic range color of light emitted by the scene's light * source. This is equivalent to the light color multiplied by the light intensity suitable for HDR lighting. * - * @alias czm_lightColorHdr - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_lightColorHdr; @@ -1427,10 +1226,6 @@ var AutomaticUniforms = { * coordinates. This is used for GPU RTE to eliminate jittering artifacts when rendering * as described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. * - * @alias czm_encodedCameraPositionMCHigh - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_encodedCameraPositionMCHigh; @@ -1452,10 +1247,6 @@ var AutomaticUniforms = { * coordinates. This is used for GPU RTE to eliminate jittering artifacts when rendering * as described in {@linkhttp://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. * - * @alias czm_encodedCameraPositionMCLow - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_encodedCameraPositionMCLow; @@ -1475,10 +1266,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the position of the viewer (camera) in world coordinates. * - * @alias czm_viewerPositionWC - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_viewerPositionWC; @@ -1498,10 +1285,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing the frame number. This uniform is automatically incremented * every frame. * - * @alias czm_frameNumber - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform float czm_frameNumber; @@ -1518,10 +1301,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing the current morph transition time between * 2D/Columbus View and 3D, with 0.0 being 2D or Columbus View and 1.0 being 3D. * - * @alias czm_morphTime - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform float czm_morphTime; @@ -1541,10 +1320,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing the current {@link SceneMode}, expressed * as a float. * - * @alias czm_sceneMode - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform float czm_sceneMode; @@ -1571,10 +1346,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the current rendering pass. * - * @alias czm_pass - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform float czm_pass; @@ -1596,10 +1367,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the current scene background color. * - * @alias czm_backgroundColor - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec4 czm_backgroundColor; @@ -1626,10 +1393,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform containing the BRDF look up texture used for image-based lighting computations. * - * @alias czm_brdfLut - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform sampler2D czm_brdfLut; @@ -1650,10 +1413,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform containing the environment map used within the scene. * - * @alias czm_environmentMap - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform samplerCube czm_environmentMap; @@ -1673,10 +1432,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform containing the specular environment map atlas used within the scene. * - * @alias czm_specularEnvironmentMaps - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform sampler2D czm_specularEnvironmentMaps; @@ -1692,10 +1447,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform containing the size of the specular environment map atlas used within the scene. * - * @alias czm_specularEnvironmentMapSize - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec2 czm_specularEnvironmentMapSize; @@ -1711,10 +1462,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform containing the maximum level-of-detail of the specular environment map atlas used within the scene. * - * @alias czm_specularEnvironmentMapsMaximumLOD - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform float czm_specularEnvironmentMapsMaximumLOD; @@ -1730,10 +1477,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform containing the spherical harmonic coefficients used within the scene. * - * @alias czm_sphericalHarmonicCoefficients - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3[9] czm_sphericalHarmonicCoefficients; @@ -1750,10 +1493,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 3x3 rotation matrix that transforms * from True Equator Mean Equinox (TEME) axes to the pseudo-fixed axes at the current scene time. * - * @alias czm_temeToPseudoFixed - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_temeToPseudoFixed; @@ -1775,10 +1514,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the ratio of canvas coordinate space to canvas pixel space. * - * @alias czm_pixelRatio - * @namespace - * @glslUniform - * * @example * uniform float czm_pixelRatio; */ @@ -1793,10 +1528,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform scalar used to mix a color with the fog color based on the distance to the camera. * - * @alias czm_fogDensity - * @namespace - * @glslUniform - * * @see czm_fog */ czm_fogDensity: new AutomaticUniform({ @@ -1811,10 +1542,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing the splitter position to use when rendering imagery layers with a splitter. * This will be in pixel coordinates relative to the canvas. * - * @alias czm_imagerySplitPosition - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform float czm_imagerySplitPosition; @@ -1829,10 +1556,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform scalar representing the geometric tolerance per meter - * - * @alias czm_geometricToleranceOverMeter - * @namespace - * @glslUniform */ czm_geometricToleranceOverMeter: new AutomaticUniform({ size: 1, @@ -1846,10 +1569,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing the distance from the camera at which to disable the depth test of billboards, labels and points * to, for example, prevent clipping against terrain. When set to zero, the depth test should always be applied. When less than zero, * the depth test should never be applied. - * - * @alias czm_minimumDisableDepthTestDistance - * @namespace - * @glslUniform */ czm_minimumDisableDepthTestDistance: new AutomaticUniform({ size: 1, @@ -1861,10 +1580,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform that will be the highlight color of unclassified 3D Tiles. - * - * @alias czm_invertClassificationColor - * @namespace - * @glslUniform */ czm_invertClassificationColor: new AutomaticUniform({ size: 1, @@ -1876,9 +1591,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform that is used for gamma correction. - * - * @alias czm_gamma - * @glslUniform */ czm_gamma: new AutomaticUniform({ size: 1, @@ -1890,9 +1602,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform that stores the ellipsoid radii. - * - * @alias czm_ellipsoidRadii - * @glslUniform */ czm_ellipsoidRadii: new AutomaticUniform({ size: 1, @@ -1904,9 +1613,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform that stores the ellipsoid inverse radii. - * - * @alias czm_ellipsoidRadii - * @glslUniform */ czm_ellipsoidInverseRadii: new AutomaticUniform({ size: 1, diff --git a/Source/Renderer/PixelDatatype.js b/Source/Renderer/PixelDatatype.js index e7f17f8404cd..e9238e94f5a8 100644 --- a/Source/Renderer/PixelDatatype.js +++ b/Source/Renderer/PixelDatatype.js @@ -1,7 +1,10 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** - * @private + * The data type of a pixel. + * + * @enum {Number} + * @see PostProcessStage */ var PixelDatatype = { UNSIGNED_BYTE: WebGLConstants.UNSIGNED_BYTE, @@ -13,45 +16,55 @@ var PixelDatatype = { UNSIGNED_SHORT_4_4_4_4: WebGLConstants.UNSIGNED_SHORT_4_4_4_4, UNSIGNED_SHORT_5_5_5_1: WebGLConstants.UNSIGNED_SHORT_5_5_5_1, UNSIGNED_SHORT_5_6_5: WebGLConstants.UNSIGNED_SHORT_5_6_5, +}; - isPacked: function (pixelDatatype) { - return ( - pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 || - pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 || - pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 || - pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5 - ); - }, +/** + @private +*/ +PixelDatatype.isPacked = function (pixelDatatype) { + return ( + pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 || + pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 || + pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 || + pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5 + ); +}; - sizeInBytes: function (pixelDatatype) { - switch (pixelDatatype) { - case PixelDatatype.UNSIGNED_BYTE: - return 1; - case PixelDatatype.UNSIGNED_SHORT: - case PixelDatatype.UNSIGNED_SHORT_4_4_4_4: - case PixelDatatype.UNSIGNED_SHORT_5_5_5_1: - case PixelDatatype.UNSIGNED_SHORT_5_6_5: - case PixelDatatype.HALF_FLOAT: - return 2; - case PixelDatatype.UNSIGNED_INT: - case PixelDatatype.FLOAT: - case PixelDatatype.UNSIGNED_INT_24_8: - return 4; - } - }, +/** + @private +*/ +PixelDatatype.sizeInBytes = function (pixelDatatype) { + switch (pixelDatatype) { + case PixelDatatype.UNSIGNED_BYTE: + return 1; + case PixelDatatype.UNSIGNED_SHORT: + case PixelDatatype.UNSIGNED_SHORT_4_4_4_4: + case PixelDatatype.UNSIGNED_SHORT_5_5_5_1: + case PixelDatatype.UNSIGNED_SHORT_5_6_5: + case PixelDatatype.HALF_FLOAT: + return 2; + case PixelDatatype.UNSIGNED_INT: + case PixelDatatype.FLOAT: + case PixelDatatype.UNSIGNED_INT_24_8: + return 4; + } +}; - validate: function (pixelDatatype) { - return ( - pixelDatatype === PixelDatatype.UNSIGNED_BYTE || - pixelDatatype === PixelDatatype.UNSIGNED_SHORT || - pixelDatatype === PixelDatatype.UNSIGNED_INT || - pixelDatatype === PixelDatatype.FLOAT || - pixelDatatype === PixelDatatype.HALF_FLOAT || - pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 || - pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 || - pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 || - pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5 - ); - }, +/** + @private +*/ +PixelDatatype.validate = function (pixelDatatype) { + return ( + pixelDatatype === PixelDatatype.UNSIGNED_BYTE || + pixelDatatype === PixelDatatype.UNSIGNED_SHORT || + pixelDatatype === PixelDatatype.UNSIGNED_INT || + pixelDatatype === PixelDatatype.FLOAT || + pixelDatatype === PixelDatatype.HALF_FLOAT || + pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 || + pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 || + pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 || + pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5 + ); }; + export default Object.freeze(PixelDatatype); diff --git a/Source/Renderer/Texture.js b/Source/Renderer/Texture.js index d4d117da35e1..3ccdad327c82 100644 --- a/Source/Renderer/Texture.js +++ b/Source/Renderer/Texture.js @@ -633,10 +633,10 @@ Object.defineProperties(Texture.prototype, { }); /** - * Copy new image data into this texture, from a source {@link ImageData}, {@link Image}, {@link Canvas}, or {@link Video}. + * Copy new image data into this texture, from a source {@link ImageData}, {@link HTMLImageElement}, {@link HTMLCanvasElement}, or {@link HTMLVideoElement}. * or an object with width, height, and arrayBufferView properties. * - * @param {Object} source The source {@link ImageData}, {@link Image}, {@link Canvas}, or {@link Video}, + * @param {Object} source The source {@link ImageData}, {@link HTMLImageElement}, {@link HTMLCanvasElement}, or {@link HTMLVideoElement}, * or an object with width, height, and arrayBufferView properties. * @param {Number} [xOffset=0] The offset in the x direction within the texture to copy into. * @param {Number} [yOffset=0] The offset in the y direction within the texture to copy into. diff --git a/Source/Renderer/TextureMagnificationFilter.js b/Source/Renderer/TextureMagnificationFilter.js index 5103252b72ba..cc1b5a05a821 100644 --- a/Source/Renderer/TextureMagnificationFilter.js +++ b/Source/Renderer/TextureMagnificationFilter.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Enumerates all possible filters used when magnifying WebGL textures. * - * @exports TextureMagnificationFilter + * @enum {Number} * * @see TextureMinificationFilter */ @@ -22,20 +22,20 @@ var TextureMagnificationFilter = { * @constant */ LINEAR: WebGLConstants.LINEAR, +}; - /** - * Validates the given textureMinificationFilter with respect to the possible enum values. - * - * @private - * - * @param textureMagnificationFilter - * @returns {Boolean} true if textureMagnificationFilter is valid. - */ - validate: function (textureMagnificationFilter) { - return ( - textureMagnificationFilter === TextureMagnificationFilter.NEAREST || - textureMagnificationFilter === TextureMagnificationFilter.LINEAR - ); - }, +/** + * Validates the given textureMinificationFilter with respect to the possible enum values. + * @param textureMagnificationFilter + * @returns {Boolean} true if textureMagnificationFilter is valid. + * + * @private + */ +TextureMagnificationFilter.validate = function (textureMagnificationFilter) { + return ( + textureMagnificationFilter === TextureMagnificationFilter.NEAREST || + textureMagnificationFilter === TextureMagnificationFilter.LINEAR + ); }; + export default Object.freeze(TextureMagnificationFilter); diff --git a/Source/Renderer/TextureMinificationFilter.js b/Source/Renderer/TextureMinificationFilter.js index 2eb8929bd8f0..a7cc13fb2bde 100644 --- a/Source/Renderer/TextureMinificationFilter.js +++ b/Source/Renderer/TextureMinificationFilter.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Enumerates all possible filters used when minifying WebGL textures. * - * @exports TextureMinificationFilter + * @enum {Number} * * @see TextureMagnificationFilter */ @@ -67,28 +67,28 @@ var TextureMinificationFilter = { * @constant */ LINEAR_MIPMAP_LINEAR: WebGLConstants.LINEAR_MIPMAP_LINEAR, +}; - /** - * Validates the given textureMinificationFilter with respect to the possible enum values. - * - * @private - * - * @param textureMinificationFilter - * @returns {Boolean} true if textureMinificationFilter is valid. - */ - validate: function (textureMinificationFilter) { - return ( - textureMinificationFilter === TextureMinificationFilter.NEAREST || - textureMinificationFilter === TextureMinificationFilter.LINEAR || - textureMinificationFilter === - TextureMinificationFilter.NEAREST_MIPMAP_NEAREST || - textureMinificationFilter === - TextureMinificationFilter.LINEAR_MIPMAP_NEAREST || - textureMinificationFilter === - TextureMinificationFilter.NEAREST_MIPMAP_LINEAR || - textureMinificationFilter === - TextureMinificationFilter.LINEAR_MIPMAP_LINEAR - ); - }, +/** + * Validates the given textureMinificationFilter with respect to the possible enum values. + * + * @private + * + * @param textureMinificationFilter + * @returns {Boolean} true if textureMinificationFilter is valid. + */ +TextureMinificationFilter.validate = function (textureMinificationFilter) { + return ( + textureMinificationFilter === TextureMinificationFilter.NEAREST || + textureMinificationFilter === TextureMinificationFilter.LINEAR || + textureMinificationFilter === + TextureMinificationFilter.NEAREST_MIPMAP_NEAREST || + textureMinificationFilter === + TextureMinificationFilter.LINEAR_MIPMAP_NEAREST || + textureMinificationFilter === + TextureMinificationFilter.NEAREST_MIPMAP_LINEAR || + textureMinificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR + ); }; + export default Object.freeze(TextureMinificationFilter); diff --git a/Source/Renderer/UniformState.js b/Source/Renderer/UniformState.js index 733cf886ca97..7fc58612aec0 100644 --- a/Source/Renderer/UniformState.js +++ b/Source/Renderer/UniformState.js @@ -867,7 +867,7 @@ Object.defineProperties(UniformState.prototype, { /** * A scalar that represents the geometric tolerance per meter - * @memberof UniformStat.prototype + * @memberof UniformState.prototype * @type {Number} */ geometricToleranceOverMeter: { diff --git a/Source/Renderer/loadCubeMap.js b/Source/Renderer/loadCubeMap.js index 70a30f5807bf..449f169a9853 100644 --- a/Source/Renderer/loadCubeMap.js +++ b/Source/Renderer/loadCubeMap.js @@ -9,7 +9,7 @@ import CubeMap from "./CubeMap.js"; * Asynchronously loads six images and creates a cube map. Returns a promise that * will resolve to a {@link CubeMap} once loaded, or reject if any image fails to load. * - * @exports loadCubeMap + * @function loadCubeMap * * @param {Context} context The context to use to create the cube map. * @param {Object} urls The source URL of each image. See the example below. diff --git a/Source/Scene/Appearance.js b/Source/Scene/Appearance.js index 26e507a2308b..88547f5a0b15 100644 --- a/Source/Scene/Appearance.js +++ b/Source/Scene/Appearance.js @@ -19,7 +19,7 @@ import CullFace from "./CullFace.js"; * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - * @param {RenderState} [options.renderState] Optional render state to override the default render state. + * @param {Object} [options.renderState] Optional render state to override the default render state. * * @see MaterialAppearance * @see EllipsoidSurfaceAppearance diff --git a/Source/Scene/ArcGisMapServerImageryProvider.js b/Source/Scene/ArcGisMapServerImageryProvider.js index 73e8f4d2523f..0107a47a9941 100644 --- a/Source/Scene/ArcGisMapServerImageryProvider.js +++ b/Source/Scene/ArcGisMapServerImageryProvider.js @@ -394,7 +394,7 @@ Object.defineProperties(ArcGisMapServerImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof ArcGisMapServerImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -677,7 +677,7 @@ ArcGisMapServerImageryProvider.prototype.getTileCredits = function ( * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/AttributeType.js b/Source/Scene/AttributeType.js index 23c0772204d2..36c7cae8848f 100644 --- a/Source/Scene/AttributeType.js +++ b/Source/Scene/AttributeType.js @@ -1,7 +1,7 @@ /** * An enum describing the attribute type for glTF and 3D Tiles. * - * @exports AttributeType + * @enum {String} * * @private */ diff --git a/Source/Scene/Axis.js b/Source/Scene/Axis.js index 160e3fbe0ee2..fb38e6e98332 100644 --- a/Source/Scene/Axis.js +++ b/Source/Scene/Axis.js @@ -6,7 +6,7 @@ import Matrix4 from "../Core/Matrix4.js"; /** * An enum describing the x, y, and z axes and helper conversion functions. * - * @exports Axis + * @enum {Number} * @private */ var Axis = { diff --git a/Source/Scene/BatchTable.js b/Source/Scene/BatchTable.js index a6b130ff334a..bd1b86df97d7 100644 --- a/Source/Scene/BatchTable.js +++ b/Source/Scene/BatchTable.js @@ -426,7 +426,7 @@ BatchTable.prototype.update = function (frameState) { /** * Gets a function that will update a uniform map to contain values for looking up values in the batch table. * - * @returns {BatchTable~updateUniformMapCallback} A callback for updating uniform maps. + * @returns {BatchTable.updateUniformMapCallback} A callback for updating uniform maps. */ BatchTable.prototype.getUniformMapCallback = function () { var that = this; @@ -569,7 +569,7 @@ function getGlslAttributeFunction(batchTable, attributeIndex) { /** * Gets a function that will update a vertex shader to contain functions for looking up values in the batch table. * - * @returns {BatchTable~updateVertexShaderSourceCallback} A callback for updating a vertex shader source. + * @returns {BatchTable.updateVertexShaderSourceCallback} A callback for updating a vertex shader source. */ BatchTable.prototype.getVertexShaderCallback = function () { var attributes = this._attributes; @@ -628,7 +628,7 @@ BatchTable.prototype.destroy = function () { /** * A callback for updating uniform maps. - * @callback BatchTable~updateUniformMapCallback + * @callback BatchTable.updateUniformMapCallback * * @param {Object} uniformMap The uniform map. * @returns {Object} The new uniform map with properties for retrieving values from the batch table. @@ -636,7 +636,7 @@ BatchTable.prototype.destroy = function () { /** * A callback for updating a vertex shader source. - * @callback BatchTable~updateVertexShaderSourceCallback + * @callback BatchTable.updateVertexShaderSourceCallback * * @param {String} vertexShaderSource The vertex shader source. * @returns {String} The new vertex shader source with the functions for retrieving batch table values injected. diff --git a/Source/Scene/Billboard.js b/Source/Scene/Billboard.js index ceb2a7e65769..38ed91290f7d 100644 --- a/Source/Scene/Billboard.js +++ b/Source/Scene/Billboard.js @@ -1192,7 +1192,7 @@ Billboard.prototype._loadImage = function () { *

* * @param {String} id The id of the image. This can be any string that uniquely identifies the image. - * @param {Image|Canvas|String|Resource|Billboard~CreateImageCallback} image The image to load. This parameter + * @param {HTMLImageElement|HTMLCanvasElement|String|Resource|Billboard.CreateImageCallback} image The image to load. This parameter * can either be a loaded Image or Canvas, a URL which will be loaded as an Image automatically, * or a function which will be called to create the image if it hasn't been loaded already. * @example @@ -1528,8 +1528,8 @@ Billboard.prototype._destroy = function () { /** * A function that creates an image. - * @callback Billboard~CreateImageCallback + * @callback Billboard.CreateImageCallback * @param {String} id The identifier of the image to load. - * @returns {Image|Canvas|Promise} The image, or a promise that will resolve to an image. + * @returns {HTMLImageElement|HTMLCanvasElement|Promise} The image, or a promise that will resolve to an image. */ export default Billboard; diff --git a/Source/Scene/BingMapsImageryProvider.js b/Source/Scene/BingMapsImageryProvider.js index fff7897960b6..716828a97034 100644 --- a/Source/Scene/BingMapsImageryProvider.js +++ b/Source/Scene/BingMapsImageryProvider.js @@ -246,7 +246,7 @@ Object.defineProperties(BingMapsImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof BingMapsImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -550,7 +550,7 @@ BingMapsImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/BingMapsStyle.js b/Source/Scene/BingMapsStyle.js index de1f0b35bccf..0923588f2dd6 100644 --- a/Source/Scene/BingMapsStyle.js +++ b/Source/Scene/BingMapsStyle.js @@ -1,7 +1,7 @@ /** * The types of imagery provided by Bing Maps. * - * @exports BingMapsStyle + * @enum {Number} * * @see BingMapsImageryProvider */ diff --git a/Source/Scene/BlendEquation.js b/Source/Scene/BlendEquation.js index 1d70ebaa957a..d2f49cbe4d8f 100644 --- a/Source/Scene/BlendEquation.js +++ b/Source/Scene/BlendEquation.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Determines how two pixels' values are combined. * - * @exports BlendEquation + * @enum {Number} */ var BlendEquation = { /** diff --git a/Source/Scene/BlendFunction.js b/Source/Scene/BlendFunction.js index 0b1d91d5847f..f0232d2ebb75 100644 --- a/Source/Scene/BlendFunction.js +++ b/Source/Scene/BlendFunction.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Determines how blending factors are computed. * - * @exports BlendFunction + * @enum {Number} */ var BlendFunction = { /** diff --git a/Source/Scene/BlendOption.js b/Source/Scene/BlendOption.js index 0dc6e060a5c3..0af43ae1d41e 100644 --- a/Source/Scene/BlendOption.js +++ b/Source/Scene/BlendOption.js @@ -1,7 +1,7 @@ /** * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene. * - * @exports BlendOption + * @enum {Number} */ var BlendOption = { /** diff --git a/Source/Scene/BlendingState.js b/Source/Scene/BlendingState.js index f697e0a9c8bd..f01f1f68180f 100644 --- a/Source/Scene/BlendingState.js +++ b/Source/Scene/BlendingState.js @@ -9,7 +9,7 @@ import BlendFunction from "./BlendFunction.js"; * This is a helper when using custom render states with {@link Appearance#renderState}. *

* - * @exports BlendingState + * @namespace */ var BlendingState = { /** diff --git a/Source/Scene/Camera.js b/Source/Scene/Camera.js index cbfedd8b73c8..167e2631b10e 100644 --- a/Source/Scene/Camera.js +++ b/Source/Scene/Camera.js @@ -137,7 +137,7 @@ function Camera(scene) { /** * The region of space in view. * - * @type {Frustum} + * @type {PerspectiveFrustum|PerspectiveOffCenterFrustum|OrthographicFrustum} * @default PerspectiveFrustum() * * @see PerspectiveFrustum @@ -3191,15 +3191,15 @@ Camera.prototype.cancelFlight = function () { * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode. * @param {Number} [options.duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. - * @param {Camera~FlightCompleteCallback} [options.complete] The function to execute when the flight is complete. - * @param {Camera~FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled. + * @param {Camera.FlightCompleteCallback} [options.complete] The function to execute when the flight is complete. + * @param {Camera.FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled. * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame the camera will be in when the flight is completed. * @param {Number} [options.maximumHeight] The maximum height at the peak of the flight. * @param {Number} [options.pitchAdjustHeight] If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport. * @param {Number} [options.flyOverLongitude] There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude. * @param {Number} [options.flyOverLongitudeWeight] Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight. * @param {Boolean} [options.convert] Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to true. - * @param {EasingFunction|EasingFunction~Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight. + * @param {EasingFunction.Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight. * * @exception {DeveloperError} If either direction or up is given, then both are required. * @@ -3459,14 +3459,14 @@ var scratchFlyToBoundingSphereMatrix3 = new Matrix3(); * @param {Object} [options] Object with the following properties: * @param {Number} [options.duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. * @param {HeadingPitchRange} [options.offset] The offset from the target in the local east-north-up reference frame centered at the target. - * @param {Camera~FlightCompleteCallback} [options.complete] The function to execute when the flight is complete. - * @param {Camera~FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled. + * @param {Camera.FlightCompleteCallback} [options.complete] The function to execute when the flight is complete. + * @param {Camera.FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled. * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame the camera will be in when the flight is completed. * @param {Number} [options.maximumHeight] The maximum height at the peak of the flight. * @param {Number} [options.pitchAdjustHeight] If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport. * @param {Number} [options.flyOverLongitude] There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude. * @param {Number} [options.flyOverLongitudeWeight] Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight. - * @param {EasingFunction|EasingFunction~Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight. + * @param {EasingFunction.Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight. */ Camera.prototype.flyToBoundingSphere = function (boundingSphere, options) { //>>includeStart('debug', pragmas.debug); @@ -3852,11 +3852,11 @@ Camera.clone = function (camera, result) { /** * A function that will execute when a flight completes. - * @callback Camera~FlightCompleteCallback + * @callback Camera.FlightCompleteCallback */ /** * A function that will execute when a flight is cancelled. - * @callback Camera~FlightCancelledCallback + * @callback Camera.FlightCancelledCallback */ export default Camera; diff --git a/Source/Scene/CameraEventAggregator.js b/Source/Scene/CameraEventAggregator.js index cdaaa41bc083..364ffaa4f41f 100644 --- a/Source/Scene/CameraEventAggregator.js +++ b/Source/Scene/CameraEventAggregator.js @@ -296,7 +296,7 @@ function listenMouseMove(aggregator, modifier) { * @alias CameraEventAggregator * @constructor * - * @param {Canvas} [canvas=document] The element to handle events for. + * @param {HTMLCanvasElement} [canvas=document] The element to handle events for. * * @see ScreenSpaceEventHandler */ diff --git a/Source/Scene/CameraEventType.js b/Source/Scene/CameraEventType.js index 29e652544818..ec6ab41afed7 100644 --- a/Source/Scene/CameraEventType.js +++ b/Source/Scene/CameraEventType.js @@ -1,7 +1,7 @@ /** * Enumerates the available input for interacting with the camera. * - * @exports CameraEventType + * @enum {Number} */ var CameraEventType = { /** diff --git a/Source/Scene/Cesium3DTileColorBlendMode.js b/Source/Scene/Cesium3DTileColorBlendMode.js index 02e4bde25e00..3f096aafebb4 100644 --- a/Source/Scene/Cesium3DTileColorBlendMode.js +++ b/Source/Scene/Cesium3DTileColorBlendMode.js @@ -22,7 +22,7 @@ * } * * - * @exports Cesium3DTileColorBlendMode + * @enum {Number} */ var Cesium3DTileColorBlendMode = { /** diff --git a/Source/Scene/Cesium3DTileOptimizationHint.js b/Source/Scene/Cesium3DTileOptimizationHint.js index 9469838d0f91..0ee1d97145e8 100644 --- a/Source/Scene/Cesium3DTileOptimizationHint.js +++ b/Source/Scene/Cesium3DTileOptimizationHint.js @@ -1,7 +1,7 @@ /** * Hint defining optimization support for a 3D tile * - * @exports Cesium3DTileOptimizationHint + * @enum {Number} * * @private */ diff --git a/Source/Scene/Cesium3DTileOptimizations.js b/Source/Scene/Cesium3DTileOptimizations.js index 9117b6e931cb..98a288f6ffa6 100644 --- a/Source/Scene/Cesium3DTileOptimizations.js +++ b/Source/Scene/Cesium3DTileOptimizations.js @@ -7,7 +7,7 @@ import TileOrientedBoundingBox from "./TileOrientedBoundingBox.js"; /** * Utility functions for computing optimization hints for a {@link Cesium3DTileset}. * - * @exports Cesium3DTileOptimizations + * @namespace Cesium3DTileOptimizations * * @private */ diff --git a/Source/Scene/Cesium3DTileRefine.js b/Source/Scene/Cesium3DTileRefine.js index c142ff7187d5..ade192c1ee03 100644 --- a/Source/Scene/Cesium3DTileRefine.js +++ b/Source/Scene/Cesium3DTileRefine.js @@ -5,7 +5,7 @@ * in the 3D Tiles spec. *

* - * @exports Cesium3DTileRefine + * @enum {Number} * * @private */ diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index 89370d7d43a4..305679733d89 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -72,7 +72,7 @@ import TileOrientedBoundingBox from "./TileOrientedBoundingBox.js"; * @param {Boolean} [options.foveatedScreenSpaceError=true] Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the screen space error for tiles around the edge of the screen. Screen space error returns to normal once all the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded. * @param {Number} [options.foveatedConeSize=0.1] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred. Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and their screen space error. This is controlled by {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}. Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, disabling the effect. * @param {Number} [options.foveatedMinimumScreenSpaceErrorRelaxation=0.0] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone. The screen space error will be raised starting with tileset value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}. - * @param {Cesium3DTileset~foveatedInterpolationCallback} [options.foveatedInterpolationCallback=Math.lerp] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError} + * @param {Cesium3DTileset.foveatedInterpolationCallback} [options.foveatedInterpolationCallback=Math.lerp] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError} * @param {Number} [options.foveatedTimeDelay=0.2] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how long in seconds to wait after the camera stops moving before deferred tiles start loading in. This time delay prevents requesting tiles around the edges of the screen when the camera is moving. Setting this to 0.0 will immediately request all tiles in any given view. * @param {Boolean} [options.skipLevelOfDetail=false] Optimization option. Determines if level of detail skipping should be applied during the traversal. * @param {Number} [options.baseScreenSpaceError=1024] When skipLevelOfDetail is true, the screen space error that must be reached before skipping levels of detail. @@ -325,9 +325,10 @@ function Cesium3DTileset(options) { ); /** - * Gets a function that will update the foveated screen space error for a tile. + * Gets or sets a callback to control how much to raise the screen space error for tiles outside the foveated cone, + * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}. * - * @type {Cesium3DTileset~foveatedInterpolationCallback} A callback to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}. + * @type {Cesium3DTileset.foveatedInterpolationCallback} */ this.foveatedInterpolationCallback = defaultValue( options.foveatedInterpolationCallback, @@ -2219,7 +2220,7 @@ function updateTiles(tileset, frameState, passOptions) { tileset._backfaceCommands.trim(); if (bivariateVisibilityTest) { - /** + /* * Consider 'effective leaf' tiles as selected tiles that have no selected descendants. They may have children, * but they are currently our effective leaves because they do not have selected descendants. These tiles * are those where with tile._finalResolution === true. @@ -2618,7 +2619,7 @@ Cesium3DTileset.prototype.destroy = function () { * Optimization option. Used as a callback when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}. * - * @callback Cesium3DTileset~foveatedInterpolationCallback + * @callback Cesium3DTileset.foveatedInterpolationCallback * @default Math.lerp * * @param {Number} p The start value to interpolate. diff --git a/Source/Scene/ClassificationType.js b/Source/Scene/ClassificationType.js index 1989b2cd63c0..259ca16ec0b0 100644 --- a/Source/Scene/ClassificationType.js +++ b/Source/Scene/ClassificationType.js @@ -1,7 +1,7 @@ /** * Whether a classification affects terrain, 3D Tiles or both. * - * @exports ClassificationType + * @enum {Number} */ var ClassificationType = { /** @@ -25,9 +25,11 @@ var ClassificationType = { * @constant */ BOTH: 2, - /** - * @private - */ - NUMBER_OF_CLASSIFICATION_TYPES: 3, }; + +/** + * @private + */ +ClassificationType.NUMBER_OF_CLASSIFICATION_TYPES = 3; + export default Object.freeze(ClassificationType); diff --git a/Source/Scene/ColorBlendMode.js b/Source/Scene/ColorBlendMode.js index 95dbfed023ff..696c101a2c83 100644 --- a/Source/Scene/ColorBlendMode.js +++ b/Source/Scene/ColorBlendMode.js @@ -7,7 +7,7 @@ import CesiumMath from "../Core/Math.js"; * REPLACE replaces the source color with the target color * MIX blends the source color and target color together * - * @exports ColorBlendMode + * @enum {Number} * * @see Model.colorBlendMode */ diff --git a/Source/Scene/CullFace.js b/Source/Scene/CullFace.js index 7be2cb95c7d6..ecd2676270f1 100644 --- a/Source/Scene/CullFace.js +++ b/Source/Scene/CullFace.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Determines which triangles, if any, are culled. * - * @exports CullFace + * @enum {Number} */ var CullFace = { /** diff --git a/Source/Scene/DebugAppearance.js b/Source/Scene/DebugAppearance.js index c321a41d0302..fc2c720d9a78 100644 --- a/Source/Scene/DebugAppearance.js +++ b/Source/Scene/DebugAppearance.js @@ -20,7 +20,7 @@ import Appearance from "./Appearance.js"; * @param {String} [options.glslDatatype='vec3'] The GLSL datatype of the attribute. Supported datatypes are float, vec2, vec3, and vec4. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - * @param {RenderState} [options.renderState] Optional render state to override the default render state. + * @param {Object} [options.renderState] Optional render state to override the default render state. * * @exception {DeveloperError} options.glslDatatype must be float, vec2, vec3, or vec4. * diff --git a/Source/Scene/DepthFunction.js b/Source/Scene/DepthFunction.js index 75ca750a45cc..e84970b58ea7 100644 --- a/Source/Scene/DepthFunction.js +++ b/Source/Scene/DepthFunction.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Determines the function used to compare two depths for the depth test. * - * @exports DepthFunction + * @enum {Number} */ var DepthFunction = { /** diff --git a/Source/Scene/DiscardEmptyTileImagePolicy.js b/Source/Scene/DiscardEmptyTileImagePolicy.js index 40d4322ba9aa..90fb289b678f 100644 --- a/Source/Scene/DiscardEmptyTileImagePolicy.js +++ b/Source/Scene/DiscardEmptyTileImagePolicy.js @@ -23,7 +23,7 @@ DiscardEmptyTileImagePolicy.prototype.isReady = function () { /** * Given a tile image, decide whether to discard that image. * - * @param {Image} image An image to test. + * @param {HTMLImageElement} image An image to test. * @returns {Boolean} True if the image should be discarded; otherwise, false. */ DiscardEmptyTileImagePolicy.prototype.shouldDiscardImage = function (image) { @@ -35,7 +35,7 @@ var emptyImage; Object.defineProperties(DiscardEmptyTileImagePolicy, { /** * Default value for representing an empty image. - * @type {Image} + * @type {HTMLImageElement} * @readonly * @memberof DiscardEmptyTileImagePolicy */ diff --git a/Source/Scene/DiscardMissingTileImagePolicy.js b/Source/Scene/DiscardMissingTileImagePolicy.js index ce7ce5dd17ac..66b5110124dc 100644 --- a/Source/Scene/DiscardMissingTileImagePolicy.js +++ b/Source/Scene/DiscardMissingTileImagePolicy.js @@ -104,7 +104,7 @@ DiscardMissingTileImagePolicy.prototype.isReady = function () { /** * Given a tile image, decide whether to discard that image. * - * @param {Image} image An image to test. + * @param {HTMLImageElement} image An image to test. * @returns {Boolean} True if the image should be discarded; otherwise, false. * * @exception {DeveloperError} shouldDiscardImage must not be called before the discard policy is ready. diff --git a/Source/Scene/EllipsoidSurfaceAppearance.js b/Source/Scene/EllipsoidSurfaceAppearance.js index 84f6836af07b..1457e7115551 100644 --- a/Source/Scene/EllipsoidSurfaceAppearance.js +++ b/Source/Scene/EllipsoidSurfaceAppearance.js @@ -24,7 +24,7 @@ import Material from "./Material.js"; * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - * @param {RenderState} [options.renderState] Optional render state to override the default render state. + * @param {Object} [options.renderState] Optional render state to override the default render state. * * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric} * diff --git a/Source/Scene/FrameState.js b/Source/Scene/FrameState.js index 44fcb7f51166..8c5e706a8bc5 100644 --- a/Source/Scene/FrameState.js +++ b/Source/Scene/FrameState.js @@ -177,40 +177,37 @@ function FrameState(context, creditDisplay, jobScheduler) { */ this.pixelRatio = 1.0; + /** + * @typedef FrameState.Passes + * @type {Object} + * @property {Boolean} render true if the primitive should update for a render pass, false otherwise. + * @property {Boolean} pick true if the primitive should update for a picking pass, false otherwise. + * @property {Boolean} depth true if the primitive should update for a depth only pass, false otherwise. + * @property {Boolean} postProcess true if the primitive should update for a per-feature post-process pass, false otherwise. + * @property {Boolean} offscreen true if the primitive should update for an offscreen pass, false otherwise. + */ + + /** + * @type {FrameState.Passes} + */ this.passes = { /** - * true if the primitive should update for a render pass, false otherwise. - * - * @type {Boolean} * @default false */ render: false, - /** - * true if the primitive should update for a picking pass, false otherwise. - * - * @type {Boolean} * @default false */ pick: false, - /** - * true if the primitive should update for a depth only pass, false otherwise. - * @type {Boolean} * @default false */ depth: false, - /** - * true if the primitive should update for a per-feature post-process pass, false otherwise. - * @type {Boolean} * @default false */ postProcess: false, - /** - * true if the primitive should update for an offscreen pass, false otherwise. - * @type {Boolean} * @default false */ offscreen: false, @@ -233,7 +230,7 @@ function FrameState(context, creditDisplay, jobScheduler) { * directly in update functions. *

* - * @type {FrameState~AfterRenderCallback[]} + * @type {FrameState.AfterRenderCallback[]} * * @example * frameState.afterRender.push(function() { @@ -250,33 +247,26 @@ function FrameState(context, creditDisplay, jobScheduler) { */ this.scene3DOnly = false; + /** + * @typedef FrameState.Fog + * @type {Object} + * @property {Boolean} enabled true if fog is enabled, false otherwise. + * @property {Number} density A positive number used to mix the color and fog color based on camera distance. + * @property {Number} sse A scalar used to modify the screen space error of geometry partially in fog. + * @property {Number} minimumBrightness The minimum brightness of terrain with fog applied. + */ + + /** + * @type {FrameState.Fog} + */ + this.fog = { /** - * true if fog is enabled, false otherwise. - * @type {Boolean} * @default false */ enabled: false, - /** - * A positive number used to mix the color and fog color based on camera distance. - * - * @type {Number} - * @default undefined - */ density: undefined, - /** - * A scalar used to modify the screen space error of geometry partially in fog. - * - * @type {Number} - * @default undefined - */ sse: undefined, - /** - * The minimum brightness of terrain with fog applied. - * - * @type {Number} - * @default undefined - */ minimumBrightness: undefined, }; @@ -287,57 +277,49 @@ function FrameState(context, creditDisplay, jobScheduler) { */ this.terrainExaggeration = 1.0; - this.shadowState = { - /** - * Whether there are any active shadow maps this frame. - * @type {Boolean} - */ - shadowsEnabled: true, + /** + * @typedef FrameState.ShadowState + * @type {Object} + * @property {Boolean} shadowsEnabled Whether there are any active shadow maps this frame. + * @property {Boolean} lightShadowsEnabled Whether there are any active shadow maps that originate from light sources. Does not include shadow maps that are used for analytical purposes. + * @property {ShadowMap[]} shadowMaps All shadow maps that are enabled this frame. + * @property {ShadowMap[]} lightShadowMaps Shadow maps that originate from light sources. Does not include shadow maps that are used for analytical purposes. Only these shadow maps will be used to generate receive shadows shaders. + * @property {Number} nearPlane The near plane of the scene's frustum commands. Used for fitting cascaded shadow maps. + * @property {Number} farPlane The far plane of the scene's frustum commands. Used for fitting cascaded shadow maps. + * @property {Number} closestObjectSize The size of the bounding volume that is closest to the camera. This is used to place more shadow detail near the object. + * @property {Number} lastDirtyTime The time when a shadow map was last dirty + * @property {Boolean} outOfView Whether the shadows maps are out of view this frame + */ - /** - * Whether there are any active shadow maps that originate from light sources. Does not - * include shadow maps that are used for analytical purposes. - */ - lightShadowsEnabled: true, + /** + * @type {FrameState.ShadowState} + */ + this.shadowState = { /** - * All shadow maps that are enabled this frame. + * @default true */ + shadowsEnabled: true, shadowMaps: [], - - /** - * Shadow maps that originate from light sources. Does not include shadow maps that are used for - * analytical purposes. Only these shadow maps will be used to generate receive shadows shaders. - */ lightShadowMaps: [], - /** - * The near plane of the scene's frustum commands. Used for fitting cascaded shadow maps. - * @type {Number} + * @default 1.0 */ nearPlane: 1.0, - /** - * The far plane of the scene's frustum commands. Used for fitting cascaded shadow maps. - * @type {Number} + * @default 5000.0 */ farPlane: 5000.0, - /** - * The size of the bounding volume that is closest to the camera. This is used to place more shadow detail near the object. - * @type {Number} + * @default 1000.0 */ closestObjectSize: 1000.0, - /** - * The time when a shadow map was last dirty - * @type {Number} + * @default 0 */ lastDirtyTime: 0, - /** - * Whether the shadows maps are out of view this frame - * @type {Boolean} + * @default true */ outOfView: true, }; @@ -420,6 +402,6 @@ function FrameState(context, creditDisplay, jobScheduler) { /** * A function that will be called at the end of the frame. * - * @callback FrameState~AfterRenderCallback + * @callback FrameState.AfterRenderCallback */ export default FrameState; diff --git a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js index 6104a29af1b9..cabaaab557cc 100644 --- a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +++ b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js @@ -16,6 +16,9 @@ import TileProviderError from "../Core/TileProviderError.js"; import protobuf from "../ThirdParty/protobuf-minimal.js"; import when from "../ThirdParty/when.js"; +/** + * @private + */ function GoogleEarthEnterpriseDiscardPolicy() { this._image = new Image(); } @@ -31,7 +34,7 @@ GoogleEarthEnterpriseDiscardPolicy.prototype.isReady = function () { /** * Given a tile image, decide whether to discard that image. * - * @param {Image} image An image to test. + * @param {HTMLImageElement} image An image to test. * @returns {Boolean} True if the image should be discarded; otherwise, false. */ GoogleEarthEnterpriseDiscardPolicy.prototype.shouldDiscardImage = function ( @@ -182,7 +185,7 @@ Object.defineProperties(GoogleEarthEnterpriseImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof GoogleEarthEnterpriseImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -451,7 +454,7 @@ GoogleEarthEnterpriseImageryProvider.prototype.getTileCredits = function ( * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js index caed15af4bea..9e3bafde92a3 100644 --- a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +++ b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js @@ -293,7 +293,7 @@ Object.defineProperties(GoogleEarthEnterpriseMapsProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof GoogleEarthEnterpriseMapsProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -598,7 +598,7 @@ GoogleEarthEnterpriseMapsProvider.prototype.getTileCredits = function ( * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/GridImageryProvider.js b/Source/Scene/GridImageryProvider.js index 7a89ae5379c1..c8c84ae6f3af 100644 --- a/Source/Scene/GridImageryProvider.js +++ b/Source/Scene/GridImageryProvider.js @@ -63,7 +63,7 @@ Object.defineProperties(GridImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof GridImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -315,7 +315,7 @@ GridImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/GroundPolylinePrimitive.js b/Source/Scene/GroundPolylinePrimitive.js index 974db0d6bbf9..9364a560423d 100644 --- a/Source/Scene/GroundPolylinePrimitive.js +++ b/Source/Scene/GroundPolylinePrimitive.js @@ -334,7 +334,7 @@ Object.defineProperties(GroundPolylinePrimitive.prototype, { * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the * GroundPolylinePrimitive synchronously. * - * @returns {Promise} A promise that will resolve once the terrain heights have been loaded. + * @returns {Promise} A promise that will resolve once the terrain heights have been loaded. */ GroundPolylinePrimitive.initializeTerrainHeights = function () { return ApproximateTerrainHeights.initialize(); diff --git a/Source/Scene/GroundPrimitive.js b/Source/Scene/GroundPrimitive.js index 5b7a1dfaf777..e07d256f54ab 100644 --- a/Source/Scene/GroundPrimitive.js +++ b/Source/Scene/GroundPrimitive.js @@ -685,7 +685,7 @@ function updateAndQueueCommands( * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the * GroundPrimitive synchronously. * - * @returns {Promise} A promise that will resolve once the terrain heights have been loaded. + * @returns {Promise} A promise that will resolve once the terrain heights have been loaded. * */ GroundPrimitive.initializeTerrainHeights = function () { diff --git a/Source/Scene/HeightReference.js b/Source/Scene/HeightReference.js index 11788d5210b8..5fcd6f3ba874 100644 --- a/Source/Scene/HeightReference.js +++ b/Source/Scene/HeightReference.js @@ -1,7 +1,7 @@ /** * Represents the position relative to the terrain. * - * @exports HeightReference + * @enum {Number} */ var HeightReference = { /** diff --git a/Source/Scene/HorizontalOrigin.js b/Source/Scene/HorizontalOrigin.js index f98f12188e8d..ab46bf910222 100644 --- a/Source/Scene/HorizontalOrigin.js +++ b/Source/Scene/HorizontalOrigin.js @@ -8,7 +8,7 @@ *
* * - * @exports HorizontalOrigin + * @enum {Number} * * @see Billboard#horizontalOrigin * @see Label#horizontalOrigin diff --git a/Source/Scene/ImageryProvider.js b/Source/Scene/ImageryProvider.js index 884a28d71ce2..0abe0a776a8f 100644 --- a/Source/Scene/ImageryProvider.js +++ b/Source/Scene/ImageryProvider.js @@ -233,7 +233,7 @@ Object.defineProperties(ImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof ImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -278,7 +278,7 @@ ImageryProvider.prototype.getTileCredits = * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. @@ -318,7 +318,7 @@ var crnRegex = /\.crn$/i; * * @param {ImageryProvider} imageryProvider The imagery provider for the URL. * @param {Resource|String} url The URL of the image. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/ImagerySplitDirection.js b/Source/Scene/ImagerySplitDirection.js index 84b6e4be79ce..0778b4021d01 100644 --- a/Source/Scene/ImagerySplitDirection.js +++ b/Source/Scene/ImagerySplitDirection.js @@ -1,7 +1,7 @@ /** * The direction to display an ImageryLayer relative to the {@link Scene#imagerySplitPosition}. * - * @exports ImagerySplitDirection + * @enum {Number} * * @see ImageryLayer#splitDirection */ diff --git a/Source/Scene/IonImageryProvider.js b/Source/Scene/IonImageryProvider.js index 806449949d30..0a636594c1a1 100644 --- a/Source/Scene/IonImageryProvider.js +++ b/Source/Scene/IonImageryProvider.js @@ -460,7 +460,7 @@ IonImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/IonWorldImageryStyle.js b/Source/Scene/IonWorldImageryStyle.js index cf7b325c15de..824de2cb4fdd 100644 --- a/Source/Scene/IonWorldImageryStyle.js +++ b/Source/Scene/IonWorldImageryStyle.js @@ -3,7 +3,7 @@ /** * The types of imagery provided by {@link createWorldImagery}. * - * @exports IonWorldImageryStyle + * @enum {Number} */ var IonWorldImageryStyle = { /** diff --git a/Source/Scene/LabelStyle.js b/Source/Scene/LabelStyle.js index 4412141dc9d7..10517de8aff3 100644 --- a/Source/Scene/LabelStyle.js +++ b/Source/Scene/LabelStyle.js @@ -1,7 +1,7 @@ /** * Describes how to draw a label. * - * @exports LabelStyle + * @enum {Number} * * @see Label#style */ diff --git a/Source/Scene/MapMode2D.js b/Source/Scene/MapMode2D.js index 3663f43a68db..7e1d8b538dce 100644 --- a/Source/Scene/MapMode2D.js +++ b/Source/Scene/MapMode2D.js @@ -1,7 +1,7 @@ /** * Describes how the map will operate in 2D. * - * @exports MapMode2D + * @enum {Number} */ var MapMode2D = { /** diff --git a/Source/Scene/MapboxImageryProvider.js b/Source/Scene/MapboxImageryProvider.js index e27c0e8eb83d..5013bc89e081 100644 --- a/Source/Scene/MapboxImageryProvider.js +++ b/Source/Scene/MapboxImageryProvider.js @@ -264,7 +264,7 @@ Object.defineProperties(MapboxImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof MapboxImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -314,7 +314,7 @@ MapboxImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/MapboxStyleImageryProvider.js b/Source/Scene/MapboxStyleImageryProvider.js index a52b5972b4e3..83228c035351 100644 --- a/Source/Scene/MapboxStyleImageryProvider.js +++ b/Source/Scene/MapboxStyleImageryProvider.js @@ -276,7 +276,7 @@ Object.defineProperties(MapboxStyleImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof MapboxStyleImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -326,7 +326,7 @@ MapboxStyleImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/MaterialAppearance.js b/Source/Scene/MaterialAppearance.js index e5a69b513abc..e0770a047378 100644 --- a/Source/Scene/MaterialAppearance.js +++ b/Source/Scene/MaterialAppearance.js @@ -22,11 +22,11 @@ import Material from "./Material.js"; * @param {Boolean} [options.faceForward=!options.closed] When true, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}. * @param {Boolean} [options.translucent=true] When true, the geometry is expected to appear translucent so {@link MaterialAppearance#renderState} has alpha blending enabled. * @param {Boolean} [options.closed=false] When true, the geometry is expected to be closed so {@link MaterialAppearance#renderState} has backface culling enabled. - * @param {MaterialAppearance.MaterialSupport} [options.materialSupport=MaterialAppearance.MaterialSupport.TEXTURED] The type of materials that will be supported. + * @param {MaterialAppearance.MaterialSupportType} [options.materialSupport=MaterialAppearance.MaterialSupport.TEXTURED] The type of materials that will be supported. * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - * @param {RenderState} [options.renderState] Optional render state to override the default render state. + * @param {Object} [options.renderState] Optional render state to override the default render state. * * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric} * @demo {@link https://sandcastle.cesium.com/index.html?src=Materials.html|Cesium Sandcastle Material Appearance Demo} @@ -177,7 +177,7 @@ Object.defineProperties(MaterialAppearance.prototype, { * * @memberof MaterialAppearance.prototype * - * @type {MaterialAppearance.MaterialSupport} + * @type {MaterialAppearance.MaterialSupportType} * @readonly * * @default {@link MaterialAppearance.MaterialSupport.TEXTURED} @@ -276,18 +276,27 @@ MaterialAppearance.prototype.isTranslucent = Appearance.prototype.isTranslucent; MaterialAppearance.prototype.getRenderState = Appearance.prototype.getRenderState; +/** + * @typedef MaterialAppearance.MaterialSupportType + * @type {Object} + * @property {VertexFormat} vertexFormat + * @property {String} vertexShaderSource + * @property {String} fragmentShaderSource + */ + /** * Determines the type of {@link Material} that is supported by a * {@link MaterialAppearance} instance. This is a trade-off between * flexibility (a wide array of materials) and memory/performance * (required vertex format and GLSL shader complexity. - * @exports MaterialAppearance.MaterialSupport + * @namespace */ MaterialAppearance.MaterialSupport = { /** * Only basic materials, which require just position and * normal vertex attributes, are supported. * + * @type {MaterialAppearance.MaterialSupportType} * @constant */ BASIC: Object.freeze({ @@ -300,6 +309,7 @@ MaterialAppearance.MaterialSupport = { * normal, and st vertex attributes, * are supported. The vast majority of materials fall into this category. * + * @type {MaterialAppearance.MaterialSupportType} * @constant */ TEXTURED: Object.freeze({ @@ -312,6 +322,7 @@ MaterialAppearance.MaterialSupport = { * This requires position, normal, st, * tangent, and bitangent vertex attributes. * + * @type {MaterialAppearance.MaterialSupportType} * @constant */ ALL: Object.freeze({ diff --git a/Source/Scene/ModelAnimationLoop.js b/Source/Scene/ModelAnimationLoop.js index cda8146ea601..3cb0a59948e9 100644 --- a/Source/Scene/ModelAnimationLoop.js +++ b/Source/Scene/ModelAnimationLoop.js @@ -1,7 +1,7 @@ /** * Determines if and how a glTF animation is looped. * - * @exports ModelAnimationLoop + * @enum {Number} * * @see ModelAnimationCollection#add */ diff --git a/Source/Scene/NeverTileDiscardPolicy.js b/Source/Scene/NeverTileDiscardPolicy.js index 3bccb7882442..77b6035d8435 100644 --- a/Source/Scene/NeverTileDiscardPolicy.js +++ b/Source/Scene/NeverTileDiscardPolicy.js @@ -19,7 +19,7 @@ NeverTileDiscardPolicy.prototype.isReady = function () { /** * Given a tile image, decide whether to discard that image. * - * @param {Image} image An image to test. + * @param {HTMLImageElement} image An image to test. * @returns {Boolean} True if the image should be discarded; otherwise, false. */ NeverTileDiscardPolicy.prototype.shouldDiscardImage = function (image) { diff --git a/Source/Scene/OctahedralProjectedCubeMap.js b/Source/Scene/OctahedralProjectedCubeMap.js index 1a3f753e7b32..1de61027cc73 100644 --- a/Source/Scene/OctahedralProjectedCubeMap.js +++ b/Source/Scene/OctahedralProjectedCubeMap.js @@ -93,7 +93,7 @@ Object.defineProperties(OctahedralProjectedCubeMap.prototype, { /** * Gets a promise that resolves when the texture atlas is ready to use. * @memberof OctahedralProjectedCubeMap.prototype - * @type {Promise} + * @type {Promise} * @readonly */ readyPromise: { diff --git a/Source/Scene/ParticleSystem.js b/Source/Scene/ParticleSystem.js index d18aff1c3a19..5169caa227f6 100644 --- a/Source/Scene/ParticleSystem.js +++ b/Source/Scene/ParticleSystem.js @@ -23,7 +23,7 @@ var defaultImageSize = new Cartesian2(1.0, 1.0); * * @param {Object} [options] Object with the following properties: * @param {Boolean} [options.show=true] Whether to display the particle system. - * @param {ParticleSystem~updateCallback} [options.updateCallback] The callback function to be called each frame to update a particle. + * @param {ParticleSystem.updateCallback} [options.updateCallback] The callback function to be called each frame to update a particle. * @param {ParticleEmitter} [options.emitter=new CircleEmitter(0.5)] The particle emitter for this system. * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the particle system from model to world coordinates. * @param {Matrix4} [options.emitterModelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system. @@ -67,7 +67,7 @@ function ParticleSystem(options) { /** * An array of force callbacks. The callback is passed a {@link Particle} and the difference from the last time - * @type {ParticleSystem~updateCallback} + * @type {ParticleSystem.updateCallback} * @default undefined */ this.updateCallback = options.updateCallback; @@ -894,7 +894,7 @@ ParticleSystem.prototype.destroy = function () { * A function used to modify attributes of the particle at each time step. This can include force modifications, * color, sizing, etc. * - * @callback ParticleSystem~updateCallback + * @callback ParticleSystem.updateCallback * * @param {Particle} particle The particle being updated. * @param {Number} dt The time in seconds since the last update. diff --git a/Source/Scene/PerInstanceColorAppearance.js b/Source/Scene/PerInstanceColorAppearance.js index bcc1d7eb9f45..79fc05bceea8 100644 --- a/Source/Scene/PerInstanceColorAppearance.js +++ b/Source/Scene/PerInstanceColorAppearance.js @@ -21,7 +21,7 @@ import Appearance from "./Appearance.js"; * @param {Boolean} [options.closed=false] When true, the geometry is expected to be closed so {@link PerInstanceColorAppearance#renderState} has backface culling enabled. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - * @param {RenderState} [options.renderState] Optional render state to override the default render state. + * @param {Object} [options.renderState] Optional render state to override the default render state. * * @example * // A solid white line segment diff --git a/Source/Scene/PointCloud3DTileContent.js b/Source/Scene/PointCloud3DTileContent.js index 56b88ac1ffeb..50ec733be009 100644 --- a/Source/Scene/PointCloud3DTileContent.js +++ b/Source/Scene/PointCloud3DTileContent.js @@ -40,10 +40,6 @@ function PointCloud3DTileContent( this._batchTable = undefined; // Used when feature table contains BATCH_ID semantic this._styleDirty = false; this._features = undefined; - - /** - * @inheritdoc Cesium3DTileContent#featurePropertiesDirty - */ this.featurePropertiesDirty = false; this._pointCloud = new PointCloud({ diff --git a/Source/Scene/Polyline.js b/Source/Scene/Polyline.js index e37a0323b6be..bbc4a6d1d82a 100644 --- a/Source/Scene/Polyline.js +++ b/Source/Scene/Polyline.js @@ -17,7 +17,7 @@ import Material from "./Material.js"; * @internalConstructor * @class * - * @param {Object} [options] Object with the following properties: + * @param {Object} options Object with the following properties: * @param {Boolean} [options.show=true] true if this polyline will be shown; otherwise, false. * @param {Number} [options.width=1.0] The width of the polyline in pixels. * @param {Boolean} [options.loop=false] Whether a line segment will be added between the last and first line positions to make this line a loop. diff --git a/Source/Scene/PolylineColorAppearance.js b/Source/Scene/PolylineColorAppearance.js index aaf4c4b8ed41..f5055d3b469c 100644 --- a/Source/Scene/PolylineColorAppearance.js +++ b/Source/Scene/PolylineColorAppearance.js @@ -28,7 +28,7 @@ if (!FeatureDetection.isInternetExplorer()) { * @param {Boolean} [options.translucent=true] When true, the geometry is expected to appear translucent so {@link PolylineColorAppearance#renderState} has alpha blending enabled. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - * @param {RenderState} [options.renderState] Optional render state to override the default render state. + * @param {Object} [options.renderState] Optional render state to override the default render state. * * @example * // A solid white line segment diff --git a/Source/Scene/PolylineMaterialAppearance.js b/Source/Scene/PolylineMaterialAppearance.js index ca2afd643a56..da555d65deb7 100644 --- a/Source/Scene/PolylineMaterialAppearance.js +++ b/Source/Scene/PolylineMaterialAppearance.js @@ -28,7 +28,7 @@ if (!FeatureDetection.isInternetExplorer()) { * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - * @param {RenderState} [options.renderState] Optional render state to override the default render state. + * @param {Object} [options.renderState] Optional render state to override the default render state. * * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric} * diff --git a/Source/Scene/PostProcessStageLibrary.js b/Source/Scene/PostProcessStageLibrary.js index 3b779589bfd7..a455f76f25d6 100644 --- a/Source/Scene/PostProcessStageLibrary.js +++ b/Source/Scene/PostProcessStageLibrary.js @@ -30,7 +30,7 @@ import PostProcessStageSampleMode from "./PostProcessStageSampleMode.js"; /** * Contains functions for creating common post-process stages. * - * @exports PostProcessStageLibrary + * @namespace PostProcessStageLibrary */ var PostProcessStageLibrary = {}; diff --git a/Source/Scene/PostProcessStageSampleMode.js b/Source/Scene/PostProcessStageSampleMode.js index 2518c57e2aab..32caaf7bb475 100644 --- a/Source/Scene/PostProcessStageSampleMode.js +++ b/Source/Scene/PostProcessStageSampleMode.js @@ -1,7 +1,7 @@ /** * Determines how input texture to a {@link PostProcessStage} is sampled. * - * @exports PostProcessStageSampleMode + * @enum {Number} */ var PostProcessStageSampleMode = { /** diff --git a/Source/Scene/QuadtreeTileLoadState.js b/Source/Scene/QuadtreeTileLoadState.js index dfce7d7b0328..e09deeeabd8a 100644 --- a/Source/Scene/QuadtreeTileLoadState.js +++ b/Source/Scene/QuadtreeTileLoadState.js @@ -1,6 +1,6 @@ /** * The state of a {@link QuadtreeTile} in the tile load pipeline. - * @exports QuadtreeTileLoadState + * @enum {Number} * @private */ var QuadtreeTileLoadState = { diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index 61ece96a6826..e6f39dba5ac0 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -126,7 +126,7 @@ var requestRenderAfterFrame = function (scene) { * @constructor * * @param {Object} [options] Object with the following properties: - * @param {Canvas} options.canvas The HTML canvas element to create the scene for. + * @param {HTMLCanvasElement} options.canvas The HTML canvas element to create the scene for. * @param {Object} [options.contextOptions] Context and WebGL creation properties. See details above. * @param {Element} [options.creditContainer] The HTML element in which the credits will be displayed. * @param {Element} [options.creditViewport] The HTML element in which to display the credit popup. If not specified, the viewport will be a added as a sibling of the canvas. @@ -787,7 +787,7 @@ Object.defineProperties(Scene.prototype, { * Gets the canvas element to which this scene is bound. * @memberof Scene.prototype * - * @type {Canvas} + * @type {HTMLCanvasElement} * @readonly */ canvas: { diff --git a/Source/Scene/SceneMode.js b/Source/Scene/SceneMode.js index 14858ffd8604..a9eabb4caae0 100644 --- a/Source/Scene/SceneMode.js +++ b/Source/Scene/SceneMode.js @@ -1,8 +1,7 @@ /** * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view. * - * @exports SceneMode - * + * @enum {Number} * @see Scene#mode */ var SceneMode = { diff --git a/Source/Scene/SceneTransforms.js b/Source/Scene/SceneTransforms.js index 5db365f69572..d6eee52df206 100644 --- a/Source/Scene/SceneTransforms.js +++ b/Source/Scene/SceneTransforms.js @@ -15,7 +15,7 @@ import SceneMode from "./SceneMode.js"; /** * Functions that do scene-dependent transforms between rendering-related coordinate systems. * - * @exports SceneTransforms + * @namespace SceneTransforms */ var SceneTransforms = {}; diff --git a/Source/Scene/ShadowMode.js b/Source/Scene/ShadowMode.js index c8a326643949..95e49b843912 100644 --- a/Source/Scene/ShadowMode.js +++ b/Source/Scene/ShadowMode.js @@ -2,7 +2,7 @@ * Specifies whether the object casts or receives shadows from light sources when * shadows are enabled. * - * @exports ShadowMode + * @enum {Number} */ var ShadowMode = { /** @@ -36,13 +36,13 @@ var ShadowMode = { * @constant */ RECEIVE_ONLY: 3, - - /** - * @private - */ - NUMBER_OF_SHADOW_MODES: 4, }; +/** + * @private + */ +ShadowMode.NUMBER_OF_SHADOW_MODES = 4; + /** * @private */ @@ -74,4 +74,5 @@ ShadowMode.fromCastReceive = function (castShadows, receiveShadows) { } return ShadowMode.DISABLED; }; + export default Object.freeze(ShadowMode); diff --git a/Source/Scene/SingleTileImageryProvider.js b/Source/Scene/SingleTileImageryProvider.js index 8ad4aa8fe339..1914251224ab 100644 --- a/Source/Scene/SingleTileImageryProvider.js +++ b/Source/Scene/SingleTileImageryProvider.js @@ -119,7 +119,7 @@ Object.defineProperties(SingleTileImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof SingleTileImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -359,7 +359,7 @@ SingleTileImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/StencilFunction.js b/Source/Scene/StencilFunction.js index 2a0fc199677a..f6affdf4a6b9 100644 --- a/Source/Scene/StencilFunction.js +++ b/Source/Scene/StencilFunction.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Determines the function used to compare stencil values for the stencil test. * - * @exports StencilFunction + * @enum {Number} */ var StencilFunction = { /** diff --git a/Source/Scene/StencilOperation.js b/Source/Scene/StencilOperation.js index b288b1d2edb2..aad78dcbd7be 100644 --- a/Source/Scene/StencilOperation.js +++ b/Source/Scene/StencilOperation.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Determines the action taken based on the result of the stencil test. * - * @exports StencilOperation + * @enum {Number} */ var StencilOperation = { /** diff --git a/Source/Scene/TextureAtlas.js b/Source/Scene/TextureAtlas.js index f640000377bd..446be3b0505e 100644 --- a/Source/Scene/TextureAtlas.js +++ b/Source/Scene/TextureAtlas.js @@ -354,7 +354,7 @@ function addImage(textureAtlas, image, index) { * the existing index is used. * * @param {String} id An identifier to detect whether the image already exists in the atlas. - * @param {Image|Canvas|String|Resource|Promise|TextureAtlas~CreateImageCallback} image An image or canvas to add to the texture atlas, + * @param {HTMLImageElement|HTMLCanvasElement|String|Resource|Promise|TextureAtlas.CreateImageCallback} image An image or canvas to add to the texture atlas, * or a URL to an Image, or a Promise for an image, or a function that creates an image. * @returns {Promise.} A Promise for the image index. */ @@ -494,8 +494,8 @@ TextureAtlas.prototype.destroy = function () { /** * A function that creates an image. - * @callback TextureAtlas~CreateImageCallback + * @callback TextureAtlas.CreateImageCallback * @param {String} id The identifier of the image to load. - * @returns {Image|Promise} The image, or a promise that will resolve to an image. + * @returns {HTMLImageElement|Promise} The image, or a promise that will resolve to an image. */ export default TextureAtlas; diff --git a/Source/Scene/TileBoundingVolume.js b/Source/Scene/TileBoundingVolume.js index 3a9093cd3c01..06d655078a81 100644 --- a/Source/Scene/TileBoundingVolume.js +++ b/Source/Scene/TileBoundingVolume.js @@ -4,6 +4,9 @@ import DeveloperError from "../Core/DeveloperError.js"; * Defines a bounding volume for a tile. This type describes an interface * and is not intended to be instantiated directly. * + * @alias TileBoundingVolume + * @constructor + * * @see TileBoundingRegion * @see TileBoundingSphere * @see TileOrientedBoundingBox @@ -15,8 +18,6 @@ function TileBoundingVolume() {} /** * The underlying bounding volume. * - * @memberof TileBoundingVolume.prototype - * * @type {Object} * @readonly */ @@ -25,8 +26,6 @@ TileBoundingVolume.prototype.boundingVolume = undefined; /** * The underlying bounding sphere. * - * @memberof TileBoundingVolume.prototype - * * @type {BoundingSphere} * @readonly */ diff --git a/Source/Scene/TileCoordinatesImageryProvider.js b/Source/Scene/TileCoordinatesImageryProvider.js index ee56a9b317bd..9e119a322fdf 100644 --- a/Source/Scene/TileCoordinatesImageryProvider.js +++ b/Source/Scene/TileCoordinatesImageryProvider.js @@ -39,7 +39,7 @@ Object.defineProperties(TileCoordinatesImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof TileCoordinatesImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -235,7 +235,7 @@ TileCoordinatesImageryProvider.prototype.getTileCredits = function ( * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/TileDiscardPolicy.js b/Source/Scene/TileDiscardPolicy.js index c50a02a8611e..1977b881fcac 100644 --- a/Source/Scene/TileDiscardPolicy.js +++ b/Source/Scene/TileDiscardPolicy.js @@ -26,7 +26,7 @@ TileDiscardPolicy.prototype.isReady = DeveloperError.throwInstantiationError; * Given a tile image, decide whether to discard that image. * @function * - * @param {Image} image An image to test. + * @param {HTMLImageElement} image An image to test. * @returns {Boolean} True if the image should be discarded; otherwise, false. */ TileDiscardPolicy.prototype.shouldDiscardImage = diff --git a/Source/Scene/TimeDynamicImagery.js b/Source/Scene/TimeDynamicImagery.js index 7afa8d904349..ef579f198928 100644 --- a/Source/Scene/TimeDynamicImagery.js +++ b/Source/Scene/TimeDynamicImagery.js @@ -111,7 +111,7 @@ Object.defineProperties(TimeDynamicImagery.prototype, { * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. * - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if the tile is not in the cache. */ TimeDynamicImagery.prototype.getFromCache = function (x, y, level, request) { diff --git a/Source/Scene/Tonemapper.js b/Source/Scene/Tonemapper.js index 4c34f7515f7f..2deefe17b20b 100644 --- a/Source/Scene/Tonemapper.js +++ b/Source/Scene/Tonemapper.js @@ -1,7 +1,7 @@ /** * A tonemapping algorithm when rendering with high dynamic range. * - * @exports Tonemapper + * @enum {Number} * @private */ var Tonemapper = { diff --git a/Source/Scene/TweenCollection.js b/Source/Scene/TweenCollection.js index ff1515276763..e27df7182912 100644 --- a/Source/Scene/TweenCollection.js +++ b/Source/Scene/TweenCollection.js @@ -45,7 +45,7 @@ function Tween( * The callback to call if the tween is canceled either because {@link Tween#cancelTween} * was called or because the tween was removed from the collection. * - * @type {TweenCollection~TweenCancelledCallback} + * @type {TweenCollection.TweenCancelledCallback} */ this.cancel = cancel; @@ -125,7 +125,7 @@ Object.defineProperties(Tween.prototype, { * The callback to call at each animation update (usually tied to the a rendered frame). * @memberof Tween.prototype * - * @type {TweenCollection~TweenUpdateCallback} + * @type {TweenCollection.TweenUpdateCallback} * @readonly */ update: { @@ -138,7 +138,7 @@ Object.defineProperties(Tween.prototype, { * The callback to call when the tween finishes animating. * @memberof Tween.prototype * - * @type {TweenCollection~TweenCompleteCallback} + * @type {TweenCollection.TweenCompleteCallback} * @readonly */ complete: { @@ -204,9 +204,9 @@ Object.defineProperties(TweenCollection.prototype, { * @param {Number} options.duration The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops. * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating. * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion. - * @param {TweenCollection~TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). - * @param {TweenCollection~TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. - * @param {TweenCollection~TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. + * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). + * @param {TweenCollection.TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. + * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. * @returns {Tween} The tween. * * @exception {DeveloperError} options.duration must be positive. @@ -284,9 +284,9 @@ TweenCollection.prototype.add = function (options) { * @param {Number} [options.duration=3.0] The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops. * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating. * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion. - * @param {TweenCollection~TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). - * @param {TweenCollection~TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. - * @param {TweenCollection~TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. + * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). + * @param {TweenCollection.TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. + * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. * @returns {Tween} The tween. * * @exception {DeveloperError} options.object must have the specified property. @@ -350,9 +350,9 @@ TweenCollection.prototype.addProperty = function (options) { * @param {Number} [options.duration=3.0] The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops. * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating. * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion. - * @param {TweenCollection~TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). - * @param {TweenCollection~TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. - * @param {TweenCollection~TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. + * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). + * @param {TweenCollection.TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. + * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. * @returns {Tween} The tween. * * @exception {DeveloperError} material has no properties with alpha components. @@ -423,8 +423,8 @@ TweenCollection.prototype.addAlpha = function (options) { * @param {Number} [options.duration=3.0] The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops. * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating. * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion. - * @param {TweenCollection~TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). - * @param {TweenCollection~TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. + * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). + * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. * @returns {Tween} The tween. * * @exception {DeveloperError} material.uniforms must have an offset property. @@ -573,16 +573,16 @@ TweenCollection.prototype.update = function (time) { /** * A function that will execute when a tween completes. - * @callback TweenCollection~TweenCompleteCallback + * @callback TweenCollection.TweenCompleteCallback */ /** * A function that will execute when a tween updates. - * @callback TweenCollection~TweenUpdateCallback + * @callback TweenCollection.TweenUpdateCallback */ /** * A function that will execute when a tween is cancelled. - * @callback TweenCollection~TweenCancelledCallback + * @callback TweenCollection.TweenCancelledCallback */ export default TweenCollection; diff --git a/Source/Scene/UrlTemplateImageryProvider.js b/Source/Scene/UrlTemplateImageryProvider.js index b053017be6ef..4585c38bab54 100644 --- a/Source/Scene/UrlTemplateImageryProvider.js +++ b/Source/Scene/UrlTemplateImageryProvider.js @@ -308,7 +308,7 @@ Object.defineProperties(UrlTemplateImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof UrlTemplateImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly * @default undefined */ @@ -660,7 +660,7 @@ UrlTemplateImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/Vector3DTileGeometry.js b/Source/Scene/Vector3DTileGeometry.js index 89095aa3e9aa..63e8ca8b74b3 100644 --- a/Source/Scene/Vector3DTileGeometry.js +++ b/Source/Scene/Vector3DTileGeometry.js @@ -139,7 +139,7 @@ Object.defineProperties(Vector3DTileGeometry.prototype, { /** * Gets a promise that resolves when the primitive is ready to render. * @memberof Vector3DTileGeometry.prototype - * @type {Promise} + * @type {Promise} * @readonly */ readyPromise: { diff --git a/Source/Scene/Vector3DTilePoints.js b/Source/Scene/Vector3DTilePoints.js index 9d2c9d5951dd..b6cd9346dc90 100644 --- a/Source/Scene/Vector3DTilePoints.js +++ b/Source/Scene/Vector3DTilePoints.js @@ -92,7 +92,7 @@ Object.defineProperties(Vector3DTilePoints.prototype, { /** * Gets a promise that resolves when the primitive is ready to render. * @memberof Vector3DTilePoints.prototype - * @type {Promise} + * @type {Promise} * @readonly */ readyPromise: { diff --git a/Source/Scene/Vector3DTilePolygons.js b/Source/Scene/Vector3DTilePolygons.js index 50a1712ba549..afe4f440b18e 100644 --- a/Source/Scene/Vector3DTilePolygons.js +++ b/Source/Scene/Vector3DTilePolygons.js @@ -143,7 +143,7 @@ Object.defineProperties(Vector3DTilePolygons.prototype, { /** * Gets a promise that resolves when the primitive is ready to render. * @memberof Vector3DTilePolygons.prototype - * @type {Promise} + * @type {Promise} * @readonly */ readyPromise: { diff --git a/Source/Scene/Vector3DTilePolylines.js b/Source/Scene/Vector3DTilePolylines.js index 13c363a1056b..d9672ddd222b 100644 --- a/Source/Scene/Vector3DTilePolylines.js +++ b/Source/Scene/Vector3DTilePolylines.js @@ -121,7 +121,7 @@ Object.defineProperties(Vector3DTilePolylines.prototype, { /** * Gets a promise that resolves when the primitive is ready to render. * @memberof Vector3DTilePolylines.prototype - * @type {Promise} + * @type {Promise} * @readonly */ readyPromise: { diff --git a/Source/Scene/VerticalOrigin.js b/Source/Scene/VerticalOrigin.js index a86ab56be337..dfd99dc56e5c 100644 --- a/Source/Scene/VerticalOrigin.js +++ b/Source/Scene/VerticalOrigin.js @@ -8,7 +8,7 @@ *
* * - * @exports VerticalOrigin + * @enum {Number} * * @see Billboard#verticalOrigin * @see Label#verticalOrigin diff --git a/Source/Scene/WebMapServiceImageryProvider.js b/Source/Scene/WebMapServiceImageryProvider.js index 8cc2b28dff20..8d76c9223b3d 100644 --- a/Source/Scene/WebMapServiceImageryProvider.js +++ b/Source/Scene/WebMapServiceImageryProvider.js @@ -242,7 +242,7 @@ Object.defineProperties(WebMapServiceImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof WebMapServiceImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -494,7 +494,7 @@ WebMapServiceImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/WebMapTileServiceImageryProvider.js b/Source/Scene/WebMapTileServiceImageryProvider.js index 54e66417b684..6703ba4c7965 100644 --- a/Source/Scene/WebMapTileServiceImageryProvider.js +++ b/Source/Scene/WebMapTileServiceImageryProvider.js @@ -300,7 +300,7 @@ Object.defineProperties(WebMapTileServiceImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof WebMapTileServiceImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -552,7 +552,7 @@ WebMapTileServiceImageryProvider.prototype.getTileCredits = function ( * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/createBillboardPointCallback.js b/Source/Scene/createBillboardPointCallback.js index 24453e9af971..65718192d807 100644 --- a/Source/Scene/createBillboardPointCallback.js +++ b/Source/Scene/createBillboardPointCallback.js @@ -1,12 +1,12 @@ /** - * Creates a {@link createBillboardPointCallback~CanvasFunction} that will create a canvas with a point. + * Creates a {@link createBillboardPointCallback.CanvasFunction} that will create a canvas with a point. * * @param {Number} centerAlpha The alpha of the center of the point. The value must be in the range [0.0, 1.0]. * @param {String} cssColor The CSS color string. * @param {String} cssOutlineColor The CSS color of the point outline. * @param {Number} cssOutlineWidth The width of the outline in pixels. * @param {Number} pixelSize The size of the point in pixels. - * @return {createBillboardPointCallback~CanvasFunction} The function that will return a canvas with the point drawn on it. + * @return {createBillboardPointCallback.CanvasFunction} The function that will return a canvas with the point drawn on it. * * @private */ @@ -64,7 +64,7 @@ function createBillboardPointCallback( /** * A function that returns a canvas containing an image of a point. - * @callback createBillboardPointCallback~CanvasFunction + * @callback createBillboardPointCallback.CanvasFunction * @returns {HTMLCanvasElement} The result of the calculation. */ export default createBillboardPointCallback; diff --git a/Source/Scene/createOsmBuildings.js b/Source/Scene/createOsmBuildings.js index a692281fae11..09636e39ced1 100644 --- a/Source/Scene/createOsmBuildings.js +++ b/Source/Scene/createOsmBuildings.js @@ -11,7 +11,7 @@ import Cesium3DTileStyle from "./Cesium3DTileStyle.js"; * {@link https://cesium.com/content/#cesium-osm-buildings|Cesium OSM Buildings} * tileset. * - * @exports createOsmBuildings + * @function * * @param {Object} [options] Construction options. Any options allowed by the {@link Cesium3DTileset} constructor * may be specified here. In addition to those, the following properties are supported: diff --git a/Source/Scene/createTangentSpaceDebugPrimitive.js b/Source/Scene/createTangentSpaceDebugPrimitive.js index fe809e7c1163..78f6436322f8 100644 --- a/Source/Scene/createTangentSpaceDebugPrimitive.js +++ b/Source/Scene/createTangentSpaceDebugPrimitive.js @@ -14,7 +14,7 @@ import Primitive from "./Primitive.js"; * is red; tangent is green; and bitangent is blue. If an attribute is not * present, it is not drawn. * - * @exports createTangentSpaceDebugPrimitive + * @function * * @param {Object} options Object with the following properties: * @param {Geometry} options.geometry The Geometry instance with the attribute. diff --git a/Source/Scene/createWorldImagery.js b/Source/Scene/createWorldImagery.js index bb00d364a3be..460d4c7ffeaa 100644 --- a/Source/Scene/createWorldImagery.js +++ b/Source/Scene/createWorldImagery.js @@ -5,7 +5,7 @@ import IonWorldImageryStyle from "./IonWorldImageryStyle.js"; /** * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps. * - * @exports createWorldImagery + * @function * * @param {Object} [options] Object with the following properties: * @param {IonWorldImageryStyle} [options.style=IonWorldImageryStyle] The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported. diff --git a/Source/Widgets/Animation/AnimationViewModel.js b/Source/Widgets/Animation/AnimationViewModel.js index 4a16227185d9..4da7381d0001 100644 --- a/Source/Widgets/Animation/AnimationViewModel.js +++ b/Source/Widgets/Animation/AnimationViewModel.js @@ -380,7 +380,7 @@ function AnimationViewModel(clockViewModel) { * Gets or sets the default date formatter used by new instances. * * @member - * @type {AnimationViewModel~DateFormatter} + * @type {AnimationViewModel.DateFormatter} */ AnimationViewModel.defaultDateFormatter = function (date, viewModel) { var gregorianDate = JulianDate.toGregorianDate(date); @@ -435,7 +435,7 @@ AnimationViewModel.defaultTicks = [ * Gets or sets the default time formatter used by new instances. * * @member - * @type {AnimationViewModel~TimeFormatter} + * @type {AnimationViewModel.TimeFormatter} */ AnimationViewModel.defaultTimeFormatter = function (date, viewModel) { var gregorianDate = JulianDate.toGregorianDate(date); @@ -598,7 +598,7 @@ Object.defineProperties(AnimationViewModel.prototype, { * Gets or sets the function which formats a date for display. * @memberof AnimationViewModel.prototype * - * @type {AnimationViewModel~DateFormatter} + * @type {AnimationViewModel.DateFormatter} * @default AnimationViewModel.defaultDateFormatter */ dateFormatter: { @@ -621,7 +621,7 @@ Object.defineProperties(AnimationViewModel.prototype, { * Gets or sets the function which formats a time for display. * @memberof AnimationViewModel.prototype * - * @type {AnimationViewModel~TimeFormatter} + * @type {AnimationViewModel.TimeFormatter} * @default AnimationViewModel.defaultTimeFormatter */ timeFormatter: { @@ -647,7 +647,7 @@ AnimationViewModel._realtimeShuttleRingAngle = realtimeShuttleRingAngle; /** * A function that formats a date for display. - * @callback AnimationViewModel~DateFormatter + * @callback AnimationViewModel.DateFormatter * * @param {JulianDate} date The date to be formatted * @param {AnimationViewModel} viewModel The AnimationViewModel instance requesting formatting. @@ -656,7 +656,7 @@ AnimationViewModel._realtimeShuttleRingAngle = realtimeShuttleRingAngle; /** * A function that formats a time for display. - * @callback AnimationViewModel~TimeFormatter + * @callback AnimationViewModel.TimeFormatter * * @param {JulianDate} date The date to be formatted * @param {AnimationViewModel} viewModel The AnimationViewModel instance requesting formatting. diff --git a/Source/Widgets/BaseLayerPicker/ProviderViewModel.js b/Source/Widgets/BaseLayerPicker/ProviderViewModel.js index f301e667748d..093bb62bf7f8 100644 --- a/Source/Widgets/BaseLayerPicker/ProviderViewModel.js +++ b/Source/Widgets/BaseLayerPicker/ProviderViewModel.js @@ -15,7 +15,7 @@ import createCommand from "../createCommand.js"; * @param {String} options.tooltip The tooltip to show when the item is moused over. * @param {String} options.iconUrl An icon representing the layer. * @param {String} [options.category] A category for the layer. - * @param {ProviderViewModel~CreationFunction|Command} options.creationFunction A function or Command + * @param {ProviderViewModel.CreationFunction|Command} options.creationFunction A function or Command * that creates one or more providers which will be added to the globe when this item is selected. * * @see BaseLayerPicker @@ -98,7 +98,7 @@ Object.defineProperties(ProviderViewModel.prototype, { /** * A function which creates one or more providers. - * @callback ProviderViewModel~CreationFunction + * @callback ProviderViewModel.CreationFunction * @returns {ImageryProvider|TerrainProvider|ImageryProvider[]|TerrainProvider[]} * The ImageryProvider or TerrainProvider, or array of providers, to be added * to the globe. diff --git a/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js b/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js index 409c9f10e6b0..178109857acd 100644 --- a/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js +++ b/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js @@ -58,7 +58,7 @@ var scratchPickCartesian = new Cartesian3(); * @constructor * * @param {Scene} scene The scene instance to use. - * @param {PerformanceContainer} performanceContainer The instance to use for performance container. + * @param {Element} performanceContainer The instance to use for performance container. */ function CesiumInspectorViewModel(scene, performanceContainer) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/Widgets/CesiumWidget/CesiumWidget.js b/Source/Widgets/CesiumWidget/CesiumWidget.js index bc1add14f2f8..b008161b2030 100644 --- a/Source/Widgets/CesiumWidget/CesiumWidget.js +++ b/Source/Widgets/CesiumWidget/CesiumWidget.js @@ -404,7 +404,7 @@ Object.defineProperties(CesiumWidget.prototype, { * Gets the canvas. * @memberof CesiumWidget.prototype * - * @type {Canvas} + * @type {HTMLCanvasElement} */ canvas: { get: function () { diff --git a/Source/Widgets/Geocoder/Geocoder.js b/Source/Widgets/Geocoder/Geocoder.js index 390a3b879ea1..943d52b1e6dd 100644 --- a/Source/Widgets/Geocoder/Geocoder.js +++ b/Source/Widgets/Geocoder/Geocoder.js @@ -24,7 +24,7 @@ var stopSearchPath = * @param {GeocoderService[]} [options.geocoderServices] The geocoder services to be used * @param {Boolean} [options.autoComplete = true] True if the geocoder should query as the user types to autocomplete * @param {Number} [options.flightDuration=1.5] The duration of the camera flight to an entered location, in seconds. - * @param {Geocoder~DestinationFoundFunction} [options.destinationFound=GeocoderViewModel.flyToDestination] A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination. + * @param {Geocoder.DestinationFoundFunction} [options.destinationFound=GeocoderViewModel.flyToDestination] A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination. */ function Geocoder(options) { //>>includeStart('debug', pragmas.debug); @@ -224,7 +224,7 @@ Geocoder.prototype.destroy = function () { /** * A function that handles the result of a successful geocode. - * @callback Geocoder~DestinationFoundFunction + * @callback Geocoder.DestinationFoundFunction * @param {GeocoderViewModel} viewModel The view model. * @param {Cartesian3|Rectangle} destination The destination result of the geocode. */ diff --git a/Source/Widgets/Geocoder/GeocoderViewModel.js b/Source/Widgets/Geocoder/GeocoderViewModel.js index b704825c6786..b384fcb853de 100644 --- a/Source/Widgets/Geocoder/GeocoderViewModel.js +++ b/Source/Widgets/Geocoder/GeocoderViewModel.js @@ -29,7 +29,7 @@ var DEFAULT_HEIGHT = 1000; * If more than one are supplied, suggestions will be gathered for the geocoders that support it, * and if no suggestion is selected the result from the first geocoder service wil be used. * @param {Number} [options.flightDuration] The duration of the camera flight to an entered location, in seconds. - * @param {Geocoder~DestinationFoundFunction} [options.destinationFound=GeocoderViewModel.flyToDestination] A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination. + * @param {Geocoder.DestinationFoundFunction} [options.destinationFound=GeocoderViewModel.flyToDestination] A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination. */ function GeocoderViewModel(options) { //>>includeStart('debug', pragmas.debug); @@ -157,7 +157,7 @@ function GeocoderViewModel(options) { /** * Gets and sets the command called when a geocode destination is found - * @type {Geocoder~DestinationFoundFunction} + * @type {Geocoder.DestinationFoundFunction} */ this.destinationFound = defaultValue( options.destinationFound, @@ -547,7 +547,7 @@ function updateSearchSuggestions(viewModel) { /** * A function to fly to the destination found by a successful geocode. - * @type {Geocoder~DestinationFoundFunction} + * @type {Geocoder.DestinationFoundFunction} */ GeocoderViewModel.flyToDestination = flyToDestination; diff --git a/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel.js b/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel.js index 08cee4b730f6..83ee0ce9a240 100644 --- a/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel.js +++ b/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel.js @@ -87,7 +87,7 @@ function SelectionIndicatorViewModel( * Gets or sets the function for converting the world position of the object to the screen space position. * * @member - * @type {SelectionIndicatorViewModel~ComputeScreenSpacePosition} + * @type {SelectionIndicatorViewModel.ComputeScreenSpacePosition} * @default SceneTransforms.wgs84ToWindowCoordinates * * @example @@ -205,7 +205,7 @@ Object.defineProperties(SelectionIndicatorViewModel.prototype, { /** * A function that converts the world position of an object to a screen space position. - * @callback SelectionIndicatorViewModel~ComputeScreenSpacePosition + * @callback SelectionIndicatorViewModel.ComputeScreenSpacePosition * @param {Cartesian3} position The position in WGS84 (world) coordinates. * @param {Cartesian2} result An object to return the input position transformed to window coordinates. * @returns {Cartesian2} The modified result parameter. diff --git a/Source/Widgets/SvgPathBindingHandler.js b/Source/Widgets/SvgPathBindingHandler.js index e57e6429efc5..cba2bd5f3cb7 100644 --- a/Source/Widgets/SvgPathBindingHandler.js +++ b/Source/Widgets/SvgPathBindingHandler.js @@ -16,7 +16,7 @@ var svgClassName = "cesium-svgPath-svg"; *
  • css: Optional. A string containing additional CSS classes to apply to the SVG. 'cesium-svgPath-svg' is always applied.
  • * * - * @exports SvgPathBindingHandler + * @namespace SvgPathBindingHandler * * @example * // Create an SVG as a child of a div @@ -29,6 +29,9 @@ var svgClassName = "cesium-svgPath-svg"; *
    */ var SvgPathBindingHandler = { + /** + * @function + */ register: function (knockout) { knockout.bindingHandlers.cesiumSvgPath = { init: function (element, valueAccessor) { diff --git a/Source/Widgets/Viewer/Viewer.js b/Source/Widgets/Viewer/Viewer.js index c54f7d9cdfb0..6e27585a1813 100644 --- a/Source/Widgets/Viewer/Viewer.js +++ b/Source/Widgets/Viewer/Viewer.js @@ -1065,7 +1065,7 @@ Object.defineProperties(Viewer.prototype, { /** * Gets the canvas. * @memberof Viewer.prototype - * @type {Canvas} + * @type {HTMLCanvasElement} * @readonly */ canvas: { @@ -1439,7 +1439,7 @@ Object.defineProperties(Viewer.prototype, { * A mixin may add additional properties, functions, or other behavior * to the provided viewer instance. * - * @param {Viewer~ViewerMixin} mixin The Viewer mixin to add to this instance. + * @param {Viewer.ViewerMixin} mixin The Viewer mixin to add to this instance. * @param {Object} [options] The options object to be passed to the mixin function. * * @see viewerDragDropMixin @@ -2311,7 +2311,7 @@ function updateTrackedEntity(viewer) { /** * A function that augments a Viewer instance with additional functionality. - * @callback Viewer~ViewerMixin + * @callback Viewer.ViewerMixin * @param {Viewer} viewer The viewer instance. * @param {Object} options Options object to be passed to the mixin function. * diff --git a/Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin.js b/Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin.js index ce0a01a079c9..c4bb1761429f 100644 --- a/Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin.js +++ b/Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin.js @@ -5,7 +5,7 @@ import Cesium3DTilesInspector from "../Cesium3DTilesInspector/Cesium3DTilesInspe * A mixin which adds the {@link Cesium3DTilesInspector} widget to the {@link Viewer} widget. * Rather than being called directly, this function is normally passed as * a parameter to {@link Viewer#extend}, as shown in the example below. - * @exports viewerCesium3DTilesInspectorMixin + * @function * * @param {Viewer} viewer The viewer instance. * diff --git a/Source/Widgets/Viewer/viewerCesiumInspectorMixin.js b/Source/Widgets/Viewer/viewerCesiumInspectorMixin.js index a7413fb3c225..de8518f1c60f 100644 --- a/Source/Widgets/Viewer/viewerCesiumInspectorMixin.js +++ b/Source/Widgets/Viewer/viewerCesiumInspectorMixin.js @@ -6,7 +6,7 @@ import CesiumInspector from "../CesiumInspector/CesiumInspector.js"; * A mixin which adds the CesiumInspector widget to the Viewer widget. * Rather than being called directly, this function is normally passed as * a parameter to {@link Viewer#extend}, as shown in the example below. - * @exports viewerCesiumInspectorMixin + * @function * * @param {Viewer} viewer The viewer instance. * diff --git a/Source/Widgets/Viewer/viewerDragDropMixin.js b/Source/Widgets/Viewer/viewerDragDropMixin.js index d111f7cdef42..06d7b7dbeffb 100644 --- a/Source/Widgets/Viewer/viewerDragDropMixin.js +++ b/Source/Widgets/Viewer/viewerDragDropMixin.js @@ -12,8 +12,8 @@ import getElement from "../getElement.js"; * A mixin which adds default drag and drop support for CZML files to the Viewer widget. * Rather than being called directly, this function is normally passed as * a parameter to {@link Viewer#extend}, as shown in the example below. - * @exports viewerDragDropMixin - * @namespace + * @function viewerDragDropMixin + * @param {Viewer} viewer The viewer instance. * @param {Object} [options] Object with the following properties: * @param {Element|String} [options.dropTarget=viewer.container] The DOM element which will serve as the drop target. diff --git a/Source/Widgets/Viewer/viewerPerformanceWatchdogMixin.js b/Source/Widgets/Viewer/viewerPerformanceWatchdogMixin.js index 589277ad44e6..c0cbb78c517c 100644 --- a/Source/Widgets/Viewer/viewerPerformanceWatchdogMixin.js +++ b/Source/Widgets/Viewer/viewerPerformanceWatchdogMixin.js @@ -7,7 +7,7 @@ import PerformanceWatchdog from "../PerformanceWatchdog/PerformanceWatchdog.js"; * A mixin which adds the {@link PerformanceWatchdog} widget to the {@link Viewer} widget. * Rather than being called directly, this function is normally passed as * a parameter to {@link Viewer#extend}, as shown in the example below. - * @exports viewerPerformanceWatchdogMixin + * @function * * @param {Viewer} viewer The viewer instance. * @param {Object} [options] An object with properties. diff --git a/Source/Widgets/createCommand.js b/Source/Widgets/createCommand.js index 88a0aec3a735..27e761f234fd 100644 --- a/Source/Widgets/createCommand.js +++ b/Source/Widgets/createCommand.js @@ -12,7 +12,7 @@ import knockout from "../ThirdParty/knockout.js"; * value of canExecute and throw if false. It also provides events for when * a command has been or is about to be executed. * - * @exports createCommand + * @function * * @param {Function} func The function to execute. * @param {Boolean} [canExecute=true] A boolean indicating whether the function can currently be executed. diff --git a/Source/Widgets/subscribeAndEvaluate.js b/Source/Widgets/subscribeAndEvaluate.js index 700240f76b12..768829eef8b7 100644 --- a/Source/Widgets/subscribeAndEvaluate.js +++ b/Source/Widgets/subscribeAndEvaluate.js @@ -6,7 +6,7 @@ import knockout from "../ThirdParty/knockout.js"; * * @private * - * @exports subscribeAndEvaluate + * @function subscribeAndEvaluate * * @param {Object} owner The object containing the observable property. * @param {String} observablePropertyName The name of the observable property. diff --git a/Source/WorkersES6/createTaskProcessorWorker.js b/Source/WorkersES6/createTaskProcessorWorker.js index 55a699a3012c..2b6f49308d8d 100644 --- a/Source/WorkersES6/createTaskProcessorWorker.js +++ b/Source/WorkersES6/createTaskProcessorWorker.js @@ -21,11 +21,11 @@ function callAndWrap(workerFunction, parameters, transferableObjects) { * Creates an adapter function to allow a calculation function to operate as a Web Worker, * paired with TaskProcessor, to receive tasks and return results. * - * @exports createTaskProcessorWorker + * @function createTaskProcessorWorker * - * @param {createTaskProcessorWorker~WorkerFunction} workerFunction The calculation function, + * @param {createTaskProcessorWorker.WorkerFunction} workerFunction The calculation function, * which takes parameters and returns a result. - * @returns {createTaskProcessorWorker~TaskProcessorWorkerFunction} A function that adapts the + * @returns {createTaskProcessorWorker.TaskProcessorWorkerFunction} A function that adapts the * calculation function to work as a Web Worker onmessage listener with TaskProcessor. * * @@ -101,7 +101,7 @@ function createTaskProcessorWorker(workerFunction) { /** * A function that performs a calculation in a Web Worker. - * @callback createTaskProcessorWorker~WorkerFunction + * @callback createTaskProcessorWorker.WorkerFunction * * @param {Object} parameters Parameters to the calculation. * @param {Array} transferableObjects An array that should be filled with references to objects inside @@ -125,7 +125,7 @@ function createTaskProcessorWorker(workerFunction) { /** * A Web Worker message event handler function that handles the interaction with TaskProcessor, * specifically, task ID management and posting a response message containing the result. - * @callback createTaskProcessorWorker~TaskProcessorWorkerFunction + * @callback createTaskProcessorWorker.TaskProcessorWorkerFunction * * @param {Object} event The onmessage event object. */ diff --git a/Specs/Core/Cartesian2Spec.js b/Specs/Core/Cartesian2Spec.js index 95d5d2c573f3..591d66f99f5d 100644 --- a/Specs/Core/Cartesian2Spec.js +++ b/Specs/Core/Cartesian2Spec.js @@ -860,12 +860,6 @@ describe("Core/Cartesian2", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with no epsilon", function () { - expect(function () { - Cartesian2.equalsEpsilon(new Cartesian2(), new Cartesian2(), undefined); - }).toThrowDeveloperError(); - }); - it("fromElements returns a cartesian2 with corrrect coordinates", function () { var cartesian2 = Cartesian2.fromElements(2, 2); var expectedResult = new Cartesian2(2, 2); diff --git a/Specs/Core/Cartesian3Spec.js b/Specs/Core/Cartesian3Spec.js index b00b85e7e4f0..338e05fa27e1 100644 --- a/Specs/Core/Cartesian3Spec.js +++ b/Specs/Core/Cartesian3Spec.js @@ -1031,12 +1031,6 @@ describe("Core/Cartesian3", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with no epsilon", function () { - expect(function () { - Cartesian3.equalsEpsilon(new Cartesian3(), new Cartesian3(), undefined); - }).toThrowDeveloperError(); - }); - it("cross throw with no left paramater", function () { var right = new Cartesian3(4, 3, 6); expect(function () { diff --git a/Specs/Core/Cartesian4Spec.js b/Specs/Core/Cartesian4Spec.js index f153832e553f..813007d128e0 100644 --- a/Specs/Core/Cartesian4Spec.js +++ b/Specs/Core/Cartesian4Spec.js @@ -1011,12 +1011,6 @@ describe("Core/Cartesian4", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with no epsilon", function () { - expect(function () { - Cartesian4.equalsEpsilon(new Cartesian4(), new Cartesian4(), undefined); - }).toThrowDeveloperError(); - }); - it("minimumByComponent throws with no result", function () { expect(function () { Cartesian4.minimumByComponent(new Cartesian4(), new Cartesian4()); diff --git a/Specs/Core/CartographicSpec.js b/Specs/Core/CartographicSpec.js index 8c662bde0cf0..358907e22867 100644 --- a/Specs/Core/CartographicSpec.js +++ b/Specs/Core/CartographicSpec.js @@ -216,10 +216,4 @@ describe("Core/Cartographic", function () { it("clone returns undefined without cartographic parameter", function () { expect(Cartographic.clone(undefined)).toBeUndefined(); }); - - it("equalsEpsilon throws without numeric epsilon", function () { - expect(function () { - Cartographic.equalsEpsilon(new Cartographic(), new Cartographic(), {}); - }).toThrowDeveloperError(); - }); }); diff --git a/Specs/Core/MathSpec.js b/Specs/Core/MathSpec.js index 7c38c87ac2e8..d065817d3afd 100644 --- a/Specs/Core/MathSpec.js +++ b/Specs/Core/MathSpec.js @@ -339,12 +339,6 @@ describe("Core/Math", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws for undefined relativeEpsilon", function () { - expect(function () { - CesiumMath.equalsEpsilon(1.0, 5.0, undefined); - }).toThrowDeveloperError(); - }); - it("equalsEpsilon throws for undefined", function () { expect(function () { CesiumMath.equalsEpsilon(); diff --git a/Specs/Core/Matrix2Spec.js b/Specs/Core/Matrix2Spec.js index 975b25d1c4a2..d1f9666e0b31 100644 --- a/Specs/Core/Matrix2Spec.js +++ b/Specs/Core/Matrix2Spec.js @@ -740,12 +740,6 @@ describe("Core/Matrix2", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with non-number parameter", function () { - expect(function () { - Matrix2.equalsEpsilon(new Matrix2(), new Matrix2(), {}); - }).toThrowDeveloperError(); - }); - it("getColumn throws without result parameter", function () { expect(function () { Matrix2.getColumn(new Matrix2(), 1); diff --git a/Specs/Core/Matrix3Spec.js b/Specs/Core/Matrix3Spec.js index b6dc75eafcdd..bfd75f43f763 100644 --- a/Specs/Core/Matrix3Spec.js +++ b/Specs/Core/Matrix3Spec.js @@ -1373,12 +1373,6 @@ describe("Core/Matrix3", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with non-number parameter", function () { - expect(function () { - Matrix3.equalsEpsilon(new Matrix3(), new Matrix3(), {}); - }).toThrowDeveloperError(); - }); - it("getColumn throws without result parameter", function () { expect(function () { Matrix3.getColumn(new Matrix3(), 2); diff --git a/Specs/Core/Matrix4Spec.js b/Specs/Core/Matrix4Spec.js index da2c3e55af50..6fad177a2d8d 100644 --- a/Specs/Core/Matrix4Spec.js +++ b/Specs/Core/Matrix4Spec.js @@ -4306,12 +4306,6 @@ describe("Core/Matrix4", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with non-number parameter", function () { - expect(function () { - Matrix4.equalsEpsilon(new Matrix4(), new Matrix4(), {}); - }).toThrowDeveloperError(); - }); - it("getTranslation throws without matrix parameter", function () { expect(function () { Matrix4.getTranslation(undefined); @@ -4566,21 +4560,6 @@ describe("Core/Matrix4", function () { }).toThrowDeveloperError(); }); - it("computeViewportTransformation works", function () { - expect(function () { - Matrix4.computeViewportTransformation( - { - x: 0, - y: 0, - width: 4.0, - height: 6.0, - }, - 0.0, - 2.0 - ); - }).toThrowDeveloperError(); - }); - it("Matrix4 objects can be used as array like objects", function () { var matrix = new Matrix4( 1, diff --git a/Specs/Core/QuaternionSpec.js b/Specs/Core/QuaternionSpec.js index 45ec1c8d2d69..d330f5905009 100644 --- a/Specs/Core/QuaternionSpec.js +++ b/Specs/Core/QuaternionSpec.js @@ -1152,12 +1152,6 @@ describe("Core/Quaternion", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with no epsilon", function () { - expect(function () { - Quaternion.equalsEpsilon(new Quaternion(), new Quaternion(), undefined); - }).toThrowDeveloperError(); - }); - it("conjugate throws with no result", function () { expect(function () { Quaternion.conjugate(new Quaternion()); diff --git a/Specs/Core/RectangleSpec.js b/Specs/Core/RectangleSpec.js index 4b18f74f707a..36db8a65726d 100644 --- a/Specs/Core/RectangleSpec.js +++ b/Specs/Core/RectangleSpec.js @@ -1014,14 +1014,6 @@ describe("Core/Rectangle", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with no epsilon", function () { - var rectangle = new Rectangle(west, south, east, north); - var other = new Rectangle(); - expect(function () { - rectangle.equalsEpsilon(other, undefined); - }).toThrowDeveloperError(); - }); - it("intersection throws with no rectangle", function () { expect(function () { Rectangle.intersection(undefined); diff --git a/Specs/Core/TimeIntervalSpec.js b/Specs/Core/TimeIntervalSpec.js index 2ada0a768700..2de525dc7623 100644 --- a/Specs/Core/TimeIntervalSpec.js +++ b/Specs/Core/TimeIntervalSpec.js @@ -633,14 +633,6 @@ describe("Core/TimeInterval", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws without epsilon.", function () { - var left = new TimeInterval(); - var right = new TimeInterval(); - expect(function () { - TimeInterval.equalsEpsilon(left, right, undefined); - }).toThrowDeveloperError(); - }); - it("intersect throws without left.", function () { var right = new TimeInterval(); var result = new TimeInterval(); @@ -649,14 +641,6 @@ describe("Core/TimeInterval", function () { }).toThrowDeveloperError(); }); - it("intersect throws without result.", function () { - var left = new TimeInterval(); - var right = new TimeInterval(); - expect(function () { - TimeInterval.intersect(left, right, undefined); - }).toThrowDeveloperError(); - }); - it("contains throws without interval.", function () { var date = new JulianDate(); expect(function () { diff --git a/Tools/jsdoc/cesium_template/publish.js b/Tools/jsdoc/cesium_template/publish.js index ab9fcf459d29..1cd1c6960ec8 100644 --- a/Tools/jsdoc/cesium_template/publish.js +++ b/Tools/jsdoc/cesium_template/publish.js @@ -217,6 +217,7 @@ function buildNav(members) { var items = members.modules .concat(members.classes) + .concat(members.globals) .concat(members.namespaces) .sort(function (a, b) { return a.longname.toLowerCase().localeCompare(b.longname.toLowerCase()); @@ -436,6 +437,7 @@ exports.publish = function (taffyData, opts, tutorials) { var classes = taffy(members.classes); var modules = taffy(members.modules); var namespaces = taffy(members.namespaces); + var globals = taffy(members.globals); var typesJson = {}; @@ -450,6 +452,10 @@ exports.publish = function (taffyData, opts, tutorials) { items = helper.find(namespaces, { longname: longname }); } + if (!items.length) { + items = helper.find(globals, { longname: longname }); + } + if (items.length) { var title = items[0].name; var filename = helper.longnameToUrl[longname]; diff --git a/Tools/jsdoc/conf.json b/Tools/jsdoc/conf.json index 84d69edfb90c..f775c5099463 100644 --- a/Tools/jsdoc/conf.json +++ b/Tools/jsdoc/conf.json @@ -3,12 +3,19 @@ "allowUnknownTags": false }, "source": { - "include": ["Source"], - "exclude": ["Source/ThirdParty", "Source/Workers"], + "include": [ + "Source" + ], + "exclude": [ + "Source/ThirdParty", + "Source/Workers" + ], "includePattern": ".+\\.js(doc)?$", "excludePattern": "(^|\\/|\\\\)_" }, - "plugins": ["./Tools/jsdoc/cesiumTags"], + "plugins": [ + "./Tools/jsdoc/cesiumTags" + ], "templates": { "cleverLinks": true, "default": { @@ -21,4 +28,4 @@ "template": "./Tools/jsdoc/cesium_template", "recurse": true } -} +} \ No newline at end of file diff --git a/Tools/jsdoc/ts-conf.json b/Tools/jsdoc/ts-conf.json new file mode 100644 index 000000000000..c5cf568076a9 --- /dev/null +++ b/Tools/jsdoc/ts-conf.json @@ -0,0 +1,32 @@ +{ + "tags": { + "allowUnknownTags": false + }, + "source": { + "include": [ + "Source" + ], + "exclude": [ + "Source/ThirdParty", + "Source/Workers" + ], + "includePattern": ".+\\.js(doc)?$", + "excludePattern": "(^|\\/|\\\\)_" + }, + "plugins": [ + "./Tools/jsdoc/cesiumTags" + ], + "templates": { + "cleverLinks": true, + "default": { + "outputSourceFiles": false + }, + "sourceUrl": "https://github.com/CesiumGS/cesium/blob/{version}/Source/{filename}" + }, + "opts": { + "destination": "Source", + "template": "./node_modules/tsd-jsdoc/dist", + "outFile": "Cesium.d.ts", + "recurse": true + } +} \ No newline at end of file diff --git a/gulpfile.cjs b/gulpfile.cjs index 9c0e88939310..a660e726903c 100644 --- a/gulpfile.cjs +++ b/gulpfile.cjs @@ -34,6 +34,7 @@ var rollupPluginStripPragma = require("rollup-plugin-strip-pragma"); var rollupPluginExternalGlobals = require("rollup-plugin-external-globals"); var rollupPluginUglify = require("rollup-plugin-uglify"); var cleanCSS = require("gulp-clean-css"); +var typescript = require("typescript"); var packageJson = require("./package.json"); var version = packageJson.version; @@ -194,6 +195,11 @@ gulp.task("build-watch", function () { return gulp.watch(watchedFiles, gulp.series("build")); }); +gulp.task("build-ts", function () { + createTypeScriptDefinitions(); + return Promise.resolve(); +}); + gulp.task("buildApps", function () { return Promise.join(buildCesiumViewer(), buildSandcastle()); }); @@ -371,7 +377,13 @@ gulp.task("generateDocumentation-watch", function () { gulp.task( "release", - gulp.series("build", combine, minifyRelease, generateDocumentation) + gulp.series( + "build", + "build-ts", + combine, + minifyRelease, + generateDocumentation + ) ); gulp.task( @@ -1467,6 +1479,131 @@ function createCesiumJs() { fs.writeFileSync("Source/Cesium.js", contents); } +function createTypeScriptDefinitions() { + // Run jsdoc with tsd-jsdoc to generate an initial Cesium.d.ts file. + child_process.execSync( + "node_modules/.bin/jsdoc --configure Tools/jsdoc/ts-conf.json", + { stdio: "inherit" } + ); + + var source = fs.readFileSync("Source/Cesium.d.ts").toString(); + + // All of our enum assignments that alias to WebGLConstants, such as PixelDatatype.js + // end up as enum strings instead of actually mapping values to WebGLConstants. + // We fix this with a simple regex replace later on, but it means the + // WebGLConstants constants enum needs to be defined in the file before it can + // be used. This block of code reads in the TS file, finds the WebGLConstants + // declaration, and then writes the file back out (in memory to source) with + // WebGLConstants being the first module. + const node = typescript.createSourceFile( + "Source/Cesium.d.ts", + source, + typescript.ScriptTarget.Latest + ); + let firstNode; + node.forEachChild((child) => { + if ( + typescript.SyntaxKind[child.kind] === "EnumDeclaration" && + child.name.escapedText === "WebGLConstants" + ) { + firstNode = child; + } + }); + + const printer = typescript.createPrinter({ + removeComments: false, + newLine: typescript.NewLineKind.LineFeed, + }); + + let newSource = ""; + newSource += printer.printNode( + typescript.EmitHint.Unspecified, + firstNode, + node + ); + node.forEachChild((child) => { + if ( + typescript.SyntaxKind[child.kind] !== "EnumDeclaration" || + child.name.escapedText !== "WebGLConstants" + ) { + newSource += printer.printNode( + typescript.EmitHint.Unspecified, + child, + node + ); + newSource += "\n\n"; + } + }); + source = newSource; + + // The next step is to find the list of Cesium modules exported by the Cesium API + // So that we can map these modules with a link back to their original source file. + + var regex = /^declare (function|class|namespace|enum) (.+)/gm; + var matches; + var publicModules = new Set(); + //eslint-disable-next-line no-cond-assign + while ((matches = regex.exec(source))) { + const moduleName = matches[2].match(/([^\s|\(]+)/); + if (moduleName[1] === "CesiumMath") { + moduleName[1] = "Math"; + } + publicModules.add(moduleName[1]); + } + + // Fix up the output to match what we need + // declare => export since we are wrapping everything in a namespace + // CesiumMath => Math (because no CesiumJS build step would be complete without special logic for the Math class) + // Fix up the WebGLConstants aliasing we mentioned above by simply unquoting the strings. + source = source + .replace(/^declare /gm, "export ") + .replace(/CesiumMath/gm, "Math") + .replace( + /= "WebGLConstants\.(.+)"/gm, + (match, p1) => `= WebGLConstants.${p1}` + ); + + // Wrap the source to actually be inside of a declared cesium module. + source = 'declare module "cesium" {\n' + source + "}\n"; + + // Map individual modules back to their source file so that TS still works + // when importing individual files instead of the entire cesium module. + globby.sync(sourceFiles).forEach(function (file) { + file = path.relative("Source", file); + + var moduleId = file; + moduleId = filePathToModuleId(moduleId); + + var assignmentName = path.basename(file, path.extname(file)); + if (publicModules.has(assignmentName)) { + publicModules.delete(assignmentName); + source += `declare module "cesium/Source/${moduleId}" { import { ${assignmentName} } from 'cesium'; export default ${assignmentName}; }\n`; + } + }); + + // Write the final source file back out + fs.writeFileSync("Source/Cesium.d.ts", source); + + // Use tsc to compile it and make sure it is valid + child_process.execSync("node_modules/.bin/tsc Source/Cesium.d.ts --noEmit", { + stdio: "inherit", + }); + + // Below is a sanity check to make sure we didn't leave anything out that + // we don't already know about + + // Intentionally ignored nested items + publicModules.delete("KmlFeatureData"); + publicModules.delete("MaterialAppearance"); + + if (publicModules.size !== 0) { + throw new Error( + "Unexpected unexposed modules: " + + Array.from(publicModules.values()).join(", ") + ); + } +} + function createSpecList() { var specFiles = globby.sync(["Specs/**/*Spec.js"]); diff --git a/package.json b/package.json index 2b1ec9a26936..bcc72607df43 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ }, "main": "index.cjs", "module": "./Source/Cesium.js", + "types": "./Source/Cesium.d.ts", "exports": { "require": "./index.cjs", "import": "./Source/Cesium.js" @@ -83,6 +84,8 @@ "rollup-plugin-strip-pragma": "^1.0.0", "rollup-plugin-uglify": "^6.0.3", "stream-to-promise": "^2.2.0", + "tsd-jsdoc": "^2.5.0", + "typescript": "^3.9.2", "yargs": "^15.0.1" }, "husky": { @@ -96,6 +99,7 @@ "startPublic": "node server.cjs --public", "build": "gulp build", "build-watch": "gulp build-watch", + "build-ts": "gulp build-ts", "buildApps": "gulp buildApps", "clean": "gulp clean", "cloc": "gulp cloc",