import type { BrokersFunction, ProducerRecord, RecordMetadata, } from 'kafkajs'; import { KeyObject } from 'tls'; export type KafkaConnection = { send: (record: ProducerRecord) => Promise; encode: (payload: any) => Promise; }; export type KafkaConnectionMap = Map; export type KafkaConnectionCredentials = { registry: string; // process.env.KAFKA_REGISTRY, brokers: string[] | BrokersFunction; // process.env.KAFKA_BROKERS?.split(';'), ca?: string | Buffer | Array; // process.env.KAFKA_CERT, cert?: string | Buffer | Array; // process.env.KAFKA_KEY, key?: string | Buffer | Array; // process.env.KAFKA_CA_CERT };