Conversation
jdalton
reviewed
Feb 19, 2025
|
|
||
| function displayAnalyticsScreen(data: FormattedData): void { | ||
| const screen = new Widgets.Screen({}) | ||
| const screen: Widgets.Screen = new ScreenWidget({}) |
Contributor
There was a problem hiding this comment.
Would this be implicit by the return type of ScreenWidget? does it need to be explicitly added to const screen: Widgets.Screen?
Contributor
Author
There was a problem hiding this comment.
TS is ignoring the import so ScreenWidget is any. But it should be the same value as what I was expecting Widgets.Screen to be, except importing it fails because apparently Widgets ends up as undefined.
This way we get a typed screen variable, mitigating the impact of the ts-ignore.
jdalton
approved these changes
Feb 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I'm not sure who's wrong here but it looks like
import {Widgets} from 'blessed'doesn't actually work. Or at least it doesn't in our build.Whichever the way, I've imported it as a type such that we can use it for typing in TS but actual code does a deep import (like it did before #323).
This fixes it for me.