Add JS client

This commit is contained in:
2020-06-04 21:13:21 +02:00
parent 13cf05bf99
commit 05c7bb3291
7 changed files with 198 additions and 53 deletions

View File

@@ -21,6 +21,9 @@ type
command*: Command ## Command that the application should execute
parameter*: string ## Optional parameter for the command
proc `$`(cMsg: CommandMessage): string =
$(%cMsg)
proc newOpResult*(): OpResult =
OpResult(success: true)
@@ -30,9 +33,6 @@ proc newOpResult*(msg: string): OpResult =
proc newCommandMessage*(c: Command, p: string = ""): CommandMessage =
CommandMessage(command: c, parameter: p)
proc wrap*(msg: CommandMessage): string =
$(%msg) & "\r\L"
proc enumToStrings*(en: typedesc): seq[string] =
for x in en:
result.add $x