/** * Generic operation event emitter for entity operations * Provides a consistent, reusable pattern for emitting and listening to operation events * * @template TEntity - The entity type that emits events * @template TOperation - The operation type (string literal union) */ export type ESPCDFOperationListener = (entity: TEntity, operation: TOperation, success: boolean, data?: any, error?: any) => void; export declare class ESPCDFOperationEventEmitter { private listeners; /** * Subscribe to all operation events * @param listener - The callback function to register * @returns Unsubscribe function */ subscribe(listener: ESPCDFOperationListener): () => void; /** * Emit an operation event to all registered listeners * @param entity - The entity that triggered the operation * @param operation - The operation type * @param success - Whether the operation succeeded * @param data - Optional data returned from the operation * @param error - Optional error if operation failed */ emit(entity: TEntity, operation: TOperation, success: boolean, data?: any, error?: any): void; /** * Remove all listeners and clean up */ dispose(): void; /** * Get the number of active listeners */ get listenerCount(): number; }