mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
tweak recently added 'level-js' types (#36301)
This commit is contained in:
parent
9fc90d53a9
commit
f23dae8c89
27
types/level-js/index.d.ts
vendored
27
types/level-js/index.d.ts
vendored
@ -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;
|
||||
|
||||
@ -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');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user