smartuniverse/ts/smartuniverse.classes.clientuniversemessage.ts

35 lines
845 B
TypeScript
Raw Normal View History

import * as plugins from './smartuniverse.plugins';
2019-04-11 15:52:01 +00:00
import * as interfaces from './interfaces';
2019-04-24 21:27:57 +00:00
import { IUniverseMessage } from './interfaces';
2019-04-11 15:52:01 +00:00
export class ClientUniverseMessage implements interfaces.IUniverseMessage {
// ======
// STATIC
// ======
2019-04-22 22:28:57 +00:00
public static createMessageFromPayload(messageDescriptor: interfaces.IUniverseMessage) {}
// ========
// INSTANCE
// ========
2019-04-22 07:58:36 +00:00
2019-04-24 21:27:57 +00:00
// properties
2019-04-22 07:58:36 +00:00
public id: string;
public timestamp: number;
public smartTimestamp: plugins.smarttime.TimeStamp;
public messageText: string;
public passphrase: string;
public payload: any;
public payloadStringType;
public targetChannelName: string;
2019-04-11 15:52:01 +00:00
2019-04-24 21:27:57 +00:00
constructor(messageArg: IUniverseMessage, payloadArg) {
for (const key of Object.keys(messageArg)) {
this[key] = messageArg[key];
}
}
getAsJsonForPayload() {};
}