import { EventDescriptor } from './BrowserRenderer' ; import { UIEventArgs } from './EventForDotNet' ; type EventDispatcher = ( eventDescriptor : EventDescriptor , eventArgs : UIEventArgs ) => void ; let eventDispatcherInstance ; export function dispatchEvent ( eventDescriptor , eventArgs ) { if ( ! eventDispatcherInstance ) { throw new Error ( 'eventDispatcher not initialized. Call \'setEventDispatcher\' to configure it.' ) ; } return eventDispatcherInstance ( eventDescriptor , eventArgs ) ; } export function setEventDispatcher ( newDispatcher ) { eventDispatcherInstance = newDispatcher ; }