Skip to content

Commit 7e5c468

Browse files
committed
Add additional smokescreen to build-ts
1. Add a Specs/TypeScript directory with a minimal TS configuration that uses the d.ts files generated by build-ts 2. Have `build-ts` compile index.ts from this directory which makes sure various types actually conform to their expected interfaces. 3. Fix ImageryProvider interfaces which had issues exposed by this new test. In the future we can add any additional smokescreens that we think are important to validate our definitions going forward, but this will never be a fully exhaustive check. We currently don't actually execute the output, it's just there for compile-time checking. We can revisit this if we ever feel that it's needed.
1 parent f1aac14 commit 7e5c468

18 files changed

+394
-2
lines changed

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
!**/*.css
1818
!**/*.html
1919
!**/*.md
20+
!**/*.ts
2021

2122
# Re-ignore a few things caught above
2223
**/*.min.js

Source/Scene/ArcGisMapServerImageryProvider.js

+18
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,24 @@ function ArcGisMapServerImageryProvider(options) {
106106
*/
107107
this.defaultAlpha = undefined;
108108

109+
/**
110+
* The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
111+
* 1.0 representing fully opaque.
112+
*
113+
* @type {Number}
114+
* @default undefined
115+
*/
116+
this.defaultNightAlpha = undefined;
117+
118+
/**
119+
* The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
120+
* 1.0 representing fully opaque.
121+
*
122+
* @type {Number}
123+
* @default undefined
124+
*/
125+
this.defaultDayAlpha = undefined;
126+
109127
/**
110128
* The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
111129
* makes the imagery darker while greater than 1.0 makes it brighter.

Source/Scene/BingMapsImageryProvider.js

+18
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,24 @@ function BingMapsImageryProvider(options) {
8585
*/
8686
this.defaultAlpha = undefined;
8787

88+
/**
89+
* The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
90+
* 1.0 representing fully opaque.
91+
*
92+
* @type {Number}
93+
* @default undefined
94+
*/
95+
this.defaultNightAlpha = undefined;
96+
97+
/**
98+
* The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
99+
* 1.0 representing fully opaque.
100+
*
101+
* @type {Number}
102+
* @default undefined
103+
*/
104+
this.defaultDayAlpha = undefined;
105+
88106
/**
89107
* The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
90108
* makes the imagery darker while greater than 1.0 makes it brighter.

Source/Scene/GoogleEarthEnterpriseImageryProvider.js

+18
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@ function GoogleEarthEnterpriseImageryProvider(options) {
105105
*/
106106
this.defaultAlpha = undefined;
107107

108+
/**
109+
* The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
110+
* 1.0 representing fully opaque.
111+
*
112+
* @type {Number}
113+
* @default undefined
114+
*/
115+
this.defaultNightAlpha = undefined;
116+
117+
/**
118+
* The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
119+
* 1.0 representing fully opaque.
120+
*
121+
* @type {Number}
122+
* @default undefined
123+
*/
124+
this.defaultDayAlpha = undefined;
125+
108126
/**
109127
* The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
110128
* makes the imagery darker while greater than 1.0 makes it brighter.

Source/Scene/GoogleEarthEnterpriseMapsProvider.js

+18
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,24 @@ function GoogleEarthEnterpriseMapsProvider(options) {
110110
*/
111111
this.defaultAlpha = undefined;
112112

113+
/**
114+
* The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
115+
* 1.0 representing fully opaque.
116+
*
117+
* @type {Number}
118+
* @default undefined
119+
*/
120+
this.defaultNightAlpha = undefined;
121+
122+
/**
123+
* The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
124+
* 1.0 representing fully opaque.
125+
*
126+
* @type {Number}
127+
* @default undefined
128+
*/
129+
this.defaultDayAlpha = undefined;
130+
113131
/**
114132
* The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
115133
* makes the imagery darker while greater than 1.0 makes it brighter.

Source/Scene/GridImageryProvider.js

+18
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,24 @@ function GridImageryProvider(options) {
4949
*/
5050
this.defaultAlpha = undefined;
5151

52+
/**
53+
* The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
54+
* 1.0 representing fully opaque.
55+
*
56+
* @type {Number}
57+
* @default undefined
58+
*/
59+
this.defaultNightAlpha = undefined;
60+
61+
/**
62+
* The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
63+
* 1.0 representing fully opaque.
64+
*
65+
* @type {Number}
66+
* @default undefined
67+
*/
68+
this.defaultDayAlpha = undefined;
69+
5270
/**
5371
* The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
5472
* makes the imagery darker while greater than 1.0 makes it brighter.

Source/Scene/IonImageryProvider.js

+18
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,24 @@ function IonImageryProvider(options) {
7474
*/
7575
this.defaultAlpha = undefined;
7676

77+
/**
78+
* The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
79+
* 1.0 representing fully opaque.
80+
*
81+
* @type {Number}
82+
* @default undefined
83+
*/
84+
this.defaultNightAlpha = undefined;
85+
86+
/**
87+
* The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
88+
* 1.0 representing fully opaque.
89+
*
90+
* @type {Number}
91+
* @default undefined
92+
*/
93+
this.defaultDayAlpha = undefined;
94+
7795
/**
7896
* The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
7997
* makes the imagery darker while greater than 1.0 makes it brighter.

Source/Scene/MapboxImageryProvider.js

+18
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,24 @@ function MapboxImageryProvider(options) {
6565
*/
6666
this.defaultAlpha = undefined;
6767

