-
Notifications
You must be signed in to change notification settings - Fork 162
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
Add upgrade() whenDefined() to CustomElementRegistry #831
base: main
Are you sure you want to change the base?
Conversation
Hmm. I think the type for a constructor should be |
Added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use some doc comments, but otherwise looks good to me! (You might have to format my example of doc comments).
Co-authored-by: zetashift <[email protected]>
Co-authored-by: zetashift <[email protected]>
fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@@ -11,11 +11,29 @@ import scala.scalajs.js.annotation._ | |||
|
|||
/** The CustomElementRegistry interface provides methods for registering custom elements and querying registered | |||
* elements. To get an instance of it, use the window.customElements property. | |||
* https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry |
*/ | ||
@js.native | ||
@JSGlobal | ||
abstract class CustomElementRegistry extends js.Object { | ||
|
||
/** Returns the constructor for a previously-defined custom element. */ | ||
def get(name: String): js.Dynamic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def get(name: String): js.Dynamic | |
def get(name: String): js.UndefOr[js.Dynamic] |
/** Returns an empty Promise that resolves when a custom element becomes defined with the given name. If such a custom | ||
* element is already defined, the returned promise is immediately fulfilled. | ||
*/ | ||
def whenDefined(name: String): js.Promise[Any] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please copy the doc from here.
def whenDefined(name: String): js.Promise[Any] | |
def whenDefined(name: String): js.Promise[js.Dynamic] |
Hi there!
Before submitting a PR containing any Scala changes, please make sure you...
sbt prePR
api-reports
Thanks for contributing!
add upgrade() whenDefined() to CustomElementRegistry