mirror of
https://github.com/PHIDIAS0303/ClusterChatSync.git
synced 2025-12-27 03:05:21 +09:00
31 lines
640 B
JavaScript
31 lines
640 B
JavaScript
import { Type, Static } from "@sinclair/typebox";
|
|
export class ChatEvent {
|
|
// declare ["constructor"]: typeof ChatEvent;
|
|
// as const
|
|
static type = "event";
|
|
// as const
|
|
static src = ["control", "instance"];
|
|
// as const
|
|
static dst = "instance";
|
|
// as const
|
|
static plugin = "global_chat";
|
|
static permission = null;
|
|
|
|
/*
|
|
constructor(
|
|
public instanceName: string,
|
|
public content: string,
|
|
) {
|
|
}
|
|
*/
|
|
|
|
static jsonSchema = Type.Object({
|
|
"instanceName": Type.String(),
|
|
"content": Type.String(),
|
|
});
|
|
|
|
// json: Static<typeof ChatEvent.jsonSchema>
|
|
static fromJSON(json) {
|
|
return new this(json.instanceName, json.content);
|
|
}
|
|
} |