This commit is contained in:
2025-08-15 20:10:16 +09:00
parent 6057a62d50
commit d4d307c4fd

View File

@@ -1,33 +1,26 @@
// import { Type, Static } from "@sinclair/typebox"; const { Type } = require("@sinclair/typebox");
const {Type, Static} = require("@sinclair/typebox");
export class ChatEvent { class ChatEvent {
// declare ["constructor"]: typeof ChatEvent; static type = "event";
// as const static src = ["control", "instance"];
static type = "event"; static dst = "instance";
// as const static plugin = "global_chat";
static src = ["control", "instance"]; static permission = null;
// as const
static dst = "instance";
// as const
static plugin = "global_chat";
static permission = null;
/* static jsonSchema = Type.Object({
constructor( "instanceName": Type.String(),
public instanceName: string, "content": Type.String(),
public content: string, });
) {
}
*/
static jsonSchema = Type.Object({ constructor(instanceName, content) {
"instanceName": Type.String(), this.instanceName = instanceName;
"content": Type.String(), this.content = content;
}); }
// json: Static<typeof ChatEvent.jsonSchema> static fromJSON(json) {
static fromJSON(json) { return new ChatEvent(json.instanceName, json.content);
return new this(json.instanceName, json.content); }
}
} }
// If you need to use this class in other files
module.exports = { ChatEvent };