export interface IMessageOptions { timestamp: number; from: string; to: string; type: string; body: T; } export default class Message { public timestamp: number; public from: string; public to: string; public type: string; public body: T; constructor(options: IMessageOptions) { this.timestamp = options.timestamp; this.from = options.from; this.to = options.to; this.type = options.type; this.body = options.body; } }