import { EventEmitter } from "events" ; interface TypedMsg < Name , Args extends Function > { messageType : Name ; messageHandler : Args ; } export type CompileStatusType = "fileSetup" | "igor" ; export interface IGameClosedStats { /**
     * Minimum FPS as shown in IGOR Output
     */ minFPS : number ; /**
     * Maximum FPS as shown in IGOR Output
     */ maxFPS : number ; /**
     * Average FPS as shown in IGOR Output
     */ avgFPS : number ; } interface IRubberMessageMap { "compileStarted" : [ undefined , ( ) => void ] ; "compileFinished" : [ ( string [ ] ) , ( errors : ( string [ ] ) ) => void ] ; "compileStatus" : [ string , ( data : string ) => void ] ; "gameStarted" : [ undefined , ( ) => void ] ; "gameStatus" : [ string , ( data : string ) => void ] ; "gameFinished" : [ undefined , ( ) => void ] ; "allFinished" : [ ( string [ ] ) , ( errors : ( string [ ] ) ) => void ] ; "rawStdout" : [ string , ( data : string ) => void ] ; "error" : [ Error , ( error : Error ) => void ] ; } export class RubberEventEmitter extends EventEmitter { on < MessageType extends keyof IRubberMessageMap > ( messageType , handler ) { super . on ( messageType , handler ) ; return this ; } public emit < MessageType extends keyof IRubberMessageMap > ( messageType , arg ? ) { return super . emit ( messageType , arg ) ; } }