Skip to content
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 add/removeEventListener overloads from HTMLElement #81

Conversation

sandersn
Copy link
Contributor

@sandersn sandersn commented Oct 30, 2017

WebviewTag adds electron-specific overloads to addEventListener and removeEventListener when it extends HTMLElement. However, it does not include the original overloads from HTMLElement, and Typescript does not include them when WebviewTag extends HTMLElement. This change adds those previously-missed overloads to WebviewTag. It is necessary to allow users of electron.d.ts to compile with Typescript 2.6 --strict.

Fixes #79

WebviewTag adds electron-specific overloads to addEventListener and
removeEventListener when it extends HTMLElement. However, it does not
include the original overloads from HTMLElement, and Typescript does not
include them when WebviewTag extends HTMLElement. This change adds
those previously-missed overloads to WebviewTag. It is necessary to
allow users of electron.d.ts to compile with Typescript 2.6 --strict.
@danielweck
Copy link

Excellent, thank you!
This "bug" currently prevents from using TypeScript 2.6+ strictFunctionTypes in Electron projects.
(unless the line interface WebviewTag extends HTMLElement in node_modules/electron/electron.d.ts is patched with @ts-ignore TS2430 (Interface 'WebviewTag' incorrectly extends interface 'HTMLElement') ... which is of course not a viable option)

danielweck added a commit to readium/r2-streamer-js that referenced this pull request Nov 2, 2017
@MarshallOfSound MarshallOfSound merged commit f304ea6 into electron:master Nov 4, 2017
@sandersn sandersn deleted the add-EventListener-overloads-from-HtmlElement branch November 29, 2017 16:58
emk added a commit to emk/subtitles-rs that referenced this pull request Dec 2, 2017
We need `"strictFunctionTypes": false` to work around
electron/typescript-definitions#81
danielweck added a commit to readium/r2-navigator-js that referenced this pull request Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants