declare module '@ioc:HalcyonAgile/Bull' { import * as Bullmq from 'bullmq'; export interface Queue extends Bullmq.Queue { } export interface Processor extends Bullmq.Processor { } export interface JobsOptions extends Bullmq.JobsOptions { } export interface QueueOptions extends Bullmq.QueueOptions { } export interface WorkerOptions extends Bullmq.WorkerOptions { } export interface Job extends Bullmq.Job { } export type BullConnectionContract = Exclude; /** * A list of typed connections defined in the user land using * the contracts file */ export interface BullConnectionsList { } /** * Define the config properties on this interface and they will appear * everywhere. */ export interface BullConfig { connection: keyof BullConnectionsList; connections: { [P in keyof BullConnectionsList]: BullConnectionsList[P]; }; prefix?: string; } export interface JobContract { key: string; options?: JobsOptions; workerOptions?: WorkerOptions; queueOptions?: QueueOptions; concurrency?: number; handle: Processor; boot?: (queue: Queue) => void; onCompleted?: (...args: any[]) => void; onProgress?: (...args: any[]) => void; onFailed?: (...args: any[]) => void; onWaiting?: (...args: any[]) => void; onDelayed?: (...args: any[]) => void; onStalled?: (...args: any[]) => void; onRemoved?: (...args: any[]) => void; onDrained?: (...args: any[]) => void; } export interface EventListener { eventName: string; method: string; } export interface QueueContract extends JobContract { bull: Queue; listeners: EventListener[]; instance: JobContract; } export interface BullManagerContract { queues: { [key: string]: QueueContract; }; getByKey(key: string): QueueContract; add(name: string, data: T, jobOptions?: JobsOptions): Promise>; schedule(name: string, data: T, date: number | Date, jobOptions?: JobsOptions): Promise>; remove(name: string, jobId: string): Promise; ui(port?: number): void; shutdown(): Promise; process(): BullManagerContract; } const Bull: BullManagerContract; export default Bull; }