Level / abstract-level

Abstract class for a lexicographically sorted key-value database.
MIT License
128 stars 8 forks source link

Wrong Type declarations for .all() and .nextv() methods AbstractKeyIterator and AbstractValueIterator #86

Open bredthau opened 6 months ago

bredthau commented 6 months ago

According to the typescript declarations the Promise overloads of .all() and .nextv() of AbstractKeyIterator return Promise<[K]>. However they should return a promise to an array of type K (so Promise<K[]> or Promise<Array<K>>). Similarly the Callback versions are declared to take NodeCallback<[K]> where it should be NodeCallback<Array<K>>. The same situation exists for AbstractValueIterator, only with [V] where it should be Array<V> instead of [K].

vweevers commented 3 weeks ago

PR is welcome. Let's use the K[] notation rather than Array<K> (same as https://github.com/Level/abstract-level/pull/67).