export default class Message { from: string content: any timestamp: number constructor(from: string, content: any, timestamp: number) { this.from = from this.content = content this.timestamp = timestamp } // 从何处来的数据 getFrom(): string { return this.from } getContent(): any { return this.content } getTimestamp(): number { return this.timestamp } static emptyMessage(): Message { return new Message("", {}, 0) } }