File tree Expand file tree Collapse file tree 4 files changed +23
-1
lines changed Expand file tree Collapse file tree 4 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ export abstract class Storage {
13
13
abstract entries < CustomValueType = unknown > ( ) :
14
14
| IterableIterator < [ string , CustomValueType ] >
15
15
| Promise < [ string , CustomValueType ] [ ] > ;
16
+ abstract open ( ) : Promise < void > ;
17
+ abstract close ( ) : Promise < void > ;
16
18
}
17
19
18
20
export interface GenericStorageOptions {
Original file line number Diff line number Diff line change @@ -264,10 +264,14 @@ export class LevelDBStorage extends Storage {
264
264
*
265
265
* @memberof LevelDBStorage
266
266
*/
267
- async open ( ) {
267
+ async open ( ) : Promise < void > {
268
268
await this . db . open ( ) ;
269
269
}
270
270
271
+ async close ( ) : Promise < void > {
272
+ await this . db . close ( ) ;
273
+ }
274
+
271
275
/**
272
276
* Returns the LevelDB instance
273
277
*
Original file line number Diff line number Diff line change @@ -258,6 +258,14 @@ export class LocalStorage extends Storage {
258
258
259
259
return entriesIterator ( ) ;
260
260
}
261
+
262
+ close ( ) : Promise < void > {
263
+ return Promise . resolve ( undefined ) ;
264
+ }
265
+
266
+ open ( ) : Promise < void > {
267
+ return Promise . resolve ( undefined ) ;
268
+ }
261
269
}
262
270
263
271
/**
Original file line number Diff line number Diff line change @@ -223,6 +223,14 @@ export class MemoryStorage extends Storage {
223
223
? entriesIterator ( )
224
224
: ( this . db . entries ( ) as IterableIterator < [ string , ValueType ] > ) ;
225
225
}
226
+
227
+ close ( ) : Promise < void > {
228
+ return Promise . resolve ( undefined ) ;
229
+ }
230
+
231
+ open ( ) : Promise < void > {
232
+ return Promise . resolve ( undefined ) ;
233
+ }
226
234
}
227
235
228
236
// Storage configuration
You can’t perform that action at this time.
0 commit comments