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