From eb73d5bc4ce051cfa5200d4475628eaab4d604b9 Mon Sep 17 00:00:00 2001 From: Tapani Moilanen Date: Tue, 16 Jul 2024 20:25:02 +0300 Subject: [PATCH] Allow null in consumer commitSync typings (#1082) KafkaConsumer incorrectly requires that commitSync be supplied with a TopicPartitionOffset or an array of TopicPartitionOffsets, when docs say that null can be passed to commit all read offsets. --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 4cd46ec1..ece3c531 100644 --- a/index.d.ts +++ b/index.d.ts @@ -218,7 +218,7 @@ export class KafkaConsumer extends Client { commitMessageSync(msg: TopicPartitionOffset): this; - commitSync(topicPartition: TopicPartitionOffset | TopicPartitionOffset[]): this; + commitSync(topicPartition: TopicPartitionOffset | TopicPartitionOffset[] | null): this; committed(toppars: TopicPartition[], timeout: number, cb: (err: LibrdKafkaError, topicPartitions: TopicPartitionOffset[]) => void): this; committed(timeout: number, cb: (err: LibrdKafkaError, topicPartitions: TopicPartitionOffset[]) => void): this;