diff --git a/types/leveldown/index.d.ts b/types/leveldown/index.d.ts index 51630dc602..a281478b43 100644 --- a/types/leveldown/index.d.ts +++ b/types/leveldown/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for LevelDown 1.7 // Project: https://github.com/level/leveldown // Definitions by: Thiago de Arruda +// Linus Unnebäck // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -137,9 +138,11 @@ interface LevelDown { iterator(options?: ValueAsStringIteratorOptions): ValueAsStringIterator; iterator(options?: KeyAndValueAsStringIteratorOptions): KeyAndValueAsStringIterator; iterator(options?: KeyAndValueAsBufferIteratorOptions): KeyAndValueAsBufferIterator; +} + +interface Constructor { + (location: string): LevelDown; destroy(location: string, callback: ErrCallback): void; repair(location: string, callback: ErrCallback): void; } - -type Constructor = (location: string) => LevelDown; } diff --git a/types/leveldown/leveldown-tests.ts b/types/leveldown/leveldown-tests.ts index 0aa9b3625e..7b00db1a96 100644 --- a/types/leveldown/leveldown-tests.ts +++ b/types/leveldown/leveldown-tests.ts @@ -82,5 +82,5 @@ db.approximateSize("k1", "k2", (err, size) => { db.compactRange("k1", "k2", (err) => {}); -db.destroy("/path/to/db", (err) => {}); -db.repair("/path/to/db", (err) => {}); +leveldown.destroy("/path/to/db", (err) => {}); +leveldown.repair("/path/to/db", (err) => {});