Level/community

Fix Typings on DefinitelyTyped

MeirionHughes opened this issue · 7 comments

  • encoding-down
    • default export no longer available
  • leveldown:
    • default export no longer available
    • getMany()
  • rocksdb:
    • default export no longer available
    • getMany()
  • levelup:
    • default export no longer available
    • getMany()

Cross-ref issue in levelup repo.

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

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.

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.

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

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.