import { WorkerOptions } from 'bullmq';
import type { Logger } from 'pino';
import type { ToroTask } from './client.js';
import { EventSubscriptions } from './event-subscriptions.js';
import { TaskJob } from './job.js';
import type { EventSubscriptionInfo, SyncJobPayload, SyncJobReturn, TaskJobOptions } from './types/index.js';
import { TaskWorkerQueue } from './worker-queue.js';
type PayloadType = SyncJobPayload;
type ReturnType = SyncJobReturn;
/**
 * Manages the synchronization of event trigger registrations using a dedicated queue
 * processed by a single worker. Ensures atomic updates across multiple Task instances.
 * Uses EventSubscriptionRepository for persistence.
 */
export declare class EventManager extends TaskWorkerQueue<PayloadType, ReturnType> {
    readonly subscriptions: EventSubscriptions;
    readonly prefix: string;
    constructor(taskClient: ToroTask, // Accept ToroTask
    parentLogger: Logger, name?: string, prefix?: string, subscriptions?: EventSubscriptions);
    /**
     * Overrides BaseQueue's startWorker with concurrency option
     */
    getWorkerOptions(): Partial<WorkerOptions>;
    /**
     * Adds a job to the synchronization queue to update event registrations for a specific task.
     * Uses a job ID based on the task to prevent duplicate concurrent syncs.
     *
     * @param taskGroup The group name of the task.
     * @param taskId The id of the task.
     * @param desiredSubscriptions The complete list of event subscriptions the task should have.
     * @param options Optional BullMQ job options.
     */
    requestSync(taskGroup: string, taskId: string, desiredSubscriptions: EventSubscriptionInfo[], options?: TaskJobOptions): Promise<TaskJob<PayloadType, ReturnType, string>>;
    /**
     * Processes a synchronization job. Fetches current Redis state via the repository,
     * compares with desired state from the job payload, and calls repository methods
     * to register/unregister differences. Executed by the single worker.
     *
     * @param job The synchronization job.
     */
    process(job: TaskJob<PayloadType, ReturnType, string>): Promise<ReturnType>;
}
export {};
//# sourceMappingURL=event-manager.d.ts.map