/**
 * Task Event Bus
 *
 * Event-driven notification system for task lifecycle events.
 * Enables automatic unblocking and execution of dependent tasks
 * when their blockers complete.
 *
 * Events:
 *   task_completed  - A task finished successfully
 *   task_failed     - A task failed
 *   task_unblocked  - A task became ready (all blockers resolved)
 *   tasks_ready     - Batch notification: multiple tasks became ready
 */
export type TaskEventType = 'task_completed' | 'task_failed' | 'task_unblocked' | 'tasks_ready';
export interface TaskCompletedEvent {
    type: 'task_completed';
    taskId: string;
    reason?: string;
}
export interface TaskFailedEvent {
    type: 'task_failed';
    taskId: string;
    error: string;
}
export interface TaskUnblockedEvent {
    type: 'task_unblocked';
    taskId: string;
    unblockedBy: string;
}
export interface TasksReadyEvent {
    type: 'tasks_ready';
    taskIds: string[];
    triggeredBy: string;
}
export type TaskEvent = TaskCompletedEvent | TaskFailedEvent | TaskUnblockedEvent | TasksReadyEvent;
export type TaskEventHandler = (event: TaskEvent) => void | Promise<void>;
/**
 * Typed event bus for task lifecycle events.
 *
 * Supports both sync and async handlers. Async handlers are
 * awaited in parallel (errors are caught and logged, not propagated).
 *
 * @example
 * ```ts
 * const bus = new TaskEventBus();
 *
 * bus.on('task_unblocked', async (event) => {
 *   if (event.type === 'task_unblocked') {
 *     console.log(`Task ${event.taskId} is now ready`);
 *     await coordinator.claim(event.taskId);
 *   }
 * });
 *
 * bus.emit({ type: 'task_completed', taskId: 'task-1' });
 * ```
 */
export declare class TaskEventBus {
    private handlers;
    private allHandlers;
    /**
     * Register a handler for a specific event type.
     */
    on(type: TaskEventType, handler: TaskEventHandler): () => void;
    /**
     * Register a handler for ALL event types.
     */
    onAny(handler: TaskEventHandler): () => void;
    /**
     * Emit an event to all registered handlers.
     * Async handlers are awaited in parallel; errors are caught and logged.
     */
    emit(event: TaskEvent): Promise<void>;
    /**
     * Remove all handlers (useful for testing or shutdown).
     */
    clear(): void;
    /**
     * Get count of registered handlers by type.
     */
    listenerCount(type?: TaskEventType): number;
}
/**
 * Get the global TaskEventBus singleton.
 * Creates one on first call.
 */
export declare function getTaskEventBus(): TaskEventBus;
/**
 * Reset the global bus (for testing).
 */
export declare function resetTaskEventBus(): void;
//# sourceMappingURL=event-bus.d.ts.map