diff --git a/CHANGES.md b/CHANGES.md index bc1680a4a127..abb2a252ebfb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Change Log +### 1.75 - 2020-11-02 + +- Fixed JSDoc and TypeScript type definitions for `writeTextToCanvas` which listed incorrect return type. [#9196](https://github.com/CesiumGS/cesium/pull/9196) + ### 1.74 - 2020-10-01 ##### Additions :tada: diff --git a/Source/Core/writeTextToCanvas.js b/Source/Core/writeTextToCanvas.js index 6c1a8544d1c8..e827b07fdf30 100644 --- a/Source/Core/writeTextToCanvas.js +++ b/Source/Core/writeTextToCanvas.js @@ -21,7 +21,7 @@ var imageSmoothingEnabledName; * @param {Number} [options.strokeWidth=1] The stroke width. * @param {Color} [options.backgroundColor=Color.TRANSPARENT] The background color of the canvas. * @param {Number} [options.padding=0] The pixel size of the padding to add around the text. - * @returns {HTMLCanvasElement} A new canvas with the given text drawn into it. The dimensions object + * @returns {HTMLCanvasElement|undefined} A new canvas with the given text drawn into it. The dimensions object * from measureText will also be added to the returned canvas. If text is * blank, returns undefined. * @function writeTextToCanvas diff --git a/Specs/TypeScript/index.ts b/Specs/TypeScript/index.ts index 98f881cada78..b91e9159f9cb 100644 --- a/Specs/TypeScript/index.ts +++ b/Specs/TypeScript/index.ts @@ -11,8 +11,8 @@ import { CheckerboardMaterialProperty, CircleGeometry, CircleOutlineGeometry, - ColorMaterialProperty, Color, + ColorMaterialProperty, CompositeMaterialProperty, CompositePositionProperty, CompositeProperty, @@ -97,6 +97,7 @@ import { WallOutlineGeometry, WebMapServiceImageryProvider, WebMapTileServiceImageryProvider, + writeTextToCanvas, } from "cesium"; // Verify ImageryProvider instances conform to the expected interface @@ -384,3 +385,5 @@ geometryInstance = new GeometryInstance({ positions: [], }), }); + +const canvas: HTMLCanvasElement | undefined = writeTextToCanvas("test");