Broken IndexedDB event typings in 3.1.5 #28293
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Milestone
TypeScript Version: 3.1.5
Search Terms:
indexedDB
Code
Expected behavior:
evt.target.result
should be an IDBDatabaseActual behavior:
TS2339: Property 'result' does not exist on type 'EventTarget'.
Playground Link:
http://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
Related Issues:
This is caused by the updates resulting from #25547
It works if you add a cast:
The text was updated successfully, but these errors were encountered: