camstreamerlib 4.0.0-beta.30 → 4.0.0-beta.32

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.
Files changed (91) hide show
  1. package/cjs/CamOverlayAPI.d.ts +4 -15
  2. package/cjs/CamOverlayAPI.js +10 -21
  3. package/cjs/CamScripterAPI.d.ts +3 -2
  4. package/cjs/CamScripterAPI.js +5 -5
  5. package/cjs/CamStreamerAPI.d.ts +3 -2
  6. package/cjs/CamStreamerAPI.js +4 -4
  7. package/cjs/CamSwitcherAPI.d.ts +3 -2
  8. package/cjs/CamSwitcherAPI.js +7 -7
  9. package/cjs/PlaneTrackerAPI.d.ts +3 -2
  10. package/cjs/PlaneTrackerAPI.js +15 -15
  11. package/cjs/VapixAPI.d.ts +3 -2
  12. package/cjs/VapixAPI.js +13 -13
  13. package/cjs/events/AxisCameraStationEvents.d.ts +4 -2
  14. package/cjs/events/AxisCameraStationEvents.js +4 -4
  15. package/cjs/index.d.ts +0 -1
  16. package/cjs/index.js +0 -1
  17. package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +708 -521
  18. package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +35 -82
  19. package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +7 -37
  20. package/cjs/types/CamOverlayAPI/accuweatherSchema.js +8 -11
  21. package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +63 -146
  22. package/cjs/types/CamOverlayAPI/customGraphicsSchema.js +6 -9
  23. package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +8 -35
  24. package/cjs/types/CamOverlayAPI/imagesSchema.js +5 -8
  25. package/cjs/types/CamOverlayAPI/index.d.ts +2 -0
  26. package/cjs/types/CamOverlayAPI/index.js +2 -0
  27. package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +9 -43
  28. package/cjs/types/CamOverlayAPI/infotickerSchema.js +7 -10
  29. package/cjs/types/CamOverlayAPI/pipSchema.d.ts +5 -46
  30. package/cjs/types/CamOverlayAPI/pipSchema.js +5 -8
  31. package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +7 -40
  32. package/cjs/types/CamOverlayAPI/ptzCompassSchema.js +5 -8
  33. package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +10 -38
  34. package/cjs/types/CamOverlayAPI/ptzSchema.js +5 -8
  35. package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +3 -24
  36. package/cjs/types/CamOverlayAPI/screenSharingSchema.js +4 -7
  37. package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +3 -24
  38. package/cjs/types/CamOverlayAPI/webCameraSharingSchema.js +4 -7
  39. package/cjs/types/CamOverlayAPI/widgetCommonTypes.d.ts +141 -0
  40. package/cjs/types/CamOverlayAPI/widgetCommonTypes.js +87 -0
  41. package/cjs/types/CamStreamerAPI.d.ts +4 -4
  42. package/cjs/types/CamSwitcherAPI.d.ts +0 -2
  43. package/cjs/types/VapixAPI.d.ts +0 -2
  44. package/esm/CamOverlayAPI.d.ts +4 -15
  45. package/esm/CamOverlayAPI.js +9 -20
  46. package/esm/CamScripterAPI.d.ts +3 -2
  47. package/esm/CamScripterAPI.js +5 -5
  48. package/esm/CamStreamerAPI.d.ts +3 -2
  49. package/esm/CamStreamerAPI.js +4 -4
  50. package/esm/CamSwitcherAPI.d.ts +3 -2
  51. package/esm/CamSwitcherAPI.js +7 -7
  52. package/esm/PlaneTrackerAPI.d.ts +3 -2
  53. package/esm/PlaneTrackerAPI.js +15 -15
  54. package/esm/VapixAPI.d.ts +3 -2
  55. package/esm/VapixAPI.js +13 -13
  56. package/esm/events/AxisCameraStationEvents.d.ts +4 -2
  57. package/esm/events/AxisCameraStationEvents.js +4 -4
  58. package/esm/index.d.ts +0 -1
  59. package/esm/index.js +0 -1
  60. package/esm/types/CamOverlayAPI/CamOverlayAPI.d.ts +708 -521
  61. package/esm/types/CamOverlayAPI/CamOverlayAPI.js +17 -73
  62. package/esm/types/CamOverlayAPI/accuweatherSchema.d.ts +7 -37
  63. package/esm/types/CamOverlayAPI/accuweatherSchema.js +1 -3
  64. package/esm/types/CamOverlayAPI/customGraphicsSchema.d.ts +63 -146
  65. package/esm/types/CamOverlayAPI/customGraphicsSchema.js +1 -3
  66. package/esm/types/CamOverlayAPI/imagesSchema.d.ts +8 -35
  67. package/esm/types/CamOverlayAPI/imagesSchema.js +1 -3
  68. package/esm/types/CamOverlayAPI/index.d.ts +2 -0
  69. package/esm/types/CamOverlayAPI/index.js +2 -0
  70. package/esm/types/CamOverlayAPI/infotickerSchema.d.ts +9 -43
  71. package/esm/types/CamOverlayAPI/infotickerSchema.js +1 -3
  72. package/esm/types/CamOverlayAPI/pipSchema.d.ts +5 -46
  73. package/esm/types/CamOverlayAPI/pipSchema.js +1 -3
  74. package/esm/types/CamOverlayAPI/ptzCompassSchema.d.ts +7 -40
  75. package/esm/types/CamOverlayAPI/ptzCompassSchema.js +1 -3
  76. package/esm/types/CamOverlayAPI/ptzSchema.d.ts +10 -38
  77. package/esm/types/CamOverlayAPI/ptzSchema.js +1 -3
  78. package/esm/types/CamOverlayAPI/screenSharingSchema.d.ts +3 -24
  79. package/esm/types/CamOverlayAPI/screenSharingSchema.js +1 -3
  80. package/esm/types/CamOverlayAPI/webCameraSharingSchema.d.ts +3 -24
  81. package/esm/types/CamOverlayAPI/webCameraSharingSchema.js +1 -3
  82. package/esm/types/CamOverlayAPI/widgetCommonTypes.d.ts +141 -0
  83. package/esm/types/CamOverlayAPI/widgetCommonTypes.js +84 -0
  84. package/esm/types/CamStreamerAPI.d.ts +4 -4
  85. package/esm/types/CamSwitcherAPI.d.ts +0 -2
  86. package/esm/types/VapixAPI.d.ts +0 -2
  87. package/package.json +2 -2
  88. package/cjs/node/WsEventClient.d.ts +0 -13
  89. package/cjs/node/WsEventClient.js +0 -22
  90. package/esm/node/WsEventClient.d.ts +0 -13
  91. package/esm/node/WsEventClient.js +0 -18
