diff --git a/.prettierignore b/.prettierignore index d913489d9fd2..c4fbdbbe4e0c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -17,6 +17,7 @@ !**/*.css !**/*.html !**/*.md +!**/*.ts # Re-ignore a few things caught above **/*.min.js diff --git a/CHANGES.md b/CHANGES.md index b42825be19c2..ec1fe5574fd7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,8 @@ - Improved `MaterialProperty` JSDoc and TypeScript type definitions, which were missing the ability to take primitive types in addition to Property instances in their constructor. - Fixed `EllipsoidGeodesic` JSDoc and TypeScript type definitions which incorrectly listed `result` as required. - Fixed a bug with handling of PixelFormat's flipY. [#8893](https://github.com/CesiumGS/cesium/pull/8893) +- Fixed JSDoc and TypeScript type definitions for all `ImageryProvider` types, which were missing `defaultNightAlpha` and `defaultDayAlpha` properties. +- Fixed JSDoc and TypeScript type definitions for `Viewer` options parameter, which was incorrectly listed as required. - Fixed a memory leak where some 3D Tiles requests were being unintentionally retained after the requests were cancelled. [#8843](https://github.com/CesiumGS/cesium/pull/8843) ### 1.70.0 - 2020-06-01 diff --git a/Source/Core/HeadingPitchRange.js b/Source/Core/HeadingPitchRange.js index 974620261628..15741102e771 100644 --- a/Source/Core/HeadingPitchRange.js +++ b/Source/Core/HeadingPitchRange.js @@ -17,6 +17,7 @@ function HeadingPitchRange(heading, pitch, range) { /** * Heading is the rotation from the local north direction where a positive angle is increasing eastward. * @type {Number} + * @default 0.0 */ this.heading = defaultValue(heading, 0.0); @@ -24,12 +25,14 @@ function HeadingPitchRange(heading, pitch, range) { * Pitch is the rotation from the local xy-plane. Positive pitch angles * are above the plane. Negative pitch angles are below the plane. * @type {Number} + * @default 0.0 */ this.pitch = defaultValue(pitch, 0.0); /** * Range is the distance from the center of the local frame. * @type {Number} + * @default 0.0 */ this.range = defaultValue(range, 0.0); } diff --git a/Source/Core/HeadingPitchRoll.js b/Source/Core/HeadingPitchRoll.js index cb037c3c41ce..acfd5c82896c 100644 --- a/Source/Core/HeadingPitchRoll.js +++ b/Source/Core/HeadingPitchRoll.js @@ -15,8 +15,23 @@ import CesiumMath from "./Math.js"; * @param {Number} [roll=0.0] The roll component in radians. */ function HeadingPitchRoll(heading, pitch, roll) { + /** + * Gets or sets the heading. + * @type {Number} + * @default 0.0 + */ this.heading = defaultValue(heading, 0.0); + /** + * Gets or sets the pitch. + * @type {Number} + * @default 0.0 + */ this.pitch = defaultValue(pitch, 0.0); + /** + * Gets or sets the roll. + * @type {Number} + * @default 0.0 + */ this.roll = defaultValue(roll, 0.0); } diff --git a/Source/DataSources/NodeTransformationProperty.js b/Source/DataSources/NodeTransformationProperty.js index 64ef8714a2c8..f5070203484f 100644 --- a/Source/DataSources/NodeTransformationProperty.js +++ b/Source/DataSources/NodeTransformationProperty.js @@ -13,9 +13,9 @@ var defaultNodeTransformation = new TranslationRotationScale(); * @constructor * * @param {Object} [options] Object with the following properties: - * @param {Property} [options.translation=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node. - * @param {Property} [options.rotation=Quaternion.IDENTITY] A {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node. - * @param {Property} [options.scale=new Cartesian3(1.0, 1.0, 1.0)] A {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node. + * @param {Property|Cartesian3} [options.translation=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node. + * @param {Property|Quaternion} [options.rotation=Quaternion.IDENTITY] A {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node. + * @param {Property|Cartesian3} [options.scale=new Cartesian3(1.0, 1.0, 1.0)] A {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node. */ function NodeTransformationProperty(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); diff --git a/Source/DataSources/PositionPropertyArray.js b/Source/DataSources/PositionPropertyArray.js index b4c04259f138..1067d4914735 100644 --- a/Source/DataSources/PositionPropertyArray.js +++ b/Source/DataSources/PositionPropertyArray.js @@ -7,7 +7,7 @@ import ReferenceFrame from "../Core/ReferenceFrame.js"; import Property from "./Property.js"; /** - * A {@link PositionProperty} whose value is an array whose items are the computed value + * A {@link Property} whose value is an array whose items are the computed value * of other PositionProperty instances. * * @alias PositionPropertyArray diff --git a/Source/DataSources/VelocityOrientationProperty.js b/Source/DataSources/VelocityOrientationProperty.js index 6c4c06705590..78c49d7c647c 100644 --- a/Source/DataSources/VelocityOrientationProperty.js +++ b/Source/DataSources/VelocityOrientationProperty.js @@ -16,7 +16,7 @@ import VelocityVectorProperty from "./VelocityVectorProperty.js"; * @alias VelocityOrientationProperty * @constructor * - * @param {Property} [position] The position property used to compute the orientation. + * @param {PositionProperty} [position] The position property used to compute the orientation. * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid used to determine which way is up. * * @example diff --git a/Source/DataSources/VelocityVectorProperty.js b/Source/DataSources/VelocityVectorProperty.js index 8c718bc68353..b5506059e849 100644 --- a/Source/DataSources/VelocityVectorProperty.js +++ b/Source/DataSources/VelocityVectorProperty.js @@ -13,7 +13,7 @@ import Property from "./Property.js"; * @alias VelocityVectorProperty * @constructor * - * @param {Property} [position] The position property used to compute the velocity. + * @param {PositionProperty} [position] The position property used to compute the velocity. * @param {Boolean} [normalize=true] Whether to normalize the computed velocity vector. * * @example diff --git a/Source/Scene/ArcGisMapServerImageryProvider.js b/Source/Scene/ArcGisMapServerImageryProvider.js index b982130e43b2..240154ae2e4b 100644 --- a/Source/Scene/ArcGisMapServerImageryProvider.js +++ b/Source/Scene/ArcGisMapServerImageryProvider.js @@ -101,16 +101,34 @@ function ArcGisMapServerImageryProvider(options) { * The default alpha blending value of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultAlpha = undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultNightAlpha = undefined; + + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultDayAlpha = undefined; + /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultBrightness = undefined; @@ -119,7 +137,7 @@ function ArcGisMapServerImageryProvider(options) { * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultContrast = undefined; @@ -127,7 +145,7 @@ function ArcGisMapServerImageryProvider(options) { /** * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultHue = undefined; @@ -136,7 +154,7 @@ function ArcGisMapServerImageryProvider(options) { * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultSaturation = undefined; @@ -144,7 +162,7 @@ function ArcGisMapServerImageryProvider(options) { /** * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultGamma = undefined; @@ -524,7 +542,7 @@ Object.defineProperties(ArcGisMapServerImageryProvider.prototype, { * Gets the maximum level-of-detail that can be requested. This function should * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. * @memberof ArcGisMapServerImageryProvider.prototype - * @type {Number} + * @type {Number|undefined} * @readonly */ maximumLevel: { diff --git a/Source/Scene/BingMapsImageryProvider.js b/Source/Scene/BingMapsImageryProvider.js index 2e458a5f2e3c..16bedbb4bb3a 100644 --- a/Source/Scene/BingMapsImageryProvider.js +++ b/Source/Scene/BingMapsImageryProvider.js @@ -80,16 +80,34 @@ function BingMapsImageryProvider(options) { * The default alpha blending value of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultAlpha = undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultNightAlpha = undefined; + + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultDayAlpha = undefined; + /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultBrightness = undefined; @@ -98,7 +116,7 @@ function BingMapsImageryProvider(options) { * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultContrast = undefined; @@ -106,7 +124,7 @@ function BingMapsImageryProvider(options) { /** * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultHue = undefined; @@ -115,7 +133,7 @@ function BingMapsImageryProvider(options) { * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultSaturation = undefined; @@ -123,7 +141,7 @@ function BingMapsImageryProvider(options) { /** * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default 1.0 */ this.defaultGamma = 1.0; @@ -404,7 +422,7 @@ Object.defineProperties(BingMapsImageryProvider.prototype, { * Gets the maximum level-of-detail that can be requested. This function should * not be called before {@link BingMapsImageryProvider#ready} returns true. * @memberof BingMapsImageryProvider.prototype - * @type {Number} + * @type {Number|undefined} * @readonly */ maximumLevel: { diff --git a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js index ed6054161d42..54013f15f698 100644 --- a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +++ b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js @@ -100,16 +100,34 @@ function GoogleEarthEnterpriseImageryProvider(options) { * The default alpha blending value of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultAlpha = undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultNightAlpha = undefined; + + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultDayAlpha = undefined; + /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultBrightness = undefined; @@ -118,7 +136,7 @@ function GoogleEarthEnterpriseImageryProvider(options) { * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultContrast = undefined; @@ -126,7 +144,7 @@ function GoogleEarthEnterpriseImageryProvider(options) { /** * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultHue = undefined; @@ -135,7 +153,7 @@ function GoogleEarthEnterpriseImageryProvider(options) { * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultSaturation = undefined; @@ -143,7 +161,7 @@ function GoogleEarthEnterpriseImageryProvider(options) { /** * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultGamma = undefined; @@ -315,7 +333,7 @@ Object.defineProperties(GoogleEarthEnterpriseImageryProvider.prototype, { * Gets the maximum level-of-detail that can be requested. This function should * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. * @memberof GoogleEarthEnterpriseImageryProvider.prototype - * @type {Number} + * @type {Number|undefined} * @readonly */ maximumLevel: { diff --git a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js index 4f3150017bc4..5ac25bf96b81 100644 --- a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +++ b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js @@ -105,16 +105,34 @@ function GoogleEarthEnterpriseMapsProvider(options) { * The default alpha blending value of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultAlpha = undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultNightAlpha = undefined; + + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultDayAlpha = undefined; + /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultBrightness = undefined; @@ -123,7 +141,7 @@ function GoogleEarthEnterpriseMapsProvider(options) { * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultContrast = undefined; @@ -131,7 +149,7 @@ function GoogleEarthEnterpriseMapsProvider(options) { /** * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultHue = undefined; @@ -140,7 +158,7 @@ function GoogleEarthEnterpriseMapsProvider(options) { * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultSaturation = undefined; @@ -148,7 +166,7 @@ function GoogleEarthEnterpriseMapsProvider(options) { /** * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default 1.9 */ this.defaultGamma = 1.9; @@ -425,7 +443,7 @@ Object.defineProperties(GoogleEarthEnterpriseMapsProvider.prototype, { * Gets the maximum level-of-detail that can be requested. This function should * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. * @memberof GoogleEarthEnterpriseMapsProvider.prototype - * @type {Number} + * @type {Number|undefined} * @readonly */ maximumLevel: { diff --git a/Source/Scene/GridImageryProvider.js b/Source/Scene/GridImageryProvider.js index 875bc143f678..1e780c0e6e15 100644 --- a/Source/Scene/GridImageryProvider.js +++ b/Source/Scene/GridImageryProvider.js @@ -44,16 +44,34 @@ function GridImageryProvider(options) { * The default alpha blending value of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultAlpha = undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultNightAlpha = undefined; + + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultDayAlpha = undefined; + /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultBrightness = undefined; @@ -62,7 +80,7 @@ function GridImageryProvider(options) { * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultContrast = undefined; @@ -70,7 +88,7 @@ function GridImageryProvider(options) { /** * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultHue = undefined; @@ -79,7 +97,7 @@ function GridImageryProvider(options) { * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultSaturation = undefined; @@ -87,7 +105,7 @@ function GridImageryProvider(options) { /** * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultGamma = undefined; @@ -177,7 +195,7 @@ Object.defineProperties(GridImageryProvider.prototype, { * Gets the maximum level-of-detail that can be requested. This function should * not be called before {@link GridImageryProvider#ready} returns true. * @memberof GridImageryProvider.prototype - * @type {Number} + * @type {Number|undefined} * @readonly */ maximumLevel: { diff --git a/Source/Scene/ImageryProvider.js b/Source/Scene/ImageryProvider.js index 616bcbcbe8f9..77c53f6975a9 100644 --- a/Source/Scene/ImageryProvider.js +++ b/Source/Scene/ImageryProvider.js @@ -36,7 +36,7 @@ function ImageryProvider() { * The default alpha blending value of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultAlpha = undefined; @@ -45,7 +45,7 @@ function ImageryProvider() { * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultNightAlpha = undefined; @@ -54,7 +54,7 @@ function ImageryProvider() { * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultDayAlpha = undefined; @@ -63,7 +63,7 @@ function ImageryProvider() { * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultBrightness = undefined; @@ -72,7 +72,7 @@ function ImageryProvider() { * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultContrast = undefined; @@ -80,7 +80,7 @@ function ImageryProvider() { /** * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultHue = undefined; @@ -89,7 +89,7 @@ function ImageryProvider() { * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultSaturation = undefined; @@ -97,7 +97,7 @@ function ImageryProvider() { /** * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultGamma = undefined; @@ -179,7 +179,7 @@ Object.defineProperties(ImageryProvider.prototype, { * Gets the maximum level-of-detail that can be requested. This function should * not be called before {@link ImageryProvider#ready} returns true. * @memberof ImageryProvider.prototype - * @type {Number} + * @type {Number|undefined} * @readonly */ maximumLevel: { diff --git a/Source/Scene/IonImageryProvider.js b/Source/Scene/IonImageryProvider.js index bea2963e3e50..d13495957e94 100644 --- a/Source/Scene/IonImageryProvider.js +++ b/Source/Scene/IonImageryProvider.js @@ -69,16 +69,34 @@ function IonImageryProvider(options) { * The default alpha blending value of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultAlpha = undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultNightAlpha = undefined; + + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultDayAlpha = undefined; + /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultBrightness = undefined; @@ -87,7 +105,7 @@ function IonImageryProvider(options) { * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultContrast = undefined; @@ -95,7 +113,7 @@ function IonImageryProvider(options) { /** * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultHue = undefined; @@ -104,7 +122,7 @@ function IonImageryProvider(options) { * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultSaturation = undefined; @@ -112,7 +130,7 @@ function IonImageryProvider(options) { /** * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultGamma = undefined; @@ -289,7 +307,7 @@ Object.defineProperties(IonImageryProvider.prototype, { * Gets the maximum level-of-detail that can be requested. This function should * not be called before {@link IonImageryProvider#ready} returns true. * @memberof IonImageryProvider.prototype - * @type {Number} + * @type {Number|undefined} * @readonly */ maximumLevel: { diff --git a/Source/Scene/MapboxImageryProvider.js b/Source/Scene/MapboxImageryProvider.js index 0ffa60334167..79caf55821b6 100644 --- a/Source/Scene/MapboxImageryProvider.js +++ b/Source/Scene/MapboxImageryProvider.js @@ -60,16 +60,34 @@ function MapboxImageryProvider(options) { * The default alpha blending value of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultAlpha = undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultNightAlpha = undefined; + + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultDayAlpha = undefined; + /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultBrightness = undefined; @@ -78,7 +96,7 @@ function MapboxImageryProvider(options) { * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultContrast = undefined; @@ -86,7 +104,7 @@ function MapboxImageryProvider(options) { /** * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultHue = undefined; @@ -95,7 +113,7 @@ function MapboxImageryProvider(options) { * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultSaturation = undefined; @@ -103,7 +121,7 @@ function MapboxImageryProvider(options) { /** * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultGamma = undefined; @@ -253,7 +271,7 @@ Object.defineProperties(MapboxImageryProvider.prototype, { * Gets the maximum level-of-detail that can be requested. This function should * not be called before {@link MapboxImageryProvider#ready} returns true. * @memberof MapboxImageryProvider.prototype - * @type {Number} + * @type {Number|undefined} * @readonly */ maximumLevel: { diff --git a/Source/Scene/MapboxStyleImageryProvider.js b/Source/Scene/MapboxStyleImageryProvider.js index c1a063fe7c19..6c51a414b32f 100644 --- a/Source/Scene/MapboxStyleImageryProvider.js +++ b/Source/Scene/MapboxStyleImageryProvider.js @@ -62,16 +62,34 @@ function MapboxStyleImageryProvider(options) { * The default alpha blending value of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultAlpha = undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultNightAlpha = undefined; + + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultDayAlpha = undefined; + /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultBrightness = undefined; @@ -80,7 +98,7 @@ function MapboxStyleImageryProvider(options) { * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultContrast = undefined; @@ -88,7 +106,7 @@ function MapboxStyleImageryProvider(options) { /** * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultHue = undefined; @@ -97,7 +115,7 @@ function MapboxStyleImageryProvider(options) { * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultSaturation = undefined; @@ -105,7 +123,7 @@ function MapboxStyleImageryProvider(options) { /** * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultGamma = undefined; @@ -265,7 +283,7 @@ Object.defineProperties(MapboxStyleImageryProvider.prototype, { * Gets the maximum level-of-detail that can be requested. This function should * not be called before {@link MapboxStyleImageryProvider#ready} returns true. * @memberof MapboxStyleImageryProvider.prototype - * @type {Number} + * @type {Number|undefined} * @readonly */ maximumLevel: { diff --git a/Source/Scene/SingleTileImageryProvider.js b/Source/Scene/SingleTileImageryProvider.js index 070344f0452e..f78fe92e4649 100644 --- a/Source/Scene/SingleTileImageryProvider.js +++ b/Source/Scene/SingleTileImageryProvider.js @@ -52,16 +52,34 @@ function SingleTileImageryProvider(options) { * The default alpha blending value of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultAlpha = undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultNightAlpha = undefined; + + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultDayAlpha = undefined; + /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultBrightness = undefined; @@ -70,7 +88,7 @@ function SingleTileImageryProvider(options) { * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultContrast = undefined; @@ -78,7 +96,7 @@ function SingleTileImageryProvider(options) { /** * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultHue = undefined; @@ -87,7 +105,7 @@ function SingleTileImageryProvider(options) { * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultSaturation = undefined; @@ -95,7 +113,7 @@ function SingleTileImageryProvider(options) { /** * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultGamma = undefined; @@ -249,7 +267,7 @@ Object.defineProperties(SingleTileImageryProvider.prototype, { * Gets the maximum level-of-detail that can be requested. This function should * not be called before {@link SingleTileImageryProvider#ready} returns true. * @memberof SingleTileImageryProvider.prototype - * @type {Number} + * @type {Number|undefined} * @readonly */ maximumLevel: { diff --git a/Source/Scene/TileCoordinatesImageryProvider.js b/Source/Scene/TileCoordinatesImageryProvider.js index 6f5c6f66c320..7194766bcefd 100644 --- a/Source/Scene/TileCoordinatesImageryProvider.js +++ b/Source/Scene/TileCoordinatesImageryProvider.js @@ -27,7 +27,7 @@ import when from "../ThirdParty/when.js"; * @alias TileCoordinatesImageryProvider * @constructor * - * @param {TileCoordinatesImageryProvider.ConstructorOptions} options Object describing initialization options + * @param {TileCoordinatesImageryProvider.ConstructorOptions} [options] Object describing initialization options */ function TileCoordinatesImageryProvider(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); @@ -45,16 +45,34 @@ function TileCoordinatesImageryProvider(options) { * The default alpha blending value of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultAlpha = undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultNightAlpha = undefined; + + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultDayAlpha = undefined; + /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultBrightness = undefined; @@ -63,7 +81,7 @@ function TileCoordinatesImageryProvider(options) { * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultContrast = undefined; @@ -71,7 +89,7 @@ function TileCoordinatesImageryProvider(options) { /** * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultHue = undefined; @@ -80,7 +98,7 @@ function TileCoordinatesImageryProvider(options) { * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultSaturation = undefined; @@ -88,7 +106,7 @@ function TileCoordinatesImageryProvider(options) { /** * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultGamma = undefined; @@ -153,7 +171,7 @@ Object.defineProperties(TileCoordinatesImageryProvider.prototype, { * Gets the maximum level-of-detail that can be requested. This function should * not be called before {@link TileCoordinatesImageryProvider#ready} returns true. * @memberof TileCoordinatesImageryProvider.prototype - * @type {Number} + * @type {Number|undefined} * @readonly */ maximumLevel: { diff --git a/Source/Scene/UrlTemplateImageryProvider.js b/Source/Scene/UrlTemplateImageryProvider.js index 11ad3d14f5f6..3a8482c1f39a 100644 --- a/Source/Scene/UrlTemplateImageryProvider.js +++ b/Source/Scene/UrlTemplateImageryProvider.js @@ -220,16 +220,34 @@ function UrlTemplateImageryProvider(options) { * The default alpha blending value of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultAlpha = undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultNightAlpha = undefined; + + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultDayAlpha = undefined; + /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultBrightness = undefined; @@ -238,7 +256,7 @@ function UrlTemplateImageryProvider(options) { * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultContrast = undefined; @@ -246,7 +264,7 @@ function UrlTemplateImageryProvider(options) { /** * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultHue = undefined; @@ -255,7 +273,7 @@ function UrlTemplateImageryProvider(options) { * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultSaturation = undefined; @@ -263,7 +281,7 @@ function UrlTemplateImageryProvider(options) { /** * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultGamma = undefined; @@ -439,7 +457,7 @@ Object.defineProperties(UrlTemplateImageryProvider.prototype, { * Gets the maximum level-of-detail that can be requested, or undefined if there is no limit. * This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true. * @memberof UrlTemplateImageryProvider.prototype - * @type {Number} + * @type {Number|undefined} * @readonly * @default undefined */ diff --git a/Source/Scene/WebMapServiceImageryProvider.js b/Source/Scene/WebMapServiceImageryProvider.js index 617aa081fcd8..c529269da2a5 100644 --- a/Source/Scene/WebMapServiceImageryProvider.js +++ b/Source/Scene/WebMapServiceImageryProvider.js @@ -98,16 +98,34 @@ function WebMapServiceImageryProvider(options) { * The default alpha blending value of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultAlpha = undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultNightAlpha = undefined; + + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultDayAlpha = undefined; + /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultBrightness = undefined; @@ -116,7 +134,7 @@ function WebMapServiceImageryProvider(options) { * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultContrast = undefined; @@ -124,7 +142,7 @@ function WebMapServiceImageryProvider(options) { /** * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultHue = undefined; @@ -133,7 +151,7 @@ function WebMapServiceImageryProvider(options) { * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultSaturation = undefined; @@ -141,7 +159,7 @@ function WebMapServiceImageryProvider(options) { /** * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultGamma = undefined; @@ -368,7 +386,7 @@ Object.defineProperties(WebMapServiceImageryProvider.prototype, { * Gets the maximum level-of-detail that can be requested. This function should * not be called before {@link WebMapServiceImageryProvider#ready} returns true. * @memberof WebMapServiceImageryProvider.prototype - * @type {Number} + * @type {Number|undefined} * @readonly */ maximumLevel: { diff --git a/Source/Scene/WebMapTileServiceImageryProvider.js b/Source/Scene/WebMapTileServiceImageryProvider.js index 3f95803b98cb..2b3c14755ca6 100644 --- a/Source/Scene/WebMapTileServiceImageryProvider.js +++ b/Source/Scene/WebMapTileServiceImageryProvider.js @@ -141,16 +141,34 @@ function WebMapTileServiceImageryProvider(options) { * The default alpha blending value of this provider, with 0.0 representing fully transparent and * 1.0 representing fully opaque. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultAlpha = undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultNightAlpha = undefined; + + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number|undefined} + * @default undefined + */ + this.defaultDayAlpha = undefined; + /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 * makes the imagery darker while greater than 1.0 makes it brighter. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultBrightness = undefined; @@ -159,7 +177,7 @@ function WebMapTileServiceImageryProvider(options) { * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces * the contrast while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultContrast = undefined; @@ -167,7 +185,7 @@ function WebMapTileServiceImageryProvider(options) { /** * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultHue = undefined; @@ -176,7 +194,7 @@ function WebMapTileServiceImageryProvider(options) { * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the * saturation while greater than 1.0 increases it. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultSaturation = undefined; @@ -184,7 +202,7 @@ function WebMapTileServiceImageryProvider(options) { /** * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. * - * @type {Number} + * @type {Number|undefined} * @default undefined */ this.defaultGamma = undefined; @@ -414,7 +432,7 @@ Object.defineProperties(WebMapTileServiceImageryProvider.prototype, { * Gets the maximum level-of-detail that can be requested. This function should * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. * @memberof WebMapTileServiceImageryProvider.prototype - * @type {Number} + * @type {Number|undefined} * @readonly */ maximumLevel: { diff --git a/Source/Widgets/Viewer/Viewer.js b/Source/Widgets/Viewer/Viewer.js index c9d7b4e3c4af..fc205ed446f2 100644 --- a/Source/Widgets/Viewer/Viewer.js +++ b/Source/Widgets/Viewer/Viewer.js @@ -269,7 +269,7 @@ function enableVRUI(viewer, enabled) { * @constructor * * @param {Element|String} container The DOM element or ID that will contain the widget. - * @param {Viewer.ConstructorOptions} options Object describing initialization options + * @param {Viewer.ConstructorOptions} [options] Object describing initialization options * * @exception {DeveloperError} Element with id "container" does not exist in the document. * @exception {DeveloperError} options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget, specify options.imageryProvider instead. diff --git a/Specs/TypeScript/index.ts b/Specs/TypeScript/index.ts new file mode 100644 index 000000000000..4e07cba7180e --- /dev/null +++ b/Specs/TypeScript/index.ts @@ -0,0 +1,160 @@ +import { + ArcGisMapServerImageryProvider, + BingMapsImageryProvider, + ImageryProvider, + WebMapServiceImageryProvider, + OpenStreetMapImageryProvider, + TileMapServiceImageryProvider, + GoogleEarthEnterpriseImageryProvider, + GoogleEarthEnterpriseMapsProvider, + GridImageryProvider, + IonImageryProvider, + MapboxImageryProvider, + MapboxStyleImageryProvider, + SingleTileImageryProvider, + TileCoordinatesImageryProvider, + UrlTemplateImageryProvider, + WebMapTileServiceImageryProvider, + GoogleEarthEnterpriseMetadata, + TerrainProvider, + ArcGISTiledElevationTerrainProvider, + CesiumTerrainProvider, + EllipsoidTerrainProvider, + GoogleEarthEnterpriseTerrainProvider, + VRTheWorldTerrainProvider, + DataSource, + CzmlDataSource, + GeoJsonDataSource, + KmlDataSource, + CustomDataSource, + Camera, + Scene, + Property, + PropertyBag, + ConstantProperty, + SampledProperty, + PositionProperty, + SampledPositionProperty, + TimeIntervalCollectionProperty, + CompositeProperty, + CompositePositionProperty, + Cartesian3, + ReferenceProperty, + MaterialProperty, + EntityCollection, + CallbackProperty, + ConstantPositionProperty, + TimeIntervalCollectionPositionProperty, + ColorMaterialProperty, + CompositeMaterialProperty, + GridMaterialProperty, + ImageMaterialProperty, + PolylineGlowMaterialProperty, + PolylineOutlineMaterialProperty, + StripeMaterialProperty, + CheckerboardMaterialProperty, + PolylineDashMaterialProperty, + VelocityVectorProperty, + VelocityOrientationProperty, + PropertyArray, + PositionPropertyArray, + PolylineArrowMaterialProperty, + NodeTransformationProperty, +} from "cesium"; + +// Verify ImageryProvider instances conform to the expected interface +let imageryProvider: ImageryProvider; +imageryProvider = new WebMapServiceImageryProvider({ url: "", layers: "0" }); +imageryProvider = new BingMapsImageryProvider({ url: "" }); +imageryProvider = new ArcGisMapServerImageryProvider({ url: "" }); +imageryProvider = new BingMapsImageryProvider({ url: "" }); +imageryProvider = new OpenStreetMapImageryProvider({ url: "" }); +imageryProvider = new TileMapServiceImageryProvider({ url: "" }); +imageryProvider = new GridImageryProvider({ url: "" }); +imageryProvider = new IonImageryProvider({ assetId: 2 }); +imageryProvider = new MapboxImageryProvider({ mapId: "" }); +imageryProvider = new MapboxStyleImageryProvider({ styleId: "" }); +imageryProvider = new SingleTileImageryProvider({ url: "" }); +imageryProvider = new TileCoordinatesImageryProvider(); +imageryProvider = new UrlTemplateImageryProvider({ url: "" }); +imageryProvider = new WebMapServiceImageryProvider({ url: "", layers: "" }); +imageryProvider = new GoogleEarthEnterpriseImageryProvider({ + url: "", + metadata: new GoogleEarthEnterpriseMetadata(""), +}); +imageryProvider = new GoogleEarthEnterpriseMapsProvider({ + url: "", + channel: 1, +}); +imageryProvider = new WebMapTileServiceImageryProvider({ + url: "", + layer: "", + style: "", + tileMatrixSetID: "", +}); + +// Verify TerrainProvider instances conform to the expected interface +let terrainProvider: TerrainProvider; +terrainProvider = new ArcGISTiledElevationTerrainProvider({ url: "" }); +terrainProvider = new CesiumTerrainProvider({ url: "" }); +terrainProvider = new EllipsoidTerrainProvider(); +terrainProvider = new VRTheWorldTerrainProvider({ url: "" }); +terrainProvider = new GoogleEarthEnterpriseTerrainProvider({ + url: "", + metadata: new GoogleEarthEnterpriseMetadata(""), +}); + +// Verify DataSource instances conform to the expected interface +let dataSource: DataSource; +dataSource = new CzmlDataSource(); +dataSource = new GeoJsonDataSource(); +dataSource = new KmlDataSource({ + canvas: document.createElement("canvas"), + camera: new Camera(new Scene()), +}); +dataSource = new CustomDataSource(); + +// Verify Property instances conform to the expected interface +let property: Property; +property = new CallbackProperty(() => 0, false); +property = new ConstantProperty(1); +property = new TimeIntervalCollectionProperty(); +property = new CompositeProperty(); +property = new SampledProperty(Cartesian3); +property = new PropertyBag(); +property = new PropertyArray(); +property = new PositionProperty(); +property = new MaterialProperty(); +property = new VelocityVectorProperty(); +property = new VelocityOrientationProperty(); +property = new PositionPropertyArray(); +property = new NodeTransformationProperty(); +property = new ReferenceProperty(new EntityCollection(), "object1", [ + "billboard", + "scale", +]); + +// Verify PositionProperty instances conform to the expected PositionProperty and Property interfaces +let positionProperty: PositionProperty; +property = positionProperty = new SampledPositionProperty(); +property = positionProperty = new CompositePositionProperty(); +property = positionProperty = new ConstantPositionProperty(); +property = positionProperty = new TimeIntervalCollectionPositionProperty(); +property = positionProperty = new ReferenceProperty( + new EntityCollection(), + "object1", + ["billboard", "scale"] +); + +// Verify MaterialProperty instances conform to the expected MaterialProperty and Property interfaces +let materialProperty: MaterialProperty; +property = materialProperty = new ColorMaterialProperty(); +property = materialProperty = new CompositeMaterialProperty(); +property = materialProperty = new GridMaterialProperty(); +property = materialProperty = new ImageMaterialProperty(); +property = materialProperty = new PolylineGlowMaterialProperty(); +property = materialProperty = new PolylineOutlineMaterialProperty(); +property = materialProperty = new StripeMaterialProperty(); +property = materialProperty = new CheckerboardMaterialProperty(); +property = materialProperty = new PolylineDashMaterialProperty(); +property = materialProperty = new PolylineArrowMaterialProperty(); diff --git a/Specs/TypeScript/tsconfig.json b/Specs/TypeScript/tsconfig.json new file mode 100644 index 000000000000..3f83cf741b1a --- /dev/null +++ b/Specs/TypeScript/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "noEmit": true, + "types": [], + "strict": true + }, + "include": [ + "../.." + ], +} \ No newline at end of file diff --git a/gulpfile.cjs b/gulpfile.cjs index 4d8a703910ac..93c5c34b78cf 100644 --- a/gulpfile.cjs +++ b/gulpfile.cjs @@ -1594,6 +1594,11 @@ ${source} stdio: "inherit", }); + // Also compile our smokescreen to make sure interfaces work as expected. + child_process.execSync("npx tsc -p Specs/TypeScript/tsconfig.json", { + stdio: "inherit", + }); + // Below is a sanity check to make sure we didn't leave anything out that // we don't already know about