declare module "abstract-leveldown" { type ObjectAny = { [index: string]: any; } type ErrorCallback = (err: Error | undefined) => void; type ErrorValueCallback = (err: Error | undefined, value: V) => void; type ErrorKeyValueCallback = (err: Error | undefined, key: K, value: V) => void; export interface AbstractOpenOptions extends ObjectAny { createIfMissing?: boolean; errorIfExists?: boolean; } export interface AbstractGetOptions extends ObjectAny { asBuffer?: boolean; } export interface AbstractPutOptions extends ObjectAny { } export interface AbstractDelOptions extends ObjectAny { } export interface AbstractBatchOptions extends ObjectAny { } export interface AbstractLevelDOWN extends ObjectAny { open(cb: ErrorCallback): void; open(options: AbstractOpenOptions, cb: ErrorCallback): void; close(cb: ErrorCallback): void; get(key: K, cb: ErrorValueCallback): void; get(key: K, options: AbstractGetOptions, cb: ErrorValueCallback): void; put(key: K, value: V, cb: ErrorCallback): void; put(key: K, value: V, options: AbstractPutOptions, cb: ErrorCallback): void; del(key: K, cb: ErrorCallback): void; del(key: K, options: AbstractDelOptions, cb: ErrorCallback): void; batch(): AbstractChainedBatch; batch(array: AbstractBatch[], cb: ErrorCallback): AbstractChainedBatch; batch(array: AbstractBatch[], options: AbstractBatchOptions, cb: ErrorCallback): AbstractChainedBatch; iterator(options?: AbstractIteratorOptions): AbstractIterator; } interface AbstractLevelDOWNConstructor { new (location: string): AbstractLevelDOWN; (location: string): AbstractLevelDOWN; } export interface AbstractIteratorOptions extends ObjectAny { gt?: K; gte?: K; lt?: K; lte?: K; reverse?: boolean; limit?: number; keys?: boolean; values?: boolean; keyAsBuffer?: boolean; valueAsBuffer?: boolean; } export type AbstractBatch = PutBatch | DelBatch export interface PutBatch { type: 'put', key: K, value: V } export interface DelBatch { type: 'del', key: K } export interface AbstractChainedBatch extends AbstractChainedBatchConstructor, ObjectAny { put(key: K, value: V): this; del(key: K): this; clear(): this; write(cb: ErrorCallback): any write(options: any, cb: ErrorCallback): any } interface AbstractChainedBatchConstructor { new(db: any): AbstractChainedBatch; (db: any): AbstractChainedBatch; } export interface AbstractIterator extends AbstractChainedBatchConstructor { db: AbstractLevelDOWN; next(cb: ErrorKeyValueCallback): this; end(cb: ErrorCallback): void; } interface AbstractIteratorConstructor { new(db: any): AbstractIterator; (db: any): AbstractIterator; } export const AbstractLevelDOWN: AbstractLevelDOWNConstructor export const AbstractIterator: AbstractIteratorConstructor export const AbstractChainedBatch: AbstractChainedBatchConstructor //export default AbstractLevelDOWN; }