You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the selector is 'a', querySelector‘s return type is be HTMLAnchorElement. To achieve the same in element-ready, we had to manually copy its types and adapt them to elementReady
Ideally, instead, we should try to “inherit” directly from the global querySelector so that, if its types are enhanced (via typed-query-selector or natively), element-ready automatically gets upgraded.
Note: We can't use Parameters<typeof querySelector> and such because it doesn't support overloads nor generics.
If the selector is
'a'
,querySelector
‘s return type is beHTMLAnchorElement
. To achieve the same inelement-ready
, we had to manually copy its types and adapt them toelementReady
Ideally, instead, we should try to “inherit” directly from the global
querySelector
so that, if its types are enhanced (via typed-query-selector or natively),element-ready
automatically gets upgraded.Note: We can't use
Parameters<typeof querySelector>
and such because it doesn't support overloads nor generics.This has been unsuccessfully tried in #31. More info about it in that PR. A possible solution might be microsoft/TypeScript#33185 (comment)
The text was updated successfully, but these errors were encountered: