From 392b7f7bb6ac151810e7f285976352d8dc0055dd Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sun, 6 Mar 2022 14:17:08 +0100 Subject: [PATCH] Fix TypeScript declaration of chained batch `write()` options --- index.d.ts | 3 ++- types/abstract-chained-batch.d.ts | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index 760cb71..3cdcc8c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -26,7 +26,8 @@ export { export { AbstractChainedBatch, AbstractChainedBatchPutOptions, - AbstractChainedBatchDelOptions + AbstractChainedBatchDelOptions, + AbstractChainedBatchWriteOptions } from './types/abstract-chained-batch' export { diff --git a/types/abstract-chained-batch.d.ts b/types/abstract-chained-batch.d.ts index 4ebe5be..0d5e305 100644 --- a/types/abstract-chained-batch.d.ts +++ b/types/abstract-chained-batch.d.ts @@ -45,9 +45,9 @@ export class AbstractChainedBatch { * commits. */ write (): Promise - write (options: {}): Promise + write (options: AbstractChainedBatchWriteOptions): Promise write (callback: NodeCallback): void - write (options: {}, callback: NodeCallback): void + write (options: AbstractChainedBatchWriteOptions, callback: NodeCallback): void /** * Free up underlying resources. This should be done even if the chained batch has @@ -113,3 +113,11 @@ export interface AbstractChainedBatchDelOptions { */ sublevel?: AbstractSublevel | undefined } + +/** + * Options for the {@link AbstractChainedBatch.write} method. + */ +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface AbstractChainedBatchWriteOptions { + // There are no abstract options but implementations may add theirs. +}