4
4
AbstractOpenOptions ,
5
5
AbstractGetOptions ,
6
6
AbstractGetManyOptions ,
7
+ AbstractHasOptions ,
8
+ AbstractHasManyOptions ,
7
9
AbstractPutOptions ,
8
10
AbstractDelOptions ,
9
11
AbstractBatchOperation ,
@@ -16,6 +18,7 @@ import {
16
18
AbstractKeyIteratorOptions ,
17
19
AbstractValueIterator ,
18
20
AbstractValueIteratorOptions ,
21
+ AbstractSnapshot ,
19
22
Transcoder
20
23
} from 'abstract-level'
21
24
@@ -54,6 +57,12 @@ declare class ClassicLevel<KDefault = string, VDefault = string>
54
57
getMany ( keys : KDefault [ ] ) : Promise < ( VDefault | undefined ) [ ] >
55
58
getMany < K = KDefault , V = VDefault > ( keys : K [ ] , options : GetManyOptions < K , V > ) : Promise < ( V | undefined ) [ ] >
56
59
60
+ has ( key : KDefault ) : Promise < boolean >
61
+ has < K = KDefault > ( key : K , options : HasOptions < K > ) : Promise < boolean >
62
+
63
+ hasMany ( keys : KDefault [ ] ) : Promise < boolean [ ] >
64
+ hasMany < K = KDefault > ( keys : K [ ] , options : HasManyOptions < K > ) : Promise < boolean [ ] >
65
+
57
66
put ( key : KDefault , value : VDefault ) : Promise < void >
58
67
put < K = KDefault , V = VDefault > ( key : K , value : V , options : PutOptions < K , V > ) : Promise < void >
59
68
@@ -73,6 +82,8 @@ declare class ClassicLevel<KDefault = string, VDefault = string>
73
82
values ( ) : ValueIterator < typeof this , KDefault , VDefault >
74
83
values < K = KDefault , V = VDefault > ( options : ValueIteratorOptions < K , V > ) : ValueIterator < typeof this , K , V >
75
84
85
+ snapshot ( options ?: any | undefined ) : Snapshot
86
+
76
87
/**
77
88
* Get the approximate number of bytes of file system space used by the range
78
89
* `[start..end)`.
@@ -198,15 +209,15 @@ export interface OpenOptions extends AbstractOpenOptions {
198
209
/**
199
210
* Allows multi-threaded access to a single DB instance for sharing a DB
200
211
* across multiple worker threads within the same process.
201
- *
212
+ *
202
213
* @defaultValue `false`
203
214
*/
204
215
multithreading ?: boolean | undefined
205
216
}
206
217
207
218
/**
208
- * Additional options for the {@link ClassicLevel.get} and {@link ClassicLevel.getMany}
209
- * methods.
219
+ * Additional options for the {@link ClassicLevel.get}, {@link ClassicLevel.getMany},
220
+ * { @link ClassicLevel.has} and { @link ClassicLevel.hasMany} methods.
210
221
*/
211
222
declare interface ReadOptions {
212
223
/**
@@ -229,6 +240,16 @@ export interface GetOptions<K, V> extends AbstractGetOptions<K, V>, ReadOptions
229
240
*/
230
241
export interface GetManyOptions < K , V > extends AbstractGetManyOptions < K , V > , ReadOptions { }
231
242
243
+ /**
244
+ * Options for the {@link ClassicLevel.has} method.
245
+ */
246
+ export interface HasOptions < K > extends AbstractHasOptions < K > , ReadOptions { }
247
+
248
+ /**
249
+ * Options for the {@link ClassicLevel.hasMany} method.
250
+ */
251
+ export interface HasManyOptions < K > extends AbstractHasManyOptions < K > , ReadOptions { }
252
+
232
253
/**
233
254
* Additional options for the {@link ClassicLevel.iterator}, {@link ClassicLevel.keys}
234
255
* and {@link ClassicLevel.values} methods.
@@ -315,3 +336,5 @@ export type ValueIterator<TDatabase, K, V> = AbstractValueIterator<TDatabase, K,
315
336
export type IteratorOptions < K , V > = AbstractIteratorOptions < K , V > & AdditionalIteratorOptions
316
337
export type KeyIteratorOptions < K > = AbstractKeyIteratorOptions < K > & AdditionalIteratorOptions
317
338
export type ValueIteratorOptions < K , V > = AbstractValueIteratorOptions < K , V > & AdditionalIteratorOptions
339
+
340
+ export type Snapshot = AbstractSnapshot
0 commit comments