1
+ /* eslint-disable @typescript-eslint/ban-types */
2
+ // this ignore is so we can use {} as the default value for the options
3
+ // extensions below - it normally means "any non-nullish value" but here
4
+ // we are using it as an intersection type - see the aside at the bottom:
5
+ // https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492
6
+
1
7
import { Key } from './key.js'
2
8
import type {
3
9
Await ,
@@ -11,18 +17,18 @@ export interface Pair {
11
17
value : Uint8Array
12
18
}
13
19
14
- export interface Batch < BatchOptionsExtension = unknown > {
20
+ export interface Batch < BatchOptionsExtension = { } > {
15
21
put : ( key : Key , value : Uint8Array ) => void
16
22
delete : ( key : Key ) => void
17
23
commit : ( options ?: AbortOptions & BatchOptionsExtension ) => Await < void >
18
24
}
19
25
20
- export interface Datastore < HasOptionsExtension = unknown ,
21
- PutOptionsExtension = unknown , PutManyOptionsExtension = unknown ,
22
- GetOptionsExtension = unknown , GetManyOptionsExtension = unknown ,
23
- DeleteOptionsExtension = unknown , DeleteManyOptionsExtension = unknown ,
24
- QueryOptionsExtension = unknown , QueryKeysOptionsExtension = unknown ,
25
- BatchOptionsExtension = unknown
26
+ export interface Datastore < HasOptionsExtension = { } ,
27
+ PutOptionsExtension = { } , PutManyOptionsExtension = { } ,
28
+ GetOptionsExtension = { } , GetManyOptionsExtension = { } ,
29
+ DeleteOptionsExtension = { } , DeleteManyOptionsExtension = { } ,
30
+ QueryOptionsExtension = { } , QueryKeysOptionsExtension = { } ,
31
+ BatchOptionsExtension = { }
26
32
> extends Store < Key , Uint8Array , Pair , HasOptionsExtension ,
27
33
PutOptionsExtension , PutManyOptionsExtension ,
28
34
GetOptionsExtension , GetManyOptionsExtension ,
0 commit comments