{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/20656","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/20656/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/20656/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/20656/events","html_url":"https://github.com/Microsoft/TypeScript/issues/20656","id":281551004,"node_id":"MDU6SXNzdWUyODE1NTEwMDQ=","number":20656,"title":"unhandledrejection event missing from WindowEventMap","user":{"login":"robatwilliams","id":3041926,"node_id":"MDQ6VXNlcjMwNDE5MjY=","avatar_url":"https://avatars0.githubusercontent.com/u/3041926?v=4","gravatar_id":"","url":"https://api.github.com/users/robatwilliams","html_url":"https://github.com/robatwilliams","followers_url":"https://api.github.com/users/robatwilliams/followers","following_url":"https://api.github.com/users/robatwilliams/following{/other_user}","gists_url":"https://api.github.com/users/robatwilliams/gists{/gist_id}","starred_url":"https://api.github.com/users/robatwilliams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robatwilliams/subscriptions","organizations_url":"https://api.github.com/users/robatwilliams/orgs","repos_url":"https://api.github.com/users/robatwilliams/repos","events_url":"https://api.github.com/users/robatwilliams/events{/privacy}","received_events_url":"https://api.github.com/users/robatwilliams/received_events","type":"User","site_admin":false},"labels":[{"id":113970366,"node_id":"MDU6TGFiZWwxMTM5NzAzNjY=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":151698898,"node_id":"MDU6TGFiZWwxNTE2OTg4OTg=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Domain:%20lib.d.ts","name":"Domain: lib.d.ts","color":"c7def8","default":false},{"id":114001888,"node_id":"MDU6TGFiZWwxMTQwMDE4ODg=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Fixed","name":"Fixed","color":"bfe5bf","default":false},{"id":265374716,"node_id":"MDU6TGFiZWwyNjUzNzQ3MTY=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/good%20first%20issue","name":"good first issue","color":"7944ba","default":true},{"id":117630704,"node_id":"MDU6TGFiZWwxMTc2MzA3MDQ=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/help%20wanted","name":"help wanted","color":"009800","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/74","html_url":"https://github.com/Microsoft/TypeScript/milestone/74","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/74/labels","id":3468190,"node_id":"MDk6TWlsZXN0b25lMzQ2ODE5MA==","number":74,"title":"TypeScript 3.1","description":"","creator":{"login":"mhegazy","id":8000722,"node_id":"MDQ6VXNlcjgwMDA3MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/8000722?v=4","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"open_issues":230,"closed_issues":65,"state":"open","created_at":"2018-07-02T19:25:46Z","updated_at":"2018-07-31T20:43:42Z","due_on":"2018-09-17T07:00:00Z","closed_at":null},"comments":4,"created_at":"2017-12-12T21:55:10Z","updated_at":"2018-07-31T20:43:46Z","closed_at":"2018-07-31T20:43:34Z","author_association":"NONE","body":"<!-- BUGS: Please use this template. -->\r\n<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\n<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:**  2.6.1\r\n\r\n**Code**\r\n\r\n```ts\r\nwindow.addEventListener('unhandledrejection', event => {\r\n  // event is of type Event\r\n});\r\n\r\nwindow.addEventListener('unhandledrejection', (event: PromiseRejectionEvent) => {\r\n    /*\r\nArgument of type '(event: PromiseRejectionEvent) => void' is not assignable to parameter of type 'EventListenerOrEventListenerObject'.\r\n  Type '(event: PromiseRejectionEvent) => void' is not assignable to type 'EventListenerObject'.\r\n    Property 'handleEvent' is missing in type '(event: PromiseRejectionEvent) => void'.\r\n*/\r\n});\r\n```\r\n\r\n**Expected behavior:**\r\nEvent listener for `unhandledrejection` should have event type `PromiseRejectionEvent`.\r\n\r\nI believe an entry needs adding to `WindowEventMap` in `lib.dom.d.ts`.\r\n\r\n**Actual behavior:**\r\nCompiler error as shown in code sample above, when using strict mode.\r\n\r\n**Workaround:**\r\nUse declaration merging; create a typings file and include\r\n```\r\ninterface WindowEventMap {\r\n  'unhandledrejection': PromiseRejectionEvent;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/409361261","html_url":"https://github.com/Microsoft/TypeScript/issues/20656#issuecomment-409361261","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/20656","id":409361261,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTM2MTI2MQ==","user":{"login":"mhegazy","id":8000722,"node_id":"MDQ6VXNlcjgwMDA3MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/8000722?v=4","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"created_at":"2018-07-31T20:43:46Z","updated_at":"2018-07-31T20:43:46Z","author_association":"CONTRIBUTOR","body":"thanks!"}}
{"actor":{"display_login":"mhegazy"}}