/**
 * Queue Type Definitions
 * Types specific to queue operations
 */

/**
 * Job data structure for queue operations
 */
export interface JobData<T = unknown> {
  handler: string;
  operation: string;
  payload: T;
  priority?: number;
}

/**
 * Queue job options
 */
export interface JobOptions {
  priority?: number;
  delay?: number;
  attempts?: number;
  backoff?: {
    type: 'exponential' | 'fixed';
    delay: number;
  };
  removeOnComplete?: boolean | number;
  removeOnFail?: boolean | number;
  timeout?: number;
}

/**
 * Queue statistics
 */
export interface QueueStats {
  waiting: number;
  active: number;
  completed: number;
  failed: number;
  delayed: number;
  paused: boolean;
  workers?: number;
}

/**
 * Batch job configuration
 */
export interface BatchJobData {
  payloadKey: string;
  batchIndex: number;
  totalBatches: number;
  items: unknown[];
}

/**
 * Queue worker configuration
 */
export interface QueueWorkerConfig {
  concurrency?: number;
  maxStalledCount?: number;
  stalledInterval?: number;
  lockDuration?: number;
  lockRenewTime?: number;
}
