Blizzard / node-rdkafka

Node.js bindings for librdkafka
MIT License
2.11k stars 392 forks source link

consume callback has an incorrect typing #1055

Open abarisain opened 10 months ago

abarisain commented 10 months ago

Environment Information

Steps to Reproduce

Use .consume(callback) from typescript. Type of "messages" in the callback is Message[] while the lib returns a single message. I have to force cast it to use it:

consumer.consume((err, msg) => {
  const message = msg as unknown as RDKafka.Message;

The .consume variant with two parameters is alright