import { IAddress , IConnector , IEvent , IMessage , Message } from 'botbuilder' ; export class TestConnector implements IConnector { private onEventHandler : ( events : IEvent [ ] , cb ? : ( err : Error ) => void ) => void ; private onInvokeHandler : ( event : IEvent , cb ? : ( err : Error , body : { } , status ? : number ) => void ) => void ; private newConvoCount : number ; constructor ( ) { this . newConvoCount = 0 ; } public onEvent ( handler ) { this . onEventHandler = handler ; } public send ( messages , done ) { done ( null , messages . map ( ( m ) => m . address ) ) ; } public startConversation ( address , cb ) { const adr = Object . assign ( { } , address ) ; adr . conversation = { id : `Convo${ this . newConvoCount ++ }` } ; cb ( null , adr ) ; } }