@ekhein/sekiro-node-client 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.d.ts +5 -2
- package/dist/main.js +4 -2
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -4,12 +4,15 @@ export declare class SekiroClient extends WebSocket {
|
|
|
4
4
|
readonly host: string;
|
|
5
5
|
readonly port: string;
|
|
6
6
|
readonly scope: string;
|
|
7
|
-
readonly handlers: Map<string, Function>;
|
|
8
7
|
private readonly logger;
|
|
8
|
+
private readonly handlers;
|
|
9
9
|
constructor(clientId?: string, host?: string, port?: string, scope?: string);
|
|
10
10
|
private onOpen;
|
|
11
11
|
private onClose;
|
|
12
12
|
private onError;
|
|
13
13
|
private onData;
|
|
14
|
-
registerAction(action:
|
|
14
|
+
registerAction(action: {
|
|
15
|
+
name: string;
|
|
16
|
+
handler: Function;
|
|
17
|
+
}): Promise<this>;
|
|
15
18
|
}
|
package/dist/main.js
CHANGED
|
@@ -12,6 +12,7 @@ class SekiroClient extends partysocket_1.WebSocket {
|
|
|
12
12
|
port;
|
|
13
13
|
scope;
|
|
14
14
|
logger = new logger_util_1.Logger(this);
|
|
15
|
+
handlers = new Map();
|
|
15
16
|
constructor(clientId = (0, crypto_1.randomUUID)().replace(/-/g, ""), host = process.env.SEKIRO_HOST, port = process.env.SEKIRO_PORT, scope = process.env.SEKIRO_SCOPE) {
|
|
16
17
|
super("ws://", [], {
|
|
17
18
|
debug: false,
|
|
@@ -60,8 +61,9 @@ class SekiroClient extends partysocket_1.WebSocket {
|
|
|
60
61
|
this.send(pack);
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
|
-
async registerAction(action
|
|
64
|
-
this.handlers.set(action, handler);
|
|
64
|
+
async registerAction(action) {
|
|
65
|
+
this.handlers.set(action.name, action.handler);
|
|
66
|
+
return this;
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
69
|
exports.SekiroClient = SekiroClient;
|