add more typescript examples
This commit is contained in:
1 parent
2bc148342d
commit
9e4e019660
2 files changed
+16
-4
No files matched your search
@@ -4,6 +4,8 @@ enum OpCode {
|
||||
MOVE,
|
||||
}
|
||||
|
||||
type PingEvent = Record<string, never>;
|
||||
|
||||
type HelloEvent = {
|
||||
name: string;
|
||||
};
|
||||
@@ -14,7 +16,7 @@ type MoveEvent = {
|
||||
};
|
||||
|
||||
type OpArgsMapping = {
|
||||
[OpCode.PING]: {};
|
||||
[OpCode.PING]: PingEvent;
|
||||
[OpCode.HELLO]: HelloEvent;
|
||||
[OpCode.MOVE]: MoveEvent;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user