-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.d.ts
38 lines (36 loc) · 1.15 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { AbstractLevel, AbstractDatabaseOptions } from 'abstract-level'
/**
* Use a [LevelDB](https://github.com/google/leveldb) database from multiple processes
* with seamless failover.
*
* @template KDefault The default type of keys if not overridden on operations.
* @template VDefault The default type of values if not overridden on operations.
*/
export class RaveLevel<KDefault = string, VDefault = string>
extends AbstractLevel<Buffer, KDefault, VDefault> {
/**
* Database constructor.
*
* @param location Directory path (relative or absolute) where LevelDB will
* store its files.
* @param options Options.
*/
constructor (
location: string,
options?: DatabaseOptions<KDefault, VDefault> | undefined
)
}
/**
* Options for the {@link RaveLevel} constructor.
*/
declare interface DatabaseOptions<K, V> extends
Omit<AbstractDatabaseOptions<K, V>, 'createIfMissing' | 'errorIfExists'> {
/**
* If true, operations are retried upon connecting to a new leader. If false,
* operations are aborted upon disconnect, which means to yield an error on e.g.
* `db.get()`.
*
* @defaultValue `true`
*/
retry?: boolean
}