consume callback has an incorrect typing
Environment Information
- node-rdkafka version [e.g. 2.3.3]: 2.18.0
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
writeRegisters [1] and read[..]Registers method allow you to write and read the buffer, when writing and reading you can set the buffer using the encoding you need, see a read example [2][3].
[1] https://github.com/yaacov/node-modbus-serial/blob/master/ModbusRTU.d.ts#L60 [2] https://github.com/yaacov/node-modbus-serial/blob/master/ModbusRTU.d.ts#L77 [3] https://github.com/yaacov/node-modbus-serial/blob/master/examples/buffer.js#L28