Skip to content

Create facade for Image #621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
armanbilge opened this issue Oct 30, 2021 · 2 comments · Fixed by #725
Closed

Create facade for Image #621

armanbilge opened this issue Oct 30, 2021 · 2 comments · Fixed by #725

Comments

@armanbilge
Copy link
Member

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

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

@armanbilge armanbilge changed the title Creage facade for Image Create facade for Image Nov 22, 2021
@zetashift
Copy link
Contributor

zetashift commented Aug 21, 2022

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?

@armanbilge
Copy link
Member Author

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

zetashift added a commit to zetashift/scala-js-dom that referenced this issue Jan 23, 2023
armanbilge added a commit that referenced this issue Jan 27, 2023
Add `Image` facade and additional facades for `HTMLImageElement` #621
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants