/**
 * Queue Singleton Management
 *
 * Provides global access to queue instances with lazy initialization.
 */
import { Queue } from './queue';
import { PriorityQueue } from './priority-queue';
import { PersistentQueue } from './persistent-queue';
// Singleton instances - stored with 'any' type for generic singleton pattern
// Type assertions are used when returning typed versions to callers
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Required for generic singleton pattern
let queueInstance = null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Required for generic singleton pattern
let priorityQueueInstance = null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Required for generic singleton pattern
let persistentQueueInstance = null;
/**
 * Get the global Queue instance
 */
export function getQueue(options) {
    if (!queueInstance) {
        queueInstance = new Queue(options);
    }
    return queueInstance;
}
/**
 * Get the global PriorityQueue instance
 */
export function getPriorityQueue(options) {
    if (!priorityQueueInstance) {
        priorityQueueInstance = new PriorityQueue(options);
    }
    return priorityQueueInstance;
}
/**
 * Get the global PersistentQueue instance
 */
export function getPersistentQueue(options) {
    if (!persistentQueueInstance) {
        persistentQueueInstance = new PersistentQueue(options);
    }
    return persistentQueueInstance;
}
/**
 * Reset all queue singletons
 */
export function resetQueues() {
    if (queueInstance) {
        queueInstance.dispose();
        queueInstance = null;
    }
    if (priorityQueueInstance) {
        priorityQueueInstance.dispose();
        priorityQueueInstance = null;
    }
    if (persistentQueueInstance) {
        persistentQueueInstance.dispose();
        persistentQueueInstance = null;
    }
}
/**
 * Get queue status summary
 */
export function getQueuesSummary() {
    return {
        queue: queueInstance?.getStats() ?? null,
        priorityQueue: priorityQueueInstance?.getStats() ?? null,
        persistentQueue: persistentQueueInstance?.getStats() ?? null,
    };
}
//# sourceMappingURL=queue-singleton.js.map