jakearchibald / idb

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

Declaration not found when using `idb/with-async-ittr-cjs` #136

Closed HerbCaudill closed 4 years ago

HerbCaudill commented 4 years ago

Jest does not like it if I import idb/with-async-ittr:

SyntaxError: Unexpected token 'export'

> 3 | import * as idb from 'idb/with-async-ittr'
    | ^

I can make Jest happy by importing idb/with-async-ittr-cjs instead, but then Typescript complains:

Could not find a declaration file for module 'idb/with-async-ittr-cjs'.

This is the same issue as #113, but for the cjs variant.

I've been able to fix this by adding another .d.ts file in my own fork of idb. I'm sure there's a better way to do all of this, but in the meantime I'll submit a PR adding that declaration file. 🤷‍♂️

jakearchibald commented 4 years ago

Fixed in 4882cae69882eab7d9ce6db23749b80b95e1b3a1