@illgrenoble/webx-client 0.10.0 → 1.1.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.
Files changed (158) hide show
  1. package/dist/WebXClient.d.ts +156 -16
  2. package/dist/WebXClient.js +170 -16
  3. package/dist/WebXClient.js.map +1 -1
  4. package/dist/display/WebXCursor.d.ts +65 -0
  5. package/dist/display/WebXCursor.js +65 -0
  6. package/dist/display/WebXCursor.js.map +1 -1
  7. package/dist/display/WebXCursorFactory.d.ts +18 -0
  8. package/dist/display/WebXCursorFactory.js +39 -16
  9. package/dist/display/WebXCursorFactory.js.map +1 -1
  10. package/dist/display/WebXDisplay.d.ts +150 -9
  11. package/dist/display/WebXDisplay.js +154 -9
  12. package/dist/display/WebXDisplay.js.map +1 -1
  13. package/dist/display/WebXSubImage.d.ts +42 -11
  14. package/dist/display/WebXSubImage.js +18 -12
  15. package/dist/display/WebXSubImage.js.map +1 -1
  16. package/dist/display/WebXTextureFactory.d.ts +30 -0
  17. package/dist/display/WebXTextureFactory.js +56 -19
  18. package/dist/display/WebXTextureFactory.js.map +1 -1
  19. package/dist/display/WebXWindow.d.ts +152 -0
  20. package/dist/display/WebXWindow.js +152 -0
  21. package/dist/display/WebXWindow.js.map +1 -1
  22. package/dist/display/WebXWindowProperties.d.ts +31 -6
  23. package/dist/display/WebXWindowProperties.js +16 -9
  24. package/dist/display/WebXWindowProperties.js.map +1 -1
  25. package/dist/input/WebXKeyboard.d.ts +40 -5
  26. package/dist/input/WebXKeyboard.js +52 -14
  27. package/dist/input/WebXKeyboard.js.map +1 -1
  28. package/dist/input/WebXMouse.d.ts +9 -0
  29. package/dist/input/WebXMouse.js +9 -4
  30. package/dist/input/WebXMouse.js.map +1 -1
  31. package/dist/input/keyboard/WebXKeyEvent.d.ts +35 -3
  32. package/dist/input/keyboard/WebXKeyEvent.js +115 -3
  33. package/dist/input/keyboard/WebXKeyEvent.js.map +1 -1
  34. package/dist/input/keyboard/WebXKeyPressEvent.d.ts +25 -8
  35. package/dist/input/keyboard/WebXKeyPressEvent.js +29 -11
  36. package/dist/input/keyboard/WebXKeyPressEvent.js.map +1 -1
  37. package/dist/input/keyboard/WebXKeyUpEvent.d.ts +30 -9
  38. package/dist/input/keyboard/WebXKeyUpEvent.js +19 -16
  39. package/dist/input/keyboard/WebXKeyUpEvent.js.map +1 -1
  40. package/dist/input/keyboard/WebXKeyboardModifierState.d.ts +69 -8
  41. package/dist/input/keyboard/WebXKeyboardModifierState.js +69 -8
  42. package/dist/input/keyboard/WebXKeyboardModifierState.js.map +1 -1
  43. package/dist/input/keyboard/WebXKeyboardUtils.d.ts +18 -2
  44. package/dist/input/keyboard/WebXKeyboardUtils.js +18 -2
  45. package/dist/input/keyboard/WebXKeyboardUtils.js.map +1 -1
  46. package/dist/input/keyboard/WebXKeydownEvent.d.ts +26 -9
  47. package/dist/input/keyboard/WebXKeydownEvent.js +17 -22
  48. package/dist/input/keyboard/WebXKeydownEvent.js.map +1 -1
  49. package/dist/input/mouse/WebXMouseState.d.ts +113 -2
  50. package/dist/input/mouse/WebXMouseState.js +104 -2
  51. package/dist/input/mouse/WebXMouseState.js.map +1 -1
  52. package/dist/instruction/WebXConnectInstruction.d.ts +16 -1
  53. package/dist/instruction/WebXConnectInstruction.js +13 -1
  54. package/dist/instruction/WebXConnectInstruction.js.map +1 -1
  55. package/dist/instruction/WebXCursorImageInstruction.d.ts +15 -3
  56. package/dist/instruction/WebXCursorImageInstruction.js +12 -5
  57. package/dist/instruction/WebXCursorImageInstruction.js.map +1 -1
  58. package/dist/instruction/WebXDataAckInstruction.d.ts +22 -5
  59. package/dist/instruction/WebXDataAckInstruction.js +15 -9
  60. package/dist/instruction/WebXDataAckInstruction.js.map +1 -1
  61. package/dist/instruction/WebXImageInstruction.d.ts +14 -3
  62. package/dist/instruction/WebXImageInstruction.js +11 -7
  63. package/dist/instruction/WebXImageInstruction.js.map +1 -1
  64. package/dist/instruction/WebXInstruction.d.ts +26 -10
  65. package/dist/instruction/WebXInstruction.js +19 -25
  66. package/dist/instruction/WebXInstruction.js.map +1 -1
  67. package/dist/instruction/WebXInstructionResponse.d.ts +55 -2
  68. package/dist/instruction/WebXInstructionResponse.js +40 -2
  69. package/dist/instruction/WebXInstructionResponse.js.map +1 -1
  70. package/dist/instruction/WebXInstructionType.d.ts +40 -0
  71. package/dist/instruction/WebXInstructionType.js +40 -0
  72. package/dist/instruction/WebXInstructionType.js.map +1 -1
  73. package/dist/instruction/WebXKeyboardInstruction.d.ts +19 -6
  74. package/dist/instruction/WebXKeyboardInstruction.js +13 -14
  75. package/dist/instruction/WebXKeyboardInstruction.js.map +1 -1
  76. package/dist/instruction/WebXMouseInstruction.d.ts +24 -9
  77. package/dist/instruction/WebXMouseInstruction.js +15 -21
  78. package/dist/instruction/WebXMouseInstruction.js.map +1 -1
  79. package/dist/instruction/WebXPongInstruction.d.ts +15 -3
  80. package/dist/instruction/WebXPongInstruction.js +12 -5
  81. package/dist/instruction/WebXPongInstruction.js.map +1 -1
  82. package/dist/instruction/WebXQualityInstruction.d.ts +16 -4
  83. package/dist/instruction/WebXQualityInstruction.js +13 -8
  84. package/dist/instruction/WebXQualityInstruction.js.map +1 -1
  85. package/dist/instruction/WebXScreenInstruction.d.ts +8 -0
  86. package/dist/instruction/WebXScreenInstruction.js +8 -0
  87. package/dist/instruction/WebXScreenInstruction.js.map +1 -1
  88. package/dist/instruction/WebXWindowsInstruction.d.ts +9 -0
  89. package/dist/instruction/WebXWindowsInstruction.js +9 -0
  90. package/dist/instruction/WebXWindowsInstruction.js.map +1 -1
  91. package/dist/message/WebXCursorImageMessage.d.ts +42 -13
  92. package/dist/message/WebXCursorImageMessage.js +24 -25
  93. package/dist/message/WebXCursorImageMessage.js.map +1 -1
  94. package/dist/message/WebXImageMessage.d.ts +37 -11
  95. package/dist/message/WebXImageMessage.js +22 -21
  96. package/dist/message/WebXImageMessage.js.map +1 -1
  97. package/dist/message/WebXMessage.d.ts +22 -6
  98. package/dist/message/WebXMessage.js +15 -9
  99. package/dist/message/WebXMessage.js.map +1 -1
  100. package/dist/message/WebXMessageType.d.ts +35 -0
  101. package/dist/message/WebXMessageType.js +35 -0
  102. package/dist/message/WebXMessageType.js.map +1 -1
  103. package/dist/message/WebXMouseMessage.d.ts +27 -7
  104. package/dist/message/WebXMouseMessage.js +18 -13
  105. package/dist/message/WebXMouseMessage.js.map +1 -1
  106. package/dist/message/WebXPingMessage.d.ts +9 -0
  107. package/dist/message/WebXPingMessage.js +9 -0
  108. package/dist/message/WebXPingMessage.js.map +1 -1
  109. package/dist/message/WebXQualityMessage.d.ts +36 -11
  110. package/dist/message/WebXQualityMessage.js +21 -21
  111. package/dist/message/WebXQualityMessage.js.map +1 -1
  112. package/dist/message/WebXScreenMessage.d.ts +17 -3
  113. package/dist/message/WebXScreenMessage.js +14 -5
  114. package/dist/message/WebXScreenMessage.js.map +1 -1
  115. package/dist/message/WebXSubImagesMessage.d.ts +27 -7
  116. package/dist/message/WebXSubImagesMessage.js +18 -13
  117. package/dist/message/WebXSubImagesMessage.js.map +1 -1
  118. package/dist/message/WebXWindowsMessage.d.ts +17 -3
  119. package/dist/message/WebXWindowsMessage.js +14 -5
  120. package/dist/message/WebXWindowsMessage.js.map +1 -1
  121. package/dist/tracer/WebXDebugImageMessageHandler.d.ts +30 -0
  122. package/dist/tracer/WebXDebugImageMessageHandler.js +30 -0
  123. package/dist/tracer/WebXDebugImageMessageHandler.js.map +1 -1
  124. package/dist/tracer/WebXHandler.d.ts +11 -0
  125. package/dist/tracer/WebXInstructionHandler.d.ts +17 -0
  126. package/dist/tracer/WebXInstructionHandler.js +6 -0
  127. package/dist/tracer/WebXInstructionHandler.js.map +1 -1
  128. package/dist/tracer/WebXMessageHandler.d.ts +17 -0
  129. package/dist/tracer/WebXMessageHandler.js +6 -0
  130. package/dist/tracer/WebXMessageHandler.js.map +1 -1
  131. package/dist/tracer/WebXStatsHandler.d.ts +16 -0
  132. package/dist/tracer/WebXStatsHandler.js +6 -0
  133. package/dist/tracer/WebXStatsHandler.js.map +1 -1
  134. package/dist/transport/WebXBinarySerializer.d.ts +20 -0
  135. package/dist/transport/WebXBinarySerializer.js +20 -0
  136. package/dist/transport/WebXBinarySerializer.js.map +1 -1
  137. package/dist/transport/WebXInstructionBuffer.d.ts +19 -0
  138. package/dist/transport/WebXInstructionBuffer.js +19 -0
  139. package/dist/transport/WebXInstructionBuffer.js.map +1 -1
  140. package/dist/transport/WebXInstructionEncoder.d.ts +138 -0
  141. package/dist/transport/WebXInstructionEncoder.js +138 -110
  142. package/dist/transport/WebXInstructionEncoder.js.map +1 -1
  143. package/dist/transport/WebXMessageBuffer.d.ts +63 -8
  144. package/dist/transport/WebXMessageBuffer.js +51 -16
  145. package/dist/transport/WebXMessageBuffer.js.map +1 -1
  146. package/dist/transport/WebXMessageDecoder.d.ts +69 -0
  147. package/dist/transport/WebXMessageDecoder.js +96 -18
  148. package/dist/transport/WebXMessageDecoder.js.map +1 -1
  149. package/dist/tunnel/WebXTunnel.d.ts +71 -0
  150. package/dist/tunnel/WebXTunnel.js +51 -4
  151. package/dist/tunnel/WebXTunnel.js.map +1 -1
  152. package/dist/tunnel/WebXWebSocketTunnel.d.ts +26 -0
  153. package/dist/tunnel/WebXWebSocketTunnel.js +26 -0
  154. package/dist/tunnel/WebXWebSocketTunnel.js.map +1 -1
  155. package/dist/utils/ColorGenerator.d.ts +19 -0
  156. package/dist/utils/ColorGenerator.js +19 -0
  157. package/dist/utils/ColorGenerator.js.map +1 -1
  158. package/package.json +1 -1
@@ -2,6 +2,12 @@ import { WebXTunnel } from './tunnel';
2
2
  import { WebXDisplay } from './display';
3
3
  import { WebXKeyboard, WebXMouse, WebXMouseState } from './input';
4
4
  import { WebXDebugImageMessageHandler, WebXHandler } from './tracer';
5
+ /**
6
+ * The main client class for interacting with the WebX Engine.
7
+ *
8
+ * This class provides methods to connect to the WebX Engine, manage the display,
9
+ * handle user input (mouse and keyboard), and send/receive instructions and messages.
10
+ */
5
11
  export declare class WebXClient {
6
12
  private _tunnel;
7
13
  private readonly _textureFactory;
@@ -11,26 +17,57 @@ export declare class WebXClient {
11
17
  private _display;
12
18
  private _mouse;
13
19
  private _keyboard;
20
+ /**
21
+ * Gets the WebXTunnel instance used for communication with the WebX Engine.
22
+ */
14
23
  get tunnel(): WebXTunnel;
24
+ /**
25
+ * Gets the map of registered tracer handlers.
26
+ */
15
27
  get tracers(): Map<string, WebXHandler>;
28
+ /**
29
+ * Gets the WebXDisplay instance used for rendering the display.
30
+ */
16
31
  get display(): WebXDisplay;
32
+ /**
33
+ * Gets the WebXMouse instance used for handling mouse input.
34
+ */
17
35
  get mouse(): WebXMouse;
36
+ /**
37
+ * Gets the WebXKeyboard instance used for handling keyboard input.
38
+ */
18
39
  get keyboard(): WebXKeyboard;
40
+ /**
41
+ * Creates a new instance of the WebXClient.
42
+ *
43
+ * @param _tunnel The WebXTunnel instance used for communication with the WebX Engine.
44
+ */
19
45
  constructor(_tunnel: WebXTunnel);
46
+ /**
47
+ * Connects to the WebX Engine and initializes the communication tunnel.
48
+ *
49
+ * @param onCloseCallback Callback function to execute when the connection is closed.
50
+ * @param data Additional data to send during the connection process.
51
+ */
20
52
  connect(onCloseCallback: () => void, data: any): Promise<void>;
53
+ /**
54
+ * Disconnects from the WebX Engine and cleans up resources.
55
+ */
21
56
  disconnect(): void;
22
57
  /**
58
+ * Initializes the WebX display and input devices.
23
59
  *
24
- * @param containerElement The main container
25
- * @param screenWidth the screen width
26
- * @param screenHeight the screen height
60
+ * @param containerElement The HTML element to render the display.
61
+ * @returns A promise that resolves to the initialized WebXDisplay instance.
27
62
  */
28
63
  initialise(containerElement: HTMLElement): Promise<WebXDisplay>;
29
64
  /**
65
+ * Creates a new WebXDisplay instance.
30
66
  *
31
- * @param containerElement The main container
32
- * @param screenWidth the screen width
33
- * @param screenHeight the screen height
67
+ * @param containerElement The HTML element to render the display.
68
+ * @param screenWidth The width of the screen.
69
+ * @param screenHeight The height of the screen.
70
+ * @returns The created WebXDisplay instance.
34
71
  */
35
72
  createDisplay(containerElement: HTMLElement, screenWidth: number, screenHeight: number): WebXDisplay;
36
73
  /**
@@ -44,14 +81,16 @@ export declare class WebXClient {
44
81
  */
45
82
  createKeyboard(element: HTMLElement): WebXKeyboard;
46
83
  /**
47
- * Sends a mouse event having the properties provided by the given mouse state
48
- * @param mouseState the state of the mouse to send in the mouse event
84
+ * Sends a mouse event to the WebX Engine.
85
+ *
86
+ * @param mouseState The state of the mouse to send in the event.
49
87
  */
50
88
  sendMouse(mouseState: WebXMouseState): void;
51
89
  /**
52
- * Sends a key event
53
- * @param pressed {Boolean} Whether the key is pressed (true) or released (false)
54
- * @param key {number} the key to send
90
+ * Sends a key event to the WebX Engine.
91
+ *
92
+ * @param key The key code to send.
93
+ * @param pressed Whether the key is pressed (true) or released (false).
55
94
  */
56
95
  sendKeyEvent(key: number, pressed: boolean): void;
57
96
  /**
@@ -65,29 +104,130 @@ export declare class WebXClient {
65
104
  */
66
105
  sendKeyUp(key: number): void;
67
106
  /**
68
- * Register a new tracer handler
69
- * @param name the name of the tracer (must be unique)
70
- * @param handler the tracer handler
107
+ * Registers a new tracer handler.
108
+ *
109
+ * @param name The unique name of the tracer.
110
+ * @param handler The tracer handler instance.
71
111
  */
72
112
  registerTracer(name: string, handler: WebXHandler): void;
73
113
  createDebugImageMessageHandler(): WebXDebugImageMessageHandler;
114
+ /**
115
+ * Resets the input devices (mouse and keyboard).
116
+ */
74
117
  resetInputs(): void;
118
+ /**
119
+ * Resizes the WebX display to fit the container.
120
+ */
75
121
  resizeDisplay(): void;
76
122
  /**
77
- * Unregister a tracer
78
- * @param name the name of the tracer
123
+ * Unregisters a tracer handler.
124
+ *
125
+ * @param name The name of the tracer to unregister.
79
126
  */
80
127
  unregisterTracer(name: string): void;
128
+ /**
129
+ * Sets the quality index for the WebX Engine.
130
+ *
131
+ * @param qualityIndex The quality index to set.
132
+ */
81
133
  setQualityIndex(qualityIndex: number): void;
134
+ /**
135
+ * Creates a screenshot of the current display.
136
+ * @param type The type of the screenshot (e.g., 'image/png').
137
+ * @param quality The quality of the screenshot (0 to 1).
138
+ *
139
+ * @returns A promise that resolves to image data in Blob form.
140
+ */
141
+ createScreenshot(type: string, quality: number): Promise<Blob>;
142
+ /**
143
+ * Retrieves the screen message from the WebX Engine.
144
+ *
145
+ * This method attempts to get the screen message, retrying up to 3 times
146
+ * if the initial attempts fail.
147
+ *
148
+ * @returns A promise that resolves to the WebXScreenMessage.
149
+ */
82
150
  private _getScreenMessage;
151
+ /**
152
+ * Sends an instruction to the WebX Engine.
153
+ *
154
+ * This method sends the provided instruction to the WebX Engine if the tunnel
155
+ * is connected.
156
+ *
157
+ * @param command The instruction to send.
158
+ */
83
159
  private _sendInstruction;
160
+ /**
161
+ * Sends a request to the WebX Engine and returns the response.
162
+ *
163
+ * This method sends the provided request to the WebX Engine and returns a promise
164
+ * that resolves to the response message.
165
+ *
166
+ * @param command The request to send.
167
+ * @param timeout Optional timeout for the request.
168
+ * @returns A promise that resolves to the WebXMessage.
169
+ */
84
170
  private _sendRequest;
171
+ /**
172
+ * Handles incoming messages from the WebX Engine.
173
+ *
174
+ * This method processes messages received from the WebX Engine and takes
175
+ * appropriate actions based on the message type.
176
+ *
177
+ * @param message The received message.
178
+ */
85
179
  private _handleMessage;
180
+ /**
181
+ * Handles received bytes from the WebX Engine.
182
+ *
183
+ * This method processes the received bytes and updates the tracers with the
184
+ * received data.
185
+ *
186
+ * @param data The received data as an ArrayBuffer.
187
+ */
86
188
  private _handleReceivedBytes;
189
+ /**
190
+ * Handles sent bytes to the WebX Engine.
191
+ *
192
+ * This method processes the sent bytes and updates the tracers with the
193
+ * sent data.
194
+ *
195
+ * @param data The sent data as an ArrayBuffer.
196
+ */
87
197
  private _handleSentBytes;
198
+ /**
199
+ * Handles the quality of the connection to the WebX Engine.
200
+ *
201
+ * This method processes the quality data and updates the tracers with the
202
+ * quality information.
203
+ *
204
+ * @param data The quality data as an ArrayBuffer.
205
+ */
88
206
  private _handleQuality;
207
+ /**
208
+ * Handles the tunnel closed event.
209
+ *
210
+ * This method performs cleanup and executes the onCloseCallback when the
211
+ * tunnel is closed.
212
+ */
89
213
  private _onTunnelClosed;
214
+ /**
215
+ * Disposes of the WebX client resources.
216
+ *
217
+ * This method cleans up the display, mouse, and keyboard resources.
218
+ */
90
219
  private _dispose;
220
+ /**
221
+ * Adds mouse event listeners to the WebX client.
222
+ *
223
+ * This method sets up the mouse event listeners for mouse move, mouse out,
224
+ * mouse down, and mouse up events.
225
+ */
91
226
  private _addMouseListeners;
227
+ /**
228
+ * Adds keyboard event listeners to the WebX client.
229
+ *
230
+ * This method sets up the keyboard event listeners for key down and key up events.
231
+ */
92
232
  private _addKeyboardListeners;
93
233
  }
@@ -16,28 +16,60 @@ const display_1 = require("./display");
16
16
  const input_1 = require("./input");
17
17
  const tracer_1 = require("./tracer");
18
18
  const transport_1 = require("./transport");
19
+ /**
20
+ * The main client class for interacting with the WebX Engine.
21
+ *
22
+ * This class provides methods to connect to the WebX Engine, manage the display,
23
+ * handle user input (mouse and keyboard), and send/receive instructions and messages.
24
+ */
19
25
  class WebXClient {
26
+ /**
27
+ * Gets the WebXTunnel instance used for communication with the WebX Engine.
28
+ */
20
29
  get tunnel() {
21
30
  return this._tunnel;
22
31
  }
32
+ /**
33
+ * Gets the map of registered tracer handlers.
34
+ */
23
35
  get tracers() {
24
36
  return this._tracers;
25
37
  }
38
+ /**
39
+ * Gets the WebXDisplay instance used for rendering the display.
40
+ */
26
41
  get display() {
27
42
  return this._display;
28
43
  }
44
+ /**
45
+ * Gets the WebXMouse instance used for handling mouse input.
46
+ */
29
47
  get mouse() {
30
48
  return this._mouse;
31
49
  }
50
+ /**
51
+ * Gets the WebXKeyboard instance used for handling keyboard input.
52
+ */
32
53
  get keyboard() {
33
54
  return this._keyboard;
34
55
  }
56
+ /**
57
+ * Creates a new instance of the WebXClient.
58
+ *
59
+ * @param _tunnel The WebXTunnel instance used for communication with the WebX Engine.
60
+ */
35
61
  constructor(_tunnel) {
36
62
  this._tunnel = _tunnel;
37
63
  this._tracers = new Map();
38
64
  this._textureFactory = new display_1.WebXTextureFactory(this._tunnel);
39
65
  this._cursorFactory = new display_1.WebXCursorFactory(this._tunnel);
40
66
  }
67
+ /**
68
+ * Connects to the WebX Engine and initializes the communication tunnel.
69
+ *
70
+ * @param onCloseCallback Callback function to execute when the connection is closed.
71
+ * @param data Additional data to send during the connection process.
72
+ */
41
73
  connect(onCloseCallback, data) {
42
74
  return __awaiter(this, void 0, void 0, function* () {
43
75
  this._onCloseCallback = onCloseCallback;
@@ -48,14 +80,17 @@ class WebXClient {
48
80
  this._tunnel.onClosed = this._onTunnelClosed.bind(this);
49
81
  });
50
82
  }
83
+ /**
84
+ * Disconnects from the WebX Engine and cleans up resources.
85
+ */
51
86
  disconnect() {
52
87
  this._tunnel.disconnect();
53
88
  }
54
89
  /**
90
+ * Initializes the WebX display and input devices.
55
91
  *
56
- * @param containerElement The main container
57
- * @param screenWidth the screen width
58
- * @param screenHeight the screen height
92
+ * @param containerElement The HTML element to render the display.
93
+ * @returns A promise that resolves to the initialized WebXDisplay instance.
59
94
  */
60
95
  initialise(containerElement) {
61
96
  return __awaiter(this, void 0, void 0, function* () {
@@ -86,10 +121,12 @@ class WebXClient {
86
121
  });
87
122
  }
88
123
  /**
124
+ * Creates a new WebXDisplay instance.
89
125
  *
90
- * @param containerElement The main container
91
- * @param screenWidth the screen width
92
- * @param screenHeight the screen height
126
+ * @param containerElement The HTML element to render the display.
127
+ * @param screenWidth The width of the screen.
128
+ * @param screenHeight The height of the screen.
129
+ * @returns The created WebXDisplay instance.
93
130
  */
94
131
  createDisplay(containerElement, screenWidth, screenHeight) {
95
132
  return new display_1.WebXDisplay(containerElement, screenWidth, screenHeight, this._textureFactory, this._cursorFactory);
@@ -109,16 +146,18 @@ class WebXClient {
109
146
  return new input_1.WebXKeyboard(element);
110
147
  }
111
148
  /**
112
- * Sends a mouse event having the properties provided by the given mouse state
113
- * @param mouseState the state of the mouse to send in the mouse event
149
+ * Sends a mouse event to the WebX Engine.
150
+ *
151
+ * @param mouseState The state of the mouse to send in the event.
114
152
  */
115
153
  sendMouse(mouseState) {
116
154
  this._sendInstruction(new instruction_1.WebXMouseInstruction(mouseState.x, mouseState.y, mouseState.getButtonMask()));
117
155
  }
118
156
  /**
119
- * Sends a key event
120
- * @param pressed {Boolean} Whether the key is pressed (true) or released (false)
121
- * @param key {number} the key to send
157
+ * Sends a key event to the WebX Engine.
158
+ *
159
+ * @param key The key code to send.
160
+ * @param pressed Whether the key is pressed (true) or released (false).
122
161
  */
123
162
  sendKeyEvent(key, pressed) {
124
163
  this._sendInstruction(new instruction_1.WebXKeyboardInstruction(key, pressed));
@@ -138,9 +177,10 @@ class WebXClient {
138
177
  this.sendKeyEvent(key, false);
139
178
  }
140
179
  /**
141
- * Register a new tracer handler
142
- * @param name the name of the tracer (must be unique)
143
- * @param handler the tracer handler
180
+ * Registers a new tracer handler.
181
+ *
182
+ * @param name The unique name of the tracer.
183
+ * @param handler The tracer handler instance.
144
184
  */
145
185
  registerTracer(name, handler) {
146
186
  this._tracers.set(name, handler);
@@ -152,6 +192,9 @@ class WebXClient {
152
192
  console.log('Cannot create DebugImageMessageHandler as display is null');
153
193
  return null;
154
194
  }
195
+ /**
196
+ * Resets the input devices (mouse and keyboard).
197
+ */
155
198
  resetInputs() {
156
199
  if (this._mouse) {
157
200
  this._mouse.reset();
@@ -160,14 +203,18 @@ class WebXClient {
160
203
  this._keyboard.reset();
161
204
  }
162
205
  }
206
+ /**
207
+ * Resizes the WebX display to fit the container.
208
+ */
163
209
  resizeDisplay() {
164
210
  if (this._display) {
165
211
  this._display.resize();
166
212
  }
167
213
  }
168
214
  /**
169
- * Unregister a tracer
170
- * @param name the name of the tracer
215
+ * Unregisters a tracer handler.
216
+ *
217
+ * @param name The name of the tracer to unregister.
171
218
  */
172
219
  unregisterTracer(name) {
173
220
  const tracer = this._tracers.get(name);
@@ -177,10 +224,45 @@ class WebXClient {
177
224
  this._tracers.delete(name);
178
225
  }
179
226
  }
227
+ /**
228
+ * Sets the quality index for the WebX Engine.
229
+ *
230
+ * @param qualityIndex The quality index to set.
231
+ */
180
232
  setQualityIndex(qualityIndex) {
181
233
  const qualityInstruction = new instruction_1.WebXQualityInstruction(qualityIndex);
182
234
  this._sendInstruction(qualityInstruction);
183
235
  }
236
+ /**
237
+ * Creates a screenshot of the current display.
238
+ * @param type The type of the screenshot (e.g., 'image/png').
239
+ * @param quality The quality of the screenshot (0 to 1).
240
+ *
241
+ * @returns A promise that resolves to image data in Blob form.
242
+ */
243
+ createScreenshot(type, quality) {
244
+ return __awaiter(this, void 0, void 0, function* () {
245
+ return new Promise((resolve, reject) => {
246
+ try {
247
+ this.display.render();
248
+ this.display.renderer.domElement.toBlob((blob) => {
249
+ resolve(blob);
250
+ }, type, quality);
251
+ }
252
+ catch (error) {
253
+ reject(error);
254
+ }
255
+ });
256
+ });
257
+ }
258
+ /**
259
+ * Retrieves the screen message from the WebX Engine.
260
+ *
261
+ * This method attempts to get the screen message, retrying up to 3 times
262
+ * if the initial attempts fail.
263
+ *
264
+ * @returns A promise that resolves to the WebXScreenMessage.
265
+ */
184
266
  _getScreenMessage() {
185
267
  return __awaiter(this, void 0, void 0, function* () {
186
268
  // Perform retries on the first instruction (client can sometimes be activated before the server connection$
@@ -200,6 +282,14 @@ class WebXClient {
200
282
  }
201
283
  });
202
284
  }
285
+ /**
286
+ * Sends an instruction to the WebX Engine.
287
+ *
288
+ * This method sends the provided instruction to the WebX Engine if the tunnel
289
+ * is connected.
290
+ *
291
+ * @param command The instruction to send.
292
+ */
203
293
  _sendInstruction(command) {
204
294
  if (this._tunnel.isConnected()) {
205
295
  this._tunnel.sendInstruction(command);
@@ -210,11 +300,29 @@ class WebXClient {
210
300
  });
211
301
  }
212
302
  }
303
+ /**
304
+ * Sends a request to the WebX Engine and returns the response.
305
+ *
306
+ * This method sends the provided request to the WebX Engine and returns a promise
307
+ * that resolves to the response message.
308
+ *
309
+ * @param command The request to send.
310
+ * @param timeout Optional timeout for the request.
311
+ * @returns A promise that resolves to the WebXMessage.
312
+ */
213
313
  _sendRequest(command, timeout) {
214
314
  if (this._tunnel.isConnected()) {
215
315
  return this._tunnel.sendRequest(command, timeout);
216
316
  }
217
317
  }
318
+ /**
319
+ * Handles incoming messages from the WebX Engine.
320
+ *
321
+ * This method processes messages received from the WebX Engine and takes
322
+ * appropriate actions based on the message type.
323
+ *
324
+ * @param message The received message.
325
+ */
218
326
  _handleMessage(message) {
219
327
  if (!this._display) {
220
328
  return;
@@ -243,6 +351,14 @@ class WebXClient {
243
351
  }
244
352
  });
245
353
  }
354
+ /**
355
+ * Handles received bytes from the WebX Engine.
356
+ *
357
+ * This method processes the received bytes and updates the tracers with the
358
+ * received data.
359
+ *
360
+ * @param data The received data as an ArrayBuffer.
361
+ */
246
362
  _handleReceivedBytes(data) {
247
363
  this._tracers.forEach((value) => {
248
364
  if (value instanceof tracer_1.WebXStatsHandler) {
@@ -250,6 +366,14 @@ class WebXClient {
250
366
  }
251
367
  });
252
368
  }
369
+ /**
370
+ * Handles sent bytes to the WebX Engine.
371
+ *
372
+ * This method processes the sent bytes and updates the tracers with the
373
+ * sent data.
374
+ *
375
+ * @param data The sent data as an ArrayBuffer.
376
+ */
253
377
  _handleSentBytes(data) {
254
378
  this._tracers.forEach((value) => {
255
379
  if (value instanceof tracer_1.WebXStatsHandler) {
@@ -257,6 +381,14 @@ class WebXClient {
257
381
  }
258
382
  });
259
383
  }
384
+ /**
385
+ * Handles the quality of the connection to the WebX Engine.
386
+ *
387
+ * This method processes the quality data and updates the tracers with the
388
+ * quality information.
389
+ *
390
+ * @param data The quality data as an ArrayBuffer.
391
+ */
260
392
  _handleQuality(data) {
261
393
  this._tracers.forEach((value) => {
262
394
  if (value instanceof tracer_1.WebXStatsHandler) {
@@ -264,12 +396,23 @@ class WebXClient {
264
396
  }
265
397
  });
266
398
  }
399
+ /**
400
+ * Handles the tunnel closed event.
401
+ *
402
+ * This method performs cleanup and executes the onCloseCallback when the
403
+ * tunnel is closed.
404
+ */
267
405
  _onTunnelClosed() {
268
406
  this._dispose();
269
407
  if (this._onCloseCallback) {
270
408
  this._onCloseCallback();
271
409
  }
272
410
  }
411
+ /**
412
+ * Disposes of the WebX client resources.
413
+ *
414
+ * This method cleans up the display, mouse, and keyboard resources.
415
+ */
273
416
  _dispose() {
274
417
  if (this._display) {
275
418
  this._display.dispose();
@@ -281,6 +424,12 @@ class WebXClient {
281
424
  this._keyboard.dispose();
282
425
  }
283
426
  }
427
+ /**
428
+ * Adds mouse event listeners to the WebX client.
429
+ *
430
+ * This method sets up the mouse event listeners for mouse move, mouse out,
431
+ * mouse down, and mouse up events.
432
+ */
284
433
  _addMouseListeners() {
285
434
  this._mouse.onMouseMove = this._mouse.onMouseOut = (mouseState) => {
286
435
  const scale = this._display.scale;
@@ -293,6 +442,11 @@ class WebXClient {
293
442
  this.sendMouse(mouseState);
294
443
  };
295
444
  }
445
+ /**
446
+ * Adds keyboard event listeners to the WebX client.
447
+ *
448
+ * This method sets up the keyboard event listeners for key down and key up events.
449
+ */
296
450
  _addKeyboardListeners() {
297
451
  this._keyboard.onKeyDown = key => {
298
452
  this.sendKeyDown(key);
@@ -1 +1 @@
1
- {"version":3,"file":"WebXClient.js","sourceRoot":"","sources":["../src/WebXClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+CAOuB;AACvB,uCAQmB;AACnB,uCAA+E;AAC/E,mCAAkE;AAClE,qCAMkB;AAClB,2CAAmD;AAEnD,MAAa,UAAU;IAYrB,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,C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