Open barinbritva opened 2 years ago
Hopefully this could be solved with template literal types in the future. But it requires some additional work before we can use template literal types.
@frenic thank for the answer!
For sure literal types would provide extremely cool experience! Do you have a plan to use them in the project any time soon?
Speaking of (string & {})
definition - which use cases will be broken without it? Some properties like display
has only white list of properties and they don't need common string
.
As soon as I have time to fix it. Soon I hope.
That's not true. The display
property accepts a two-value syntax even though it's rarely used. That's why string & {}
is generated.
Oh, two-value syntax, now I see...
Could string & {}
be potentially replaced by full list of combinations? Or there is no necessary data to do it?
It's pretty intense to generate a union for every possible combination for every property of this kind. That's why literal template types will come in handy.
Hi there,
I use a library
typestyle
which depends oncsstype
. And I have a next case:It happens because the definition of
display
looks like:I understand the definition relies on web specifications and that's absolutely correct. But it doesn't make sense from a type safety perspective.
Is it possible to solve the issue? Maybe
csstype
could do two kind of builds -default
andtype safe
?