Event emitter that wraps ICompilerEvents callbacks. Provides safe event emission with error handling and type safety.
CompilerEventEmitter(events?: ICompilerEvents,logger?: IBasicLogger,)
Creates a new CompilerEventEmitter
events: Readonly<ICompilerEvents>
logger: IBasicLogger
emitCompilationComplete(event: ICompilationCompleteEvent): void
Emit compilation complete event
emitCompilationStart(event: ICompilationStartEvent): void
Emit compilation start event.
Fires after configuration validation passes but before any source is
fetched. This is the earliest point at which sourceCount and
transformationCount are guaranteed to be correct.
emitProgress(event: IProgressEvent): void
Emit progress event
emitSourceComplete(event: ISourceCompleteEvent): void
Emit source complete event
emitSourceError(event: ISourceErrorEvent): void
Emit source error event
emitSourceStart(event: ISourceStartEvent): void
Emit source start event
emitTransformationComplete(event: ITransformationCompleteEvent): void
Emit transformation complete event
emitTransformationStart(event: ITransformationStartEvent): void
Emit transformation start event
hasListeners(): boolean
Check if any event handlers are registered
hasTransformationListeners(): boolean
Check if transformation-specific event handlers are registered.
Used by TransformationPipeline to decide whether to auto-wire the
event-bridge hook. We check only onTransformationStart and
onTransformationComplete rather than the broad hasListeners() to
avoid registering hook overhead for unrelated listeners such as
onProgress or onCompilationComplete.
safeEmit<K extends keyof EventMap>(eventName: K,event: EventMap[K],): void
Safely emit an event, catching any errors thrown by handlers. This prevents user code from breaking the compilation process.