jakearchibald / idb

IndexedDB, but with promises
https://www.npmjs.com/package/idb
ISC License
6.2k stars 348 forks source link

KnownKeys on ts > 4.2 #278

Closed andrewbaxter closed 1 year ago

andrewbaxter commented 1 year ago

TBH I haven't tested this at all, but apparently some change in TypeScript 4.3+ breaks the KnownKeys definition: https://github.com/slackapi/bolt-js/issues/951

I'm seeing this locally (VS code automatically uses 4.7.3 at the moment): all strings are rejected with an error like:

No overload matches this call.
  Overload 1 of 2, '(storeNames: never, mode?: IDBTransactionMode | undefined): IDBPTransaction<CollectionSchema<T>, [never]>', gave the following error.
    Argument of type 'string' is not assignable to parameter of type 'never'.
  Overload 2 of 2, '(storeNames: never[], mode?: IDBTransactionMode | undefined): IDBPTransaction<CollectionSchema<T>, never[]>', gave the following error.
    Argument of type 'string' is not assignable to parameter of type 'never[]'
andrewbaxter commented 1 year ago

Sorry, I was using an old version of IDB too :facepalm:

I guess I'll blame this on vs code auto updates.