/**
 * ProjectEventBus - Event-Driven Architecture for Project Sync
 *
 * Implements an EventEmitter-based bus for project-related events.
 * Supports async handler execution with error isolation.
 */
import { Logger } from '../../utils/logger.js';
import { ProjectEvent, ProjectEventType, ProjectEventHandler, ProjectCreatedEvent, ProjectUpdatedEvent, ProjectDeletedEvent, ProjectSyncRequestedEvent, ExternalProjectDiscoveredEvent } from './types/project-types.js';
export declare class ProjectEventBus {
    private emitter;
    private logger;
    private handlerMap;
    constructor(options?: {
        logger?: Logger;
    });
    /**
     * Subscribe to a specific event type
     */
    on<T extends ProjectEventType>(eventType: T, handler: ProjectEventHandler<Extract<ProjectEvent, {
        type: T;
    }>>): void;
    /**
     * Subscribe to an event type (one-time only)
     */
    once<T extends ProjectEventType>(eventType: T, handler: ProjectEventHandler<Extract<ProjectEvent, {
        type: T;
    }>>): void;
    /**
     * Unsubscribe from an event type
     */
    off<T extends ProjectEventType>(eventType: T, handler: ProjectEventHandler<Extract<ProjectEvent, {
        type: T;
    }>>): void;
    /**
     * Emit an event
     */
    emit(event: ProjectEvent): void;
    /**
     * Emit and wait for all handlers to complete
     * Useful for testing or synchronous workflows
     */
    emitAndWait(event: ProjectEvent): Promise<void>;
    /**
     * Get the number of listeners for an event type
     */
    listenerCount(eventType: ProjectEventType): number;
    /**
     * Remove all listeners for an event type (or all events)
     */
    removeAllListeners(eventType?: ProjectEventType): void;
    /**
     * Subscribe to ProjectCreated events
     */
    onProjectCreated(handler: ProjectEventHandler<ProjectCreatedEvent>): void;
    /**
     * Subscribe to ProjectUpdated events
     */
    onProjectUpdated(handler: ProjectEventHandler<ProjectUpdatedEvent>): void;
    /**
     * Subscribe to ProjectDeleted events
     */
    onProjectDeleted(handler: ProjectEventHandler<ProjectDeletedEvent>): void;
    /**
     * Subscribe to ProjectSyncRequested events
     */
    onProjectSyncRequested(handler: ProjectEventHandler<ProjectSyncRequestedEvent>): void;
    /**
     * Subscribe to ExternalProjectDiscovered events
     */
    onExternalProjectDiscovered(handler: ProjectEventHandler<ExternalProjectDiscoveredEvent>): void;
}
//# sourceMappingURL=project-event-bus.d.ts.map