eventBus: Emitter<AcEdEvents> = ...

Global event bus for application-wide communication.

This event bus enables decoupled communication between different parts of the CAD viewer application. Components can emit events to notify about state changes or request actions, while other components can listen for these events to respond appropriately.

The event bus is particularly useful for:

  • File operation status updates
  • Error and warning notifications
  • Font loading status
  • Cross-component communication
import { eventBus } from './eventBus';

// Listen for file opening events
eventBus.on('open-file', () => {
console.log('File open requested');
});

// Emit a progress update
eventBus.emit('open-file-progress', {
percentage: 50,
stage: AcDbConversionStage.Parsing,
stageStatus: AcDbConversionStageStatus.InProgress
});

// Display a message to the user
eventBus.emit('message', {
message: 'File opened successfully',
type: 'success'
});