Initial Commit ...
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
|
||||
'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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user