-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScript
Milestone
Description
TypeScript Version: 3.1.5
Search Terms:
indexedDB
Code
let dbreq = indexedDB.open('test', 1);
dbreq.onsuccess = function (evt) {
let database = evt.target.result;
}
Expected behavior:
evt.target.result
should be an IDBDatabase
Actual behavior:
TS2339: Property 'result' does not exist on type 'EventTarget'.
Related Issues:
This is caused by the updates resulting from #25547
It works if you add a cast:
let dbreq = indexedDB.open('test', 1);
dbreq.onsuccess = function (evt) {
let database = (evt.target as IDBOpenDBRequest).result;
}
diescake, debu11, tonitrnel, Season-Z, randomer and 26 moreglyph-cat
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScript