question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript Types change from version 4.0.6 to version 4.0.7

See original GitHub issue

Hello guys,

when updating from version 4.0.6 to version 4.0.7 I lost a lot of types in lib/model/lightstate/LightState.d.ts (attached a graphical diff).

Is changed something in type generator? I’m collecting a lot of error like this one:

  • error TS2339: Property 'hue' does not exist on type 'States'.
  • error TS2339: Property 'sat' does not exist on type 'States'.
  • error TS2345: Argument of type 'BaseStates' is not assignable to parameter of type 'LightState'. Type 'BaseStates' is missing the following properties from type 'LightState': white, hsb, hsl, rgb, and 14 more.

Thanks!

diff

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
peter-murraycommented, Jul 30, 2020

Ah, that is certainly the information I was needing here… So it is the fact that base classes return only instances of the base class, hence the chaining end up breaking because of this.

I will have to look deeper into what is going on with respect to the TypeScript definition generation as this is just driven from the JSDoc.

Thanks for the clarification.

0reactions
peter-murraycommented, Aug 11, 2020

These have been set as Objects in the JSDoc for sometime now, and they are actual objects with keys and properties. The data payloads change depending upon the instance of the light.

Why is this being an Object causing issues in this case?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - TypeScript 4.0
TypeScript 4.0 brings two fundamental changes, along with inference improvements, to make typing these possible. The first change is that spreads in tuple...
Read more >
Releases · microsoft/TypeScript - GitHub
TypeScript is a superset of JavaScript that compiles to clean JavaScript output. ... b4d382b Cherry-pick changes for narrowing to tagged literal types.
Read more >
Announcing TypeScript 4.0 Beta - Microsoft Developer Blogs
TypeScript 4.0 brings two fundamental changes, along with inference improvements, to make typing these possible. The first change is that ...
Read more >
The Angular Compiler requires TypeScript >=3.4.0 and <3.5.0 ...
Removing it completely means it will prevent npm from installing/using the most recent minor version (3.5.3). "typescript": "3.4.5". Changing it ...
Read more >
types/mongodb, NodeJS open source component - Meterian
The repository for high quality TypeScript type definitions. Latest version: 4.0.7 registry icon. Maintenance score ... 4.0.6, 0, 0, 0, 0.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found