Closed
Description
lib Update Request
Configuration Check
My compilation target is ES2015
and my lib is the default
.
Missing / Incorrect Definition
HTMLImageElement.loading is currently a string
, but the only valid values for it are eager
and lazy
Sample Code
While the string works, it allows for invalid values. ex:
<img loading="random value" />
is valid, as well as:
interface ImageWrapper {
image: HTMLImageElement
}
const imageWrapper: ImageWrapper = { image: new HTMLImageElement() }
imageWrapper.image.loading = 'random value'
I would expect both of these cases to throw a warning at least on invalid/not useful value
Documentation Link
https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/loading