Skip to content

Commit 67e27a7

Browse files
committed
Explicitly return when (not native) Promise
1 parent 78606b8 commit 67e27a7

File tree

69 files changed

+161
-187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+161
-187
lines changed

Source/Core/ApproximateTerrainHeights.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var ApproximateTerrainHeights = {};
3636

3737
/**
3838
* Initializes the minimum and maximum terrain heights
39-
* @return {Promise<void>}
39+
* @return {when.Promise.<void>}
4040
*/
4141
ApproximateTerrainHeights.initialize = function () {
4242
var initPromise = ApproximateTerrainHeights._initPromise;

Source/Core/ArcGISTiledElevationTerrainProvider.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ Object.defineProperties(ArcGISTiledElevationTerrainProvider.prototype, {
264264
/**
265265
* Gets a promise that resolves to true when the provider is ready for use.
266266
* @memberof ArcGISTiledElevationTerrainProvider.prototype
267-
* @type {Promise.<Boolean>}
267+
* @type {when.Promise<Boolean>}
268268
* @readonly
269269
*/
270270
readyPromise: {
@@ -332,7 +332,7 @@ Object.defineProperties(ArcGISTiledElevationTerrainProvider.prototype, {
332332
* @param {Number} y The Y coordinate of the tile for which to request geometry.
333333
* @param {Number} level The level of the tile for which to request geometry.
334334
* @param {Request} [request] The request object. Intended for internal use only.
335-
* @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method
335+
* @returns {when.Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method
336336
* returns undefined instead of a promise, it is an indication that too many requests are already
337337
* pending and the request will be retried later.
338338
*/
@@ -486,7 +486,7 @@ ArcGISTiledElevationTerrainProvider.prototype.getTileDataAvailable = function (
486486
* @param {Number} x The X coordinate of the tile for which to request geometry.
487487
* @param {Number} y The Y coordinate of the tile for which to request geometry.
488488
* @param {Number} level The level of the tile for which to request geometry.
489-
* @returns {undefined|Promise<void>} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
489+
* @returns {undefined} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
490490
*/
491491
ArcGISTiledElevationTerrainProvider.prototype.loadTileDataAvailability = function (
492492
x,

Source/Core/BingMapsGeocoderService.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Object.defineProperties(BingMapsGeocoderService.prototype, {
6464
* @function
6565
*
6666
* @param {String} query The query to be sent to the geocoder service
67-
* @returns {Promise<GeocoderService.Result[]>}
67+
* @returns {when.Promise<GeocoderService.Result[]>}
6868
*/
6969
BingMapsGeocoderService.prototype.geocode = function (query) {
7070
//>>includeStart('debug', pragmas.debug);

Source/Core/CartographicGeocoderService.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function CartographicGeocoderService() {}
1515
* @function
1616
*
1717
* @param {String} query The query to be sent to the geocoder service
18-
* @returns {Promise<GeocoderService.Result[]>}
18+
* @returns {when.Promise<GeocoderService.Result[]>}
1919
*/
2020
CartographicGeocoderService.prototype.geocode = function (query) {
2121
//>>includeStart('debug', pragmas.debug);

Source/Core/CesiumTerrainProvider.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ function createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) {
804804
* @param {Number} level The level of the tile for which to request geometry.
805805
* @param {Request} [request] The request object. Intended for internal use only.
806806
*
807-
* @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method
807+
* @returns {when.Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method
808808
* returns undefined instead of a promise, it is an indication that too many requests are already
809809
* pending and the request will be retried later.
810810
*
@@ -1007,7 +1007,7 @@ Object.defineProperties(CesiumTerrainProvider.prototype, {
10071007
/**
10081008
* Gets a promise that resolves to true when the provider is ready for use.
10091009
* @memberof CesiumTerrainProvider.prototype
1010-
* @type {Promise.<Boolean>}
1010+
* @type {when.Promise<Boolean>}
10111011
* @readonly
10121012
*/
10131013
readyPromise: {

Source/Core/EarthOrientationParameters.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ EarthOrientationParameters.NONE = Object.freeze({
136136
* Gets a promise that, when resolved, indicates that the EOP data has been loaded and is
137137
* ready to use.
138138
*
139-
* @returns {Promise<void>} The promise.
139+
* @returns {when.Promise<void>} The promise.
140140
*/
141141
EarthOrientationParameters.prototype.getPromiseToLoad = function () {
142142
return when(this._downloadPromise);

Source/Core/EllipsoidTerrainProvider.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Object.defineProperties(EllipsoidTerrainProvider.prototype, {
102102
/**
103103
* Gets a promise that resolves to true when the provider is ready for use.
104104
* @memberof EllipsoidTerrainProvider.prototype
105-
* @type {Promise.<Boolean>}
105+
* @type {when.Promise<Boolean>}
106106
* @readonly
107107
*/
108108
readyPromise: {
@@ -164,7 +164,7 @@ Object.defineProperties(EllipsoidTerrainProvider.prototype, {
164164
* @param {Number} level The level of the tile for which to request geometry.
165165
* @param {Request} [request] The request object. Intended for internal use only.
166166
*
167-
* @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method
167+
* @returns {when.Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method
168168
* returns undefined instead of a promise, it is an indication that too many requests are already
169169
* pending and the request will be retried later.
170170
*/
@@ -219,7 +219,7 @@ EllipsoidTerrainProvider.prototype.getTileDataAvailable = function (
219219
* @param {Number} x The X coordinate of the tile for which to request geometry.
220220
* @param {Number} y The Y coordinate of the tile for which to request geometry.
221221
* @param {Number} level The level of the tile for which to request geometry.
222-
* @returns {undefined|Promise<void>} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
222+
* @returns {undefined} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
223223
*/
224224
EllipsoidTerrainProvider.prototype.loadTileDataAvailability = function (
225225
x,

Source/Core/GeocoderService.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function GeocoderService() {}
2323
*
2424
* @param {String} query The query to be sent to the geocoder service
2525
* @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform.
26-
* @returns {Promise<GeocoderService.Result[]>}
26+
* @returns {when.Promise<GeocoderService.Result[]>}
2727
*/
2828
GeocoderService.prototype.geocode = DeveloperError.throwInstantiationError;
2929
export default GeocoderService;

Source/Core/GoogleEarthEnterpriseMetadata.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Object.defineProperties(GoogleEarthEnterpriseMetadata.prototype, {
172172
/**
173173
* Gets a promise that resolves to true when the metadata is ready for use.
174174
* @memberof GoogleEarthEnterpriseMetadata.prototype
175-
* @type {Promise.<Boolean>}
175+
* @type {when.Promise<Boolean>}
176176
* @readonly
177177
*/
178178
readyPromise: {
@@ -380,7 +380,7 @@ GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket = function (
380380
* @param {Number} level The tile level.
381381
* @param {Request} [request] The request object. Intended for internal use only.
382382
*
383-
* @returns {Promise<GoogleEarthEnterpriseTileInformation>} A promise that resolves to the tile info for the requested quad key
383+
* @returns {when.Promise<GoogleEarthEnterpriseTileInformation>} A promise that resolves to the tile info for the requested quad key
384384
*
385385
* @private
386386
*/

Source/Core/GoogleEarthEnterpriseTerrainData.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ var rectangleScratch = new Rectangle();
140140
* @param {Number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.
141141
* @param {Number} [options.exaggerationRelativeHeight=0.0] The height from which terrain is exaggerated.
142142
* @param {Boolean} [options.throttle=true] If true, indicates that this operation will need to be retried if too many asynchronous mesh creations are already in progress.
143-
* @returns {Promise.<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many
143+
* @returns {when.Promise.<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many
144144
* asynchronous mesh creations are already in progress and the operation should
145145
* be retried later.
146146
*/
@@ -282,7 +282,7 @@ var upsampleTaskProcessor = new TaskProcessor(
282282
* @param {Number} descendantX The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
283283
* @param {Number} descendantY The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
284284
* @param {Number} descendantLevel The level within the tiling scheme of the descendant tile for which we are upsampling.
285-
* @returns {Promise.<HeightmapTerrainData>|undefined} A promise for upsampled heightmap terrain data for the descendant tile,
285+
* @returns {when.Promise.<HeightmapTerrainData>|undefined} A promise for upsampled heightmap terrain data for the descendant tile,
286286
* or undefined if too many asynchronous upsample operations are in progress and the request has been
287287
* deferred.
288288
*/

Source/Core/GoogleEarthEnterpriseTerrainProvider.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, {
251251
/**
252252
* Gets a promise that resolves to true when the provider is ready for use.
253253
* @memberof GoogleEarthEnterpriseTerrainProvider.prototype
254-
* @type {Promise.<Boolean>}
254+
* @type {when.Promise<Boolean>}
255255
* @readonly
256256
*/
257257
readyPromise: {
@@ -347,7 +347,7 @@ function computeChildMask(quadKey, info, metadata) {
347347
* @param {Number} y The Y coordinate of the tile for which to request geometry.
348348
* @param {Number} level The level of the tile for which to request geometry.
349349
* @param {Request} [request] The request object. Intended for internal use only.
350-
* @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method
350+
* @returns {when.Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method
351351
* returns undefined instead of a promise, it is an indication that too many requests are already
352352
* pending and the request will be retried later.
353353
*

Source/Core/HeightmapTerrainData.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ var createMeshTaskProcessorThrottle = new TaskProcessor(
204204
* @param {Number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.
205205
* @param {Number} [options.exaggerationRelativeHeight=0.0] The height relative to which terrain is exaggerated.
206206
* @param {Boolean} [options.throttle=true] If true, indicates that this operation will need to be retried if too many asynchronous mesh creations are already in progress.
207-
* @returns {Promise.<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many
207+
* @returns {when.Promise.<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many
208208
* asynchronous mesh creations are already in progress and the operation should
209209
* be retried later.
210210
*/
@@ -501,9 +501,8 @@ HeightmapTerrainData.prototype.interpolateHeight = function (
501501
* @param {Number} descendantX The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
502502
* @param {Number} descendantY The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
503503
* @param {Number} descendantLevel The level within the tiling scheme of the descendant tile for which we are upsampling.
504-
* @returns {Promise.<HeightmapTerrainData>|undefined} A promise for upsampled heightmap terrain data for the descendant tile,
505-
* or undefined if too many asynchronous upsample operations are in progress and the request has been
506-
* deferred.
504+
* @returns {HeightmapTerrainData|undefined} The upsampled heightmap terrain data for the descendant tile,
505+
* or undefined if the mesh is unavailable
507506
*/
508507
HeightmapTerrainData.prototype.upsample = function (
509508
tilingScheme,

Source/Core/Iau2006XysData.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function getDaysSinceEpoch(xys, dayTT, secondTT) {
9494
* the Terrestrial Time (TT) time standard.
9595
* @param {Number} stopSecondTT The seconds past noon of the end of the interval to preload, expressed in
9696
* the Terrestrial Time (TT) time standard.
97-
* @returns {Promise<void>} A promise that, when resolved, indicates that the requested interval has been
97+
* @returns {when.Promise<void>} A promise that, when resolved, indicates that the requested interval has been
9898
* preloaded.
9999
*/
100100
Iau2006XysData.prototype.preload = function (

Source/Core/IonGeocoderService.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function IonGeocoderService(options) {
5656
*
5757
* @param {String} query The query to be sent to the geocoder service
5858
* @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform.
59-
* @returns {Promise<GeocoderService.Result[]>}
59+
* @returns {when.Promise<GeocoderService.Result[]>}
6060
*/
6161
IonGeocoderService.prototype.geocode = function (query, geocodeType) {
6262
return this._pelias.geocode(query, geocodeType);

Source/Core/IonResource.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ if (defined(Object.create)) {
8585
* @param {Object} [options] An object with the following properties:
8686
* @param {String} [options.accessToken=Ion.defaultAccessToken] The access token to use.
8787
* @param {String|Resource} [options.server=Ion.defaultServer] The resource to the Cesium ion API server.
88-
* @returns {Promise.<IonResource>} A Promise to am instance representing the Cesium ion Asset.
88+
* @returns {when.Promise.<IonResource>} A Promise to am instance representing the Cesium ion Asset.
8989
*
9090
* @example
9191
* //Load a Cesium3DTileset with asset ID of 124624234

Source/Core/OpenCageGeocoderService.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Object.defineProperties(OpenCageGeocoderService.prototype, {
7979
* @function
8080
*
8181
* @param {String} query The query to be sent to the geocoder service
82-
* @returns {Promise<GeocoderService.Result[]>}
82+
* @returns {when.Promise<GeocoderService.Result[]>}
8383
*/
8484
OpenCageGeocoderService.prototype.geocode = function (query) {
8585
//>>includeStart('debug', pragmas.debug);

Source/Core/PeliasGeocoderService.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Object.defineProperties(PeliasGeocoderService.prototype, {
5151
*
5252
* @param {String} query The query to be sent to the geocoder service
5353
* @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform.
54-
* @returns {Promise<GeocoderService.Result[]>}
54+
* @returns {when.Promise<GeocoderService.Result[]>}
5555
*/
5656
PeliasGeocoderService.prototype.geocode = function (query, type) {
5757
//>>includeStart('debug', pragmas.debug);

Source/Core/QuantizedMeshTerrainData.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ var createMeshTaskProcessorThrottle = new TaskProcessor(
284284
* @param {Number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.
285285
* @param {Number} [options.exaggerationRelativeHeight=0.0] The height relative to which terrain is exaggerated.
286286
* @param {Boolean} [options.throttle=true] If true, indicates that this operation will need to be retried if too many asynchronous mesh creations are already in progress.
287-
* @returns {Promise.<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many
287+
* @returns {when.Promise.<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many
288288
* asynchronous mesh creations are already in progress and the operation should
289289
* be retried later.
290290
*/
@@ -425,7 +425,7 @@ var upsampleTaskProcessor = new TaskProcessor(
425425
* @param {Number} descendantX The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
426426
* @param {Number} descendantY The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
427427
* @param {Number} descendantLevel The level within the tiling scheme of the descendant tile for which we are upsampling.
428-
* @returns {Promise.<QuantizedMeshTerrainData>|undefined} A promise for upsampled heightmap terrain data for the descendant tile,
428+
* @returns {when.Promise.<QuantizedMeshTerrainData>|undefined} A promise for upsampled heightmap terrain data for the descendant tile,
429429
* or undefined if too many asynchronous upsample operations are in progress and the request has been
430430
* deferred.
431431
*/

Source/Core/RequestScheduler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ RequestScheduler.getServerKey = function (url) {
372372
*
373373
* @param {Request} request The request object.
374374
*
375-
* @returns {Promise|undefined} A Promise for the requested data, or undefined if this request does not have high enough priority to be issued.
375+
* @returns {when.Promise|undefined} A Promise for the requested data, or undefined if this request does not have high enough priority to be issued.
376376
*
377377
* @private
378378
*/

0 commit comments

Comments
 (0)