Everything resolves to strings
See original GitHub issueHi there!
It seems to me that all typing resolves to string
?
Example:
export type BorderStyleProperty = Globals | LineStyle | string;
Since it can be a string
that will override both Globals
and LineStyle
, not giving intellisense on the possible properties of the border style.
Is this intentional?
I did some more research: https://github.com/Microsoft/TypeScript/issues/29729#issuecomment-471566609
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:12 (3 by maintainers)
Top Results From Across the Web
python 3.x - Resolve list of strings as respective objects
I have a list containing [bool, "string of function name", ["parameters","to","pass"]] but when I pass them, they don't resolve to anything ...
Read more >What is string theory? - Space.com
String theory has been held up as a possible "theory of everything," a single framework that could unite general relativity and quantum ...
Read more >String theory - Wikipedia
In physics, string theory is a theoretical framework in which the point-like particles of particle physics are replaced by one-dimensional objects called ...
Read more >Promise.resolve() - JavaScript - MDN Web Docs
The Promise.resolve() method "resolves" a given value to a Promise. If the value is a promise, that promise is returned; if the value...
Read more >Strings - C# Programming Guide | Microsoft Learn
Everything inside the braces ( {...} ) will be resolved to a value and output as a formatted string at run time.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Adding the string type to the union does not make much sense imo, you lose auto completion and type validation
@kylemh
display
can have combinations of values https://drafts.csswg.org/css-display/#the-display-properties so it would be wrong to remove| string
from that property. I’ve given it some attempts to combine different values into multiple string literals and in that way be able to skip| string
but it’s really complicated to do problematically and the type definitions exploded in size and performance issues became a concern so the progress halted.I may give it another try soon thanks to this which will make things a bit easier. At least support a fragment of different combinations so
display
becomes complete without| string
would be really nice. I’m well aware of the issue but you’re welcome to submit a separate issue if you’d like.