Skip to content

IDBRequest result attribute typed as any #25547

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

Closed
LinusU opened this issue Jul 10, 2018 · 0 comments
Closed

IDBRequest result attribute typed as any #25547

LinusU opened this issue Jul 10, 2018 · 0 comments
Assignees
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this

Comments

@LinusU
Copy link
Contributor

LinusU commented Jul 10, 2018

TypeScript Version: master

Search Terms: IDBRequest

Code

new Promise((resolve, reject) => {
  const req = indexedDB.open(name, 1)
  req.onerror = () => reject(req.error)
  req.onsuccess = () => resolve(req.result)

  req.onupgradeneeded = () => {
    req.result.createObjectStore('keyval', { notValidKey: false })
  }
})

Expected behavior: notValidKey should not be accepted in the second argument to createObjectStore

Actual behavior: Since req.result is typed as any, anything goes

Playground Link: link

Related Issues: none

@mhegazy mhegazy added Bug A bug in TypeScript Help Wanted You can do this Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Jul 10, 2018
@mhegazy mhegazy added this to the Community milestone Jul 10, 2018
@mhegazy mhegazy self-assigned this Jul 12, 2018
@mhegazy mhegazy modified the milestones: Community, TypeScript 3.1 Jul 12, 2018
@mhegazy mhegazy added the Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet label Jul 12, 2018
@mhegazy mhegazy added Fixed A PR has been merged for this issue and removed Fixed A PR has been merged for this issue labels Jul 25, 2018
@mhegazy mhegazy removed the Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet label Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

2 participants