Skip to content

Upgrade editor support to TS 4.4, update typings to infer object types #878

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

Merged
merged 2 commits into from
Sep 7, 2021

Conversation

AlCalzone
Copy link
Collaborator

@AlCalzone AlCalzone commented Sep 3, 2021

This PR updates the editor and compiler to support TypeScript 4.4. Most notably, this allows us to infer object types from object IDs. For example, the editor knows that the object with the ID "system.adapter.javascript.0.alive" must be a state:
grafik
The common.alias property is now also supported, among many others:
grafik

Inferring the type works for a bunch of common IDs. When it is not certain like in this case:
grafik
accessing properties that could exists on any of the possibilities is now allowed (but no syntax help):
grafik

fixes: #838
fixes: #846
fixes: #865

@AlCalzone
Copy link
Collaborator Author

Additionally, we could think about extending this functionality to setObject and extendObject, but I fear this will break (TS) or add warnings (JS) to a ton of scripts.

@PeterVoronov
Copy link
Contributor

Looks awesome!

@GermanBluefox GermanBluefox merged commit cdceebe into master Sep 7, 2021
@GermanBluefox
Copy link
Contributor

LGTM

@AlCalzone

This comment was marked as off-topic.

@uwe72

This comment was marked as spam.

@ioBroker ioBroker locked as too heated and limited conversation to collaborators Mar 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants