import type { QueueMetricType, QueueMetrics } from 'bunqueue/client'; import type { ServerConfig } from '../manager'; export interface QueueLimitSnapshot { rateLimit: { max: number; duration: number } | null; concurrency: number | null; rateLimitTtl: number; maxed: boolean; } export interface QueueGroupSnapshot { jobs: number; active: number; totalGrouped: number; paused: boolean; entries: QueueGroupJobSummary[]; priorityCounts: Record; rateLimit: { max: number; duration: number } | null; rateLimitTtl: number; concurrency: number | null; } export interface QueueGroupJobSummary { id: string; name: string; priority: number; delay: number; timestamp: number; } export interface QueueOperationsPort { limits(config: ServerConfig, queue: string, maxJobs?: number): Promise; group( config: ServerConfig, queue: string, groupId: string, maxJobs?: number, maxCount?: number, start?: number, end?: number ): Promise; pauseGroup(config: ServerConfig, queue: string, groupId: string): Promise; resumeGroup(config: ServerConfig, queue: string, groupId: string): Promise; setGroupRateLimit( config: ServerConfig, queue: string, groupId: string, max: number, duration: number ): Promise; removeGroupRateLimit(config: ServerConfig, queue: string, groupId: string): Promise; setGroupConcurrency( config: ServerConfig, queue: string, groupId: string, concurrency: number ): Promise; removeGroupConcurrency(config: ServerConfig, queue: string, groupId: string): Promise; deduplicationJobId( config: ServerConfig, queue: string, deduplicationId: string ): Promise; removeDeduplicationKey( config: ServerConfig, queue: string, deduplicationId: string ): Promise; removeDlqJob(config: ServerConfig, queue: string, jobId: string): Promise; metrics( config: ServerConfig, queue: string, type: QueueMetricType, start: number, end: number ): Promise; trimEvents(config: ServerConfig, queue: string, maxLength: number): Promise; close(): Promise; } export class QueueOperationsUnavailableError extends Error {}