Skip to content

Commit

Permalink
update TypeScript typings for v4
Browse files Browse the repository at this point in the history
* remove approximateSize() and isLevelDOWN()
* make Batch value optional
* add missing db property to AbstractIterator
  • Loading branch information
vweevers committed Feb 8, 2018
1 parent 268e59b commit b353fb4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions index.d.ts
Expand Up @@ -19,8 +19,6 @@ interface AbstractLevelDOWN<K=any, V=any, O=any, PO=any, GO=any, DO=any, IO=any,

iterator(options?: IO & AbstractIteratorOptions<K>): AbstractIterator<K, V>;

approximateSize(start: K, end: K, cb: (err: any, size: number) => void): void;

[index: string]: any;
}

Expand All @@ -42,7 +40,7 @@ export interface AbstractIteratorOptions<K=any> {
values?: boolean;
}

export type Batch<K=any, V=any> = PutBatch<K, V> | DelBatch<K>
export type Batch<K=any, V?=any> = PutBatch<K, V> | DelBatch<K>

export interface PutBatch<K=any, V=any> {
type: 'put',
Expand All @@ -56,6 +54,7 @@ export interface DelBatch<K=any, V=any> {
}

interface AbstractIterator<K=any, V=any> {
db: any;
next(callback: (err: any, key: K, value: V) => void): void;
end(callback: (err: any) => void): void;
}
Expand All @@ -82,4 +81,3 @@ interface AbstractChainedBatchConstructor {
export const AbstractLevelDOWN: AbstractLevelDOWNConstructor
export const AbstractIterator: AbstractIteratorConstructor
export const AbstractChainedBatch: AbstractChainedBatchConstructor
export function isLevelDOWN(db: any): boolean;

0 comments on commit b353fb4

Please sign in to comment.