import { type EachMessagePayload } from 'kafkajs';
/**
 * BaseConsumer class to handle Kafka consumer operations such as connecting,
 * subscribing to topics, consuming messages, and disconnecting.
 */
export declare class BaseConsumer {
    private kafka;
    private consumer;
    private groupId;
    /**
     * @param clientId - The client ID used to identify the consumer instance.
     * @param brokers - An array of Kafka brokers to connect to.
     * @param groupId - The consumer group ID to which this consumer belongs.
     */
    constructor(clientId: string, brokers: string[], groupId: string);
    /**
     * Connects the consumer to the Kafka cluster.
     * This method establishes the connection between the consumer and the Kafka brokers.
     */
    connect(): Promise<void>;
    /**
     * Subscribes the consumer to a Kafka topic.
     *
     * @param topic - The Kafka topic to subscribe to.
     * @param fromBeginning - Whether to start reading from the beginning of the topic (default: true).
     */
    subscribe(topic: string, fromBeginning?: boolean): Promise<void>;
    /**
     * Starts consuming messages from the Kafka topic.
     * The provided `eachMessageHandler` will be executed for each consumed message.
     *
     * @param eachMessageHandler - A callback function that processes each consumed message.
     */
    run(eachMessageHandler: (payload: EachMessagePayload) => Promise<void>): Promise<void>;
    /**
     * Disconnects the consumer from the Kafka cluster.
     * This method gracefully shuts down the consumer connection.
     */
    disconnect(): Promise<void>;
}
//# sourceMappingURL=BaseConsumer.d.ts.map