New definition files for level-sublevel

This commit is contained in:
Bas Pennings
2015-09-14 16:05:03 +02:00
parent 7a3ca1f0b8
commit 072ab07618
2 changed files with 52 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
// Type definitions for level-sublevel
// Project: https://github.com/dominictarr/level-sublevel
// Definitions by: Bas Pennings <https://github.com/basp/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../levelup/levelup.d.ts" />
interface Hook {
(ch: any, add: (op: Batch|boolean) => void): void;
}
interface Batch {
prefix?: Sublevel;
}
interface Sublevel extends LevelUp {
sublevel(key: string): Sublevel;
pre(hook: Hook): Function;
}
declare module "level-sublevel" {
function sublevel(levelup: LevelUp): Sublevel;
export = sublevel;
}