tweak recently added 'level-js' types (#36301)

This commit is contained in:
Daniel Byrne 2019-06-19 16:03:23 -07:00 committed by Daniel Rosenwasser
parent 9fc90d53a9
commit f23dae8c89
2 changed files with 15 additions and 14 deletions

View File

@ -6,22 +6,23 @@
import { AbstractLevelDOWN, AbstractOptions } from 'abstract-leveldown';
export interface Level extends AbstractLevelDOWN {
readonly location: string;
readonly prefix: string;
readonly version: string | number;
destroy(location: string, cb: (err: Error | undefined) => void): void;
destroy(location: string, prefix: string, cb: (err: Error | undefined) => void): void;
interface Level extends AbstractLevelDOWN {
readonly location: string;
readonly prefix: string;
readonly version: string | number;
destroy(location: string, cb: (err: Error | undefined) => void): void;
destroy(location: string, prefix: string, cb: (err: Error | undefined) => void): void;
}
export interface LevelOptions {
readonly prefix?: string;
readonly version?: string | number;
interface LevelOptions {
readonly prefix?: string;
readonly version?: string | number;
}
export interface LevelConstructor {
new (location: string, options?: LevelOptions): Level;
(location: string, options?: LevelOptions): Level;
interface LevelConstructor {
new (location: string, options?: LevelOptions): Level;
(location: string, options?: LevelOptions): Level;
}
export const Level: LevelConstructor;
declare const Level: LevelConstructor;
export = Level;

View File

@ -1,5 +1,5 @@
/// <reference types="node" />
import { Level } from 'level-js';
import Level = require('level-js');
const db = Level('bigData');
const dbClass = new Level('bigData');