diff --git a/types/index.d.ts b/types/index.d.ts index ff168b24c..0f90bdeb9 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -631,16 +631,26 @@ export type Broker = { }): Promise } -export type KafkaMessage = { +interface MessageSetEntry { key: Buffer | null value: Buffer | null timestamp: string + attributes: number + offset: string size: number +} + +interface RecordBatchEntry { + key: Buffer | null + value: Buffer | null + timestamp: string attributes: number offset: string - headers?: IHeaders + headers: IHeaders } +export type KafkaMessage = MessageSetEntry | RecordBatchEntry + export interface ProducerRecord { topic: string messages: Message[]