import { Redis } from "ioredis"; import { Closable } from "../Closable"; import { Job } from "../Job"; export declare type SubscriptionOptions = { queue?: string; id?: string; }; export declare type OnActivity = (event: OnActivityEvent) => Promise | void; export declare type OnActivityEvent = ScheduledEvent | DeletedEvent | RequestedEvent | InvokedEvent | RescheduledEvent | AcknowledgedEvent; interface ScheduledEvent { type: "scheduled"; job: Job; } interface InvokedEvent { type: "invoked"; id: string; queue: string; } interface RescheduledEvent { type: "rescheduled"; id: string; queue: string; runAt: Date; } interface DeletedEvent { type: "deleted"; id: string; queue: string; } interface RequestedEvent { type: "requested"; id: string; queue: string; } interface AcknowledgedEvent { type: "acknowledged"; id: string; queue: string; } export declare class Activity implements Closable { private readonly redis; private readonly onEvent; private readonly pattern; constructor(redis: Redis, onEvent: OnActivity, options?: SubscriptionOptions); private matchesPattern; private handleMessage; close(): Promise; } export {}; //# sourceMappingURL=activity.d.ts.map