[@types/levelup] can't be used with the levelup package
#59192
Replies: 4 comments 1 reply
-
|
Thanks for the discussion about "levelup", some useful links for everyone: Pinging the DT module owners: @MeirionHughes, @danwbyrne, @carsonfarmer, @istherepie. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks davidmurdoch! You are correct, exported definitions do not mimic the original package. |
Beta Was this translation helpful? Give feedback.
-
|
I have opened a pull request to resolve this issue: #59253 |
Beta Was this translation helpful? Give feedback.
-
|
A new package of @types/levelup has been released on npm with version 5.1.1: This will now work as intended using the export = and import = require() syntax: import levelup = require("levelup");
// leveldown store
const leveldown = require("leveldown") ;
const store = leveldown("./testdb")
// levelup instance
const db = levelup(store)Thanks again for report this and please mark this discussion as answered if you are satisfied with the fix! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The
leveluppackage itself usesmodule.exports = LevelUp;but the @types/levelup package doesexport const LevelUp: LevelUpConstructor... which makes the types wrong and useless for those that uselevelupdirectly.Using
"levelup": "5.1.1"with"@types/levelup": "5.1.0",Beta Was this translation helpful? Give feedback.
All reactions