import { a as NotificationMessage } from "../packem_shared/notification.d-D0ado_cy.js"; import { Q as QueueJob, N as NotificationQueue } from "../packem_shared/types.d-r8K0ICyx.js"; import "../packem_shared/types.d-CRs03TYV.js"; import "../packem_shared/types.d-C7l7qdMG.js"; import "../packem_shared/provider.d-Dh32nRm9.js"; /** * A BullMQ job, narrowed to the members this adapter reads. */ interface BullmqJobLike { attemptsMade: number; data: unknown; id?: string; moveToDelayed: (timestamp: number) => Promise; remove: () => Promise; } /** * The subset of a [BullMQ](https://docs.bullmq.io/) `Queue` this adapter uses. Typed structurally so * the `bullmq` optional peer is never imported — pass a real `Queue` instance, which satisfies this. */ interface BullmqQueueLike { add: (name: string, data: unknown, options?: { delay?: number; }) => Promise<{ id?: string; }>; count: () => Promise; getJob: (id: string) => Promise; getNextJob: (token: string) => Promise; } /** * A {@link NotificationQueue} backed by [BullMQ](https://docs.bullmq.io/) (Redis). * * BullMQ is push-based: jobs are normally consumed by a BullMQ `Worker`. This adapter maps the * pull-based reserve/ack model onto BullMQ's `getNextJob`-style primitives so it composes with the * notification `QueueWorker`. Pass an already-configured `Queue` instance — `bullmq` is an optional * peer dependency and is never instantiated here. * * Runtime: NODE ONLY (requires a Redis connection). Not Cloudflare Workers compatible. */ declare class BullMqQueue implements NotificationQueue { #private; constructor(queue: BullmqQueueLike, jobName?: string); enqueue(message: NotificationMessage, options?: { scheduledAt?: number; }): Promise; reserve(): Promise; ack(id: string): Promise; retry(id: string, delayMs?: number): Promise; size(): Promise; } /** * Convenience factory for {@link BullMqQueue}. * @param queue A configured BullMQ `Queue` instance (optional peer). * @param jobName The name jobs are enqueued under. * @returns A new {@link BullMqQueue}. */ declare const createBullMqQueue: (queue: BullmqQueueLike, jobName?: string) => BullMqQueue; export { BullMqQueue, type BullmqJobLike, type BullmqQueueLike, createBullMqQueue };