{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/28293","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/28293/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/28293/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/28293/events","html_url":"https://github.com/Microsoft/TypeScript/issues/28293","id":376568696,"node_id":"MDU6SXNzdWUzNzY1Njg2OTY=","number":28293,"title":"Broken IndexedDB event typings in 3.1.5","user":{"login":"dpogue","id":241708,"node_id":"MDQ6VXNlcjI0MTcwOA==","avatar_url":"https://avatars3.githubusercontent.com/u/241708?v=4","gravatar_id":"","url":"https://api.github.com/users/dpogue","html_url":"https://github.com/dpogue","followers_url":"https://api.github.com/users/dpogue/followers","following_url":"https://api.github.com/users/dpogue/following{/other_user}","gists_url":"https://api.github.com/users/dpogue/gists{/gist_id}","starred_url":"https://api.github.com/users/dpogue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpogue/subscriptions","organizations_url":"https://api.github.com/users/dpogue/orgs","repos_url":"https://api.github.com/users/dpogue/repos","events_url":"https://api.github.com/users/dpogue/events{/privacy}","received_events_url":"https://api.github.com/users/dpogue/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-01T21:00:05Z","updated_at":"2018-11-01T21:00:05Z","closed_at":null,"author_association":"NONE","body":"<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common \"Bugs\" That Aren't Bugs section!\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\nPlease fill in the *entire* template below.\r\n-->\r\n\r\n<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:**  3.1.5\r\n\r\n<!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:**\r\nindexedDB\r\n\r\n**Code**\r\n\r\n```ts\r\nlet dbreq = indexedDB.open('test', 1);\r\n\r\ndbreq.onsuccess = function (evt) {\r\n    let database = evt.target.result;\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\n`evt.target.result` should be an IDBDatabase\r\n\r\n**Actual behavior:**\r\nTS2339: Property 'result' does not exist on type 'EventTarget'.\r\n\r\n**Playground Link:** <!-- A link to a TypeScript Playground \"Share\" link which demonstrates this behavior -->\r\nhttp://www.typescriptlang.org/play/index.html#src=let%20dbreq%20%3D%20indexedDB.open('test'%2C%201)%3B%0D%0A%0D%0Adbreq.onsuccess%20%3D%20function%20(evt)%20%7B%0D%0A%20%20%20%20let%20database%20%3D%20evt.target.result%3B%0D%0A%7D\r\n\r\n**Related Issues:** <!-- Did you find other bugs that looked similar? -->\r\nThis is caused by the updates resulting from https://github.com/Microsoft/TypeScript/issues/25547\r\n\r\nIt works if you add a cast:\r\n\r\n```ts\r\nlet dbreq = indexedDB.open('test', 1);\r\n\r\ndbreq.onsuccess = function (evt) {\r\n    let database = (evt.target as IDBOpenDBRequest).result;\r\n}\r\n```"}}
{"actor":{"display_login":"dpogue"}}