@blueyerobotics/blueye-ts 1.3.0 → 1.5.0
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/src/client.d.ts +7 -5
- package/dist/src/client.js +2 -2
- package/package.json +2 -2
package/dist/src/client.d.ts
CHANGED
|
@@ -2,11 +2,13 @@ import { blueye } from "@blueyerobotics/protocol-definitions";
|
|
|
2
2
|
import { LogLevel } from "consola";
|
|
3
3
|
import { Emitter } from "strict-event-emitter";
|
|
4
4
|
export type Protocol = typeof blueye.protocol;
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
5
|
+
export type ProtocolType = "Req" | "Rep" | "Tel" | "Ctrl";
|
|
6
|
+
export type ProtocolKey = Extract<keyof Protocol, `${string}${ProtocolType}`>;
|
|
7
|
+
export type Req = keyof Pick<Protocol, Extract<ProtocolKey, `${string}Req`>>;
|
|
8
|
+
export type Rep = keyof Pick<Protocol, Extract<ProtocolKey, `${string}Rep`>>;
|
|
9
|
+
export type Tel = keyof Pick<Protocol, Extract<ProtocolKey, `${string}Tel`>>;
|
|
10
|
+
export type Ctrl = keyof Pick<Protocol, Extract<ProtocolKey, `${string}Ctrl`>>;
|
|
11
|
+
export type ReqToRep<T extends Req> = T extends `${infer Prefix}Req` ? `${Prefix}Rep` extends ProtocolKey ? Protocol[`${Prefix}Rep`] : never : never;
|
|
10
12
|
export type MsgHandler<T extends Req> = Protocol[T];
|
|
11
13
|
export type CreateArgs<T extends Req> = Parameters<MsgHandler<T>["create"]>[0];
|
|
12
14
|
export type DecodedOutput<T extends Req> = ReturnType<ReqToRep<T>["decode"]>;
|
package/dist/src/client.js
CHANGED
|
@@ -7,8 +7,8 @@ const consola_1 = require("consola");
|
|
|
7
7
|
const strict_event_emitter_1 = require("strict-event-emitter");
|
|
8
8
|
const uuid_1 = require("uuid");
|
|
9
9
|
const schema_1 = require("./schema");
|
|
10
|
-
const WS_PUBSUB_URL = "ws://
|
|
11
|
-
const WS_REQREP_URL = "ws://
|
|
10
|
+
const WS_PUBSUB_URL = "ws://192.168.1.101:8765";
|
|
11
|
+
const WS_REQREP_URL = "ws://192.168.1.101:8766";
|
|
12
12
|
const isInProtocol = (key) => {
|
|
13
13
|
return key in protocol_definitions_1.blueye.protocol;
|
|
14
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blueyerobotics/blueye-ts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "A TypeScript client for interacting with Blueye underwater drones.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"author": "Blueye <contact@blueye.no> (https://blueye.no/)",
|
|
20
20
|
"license": "LGPL-3.0-only",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@blueyerobotics/protocol-definitions": "3.2.0-
|
|
22
|
+
"@blueyerobotics/protocol-definitions": "3.2.0-0f78a956",
|
|
23
23
|
"buffer": "^6.0.3",
|
|
24
24
|
"consola": "^3.4.2",
|
|
25
25
|
"strict-event-emitter": "^0.5.1",
|