1 | import * as AbstractLevel from 'abstract-level'
|
2 | import * as ClassicLevel from 'classic-level'
|
3 | import * as BrowserLevel from 'browser-level'
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | export class Level<KDefault = string, VDefault = string>
|
12 | extends AbstractLevel.AbstractLevel<string | Buffer | Uint8Array, KDefault, VDefault> {
|
13 | |
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | constructor (location: string, options?: DatabaseOptions<KDefault, VDefault> | undefined)
|
23 |
|
24 | /**
|
25 | * Location that was passed to the constructor.
|
26 | */
|
27 | get location (): string
|
28 |
|
29 | open (): Promise<void>
|
30 | open (options: OpenOptions): Promise<void>
|
31 | open (callback: AbstractLevel.NodeCallback<void>): void
|
32 | open (options: OpenOptions, callback: AbstractLevel.NodeCallback<void>): void
|
33 |
|
34 | get (key: KDefault): Promise<VDefault>
|
35 | get (key: KDefault, callback: AbstractLevel.NodeCallback<VDefault>): void
|
36 | get<K = KDefault, V = VDefault> (key: K, options: GetOptions<K, V>): Promise<V>
|
37 | get<K = KDefault, V = VDefault> (key: K, options: GetOptions<K, V>, callback: AbstractLevel.NodeCallback<V>): void
|
38 |
|
39 | getMany (keys: KDefault[]): Promise<VDefault[]>
|
40 | getMany (keys: KDefault[], callback: AbstractLevel.NodeCallback<VDefault[]>): void
|
41 | getMany<K = KDefault, V = VDefault> (keys: K[], options: GetManyOptions<K, V>): Promise<V[]>
|
42 | getMany<K = KDefault, V = VDefault> (keys: K[], options: GetManyOptions<K, V>, callback: AbstractLevel.NodeCallback<V[]>): void
|
43 |
|
44 | put (key: KDefault, value: VDefault): Promise<void>
|
45 | put (key: KDefault, value: VDefault, callback: AbstractLevel.NodeCallback<void>): void
|
46 | put<K = KDefault, V = VDefault> (key: K, value: V, options: PutOptions<K, V>): Promise<void>
|
47 | put<K = KDefault, V = VDefault> (key: K, value: V, options: PutOptions<K, V>, callback: AbstractLevel.NodeCallback<void>): void
|
48 |
|
49 | del (key: KDefault): Promise<void>
|
50 | del (key: KDefault, callback: AbstractLevel.NodeCallback<void>): void
|
51 | del<K = KDefault> (key: K, options: DelOptions<K>): Promise<void>
|
52 | del<K = KDefault> (key: K, options: DelOptions<K>, callback: AbstractLevel.NodeCallback<void>): void
|
53 |
|
54 | batch (operations: Array<BatchOperation<typeof this, KDefault, VDefault>>): Promise<void>
|
55 | batch (operations: Array<BatchOperation<typeof this, KDefault, VDefault>>, callback: AbstractLevel.NodeCallback<void>): void
|
56 | batch<K = KDefault, V = VDefault> (operations: Array<BatchOperation<typeof this, K, V>>, options: BatchOptions<K, V>): Promise<void>
|
57 | batch<K = KDefault, V = VDefault> (operations: Array<BatchOperation<typeof this, K, V>>, options: BatchOptions<K, V>, callback: AbstractLevel.NodeCallback<void>): void
|
58 | batch (): ChainedBatch<typeof this, KDefault, VDefault>
|
59 |
|
60 | iterator (): Iterator<typeof this, KDefault, VDefault>
|
61 | iterator<K = KDefault, V = VDefault> (options: IteratorOptions<K, V>): Iterator<typeof this, K, V>
|
62 |
|
63 | keys (): KeyIterator<typeof this, KDefault>
|
64 | keys<K = KDefault> (options: KeyIteratorOptions<K>): KeyIterator<typeof this, K>
|
65 |
|
66 | values (): ValueIterator<typeof this, KDefault, VDefault>
|
67 | values<K = KDefault, V = VDefault> (options: ValueIteratorOptions<K, V>): ValueIterator<typeof this, K, V>
|
68 | }
|
69 |
|
70 | export type DatabaseOptions<K, V> = ClassicLevel.DatabaseOptions<K, V> & BrowserLevel.DatabaseOptions<K, V>
|
71 | export type OpenOptions = ClassicLevel.OpenOptions & BrowserLevel.OpenOptions
|
72 | export type GetOptions<K, V> = ClassicLevel.GetOptions<K, V> & BrowserLevel.GetOptions<K, V>
|
73 | export type GetManyOptions<K, V> = ClassicLevel.GetManyOptions<K, V> & BrowserLevel.GetManyOptions<K, V>
|
74 | export type PutOptions<K, V> = ClassicLevel.PutOptions<K, V> & BrowserLevel.PutOptions<K, V>
|
75 | export type DelOptions<K> = ClassicLevel.DelOptions<K> & BrowserLevel.DelOptions<K>
|
76 |
|
77 | export type BatchOptions<K, V> = ClassicLevel.BatchOptions<K, V> & BrowserLevel.BatchOptions<K, V>
|
78 | export type BatchOperation<TDatabase, K, V> = ClassicLevel.BatchOperation<TDatabase, K, V> & BrowserLevel.BatchOperation<TDatabase, K, V>
|
79 | export type ChainedBatch<TDatabase, K, V> = ClassicLevel.ChainedBatch<TDatabase, K, V> & BrowserLevel.ChainedBatch<TDatabase, K, V>
|
80 |
|
81 | export type Iterator<TDatabase, K, V> = ClassicLevel.Iterator<TDatabase, K, V> & BrowserLevel.Iterator<TDatabase, K, V>
|
82 | export type KeyIterator<TDatabase, K> = ClassicLevel.KeyIterator<TDatabase, K> & BrowserLevel.KeyIterator<TDatabase, K>
|
83 | export type ValueIterator<TDatabase, K, V> = ClassicLevel.ValueIterator<TDatabase, K, V> & BrowserLevel.ValueIterator<TDatabase, K, V>
|
84 |
|
85 | export type IteratorOptions<K, V> = ClassicLevel.IteratorOptions<K, V> & BrowserLevel.IteratorOptions<K, V>
|
86 | export type KeyIteratorOptions<K> = ClassicLevel.KeyIteratorOptions<K> & BrowserLevel.KeyIteratorOptions<K>
|
87 | export type ValueIteratorOptions<K, V> = ClassicLevel.ValueIteratorOptions<K, V> & BrowserLevel.ValueIteratorOptions<K, V>
|