We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When using element.useEventListener where element: HTMLElement there are two overloads (source):
element.useEventListener
element: HTMLElement
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
This enables the type checker in an IDE to defer the type of the event argument that is passed into the handler.
event
For example
buttonElement.addEventListener("click", (event) => doSomething());
will have IDEs recognize event as type MouseEvent.
MouseEvent
I would suggest adding the overloads to the types of this package as well to enable that IDE feature.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
When using
element.useEventListener
whereelement: HTMLElement
there are two overloads (source):This enables the type checker in an IDE to defer the type of the
event
argument that is passed into the handler.For example
will have IDEs recognize
event
as typeMouseEvent
.I would suggest adding the overloads to the types of this package as well to enable that IDE feature.
The text was updated successfully, but these errors were encountered: