Skip to content

Commit 392b7f7

Browse files
committed
Fix TypeScript declaration of chained batch write() options
1 parent 4bdeea9 commit 392b7f7

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export {
2626
export {
2727
AbstractChainedBatch,
2828
AbstractChainedBatchPutOptions,
29-
AbstractChainedBatchDelOptions
29+
AbstractChainedBatchDelOptions,
30+
AbstractChainedBatchWriteOptions
3031
} from './types/abstract-chained-batch'
3132

3233
export {

types/abstract-chained-batch.d.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ export class AbstractChainedBatch<TDatabase, KDefault, VDefault> {
4545
* commits.
4646
*/
4747
write (): Promise<void>
48-
write (options: {}): Promise<void>
48+
write (options: AbstractChainedBatchWriteOptions): Promise<void>
4949
write (callback: NodeCallback<void>): void
50-
write (options: {}, callback: NodeCallback<void>): void
50+
write (options: AbstractChainedBatchWriteOptions, callback: NodeCallback<void>): void
5151

5252
/**
5353
* Free up underlying resources. This should be done even if the chained batch has
@@ -113,3 +113,11 @@ export interface AbstractChainedBatchDelOptions<TDatabase, K> {
113113
*/
114114
sublevel?: AbstractSublevel<TDatabase, any, any, any> | undefined
115115
}
116+
117+
/**
118+
* Options for the {@link AbstractChainedBatch.write} method.
119+
*/
120+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
121+
export interface AbstractChainedBatchWriteOptions {
122+
// There are no abstract options but implementations may add theirs.
123+
}

0 commit comments

Comments
 (0)