import { Message , MessageAttributes } from '@node-ts/bus-messages' ; import { HandlerDefinition } from '../handler' ; import { ClassConstructor } from '../util' ; import { TestEvent } from './test-event' ; const handlerFor = < TMessageType extends Message > ( messageType , messageHandler ) => { return { messageType , messageHandler } ; } ; export interface MessageLogger { log ( message ) : void ; } export const testEventHandler = ( messageLogger ) => handlerFor ( TestEvent , ( message , attributes ) => { messageLogger . log ( message ) ; messageLogger . log ( attributes ) ; } ) ;