import { ConsumerRunConfig, type Consumer, type ConsumerConfig } from "kafkajs";
import { BaseKafka } from "./BaseKafka";
import type { MessageHandler } from "../types/BrokerType";
/**
 * BaseConsumer class provides basic functionality for consuming messages from a Kafka topic.
 * It manages the connection, subscription, and message handling logic for Kafka consumers.
 */
export declare class BaseConsumer {
    consumer: Consumer | null;
    private kafka;
    /**
     * Creates an instance of BaseConsumer 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 consumer to the Kafka cluster with the specified group ID and optional consumer configuration.
     * If the consumer is already connected, it logs a message and does nothing.
     *
     * @param {string} groupId - The consumer group ID to join.
     * @param {ConsumerConfig} [config] - Optional additional configuration for the consumer.
     * @returns {Promise<void>} - A promise that resolves once the consumer is connected.
     */
    connect(groupId: string, config?: ConsumerConfig): Promise<void>;
    /**
     * Disconnects the consumer from the Kafka cluster.
     * If the consumer is already disconnected, it logs a message and does nothing.
     *
     * @returns {Promise<void>} - A promise that resolves once the consumer is disconnected.
     */
    disconnect(): Promise<void>;
    /**
     * Subscribes the consumer to a Kafka topic and starts processing messages from the topic.
     * The consumer runs the provided message handler for each received message.
     *
     * @param {string} topic - The Kafka topic to subscribe to.
     * @param {MessageHandler} messageHandler - A function to handle the processed messages.
     * @returns {Promise<void>} - A promise that resolves once the consumer has successfully subscribed and started processing messages.
     * @throws {Error} - Throws an error if the consumer is not connected before subscribing.
     */
    subscribe(topic: string, messageHandler: MessageHandler, consumerRunConfig?: ConsumerRunConfig): Promise<void>;
}
//# sourceMappingURL=BaseConsumer.d.ts.map