Level / community

Discussion, support and common information for projects in the community.
MIT License
42 stars 15 forks source link

Fix Typings on DefinitelyTyped #104

Closed MeirionHughes closed 2 years ago

MeirionHughes commented 2 years ago
sebastianst commented 2 years ago

Cross-ref issue in levelup repo.

sebastianst commented 2 years ago

It would also be good to remove the unused type LevelUpBatch in the leveup types declaration file.

MeirionHughes commented 2 years ago

been delayed on this ... I'm in the middle of a init product release that is draining my will to live. Once that's done, and the rocksdb gets a new release, I'll start upgrading our dependencies and work through the types.

sebastianst commented 2 years ago

The return type of db.iterator() also needs to be fixed. It should be something like AsyncIterable<[K, V]>. The current custom return type doesn't allow for async (const x of it) syntax in typescript code.

sebastianst commented 2 years ago

The LevelUpConstructor interface could be improved to accept a ErrorValueCallback<LevelUp> as the third parameter, it currently only receives ErrorCallback. (Or ErrorValueCallback<LevelUp|undefined>?)

vweevers commented 2 years ago

Relevant: https://github.com/Level/abstract-level/issues/5

vweevers commented 2 years ago

Closing because abstract-level and dependents have built-in type declarations. If someone wants to fix the typings of older modules on DT, go for it of course, but because @MeirionHughes is the main contributor of those types and seems to be busy, and the work needs to happen externally, I don't see an actionable item for us here.