DX: Fix defined
and Check
types for CesiumJS devs
#12312
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
defined.d.ts
which will now get picked up and provide the correct type predicates and assertions so JS Type checking will understand things are defined after this calldefined
use type predicate #11455 which is fantastic for external contributors but local development doesn't look at the generatedindex.d.ts
file for types like it will with the newdefined.d.ts
fileCheck.d.ts
for local development so the TS server understands it's a default export not an exported objectCheck
, remove circular dependency #11901 to help external users of CesiumJS, primarily the ion teamCesium.d.ts
andengine/index.d.ts
files should be identical to the previous ones.Issue number and link
No issue, just a small DX issue I've grown too tired of seeing
Testing plan
main
runnpm run built-ts
Source/Cesium.d.ts
andpackages/engine/index.d.ts
somewhere you can check laternpm run build-ts
defined
andCheck
locallyCheck JS
for type checking with the TS server (This may or may not be necessary, I'm not sure)main
the types aren't correct as shown above, verify that in this branch they areCheckJS
if you're not ready to see a lot of other (false positive) errors scattered in our codeAuthor checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change