49 lines
1010 B
JavaScript
49 lines
1010 B
JavaScript
|
|
'use strict';
|
|
|
|
//
|
|
const XElectronChannel = {
|
|
Default: 'xMessage',
|
|
Handshake: 'xHandshake',
|
|
FileService: 'xFileService',
|
|
ProjectsService: 'xProjectsService',
|
|
}
|
|
|
|
//
|
|
// Module Exports ...
|
|
module.exports = {
|
|
//
|
|
XElectronChannel: XElectronChannel,
|
|
|
|
//
|
|
XElectronMessage: class XElectronMessage {
|
|
//
|
|
constructor(
|
|
sender = '',
|
|
reciever = '',
|
|
message = '',
|
|
payload = undefined,
|
|
channel = undefined,
|
|
timestamp = undefined,
|
|
) {
|
|
//
|
|
if (!timestamp) {
|
|
timestamp = Date.now();
|
|
}
|
|
|
|
//
|
|
if (!channel) {
|
|
channel = XElectronChannel.Default;
|
|
}
|
|
|
|
//
|
|
this.sender = sender;
|
|
this.reciever = reciever;
|
|
this.payload = payload;
|
|
this.message = message;
|
|
this.timestamp = timestamp;
|
|
this.channel = channel;
|
|
}
|
|
}
|
|
}
|