From 96bdb0c97da9edebadb16e72001792f624966478 Mon Sep 17 00:00:00 2001 From: Nick Crews Date: Sun, 29 Dec 2024 13:00:43 -0900 Subject: [PATCH 1/5] types: mark `options` param of ImageryLayer.fromProviderAsync as optional As the examples show, it is perfectly fine to not pass in the options object. However, in my typescript project, if I don't pass in the options, I get a type error. This is intended to fix that error. This was brought up in https://community.cesium.com/t/error-when-initialize-imagerylayer-fromproviderasync-without-options/31665 --- packages/engine/Source/Scene/ImageryLayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/engine/Source/Scene/ImageryLayer.js b/packages/engine/Source/Scene/ImageryLayer.js index 897686064402..7b3e8b6b17b6 100644 --- a/packages/engine/Source/Scene/ImageryLayer.js +++ b/packages/engine/Source/Scene/ImageryLayer.js @@ -511,7 +511,7 @@ ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD = 0.004; * Create a new imagery layer from an asynchronous imagery provider. The layer will handle any asynchronous loads or errors, and begin rendering the imagery layer once ready. * * @param {Promise} imageryProviderPromise A promise which resolves to a imagery provider - * @param {ImageryLayer.ConstructorOptions} options An object describing initialization options + * @param {ImageryLayer.ConstructorOptions|undefined} options An object describing initialization options * @returns {ImageryLayer} The created imagery layer. * * @example From b1846e55d53333495fe02a7dfee23d220a6cbb83 Mon Sep 17 00:00:00 2001 From: Nick Crews Date: Fri, 3 Jan 2025 16:05:41 -0900 Subject: [PATCH 2/5] fixup: use proper jsdoc syntax --- packages/engine/Source/Scene/ImageryLayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/engine/Source/Scene/ImageryLayer.js b/packages/engine/Source/Scene/ImageryLayer.js index 7b3e8b6b17b6..b2a72c71adac 100644 --- a/packages/engine/Source/Scene/ImageryLayer.js +++ b/packages/engine/Source/Scene/ImageryLayer.js @@ -511,7 +511,7 @@ ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD = 0.004; * Create a new imagery layer from an asynchronous imagery provider. The layer will handle any asynchronous loads or errors, and begin rendering the imagery layer once ready. * * @param {Promise} imageryProviderPromise A promise which resolves to a imagery provider - * @param {ImageryLayer.ConstructorOptions|undefined} options An object describing initialization options + * @param {ImageryLayer.ConstructorOptions} [options] An object describing initialization options * @returns {ImageryLayer} The created imagery layer. * * @example From a87cd4fc70ae4747866d20b1b0e98e47b99b1e4f Mon Sep 17 00:00:00 2001 From: Nick Crews Date: Fri, 3 Jan 2025 16:06:45 -0900 Subject: [PATCH 3/5] Add Nick Crews to CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index bc8598aeda78..7e769b6ca14c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -419,3 +419,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu - [Kirn Kim](https://github.com/squrki) - [Emanuele Mastaglia](https://github.com/Masty88) - [Connor Manning](https://github.com/connormanning) +- [NickCrews](https://github.com/NickCrews) From 77002682b557026dc68748644e05f05fe371e0f8 Mon Sep 17 00:00:00 2001 From: Nick Crews Date: Fri, 3 Jan 2025 16:07:35 -0900 Subject: [PATCH 4/5] fixup contributors --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 7e769b6ca14c..77b548eab882 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -419,4 +419,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu - [Kirn Kim](https://github.com/squrki) - [Emanuele Mastaglia](https://github.com/Masty88) - [Connor Manning](https://github.com/connormanning) -- [NickCrews](https://github.com/NickCrews) +- [Nick Crews](https://github.com/NickCrews) From 8c6909122c02ea58e4bf11a1328b3295c4ae349b Mon Sep 17 00:00:00 2001 From: Nick Crews Date: Mon, 6 Jan 2025 14:32:21 -0900 Subject: [PATCH 5/5] Add typing fix from #12400 to CHANGES.md --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 7239383a29dc..7ab5c50f40a1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,7 @@ ##### Fixes :wrench: - Fixed error when resetting `Cesium3DTileset.modelMatrix` to its initial value. [#12409](https://github.com/CesiumGS/cesium/pull/12409) +- Fixed type of `ImageryLayer.fromProviderAsync`, to correctly show that the param `options` is optional. [#12400](https://github.com/CesiumGS/cesium/pull/12400) ### 1.125 - 2025-01-02