import * as http from "http" ; export type RequestListener = ( request : http . IncomingMessage , response : http . ServerResponse ) => void ; export interface IWebServerFactory { create ( requestListener ) : IWebServer ; } export interface IWebSocket { id : string ; on ( event , listener ) ; join ( id ) : Promise < void > ; emit ( event , ... args ) ; emitToRoom ( roomId , event , ... args ) ; disconnect ( close ? ) : void ; } export interface IWebServer { /**
     * Web socket interface
     */ webSocketServer : IWebSocketServer ; /**
     * HTTP server interface
     */ httpServer : IHttpServer ; /**
     * Closes the web server
     */ close ( ) : Promise < void > ; } export interface IWebSocketServer { on ( event , listener ) ; close ( ) : Promise < void > ; } export interface IHttpServer { listen ( port ) : void ; on ( event , listener ) ; address ( ) : { port : number ; family : string ; address : string ; } ; }