mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 07:33:12 +09:00
Strongly type invokeHook
Add strong typing of the invokeHook function to prevent incorrect paramaters being passed to plugin hooks. This detected a few places where the parameters passed were incorrect.
This commit is contained in:
1 parent
e3e5867d60
commit
654df76065
7 files changed
+24
-18
No files matched your search
@@ -96,11 +96,11 @@ export class ControllerConnectionEvent {
|
||||
static dst = "instance" as const;
|
||||
|
||||
constructor(
|
||||
public event: string,
|
||||
public event: "connect" | "drop" | "resume" | "close",
|
||||
) { }
|
||||
|
||||
static jsonSchema = Type.Object({
|
||||
"event": Type.String(),
|
||||
"event": StringEnum(["connect", "drop", "resume", "close"]),
|
||||
});
|
||||
|
||||
static fromJSON(json: Static<typeof this.jsonSchema>) {
|
||||
|
||||
Reference in new issue
Block a user