-
Notifications
You must be signed in to change notification settings - Fork 440
Add HTML DOM types #525
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 HTML DOM types #525
Conversation
baselines/dom.generated.d.ts
Outdated
@@ -5267,9 +5298,13 @@ interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils { | |||
*/ | |||
text: string; | |||
type: string; | |||
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; | |||
addEventListener<K extends keyof DocumentAndElementEventHandlersEventMap>(type: K, listener: (this: HTMLAnchorElement, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; | |||
addEventListener<K extends keyof ElementEventMap>(type: K, listener: (this: HTMLAnchorElement, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; |
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.
HTMLElementEventMap
already extends ElementEventMap
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.
also i think the change here should be on HTMLElementEventMap
to extend DocumentAndElementEventHandlersEventMap
and GlobalEventHandlersEventMap
instead of on every element.
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.
HTMLElementEventMap already extends ElementEventMap
Yes, but that map is now empty and not generated because HTMLElement does not directly include any event handlers anymore.
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.
we should generate the map always instead of generating overloads.. the map can still be empty, but just extends other maps.
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.
Hmm, makes sense. I'll try it.
thanks! |
Diffs are mainly because of HTMLElement not including event handlers anymore.