import { type ProducerConfig } from "kafkajs";
import { BaseKafka } from "./BaseKafka";
import type { PublishType } from "../types/BrokerType";
/**
 * BaseProducer class provides basic functionality for producing messages to a Kafka topic.
 * It manages the connection, disconnection, and message publishing logic for Kafka producers.
 */
export declare class BaseProducer {
    private producer;
    private kafka;
    /**
     * Creates an instance of BaseProducer using a BaseKafka instance.
     *
     * @param {BaseKafka} baseKafka - The instance of the BaseKafka class which provides access to the Kafka client.
     */
    constructor(baseKafka: BaseKafka);
    /**
     * Connects the producer to the Kafka cluster with the specified optional configuration.
     * If the producer is already connected, it logs a message and does nothing.
     *
     * @param {ProducerConfig} [config] - Optional additional configuration for the producer.
     * @returns {Promise<void>} - A promise that resolves once the producer is connected.
     */
    connect(config?: ProducerConfig): Promise<void>;
    /**
     * Disconnects the producer from the Kafka cluster.
     * If the producer is already disconnected, it logs a message and does nothing.
     *
     * @returns {Promise<void>} - A promise that resolves once the producer is disconnected.
     */
    disconnect(): Promise<void>;
    /**
     * Publishes a message to a Kafka topic.
     * If the producer is not connected, it throws an error.
     *
     * @param {PublishType} data - The data to publish, including the topic, event, headers, and message content.
     * @returns {Promise<boolean>} - A promise that resolves to true if the message was successfully sent, false otherwise.
     * @throws {Error} - Throws an error if the producer is not connected.
     */
    publish(data: PublishType): Promise<boolean>;
}
//# sourceMappingURL=BaseProducer.d.ts.map