9
9
AbstractBatchOperation ,
10
10
AbstractBatchOptions ,
11
11
AbstractChainedBatch ,
12
+ AbstractChainedBatchWriteOptions ,
12
13
AbstractIteratorOptions ,
13
14
AbstractIterator ,
14
15
AbstractKeyIterator ,
@@ -70,20 +71,20 @@ declare class ClassicLevel<KDefault = string, VDefault = string>
70
71
del < K = KDefault > ( key : K , options : DelOptions < K > ) : Promise < void >
71
72
del < K = KDefault > ( key : K , options : DelOptions < K > , callback : NodeCallback < void > ) : void
72
73
73
- batch ( operations : Array < AbstractBatchOperation < typeof this , KDefault , VDefault > > ) : Promise < void >
74
- batch ( operations : Array < AbstractBatchOperation < typeof this , KDefault , VDefault > > , callback : NodeCallback < void > ) : void
75
- batch < K = KDefault , V = VDefault > ( operations : Array < AbstractBatchOperation < typeof this , K , V > > , options : BatchOptions < K , V > ) : Promise < void >
76
- batch < K = KDefault , V = VDefault > ( operations : Array < AbstractBatchOperation < typeof this , K , V > > , options : BatchOptions < K , V > , callback : NodeCallback < void > ) : void
74
+ batch ( operations : Array < BatchOperation < typeof this , KDefault , VDefault > > ) : Promise < void >
75
+ batch ( operations : Array < BatchOperation < typeof this , KDefault , VDefault > > , callback : NodeCallback < void > ) : void
76
+ batch < K = KDefault , V = VDefault > ( operations : Array < BatchOperation < typeof this , K , V > > , options : BatchOptions < K , V > ) : Promise < void >
77
+ batch < K = KDefault , V = VDefault > ( operations : Array < BatchOperation < typeof this , K , V > > , options : BatchOptions < K , V > , callback : NodeCallback < void > ) : void
77
78
batch ( ) : ChainedBatch < typeof this , KDefault , VDefault >
78
79
79
- iterator ( ) : AbstractIterator < typeof this , KDefault , VDefault >
80
- iterator < K = KDefault , V = VDefault > ( options : AbstractIteratorOptions < K , V > & AdditionalIteratorOptions ) : AbstractIterator < typeof this , K , V >
80
+ iterator ( ) : Iterator < typeof this , KDefault , VDefault >
81
+ iterator < K = KDefault , V = VDefault > ( options : IteratorOptions < K , V > ) : Iterator < typeof this , K , V >
81
82
82
- keys ( ) : AbstractKeyIterator < typeof this , KDefault >
83
- keys < K = KDefault > ( options : AbstractKeyIteratorOptions < K > & AdditionalIteratorOptions ) : AbstractKeyIterator < typeof this , K >
83
+ keys ( ) : KeyIterator < typeof this , KDefault >
84
+ keys < K = KDefault > ( options : KeyIteratorOptions < K > ) : KeyIterator < typeof this , K >
84
85
85
- values ( ) : AbstractValueIterator < typeof this , KDefault , VDefault >
86
- values < K = KDefault , V = VDefault > ( options : AbstractValueIteratorOptions < K , V > & AdditionalIteratorOptions ) : AbstractValueIterator < typeof this , K , V >
86
+ values ( ) : ValueIterator < typeof this , KDefault , VDefault >
87
+ values < K = KDefault , V = VDefault > ( options : ValueIteratorOptions < K , V > ) : ValueIterator < typeof this , K , V >
87
88
88
89
/**
89
90
* Get the approximate number of bytes of file system space used by the range
@@ -297,7 +298,7 @@ export interface BatchOptions<K, V> extends AbstractBatchOptions<K, V>, WriteOpt
297
298
/**
298
299
* Options for the {@link ChainedBatch.write} method.
299
300
*/
300
- export interface ChainedBatchWriteOptions extends WriteOptions { }
301
+ export interface ChainedBatchWriteOptions extends AbstractChainedBatchWriteOptions , WriteOptions { }
301
302
302
303
export class ChainedBatch < TDatabase , KDefault , VDefault > extends AbstractChainedBatch < TDatabase , KDefault , VDefault > {
303
304
write ( ) : Promise < void >
@@ -316,3 +317,14 @@ export interface StartEndOptions<K> {
316
317
*/
317
318
keyEncoding ?: string | Transcoder . PartialEncoder < K > | undefined
318
319
}
320
+
321
+ // Export remaining types so that consumers don't have to guess whether they're extended
322
+ export type BatchOperation < TDatabase , K , V > = AbstractBatchOperation < TDatabase , K , V >
323
+
324
+ export type Iterator < TDatabase , K , V > = AbstractIterator < TDatabase , K , V >
325
+ export type KeyIterator < TDatabase , K > = AbstractKeyIterator < TDatabase , K >
326
+ export type ValueIterator < TDatabase , K , V > = AbstractValueIterator < TDatabase , K , V >
327
+
328
+ export type IteratorOptions < K , V > = AbstractIteratorOptions < K , V > & AdditionalIteratorOptions
329
+ export type KeyIteratorOptions < K > = AbstractKeyIteratorOptions < K > & AdditionalIteratorOptions
330
+ export type ValueIteratorOptions < K , V > = AbstractValueIteratorOptions < K , V > & AdditionalIteratorOptions
0 commit comments