import { Job, JobOptions } from 'bull';
import { EventEmitter } from 'events';
/**
 * Job Types
 */
export declare enum JobType {
    STATUS_TRANSITION = "status_transition",
    WEBHOOK_DELIVERY = "webhook_delivery",
    BATCH_UPDATE = "batch_update",
    SCHEDULED_TRANSITION = "scheduled_transition",
    RECURRING_CHECK = "recurring_check",
    CLEANUP = "cleanup",
    NOTIFICATION = "notification",
    SYNC = "sync",
    EXPORT = "export",
    ARCHIVE = "archive"
}
/**
 * Job Priority Levels
 */
export declare enum JobPriority {
    CRITICAL = 1,
    HIGH = 5,
    NORMAL = 10,
    LOW = 20
}
/**
 * Job Data Interface
 */
export interface JobData {
    type: JobType;
    taskId?: string;
    payload: any;
    metadata?: Record<string, any>;
    retryOnFail?: boolean;
    maxRetries?: number;
}
/**
 * Job Result Interface
 */
export interface JobResult {
    success: boolean;
    data?: any;
    error?: string;
    duration?: number;
    timestamp: string;
}
/**
 * Queue Statistics
 */
export interface QueueStatistics {
    waiting: number;
    active: number;
    completed: number;
    failed: number;
    delayed: number;
    paused: boolean;
    jobCounts: Record<string, number>;
    processingRate: number;
    averageProcessingTime: number;
}
/**
 * Job Queue Service
 * Manages asynchronous job processing using Bull
 */
export declare class JobQueueService extends EventEmitter {
    private queues;
    private schedulers;
    private client;
    private redisConfig;
    private isProcessing;
    constructor();
    private initializeClient;
    /**
     * Initialize job queues
     */
    private initializeQueues;
    /**
     * Create a new queue
     */
    private createQueue;
    /**
     * Set up queue event handlers
     */
    private setupQueueEventHandlers;
    /**
     * Process a job
     */
    private processJob;
    /**
     * Process status transition job
     */
    private processStatusTransition;
    /**
     * Process webhook delivery job
     */
    private processWebhookDelivery;
    /**
     * Process batch update job
     */
    private processBatchUpdate;
    /**
     * Process scheduled transition job
     */
    private processScheduledTransition;
    /**
     * Process recurring check job
     */
    private processRecurringCheck;
    /**
     * Process cleanup job
     */
    private processCleanup;
    /**
     * Process notification job
     */
    private processNotification;
    /**
     * Process sync job
     */
    private processSync;
    /**
     * Process export job
     */
    private processExport;
    /**
     * Process archive job
     */
    private processArchive;
    /**
     * Add job to queue
     */
    addJob(queueName: string, jobData: JobData, options?: JobOptions): Promise<Job>;
    /**
     * Schedule a job
     */
    scheduleJob(queueName: string, jobData: JobData, delay: number | Date, options?: JobOptions): Promise<Job>;
    /**
     * Add recurring job
     */
    addRecurringJob(queueName: string, jobData: JobData, cronExpression: string, options?: JobOptions): Promise<Job>;
    /**
     * Get queue statistics
     */
    getQueueStatistics(queueName: string): Promise<QueueStatistics>;
    /**
     * Pause queue
     */
    pauseQueue(queueName: string): Promise<void>;
    /**
     * Resume queue
     */
    resumeQueue(queueName: string): Promise<void>;
    /**
     * Clear queue
     */
    clearQueue(queueName: string): Promise<void>;
    /**
     * Check transition conditions
     */
    private checkTransitionConditions;
    /**
     * Check stale tasks
     */
    private checkStaleTasks;
    /**
     * Check overdue tasks
     */
    private checkOverdueTasks;
    /**
     * Check blocked tasks
     */
    private checkBlockedTasks;
    /**
     * Clean completed jobs
     */
    private cleanCompletedJobs;
    /**
     * Clean orphaned tasks
     */
    private cleanOrphanedTasks;
    /**
     * Set up default recurring jobs
     */
    setupDefaultRecurringJobs(): Promise<void>;
    /**
     * Clean up service
     */
    cleanup(): Promise<void>;
}
export declare const jobQueueService: JobQueueService;
//# sourceMappingURL=jobQueue.d.ts.map