import { Worker, Job } from "bullmq";
import { RedisClient } from "../../config/redis-config";
import { QueueName } from "../../events/types/event-types";
import { WhatsAppEvent, EventProcessingResult } from "../../events/types/event-interfaces";
/**
 * Clase principal para manejo de message queues con BullMQ
 */
export declare class WhatsAppMessageQueue {
    private redisClient;
    private queues;
    private workers;
    private isInitialized;
    constructor(redisClient: RedisClient);
    /**
     * Inicializa todas las colas del sistema
     */
    initialize(): Promise<void>; /**
     * Verifica si el sistema está inicializado
     */
    getInitializedStatus(): boolean;
    /**
     * Asegura que el sistema esté inicializado, inicializando si es necesario
     */
    ensureInitialized(): Promise<void>;
    /**
     * Publica un evento en la cola correspondiente
     */
    publishEvent(event: WhatsAppEvent, queueName?: QueueName): Promise<void>; /**
     * Publica múltiples eventos en batch
     */
    publishBatch(events: WhatsAppEvent[], queueName?: QueueName): Promise<void>;
    /**
     * Crea un worker para procesar eventos de una cola específica
     */
    createWorker(queueName: QueueName, processor: (job: Job<WhatsAppEvent>) => Promise<EventProcessingResult>): Worker<WhatsAppEvent>;
    /**
     * Obtiene estadísticas de una cola específica
     */
    getQueueStats(queueName: QueueName): Promise<any>;
    /**
     * Cierra todas las colas y workers
     */
    close(): Promise<void>; /**
     * Crea todas las colas del sistema
     */
    private createQueues;
    /**
     * Obtiene la cola por defecto para un tipo de evento
     */
    private getDefaultQueue;
    /**
     * Genera un ID único para el evento
     */
    private generateEventId;
    /**
     * Obtiene el número de intentos para un tipo de evento
     */
    private getAttemptsForEvent;
    /**
     * Configura event listeners para un worker
     */
    private setupWorkerEventListeners;
    /**
     * Check if the message queue system is ready
     */ isReady(): Promise<boolean>;
    /**
     * Get statistics for all queues
     */
    getAllQueueStats(): Promise<{
        realtime: QueueStat;
        bulk: QueueStat;
        webhook: QueueStat;
        notifications: QueueStat;
    }>;
    /**
     * Clean up old jobs from all queues
     */
    cleanupQueues(maxAge?: number): Promise<void>;
    /**
     * Gracefully shutdown all queues
     */
    shutdown(): Promise<void>;
}
interface QueueStat {
    waiting: number;
    active: number;
    completed: number;
    failed: number;
    delayed: number;
}
export {};
//# sourceMappingURL=redis-queue.d.ts.map