import { IChannel } from "./IChannel" ; import { LogLevel } from "./ILogger" ; declare let self ; export const WORKERCHANNEL_MSG_TYPE = "worker-channel-message" ; /**
 * The interface for the messages of the WorkerChannel.
 */ export interface IWorkerChannelMessage { message : any [ ] ; type : "worker-channel-message" ; level : LogLevel ; } /**
 * The class for the worker channel.
 */ export class WorkerChannel implements IChannel { error ( message ? , ... optionalParams ) { const workerMessage = { message : [ message , ... optionalParams ] , type : WORKERCHANNEL_MSG_TYPE , level : LogLevel . Error } ; self . postMessage ( workerMessage ) ; } debug ( message ? , ... optionalParams ) { const workerMessage = { message : [ message , ... optionalParams ] , type : WORKERCHANNEL_MSG_TYPE , level : LogLevel . Debug } ; self . postMessage ( workerMessage ) ; } info ( message ? , ... optionalParams ) { const workerMessage = { message : [ message , ... optionalParams ] , type : WORKERCHANNEL_MSG_TYPE , level : LogLevel . Info } ; self . postMessage ( workerMessage ) ; } log ( message ? , ... optionalParams ) { const workerMessage = { message : [ message , ... optionalParams ] , type : WORKERCHANNEL_MSG_TYPE , level : LogLevel . Log } ; self . postMessage ( workerMessage ) ; } trace ( message ? , ... optionalParams ) { const workerMessage = { message : [ message , ... optionalParams ] , type : WORKERCHANNEL_MSG_TYPE , level : LogLevel . Trace } ; self . postMessage ( workerMessage ) ; } warn ( message ? , ... optionalParams ) { const workerMessage = { message : [ message , ... optionalParams ] , type : WORKERCHANNEL_MSG_TYPE , level : LogLevel . Warn } ; self . postMessage ( workerMessage ) ; } }