declare var module ; declare var require ; declare var Object ; import { OptionsInterface } from './types/options' ; import { DriverInterface } from './types/driver' ; import { DriverFactory } from './drivers/factory' ; import { RealTimeLog } from './logger' ; module mean-expert author Jonathan Casarrubias <t:@johncasarrubias, gh:github.com/mean-expert-official>
 *  license description class RealTime { static driver : DriverInterface ; static options : OptionsInterface = { driver : { name : 'socket.io' , options : { forceNew : true , upgrade : false , transports : [ 'websocket' ] } } , debug : false , auth : true , secure : false , modules : [ 'IO' , 'FireLoop' ] } ; constructor ( app = undefined , options ) { RealTimeLog . options = options ; if ( ! app ) { RealTimeLog . log ( 'LoopBack Application Instance is Missing' ) ; } else { app . on ( 'started' , ( server ) => { app . mx = app . mx || { } ; if ( options . driver && options . driver . options ) { Object . assign ( options . driver . options , RealTime . options . driver . options ) ; Object . assign ( RealTime . options . driver , options . driver ) ; } RealTime . options = Object . assign ( RealTime . options , options , { app : app , server : server , driver : RealTime . options . driver } ) ; RealTime . connect ( ) ; RealTime . setup ( ) ; } ) ; } } static connect ( ) { RealTime . driver = < DriverInterface > DriverFactory . load ( RealTime . options . driver . name ) ; RealTime . driver . connect ( RealTime . options ) ; } static setup ( ) { RealTime . options . modules . forEach ( _module => RealTime . options . app . mx [ _module ] = require ( `./modules/${ _module }` ) [ _module ] ( RealTime . driver , RealTime . options ) ) ; RealTime . options . app . emit ( 'realtime-loaded' ) ; } } module . exports = RealTime ;