@@ -0,0 +1,141 @@
1
+ import { z } from 'zod';
2
+ export declare const allowedWidgetNames: {
3
+ readonly accuweather: "accuweather";
4
+ readonly infoticker: "infoticker";
5
+ readonly customGraphics: "customGraphics";
6
+ readonly ptzCompass: "ptzCompass";
7
+ readonly images: "images";
8
+ readonly ptz: "ptz";
9
+ readonly pip: "pip";
10
+ readonly screenSharing: "screenSharing";
11
+ readonly web_camera: "web_camera";
12
+ };
13
+ export declare const coordinateSystemSchema: z.ZodUnion<[z.ZodLiteral<"top_left">, z.ZodLiteral<"top">, z.ZodLiteral<"top_right">, z.ZodLiteral<"left">, z.ZodLiteral<"center">, z.ZodLiteral<"right">, z.ZodLiteral<"bottom_left">, z.ZodLiteral<"bottom">, z.ZodLiteral<"bottom_right">]>;
14
+ export type TCoordinates = z.infer<typeof coordinateSystemSchema> | '';
15
+ export declare const languageSchema: z.ZodUnion<[z.ZodLiteral<"en-us">, z.ZodLiteral<"fr-fr">, z.ZodLiteral<"ja-jp">, z.ZodLiteral<"pt-pt">, z.ZodLiteral<"es-es">, z.ZodLiteral<"de-de">, z.ZodLiteral<"ko-kr">, z.ZodLiteral<"zh-hk">, z.ZodLiteral<"zh-cn">, z.ZodLiteral<"nl-nl">, z.ZodLiteral<"cs-cz">, z.ZodLiteral<"ru-ru">, z.ZodLiteral<"sv-se">]>;
16
+ export type TLanguage = z.infer<typeof languageSchema>;
17
+ export declare const fontSchema: z.ZodUnion<[z.ZodLiteral<"classic">, z.ZodLiteral<"digital">, z.ZodType<string, z.ZodTypeDef, string>]>;
18
+ export type TFont = z.infer<typeof fontSchema>;
19
+ export declare const weatherUnitSchema: z.ZodUnion<[z.ZodLiteral<"Metric">, z.ZodLiteral<"Imperial">]>;
20
+ export type TWeatherUnit = z.infer<typeof weatherUnitSchema>;
21
+ export declare const widgetCommonSchema: z.ZodObject<{
22
+ id: z.ZodNumber;
23
+ enabled: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
24
+ automationType: z.ZodUnion<[z.ZodLiteral<"time">, z.ZodLiteral<"manual">, z.ZodLiteral<"schedule">, z.ZodType<`input${number}`, z.ZodTypeDef, `input${number}`>]>;
25
+ invertInput: z.ZodOptional<z.ZodBoolean>;
26
+ cameraList: z.ZodArray<z.ZodNumber, "many">;
27
+ camera: z.ZodOptional<z.ZodNumber>;
28
+ schedule: z.ZodOptional<z.ZodString>;
29
+ customName: z.ZodString;
30
+ zIndex: z.ZodOptional<z.ZodNumber>;
31
+ width: z.ZodNumber;
32
+ height: z.ZodNumber;
33
+ }, "strip", z.ZodTypeAny, {
34
+ enabled: 0 | 1;
35
+ id: number;
36
+ width: number;
37
+ height: number;
38
+ automationType: "time" | "manual" | "schedule" | `input${number}`;
39
+ cameraList: number[];
40
+ customName: string;
41
+ camera?: number | undefined;
42
+ schedule?: string | undefined;
43
+ invertInput?: boolean | undefined;
44
+ zIndex?: number | undefined;
45
+ }, {
46
+ enabled: 0 | 1;
47
+ id: number;
48
+ width: number;
49
+ height: number;
50
+ automationType: "time" | "manual" | "schedule" | `input${number}`;
51
+ cameraList: number[];
52
+ customName: string;
53
+ camera?: number | undefined;
54
+ schedule?: string | undefined;
55
+ invertInput?: boolean | undefined;
56
+ zIndex?: number | undefined;
57
+ }>;
58
+ export declare const sharingSchema: z.ZodObject<{
59
+ id: z.ZodNumber;
60
+ enabled: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
61
+ automationType: z.ZodUnion<[z.ZodLiteral<"time">, z.ZodLiteral<"manual">, z.ZodLiteral<"schedule">, z.ZodType<`input${number}`, z.ZodTypeDef, `input${number}`>]>;
62
+ invertInput: z.ZodOptional<z.ZodBoolean>;
63
+ cameraList: z.ZodArray<z.ZodNumber, "many">;
64
+ camera: z.ZodOptional<z.ZodNumber>;
65
+ schedule: z.ZodOptional<z.ZodString>;
66
+ customName: z.ZodString;
67
+ zIndex: z.ZodOptional<z.ZodNumber>;
68
+ width: z.ZodNumber;
69
+ height: z.ZodNumber;
70
+ } & {
71
+ pos_x: z.ZodNumber;
72
+ pos_y: z.ZodNumber;
73
+ coordSystem: z.ZodUnion<[z.ZodLiteral<"top_left">, z.ZodLiteral<"top">, z.ZodLiteral<"top_right">, z.ZodLiteral<"left">, z.ZodLiteral<"center">, z.ZodLiteral<"right">, z.ZodLiteral<"bottom_left">, z.ZodLiteral<"bottom">, z.ZodLiteral<"bottom_right">]>;
74
+ screenSize: z.ZodNumber;
75
+ fps: z.ZodNumber;
76
+ }, "strip", z.ZodTypeAny, {
77
+ enabled: 0 | 1;
78
+ id: number;
79
+ width: number;
80
+ height: number;
81
+ fps: number;
82
+ automationType: "time" | "manual" | "schedule" | `input${number}`;
83
+ cameraList: number[];
84
+ customName: string;
85
+ pos_x: number;
86
+ pos_y: number;
87
+ coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
88
+ screenSize: number;
89
+ camera?: number | undefined;
90
+ schedule?: string | undefined;
91
+ invertInput?: boolean | undefined;
92
+ zIndex?: number | undefined;
93
+ }, {
94
+ enabled: 0 | 1;
95
+ id: number;
96
+ width: number;
97
+ height: number;
98
+ fps: number;
99
+ automationType: "time" | "manual" | "schedule" | `input${number}`;
100
+ cameraList: number[];
101
+ customName: string;
102
+ pos_x: number;
103
+ pos_y: number;
104
+ coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
105
+ screenSize: number;
106
+ camera?: number | undefined;
107
+ schedule?: string | undefined;
108
+ invertInput?: boolean | undefined;
109
+ zIndex?: number | undefined;
110
+ }>;
111
+ export declare const overlaySchema: z.ZodObject<{
112
+ active: z.ZodBoolean;
113
+ coordSystem: z.ZodUnion<[z.ZodLiteral<"top_left">, z.ZodLiteral<"top">, z.ZodLiteral<"top_right">, z.ZodLiteral<"left">, z.ZodLiteral<"center">, z.ZodLiteral<"right">, z.ZodLiteral<"bottom_left">, z.ZodLiteral<"bottom">, z.ZodLiteral<"bottom_right">]>;
114
+ pos_x: z.ZodNumber;
115
+ pos_y: z.ZodNumber;
116
+ imgPath: z.ZodString;
117
+ imgName: z.ZodString;
118
+ duration: z.ZodNumber;
119
+ scale: z.ZodNumber;
120
+ fps: z.ZodOptional<z.ZodNumber>;
121
+ }, "strip", z.ZodTypeAny, {
122
+ duration: number;
123
+ pos_x: number;
124
+ pos_y: number;
125
+ coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
126
+ active: boolean;
127
+ imgPath: string;
128
+ imgName: string;
129
+ scale: number;
130
+ fps?: number | undefined;
131
+ }, {
132
+ duration: number;
133
+ pos_x: number;
134
+ pos_y: number;
135
+ coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
136
+ active: boolean;
137
+ imgPath: string;
138
+ imgName: string;
139
+ scale: number;
140
+ fps?: number | undefined;
141
+ }>;
@@ -0,0 +1,84 @@
1
+ import { z } from 'zod';
2
+ export const allowedWidgetNames = {
3
+ accuweather: 'accuweather',
4
+ infoticker: 'infoticker',
5
+ customGraphics: 'customGraphics',
6
+ ptzCompass: 'ptzCompass',
7
+ images: 'images',
8
+ ptz: 'ptz',
9
+ pip: 'pip',
10
+ screenSharing: 'screenSharing',
11
+ web_camera: 'web_camera',
12
+ };
13
+ export const coordinateSystemSchema = z.union([
14
+ z.literal('top_left'),
15
+ z.literal('top'),
16
+ z.literal('top_right'),
17
+ z.literal('left'),
18
+ z.literal('center'),
19
+ z.literal('right'),
20
+ z.literal('bottom_left'),
21
+ z.literal('bottom'),
22
+ z.literal('bottom_right'),
23
+ ]);
24
+ export const languageSchema = z.union([
25
+ z.literal('en-us'),
26
+ z.literal('fr-fr'),
27
+ z.literal('ja-jp'),
28
+ z.literal('pt-pt'),
29
+ z.literal('es-es'),
30
+ z.literal('de-de'),
31
+ z.literal('ko-kr'),
32
+ z.literal('zh-hk'),
33
+ z.literal('zh-cn'),
34
+ z.literal('nl-nl'),
35
+ z.literal('cs-cz'),
36
+ z.literal('ru-ru'),
37
+ z.literal('sv-se'),
38
+ ]);
39
+ export const fontSchema = z.union([
40
+ z.literal('classic'),
41
+ z.literal('digital'),
42
+ z.custom((val) => {
43
+ return typeof val === 'string';
44
+ }),
45
+ ]);
46
+ export const weatherUnitSchema = z.union([z.literal('Metric'), z.literal('Imperial')]);
47
+ export const widgetCommonSchema = z.object({
48
+ id: z.number().nonnegative(),
49
+ enabled: z.union([z.literal(0), z.literal(1)]),
50
+ automationType: z.union([
51
+ z.literal('time'),
52
+ z.literal('manual'),
53
+ z.literal('schedule'),
54
+ z.custom((val) => {
55
+ return typeof val === 'string' ? /^input\d+$/.test(val) : false;
56
+ }),
57
+ ]),
58
+ invertInput: z.boolean().optional(),
59
+ cameraList: z.array(z.number()),
60
+ camera: z.number().nonnegative().optional(),
61
+ schedule: z.string().optional(),
62
+ customName: z.string(),
63
+ zIndex: z.number().optional(),
64
+ width: z.number().nonnegative(),
65
+ height: z.number().nonnegative(),
66
+ });
67
+ export const sharingSchema = widgetCommonSchema.extend({
68
+ pos_x: z.number().nonnegative(),
69
+ pos_y: z.number().nonnegative(),
70
+ coordSystem: coordinateSystemSchema,
71
+ screenSize: z.number().positive(),
72
+ fps: z.number(),
73
+ });
74
+ export const overlaySchema = z.object({
75
+ active: z.boolean(),
76
+ coordSystem: coordinateSystemSchema,
77
+ pos_x: z.number(),
78
+ pos_y: z.number(),
79
+ imgPath: z.string(),
80
+ imgName: z.string(),
81
+ duration: z.number(),
82
+ scale: z.number(),
83
+ fps: z.number().optional(),
84
+ });
@@ -25,8 +25,8 @@ export declare const streamAttributesSchema: z.ZodObject<{
25
25
  stopTime: z.ZodString;
26
26
  }, "strip", z.ZodTypeAny, {
27
27
  enabled: string;
28
- active: string;
29
28
  schedule: string;
29
+ active: string;
30
30
  audioSource: string;
31
31
  avSyncMsec: string;
32
32
  internalVapixParameters: string;
@@ -47,8 +47,8 @@ export declare const streamAttributesSchema: z.ZodObject<{
47
47
  stopTime: string;
48
48
  }, {
49
49
  enabled: string;
50
- active: string;
51
50
  schedule: string;
51
+ active: string;
52
52
  audioSource: string;
53
53
  avSyncMsec: string;
54
54
  internalVapixParameters: string;
@@ -93,8 +93,8 @@ export declare const streamListSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
93
93
  stopTime: z.ZodString;
94
94
  }, "strip", z.ZodTypeAny, {
95
95
  enabled: string;
96
- active: string;
97
96
  schedule: string;
97
+ active: string;
98
98
  audioSource: string;
99
99
  avSyncMsec: string;
100
100
  internalVapixParameters: string;
@@ -115,8 +115,8 @@ export declare const streamListSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
115
115
  stopTime: string;
116
116
  }, {
117
117
  enabled: string;
118
- active: string;
119
118
  schedule: string;
119
+ active: string;
120
120
  audioSource: string;
121
121
  avSyncMsec: string;
122
122
  internalVapixParameters: string;
@@ -1,7 +1,5 @@
1
- import { HttpOptions } from '../internal/types';
2
1
  import { z } from 'zod';
3
2
  import { TH264Profile, TAudioChannelCount, TKeyboardShortcut } from './common';
4
- export type CamSwitcherAPIOptions = HttpOptions;
5
3
  declare const channelTypeSchema: z.ZodUnion<[z.ZodLiteral<"audio">, z.ZodLiteral<"video">, z.ZodLiteral<"av">]>;
6
4
  export type TChannelType = z.infer<typeof channelTypeSchema>;
7
5
  declare const playlistPlayTypeSchema: z.ZodUnion<[z.ZodLiteral<"PLAY_ALL">, z.ZodLiteral<"PLAY_ALL_LOOP">, z.ZodLiteral<"PLAY_ALL_SHUFFLED">, z.ZodLiteral<"PLAY_ALL_LOOP_SHUFFLED">, z.ZodLiteral<"PLAY_ONE_RANDOM">]>;
@@ -1,6 +1,4 @@
1
- import { HttpOptions } from '../internal/types';
2
1
  import { z } from 'zod';
3
- export type CameraVapixOptions = HttpOptions;
4
2
  export declare const applicationSchema: z.ZodObject<{
5
3
  Name: z.ZodString;
6
4
  NiceName: z.ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstreamerlib",
3
- "version": "4.0.0-beta.30",
3
+ "version": "4.0.0-beta.32",
4
4
  "description": "Helper library for CamStreamer ACAP applications.",
5
5
  "prettier": "@camstreamer/prettier-config",
6
6
  "engine": {
@@ -15,7 +15,7 @@
15
15
  "type-fest": "^4.41.0",
16
16
  "undici": "^6.21.3",
17
17
  "ws": "^8.18.0",
18
- "zod": "^3.24.3"
18
+ "zod": "^3.25.76"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@camstreamer/eslint-config": "^1.0.2",
@@ -1,13 +0,0 @@
1
- import { IWebsocket } from '../internal/types';
2
- import { WsClientOptions } from './WsClient';
3
- type TEvent = {
4
- data: string;
5
- };
6
- export declare class WsEventClient implements IWebsocket<TEvent> {
7
- private wsClient;
8
- constructor(options: WsClientOptions);
9
- send: (data: string) => void;
10
- destroy: () => void;
11
- onmessage: ((event: TEvent) => void) | null;
12
- }
13
- export {};
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WsEventClient = void 0;
4
- const WsClient_1 = require("./WsClient");
5
- class WsEventClient {
6
- wsClient;
7
- constructor(options) {
8
- this.wsClient = new WsClient_1.WsClient(options);
9
- this.wsClient.on('message', (data) => {
10
- this.onmessage?.({ data: data.toString() });
11
- });
12
- }
13
- send = (data) => {
14
- this.wsClient.send(data);
15
- };
16
- destroy = () => {
17
- this.wsClient.close();
18
- this.onmessage = null;
19
- };
20
- onmessage = null;
21
- }
22
- exports.WsEventClient = WsEventClient;
@@ -1,13 +0,0 @@
1
- import { IWebsocket } from '../internal/types';
2
- import { WsClientOptions } from './WsClient';
3
- type TEvent = {
4
- data: string;
5
- };
6
- export declare class WsEventClient implements IWebsocket<TEvent> {
7
- private wsClient;
8
- constructor(options: WsClientOptions);
9
- send: (data: string) => void;
10
- destroy: () => void;
11
- onmessage: ((event: TEvent) => void) | null;
12
- }
13
- export {};
@@ -1,18 +0,0 @@
1
- import { WsClient } from './WsClient';
2
- export class WsEventClient {
3
- wsClient;
4
- constructor(options) {
5
- this.wsClient = new WsClient(options);
6
- this.wsClient.on('message', (data) => {
7
- this.onmessage?.({ data: data.toString() });
8
- });
9
- }
10
- send = (data) => {
11
- this.wsClient.send(data);
12
- };
13
- destroy = () => {
14
- this.wsClient.close();
15
- this.onmessage = null;
16
- };
17
- onmessage = null;
18
- }