-
@simonhaenisch @wesbos That's interesting. The challenge there is that nothing is checking
as 'video'
, you could cast to the wrong thing. In theory, a template type could work here in a type-checkable manner. querySelector('video.webcam' as const asvideo${string}
) -
@simonhaenisch @wesbos But
querySelector()
doesn't support that and it doesn't work with CSS combinators (div > video
), so it's still pretty limited. Also'foo' as const as 'bar'
still passes type checking, which is surprising to me. I feel like it shouldn't? 🤔