mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-20 21:12:38 +08:00
24 lines
579 B
TypeScript
24 lines
579 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
|
|
|
|
/// <reference types="levelup" />
|
|
|
|
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;
|
|
} |