mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
28 lines
669 B
TypeScript
28 lines
669 B
TypeScript
// Type definitions for level-sublevel
|
|
// Project: https://github.com/dominictarr/level-sublevel
|
|
// Definitions by: Bas Pennings <https://github.com/basp>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
import * as levelup from "levelup";
|
|
|
|
export = sublevel
|
|
|
|
declare var sublevel: sublevel.Constructor;
|
|
|
|
declare namespace sublevel {
|
|
interface Hook {
|
|
(ch: any, add: (op: Batch|boolean) => void): void;
|
|
}
|
|
|
|
interface Batch extends levelup.Batch {
|
|
prefix?: Sublevel;
|
|
}
|
|
|
|
interface Sublevel extends levelup.LevelUpBase<Batch> {
|
|
sublevel(key: string): Sublevel;
|
|
pre(hook: Hook): Function;
|
|
}
|
|
|
|
type Constructor = (levelup: levelup.LevelUp) => Sublevel
|
|
}
|