Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve JSDoc/TypeScript support for Material properties #8904

Merged
merged 4 commits into from
Jun 4, 2020
Merged

Conversation

mramato
Copy link
Contributor

@mramato mramato commented Jun 3, 2020

All of the MaterialProperty constructors take primitive types in addition to Property instances (and automatically wrap the primitive type in a ConstantProperty). The JSDoc was incorrect on this leading to sub-par TS type definitions. Also fixed a missing optional result parameter in the JSDoc for EllipsoidGeodesic.interpolateUsingSurfaceDistance.

Fixes #8898

All of the MaterialProperty constructors take primitive types in addition
to Property instances (and automatically wrap the primitive type in a
`ConstantProperty`).  The JSDoc was incorrect on this leading to sub-par
TS type definitions. Also fixed a missing optional result parameter in
the JSDoc for `EllipsoidGeodesic.interpolateUsingSurfaceDistance`.

Fixes #8898
@cesium-concierge
Copy link

Thanks for the pull request @mramato!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

Add another missing optional result fix.
@mramato
Copy link
Contributor Author

mramato commented Jun 3, 2020

I'm looking at way to bootstrap some basic TypeScript tests so that we can avoid regressions.

@mramato
Copy link
Contributor Author

mramato commented Jun 3, 2020

For those new to reviewing TS related PRs, in 99% of the time (like this one) it's literally just fixing JSDoc.

@mramato mramato requested a review from kring June 3, 2020 17:18
@mramato
Copy link
Contributor Author

mramato commented Jun 3, 2020

I pushed one more small change to fix the individual properties to be @type {Property|undefined}, since they were not marked that way. Unless there's more feedback, this is ready.

@kring kring merged commit 50e8a91 into master Jun 4, 2020
@kring kring deleted the issue8898 branch June 4, 2020 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

typescript issues
3 participants