scala-js-dom icon indicating copy to clipboard operation
scala-js-dom copied to clipboard

Create facade for `Image`

Open armanbilge opened this issue 4 years ago • 2 comments

https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image

ScalablyTyped thought we had this, so we may as well add it :)

armanbilge avatar Oct 30 '21 21:10 armanbilge

So far I've got this:

/** Image creates a new HTMLImageElement instance. It is functionally equivalent to document.createElement('img').
  *
  * @param width
  *   The width of the image (i.e., the value for the width attribute).
  * @param height
  *   The height of the image (i.e., the value for the height attribute).
  */
class Image(width: Int, height: Int) extends HTMLImageElement

However in my exploration I see that the HTMLImageElement is missing some properties, for example:

https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/loading

https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset

Want me to add these as well in the same PR?

zetashift avatar Aug 21 '22 19:08 zetashift

Sure, if you're up for it! :)

armanbilge avatar Aug 21 '22 19:08 armanbilge