-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Global variable event: Event
in lib.es6.d.ts
#11583
Global variable event: Event
in lib.es6.d.ts
#11583
Comments
According to MDN it is non-standard IE/Edge property. The typings for the But it does seem to be present in other browsers (I checked Chrome) 'event' in window; // returns `true`
'foo' in window; // returns `false` I guess it should be properly typed as |
Indeed. You are right. The property exists on window. But it is So maybe Edit: @kitsonk ah, it's filled while event listeners are executed in IE/edge. Hm |
Yes, sorry, I meant to say that. I suspect that IE/Edge continues to support it, though it isn't part of standards, and other browsers define it, but keep its value always Anyways, I still suspect it is better to have it as |
PRs welcomed. You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes. |
Awesome! |
I will do it 😄 |
TypeScript Version: 2.0.3
Code
tsconfig.json includes lib
es6
:Expected behavior:
Don't expect event to exist on the global object. Couldn't reproduce it in Safari, Firefox or Chrome. It's always
console.log(window.event); // undefined
Actual behavior:
event: Event
is declared as global variable in lib.es6.d.tshttps://github.com/Microsoft/TypeScript/blob/2e7c83abc833534181d97c534bfac865cd93b1f0/lib/lib.es6.d.ts#L18680
https://github.com/Microsoft/TypeScript/blob/2e7c83abc833534181d97c534bfac865cd93b1f0/lib/lib.es6.d.ts#L20129
The text was updated successfully, but these errors were encountered: