Open gossi opened 1 year ago
It might work to change this line:
to something like ? Element extends null
But I don't have the capacity right now to verify that that doesn't adversely affect some other area of inference, so someone else will need to take a look. We should have decent test coverage for this.
I'm providing glint support for
ember-element-helper
tildeio/ember-element-helper#107Here are the types based on the ones from Dan (in tildeio/ember-element-helper#102):
Using the helper works straight away:
Going a bit more dynamic and allowing a
@tag
to be passed in, works when the type is made explicit:... of course those explicit types do not make sense, when we want to have any element being passed in. Making it generic makes the problem visible:
This reveals two locations where glint throws both times the same error:
<Tag
and...attributes
Wit the error message being:
As to my understanding, the types for the signature are correct, but the error message is wrong. The
ElementFromTagName
will always return a valid type, in either explicitHTMLElementTagNameMap[T]
or genericElement
which should be accurate inside the component (typing the unknownigly character of@tag
).Is this a valid problem with glint? Or are my typings wrong?