68+
/**
69+
* The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
70+
* 1.0 representing fully opaque.
71+
*
72+
* @type {Number}
73+
* @default undefined
74+
*/
75+
this.defaultNightAlpha = undefined;
76+
77+
/**
78+
* The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
79+
* 1.0 representing fully opaque.
80+
*
81+
* @type {Number}
82+
* @default undefined
83+
*/
84+
this.defaultDayAlpha = undefined;
85+
6886
/**
6987
* The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
7088
* makes the imagery darker while greater than 1.0 makes it brighter.

Source/Scene/MapboxStyleImageryProvider.js

+18
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,24 @@ function MapboxStyleImageryProvider(options) {
6767
*/
6868
this.defaultAlpha = undefined;
6969

70+
/**
71+
* The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
72+
* 1.0 representing fully opaque.
73+
*
74+
* @type {Number}
75+
* @default undefined
76+
*/
77+
this.defaultNightAlpha = undefined;
78+
79+
/**
80+
* The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
81+
* 1.0 representing fully opaque.
82+
*
83+
* @type {Number}
84+
* @default undefined
85+
*/
86+
this.defaultDayAlpha = undefined;
87+
7088
/**
7189
* The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
7290
* makes the imagery darker while greater than 1.0 makes it brighter.

Source/Scene/SingleTileImageryProvider.js

+18
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,24 @@ function SingleTileImageryProvider(options) {
5757
*/
5858
this.defaultAlpha = undefined;
5959

60+
/**
61+
* The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
62+
* 1.0 representing fully opaque.
63+
*
64+
* @type {Number}
65+
* @default undefined
66+
*/
67+
this.defaultNightAlpha = undefined;
68+
69+
/**
70+
* The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
71+
* 1.0 representing fully opaque.
72+
*
73+
* @type {Number}
74+
* @default undefined
75+
*/
76+
this.defaultDayAlpha = undefined;
77+
6078
/**
6179
* The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
6280
* makes the imagery darker while greater than 1.0 makes it brighter.

Source/Scene/TileCoordinatesImageryProvider.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import when from "../ThirdParty/when.js";
2727
* @alias TileCoordinatesImageryProvider
2828
* @constructor
2929
*
30-
* @param {TileCoordinatesImageryProvider.ConstructorOptions} options Object describing initialization options
30+
* @param {TileCoordinatesImageryProvider.ConstructorOptions} [options] Object describing initialization options
3131
*/
3232
function TileCoordinatesImageryProvider(options) {
3333
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
@@ -50,6 +50,24 @@ function TileCoordinatesImageryProvider(options) {
5050
*/
5151
this.defaultAlpha = undefined;
5252

53+
/**
54+
* The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
55+
* 1.0 representing fully opaque.
56+
*
57+
* @type {Number}
58+
* @default undefined
59+
*/
60+
this.defaultNightAlpha = undefined;
61+
62+
/**
63+
* The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
64+
* 1.0 representing fully opaque.
65+
*
66+
* @type {Number}
67+
* @default undefined
68+
*/
69+
this.defaultDayAlpha = undefined;
70+
5371
/**
5472
* The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
5573
* makes the imagery darker while greater than 1.0 makes it brighter.

Source/Scene/UrlTemplateImageryProvider.js

+18
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,24 @@ function UrlTemplateImageryProvider(options) {
225225
*/
226226
this.defaultAlpha = undefined;
227227

228+
/**
229+
* The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
230+
* 1.0 representing fully opaque.
231+
*
232+
* @type {Number}
233+
* @default undefined
234+
*/
235+
this.defaultNightAlpha = undefined;
236+
237+
/**
238+
* The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
239+
* 1.0 representing fully opaque.
240+
*
241+
* @type {Number}
242+
* @default undefined
243+
*/
244+
this.defaultDayAlpha = undefined;
245+
228246
/**
229247
* The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
230248
* makes the imagery darker while greater than 1.0 makes it brighter.

Source/Scene/WebMapServiceImageryProvider.js

+18
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,24 @@ function WebMapServiceImageryProvider(options) {
103103
*/
104104
this.defaultAlpha = undefined;
105105

106+
/**
107+
* The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
108+
* 1.0 representing fully opaque.
109+
*
110+
* @type {Number}
111+
* @default undefined
112+
*/
113+
this.defaultNightAlpha = undefined;
114+
115+
/**
116+
* The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
117+
* 1.0 representing fully opaque.
118+
*
119+
* @type {Number}
120+
* @default undefined
121+
*/
122+
this.defaultDayAlpha = undefined;
123+
106124
/**
107125
* The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
108126
* makes the imagery darker while greater than 1.0 makes it brighter.

Source/Scene/WebMapTileServiceImageryProvider.js

+18
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,24 @@ function WebMapTileServiceImageryProvider(options) {
146146
*/
147147
this.defaultAlpha = undefined;
148148

149+
/**
150+
* The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
151+
* 1.0 representing fully opaque.
152+
*
153+
* @type {Number}
154+
* @default undefined
155+
*/
156+
this.defaultNightAlpha = undefined;
157+
158+
/**
159+
* The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
160+
* 1.0 representing fully opaque.
161+
*
162+
* @type {Number}
163+
* @default undefined
164+
*/
165+
this.defaultDayAlpha = undefined;
166+
149167
/**
150168
* The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
151169
* makes the imagery darker while greater than 1.0 makes it brighter.

Source/Widgets/Viewer/Viewer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ function enableVRUI(viewer, enabled) {
269269
* @constructor
270270
*
271271
* @param {Element|String} container The DOM element or ID that will contain the widget.
272-
* @param {Viewer.ConstructorOptions} options Object describing initialization options
272+
* @param {Viewer.ConstructorOptions} [options] Object describing initialization options
273273
*
274274
* @exception {DeveloperError} Element with id "container" does not exist in the document.
275275
* @exception {DeveloperError} options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget, specify options.imageryProvider instead.

0 commit comments

Comments
 (0)