mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 07:24:53 +09:00
* .js to .ts * translate * update paths to dist/plugin * add "tsc --build" to prepare * use field main in package.json de find info * tsc --build need to append before webpack * update test and use for plugins package.main
24 lines
525 B
TypeScript
24 lines
525 B
TypeScript
import { Type, Static } from "@sinclair/typebox";
|
|
export class ChatEvent {
|
|
static type = "event";
|
|
static src = ["control", "instance"];
|
|
static dst = "instance";
|
|
static plugin = "global_chat";
|
|
static permission = null;
|
|
|
|
constructor(
|
|
public instanceName: string,
|
|
public content: string,
|
|
) {
|
|
}
|
|
|
|
static jsonSchema = Type.Object({
|
|
"instanceName": Type.String(),
|
|
"content": Type.String(),
|
|
});
|
|
|
|
static fromJSON(json: Static<typeof ChatEvent.jsonSchema>) {
|
|
return new this(json.instanceName, json.content);
|
|
}
|
|
}
|