@illgrenoble/webx-client 1.9.2 → 1.9.4

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 (286) hide show
  1. package/dist/input/GuacamoleKeyboard.js +118 -99
  2. package/dist/input/WebXKeyboard.d.ts +0 -16
  3. package/dist/input/WebXKeyboard.js +3 -27
  4. package/dist/input/WebXKeyboard.js.map +1 -1
  5. package/package.json +1 -1
  6. package/dist/display/WebXMaterialProvider.d.ts +0 -8
  7. package/dist/display/WebXMaterialProvider.js +0 -71
  8. package/dist/display/WebXMaterialProvider.js.map +0 -1
  9. package/dist/input/WebXNewKeyboard.d.ts +0 -62
  10. package/dist/input/WebXNewKeyboard.js +0 -94
  11. package/dist/input/WebXNewKeyboard.js.map +0 -1
  12. package/dist/input/keyboard/WebXKeyEvent.d.ts +0 -79
  13. package/dist/input/keyboard/WebXKeyEvent.js +0 -324
  14. package/dist/input/keyboard/WebXKeyEvent.js.map +0 -1
  15. package/dist/input/keyboard/WebXKeyPressEvent.d.ts +0 -30
  16. package/dist/input/keyboard/WebXKeyPressEvent.js +0 -44
  17. package/dist/input/keyboard/WebXKeyPressEvent.js.map +0 -1
  18. package/dist/input/keyboard/WebXKeyUpEvent.d.ts +0 -33
  19. package/dist/input/keyboard/WebXKeyUpEvent.js +0 -31
  20. package/dist/input/keyboard/WebXKeyUpEvent.js.map +0 -1
  21. package/dist/input/keyboard/WebXKeyboardModifierState.d.ts +0 -108
  22. package/dist/input/keyboard/WebXKeyboardModifierState.js +0 -148
  23. package/dist/input/keyboard/WebXKeyboardModifierState.js.map +0 -1
  24. package/dist/input/keyboard/WebXKeyboardUtils.d.ts +0 -25
  25. package/dist/input/keyboard/WebXKeyboardUtils.js +0 -63
  26. package/dist/input/keyboard/WebXKeyboardUtils.js.map +0 -1
  27. package/dist/input/keyboard/WebXKeydownEvent.d.ts +0 -46
  28. package/dist/input/keyboard/WebXKeydownEvent.js +0 -66
  29. package/dist/input/keyboard/WebXKeydownEvent.js.map +0 -1
  30. package/dist/input/keyboard/index.d.ts +0 -6
  31. package/dist/input/keyboard/index.js +0 -23
  32. package/dist/input/keyboard/index.js.map +0 -1
  33. package/dist/lib/GuacamoleKeyboard.js +0 -1290
  34. package/dist/lib/GuacamoleKeyboard.js.map +0 -1
  35. package/dist/message/WebXPollMessage.d.ts +0 -4
  36. package/dist/message/WebXPollMessage.js +0 -12
  37. package/dist/message/WebXPollMessage.js.map +0 -1
  38. package/dist/src/WebXClient.d.ts +0 -261
  39. package/dist/src/WebXClient.js +0 -571
  40. package/dist/src/WebXClient.js.map +0 -1
  41. package/dist/src/WebXEngine.d.ts +0 -4
  42. package/dist/src/WebXEngine.js +0 -7
  43. package/dist/src/WebXEngine.js.map +0 -1
  44. package/dist/src/display/WebXCursor.d.ts +0 -88
  45. package/dist/src/display/WebXCursor.js +0 -150
  46. package/dist/src/display/WebXCursor.js.map +0 -1
  47. package/dist/src/display/WebXCursorFactory.d.ts +0 -36
  48. package/dist/src/display/WebXCursorFactory.js +0 -59
  49. package/dist/src/display/WebXCursorFactory.js.map +0 -1
  50. package/dist/src/display/WebXDisplay.d.ts +0 -226
  51. package/dist/src/display/WebXDisplay.js +0 -424
  52. package/dist/src/display/WebXDisplay.js.map +0 -1
  53. package/dist/src/display/WebXMaterial.d.ts +0 -14
  54. package/dist/src/display/WebXMaterial.js +0 -140
  55. package/dist/src/display/WebXMaterial.js.map +0 -1
  56. package/dist/src/display/WebXSubImage.d.ts +0 -50
  57. package/dist/src/display/WebXSubImage.js +0 -26
  58. package/dist/src/display/WebXSubImage.js.map +0 -1
  59. package/dist/src/display/WebXTextureFactory.d.ts +0 -54
  60. package/dist/src/display/WebXTextureFactory.js +0 -160
  61. package/dist/src/display/WebXTextureFactory.js.map +0 -1
  62. package/dist/src/display/WebXWindow.d.ts +0 -241
  63. package/dist/src/display/WebXWindow.js +0 -438
  64. package/dist/src/display/WebXWindow.js.map +0 -1
  65. package/dist/src/display/WebXWindowProperties.d.ts +0 -44
  66. package/dist/src/display/WebXWindowProperties.js +0 -25
  67. package/dist/src/display/WebXWindowProperties.js.map +0 -1
  68. package/dist/src/display/index.d.ts +0 -7
  69. package/dist/src/display/index.js +0 -24
  70. package/dist/src/display/index.js.map +0 -1
  71. package/dist/src/index.d.ts +0 -7
  72. package/dist/src/index.js +0 -24
  73. package/dist/src/index.js.map +0 -1
  74. package/dist/src/input/WebXKeyboard.d.ts +0 -265
  75. package/dist/src/input/WebXKeyboard.js +0 -632
  76. package/dist/src/input/WebXKeyboard.js.map +0 -1
  77. package/dist/src/input/WebXMouse.d.ts +0 -125
  78. package/dist/src/input/WebXMouse.js +0 -231
  79. package/dist/src/input/WebXMouse.js.map +0 -1
  80. package/dist/src/input/index.d.ts +0 -4
  81. package/dist/src/input/index.js +0 -21
  82. package/dist/src/input/index.js.map +0 -1
  83. package/dist/src/input/keyboard/WebXKeyEvent.d.ts +0 -79
  84. package/dist/src/input/keyboard/WebXKeyEvent.js +0 -324
  85. package/dist/src/input/keyboard/WebXKeyEvent.js.map +0 -1
  86. package/dist/src/input/keyboard/WebXKeyPressEvent.d.ts +0 -30
  87. package/dist/src/input/keyboard/WebXKeyPressEvent.js +0 -44
  88. package/dist/src/input/keyboard/WebXKeyPressEvent.js.map +0 -1
  89. package/dist/src/input/keyboard/WebXKeyUpEvent.d.ts +0 -33
  90. package/dist/src/input/keyboard/WebXKeyUpEvent.js +0 -31
  91. package/dist/src/input/keyboard/WebXKeyUpEvent.js.map +0 -1
  92. package/dist/src/input/keyboard/WebXKeyboardModifierState.d.ts +0 -108
  93. package/dist/src/input/keyboard/WebXKeyboardModifierState.js +0 -148
  94. package/dist/src/input/keyboard/WebXKeyboardModifierState.js.map +0 -1
  95. package/dist/src/input/keyboard/WebXKeyboardUtils.d.ts +0 -25
  96. package/dist/src/input/keyboard/WebXKeyboardUtils.js +0 -63
  97. package/dist/src/input/keyboard/WebXKeyboardUtils.js.map +0 -1
  98. package/dist/src/input/keyboard/WebXKeydownEvent.d.ts +0 -46
  99. package/dist/src/input/keyboard/WebXKeydownEvent.js +0 -66
  100. package/dist/src/input/keyboard/WebXKeydownEvent.js.map +0 -1
  101. package/dist/src/input/keyboard/index.d.ts +0 -6
  102. package/dist/src/input/keyboard/index.js +0 -23
  103. package/dist/src/input/keyboard/index.js.map +0 -1
  104. package/dist/src/input/mouse/WebXMouseState.d.ts +0 -190
  105. package/dist/src/input/mouse/WebXMouseState.js +0 -217
  106. package/dist/src/input/mouse/WebXMouseState.js.map +0 -1
  107. package/dist/src/input/mouse/index.d.ts +0 -1
  108. package/dist/src/input/mouse/index.js +0 -18
  109. package/dist/src/input/mouse/index.js.map +0 -1
  110. package/dist/src/instruction/WebXClipboardInstruction.d.ts +0 -18
  111. package/dist/src/instruction/WebXClipboardInstruction.js +0 -23
  112. package/dist/src/instruction/WebXClipboardInstruction.js.map +0 -1
  113. package/dist/src/instruction/WebXConnectInstruction.d.ts +0 -19
  114. package/dist/src/instruction/WebXConnectInstruction.js +0 -24
  115. package/dist/src/instruction/WebXConnectInstruction.js.map +0 -1
  116. package/dist/src/instruction/WebXCursorImageInstruction.d.ts +0 -18
  117. package/dist/src/instruction/WebXCursorImageInstruction.js +0 -23
  118. package/dist/src/instruction/WebXCursorImageInstruction.js.map +0 -1
  119. package/dist/src/instruction/WebXDataAckInstruction.d.ts +0 -25
  120. package/dist/src/instruction/WebXDataAckInstruction.js +0 -26
  121. package/dist/src/instruction/WebXDataAckInstruction.js.map +0 -1
  122. package/dist/src/instruction/WebXImageInstruction.d.ts +0 -18
  123. package/dist/src/instruction/WebXImageInstruction.js +0 -23
  124. package/dist/src/instruction/WebXImageInstruction.js.map +0 -1
  125. package/dist/src/instruction/WebXInstruction.d.ts +0 -29
  126. package/dist/src/instruction/WebXInstruction.js +0 -28
  127. package/dist/src/instruction/WebXInstruction.js.map +0 -1
  128. package/dist/src/instruction/WebXInstructionResponse.d.ts +0 -66
  129. package/dist/src/instruction/WebXInstructionResponse.js +0 -78
  130. package/dist/src/instruction/WebXInstructionResponse.js.map +0 -1
  131. package/dist/src/instruction/WebXInstructionType.d.ts +0 -63
  132. package/dist/src/instruction/WebXInstructionType.js +0 -96
  133. package/dist/src/instruction/WebXInstructionType.js.map +0 -1
  134. package/dist/src/instruction/WebXKeyboardInstruction.d.ts +0 -23
  135. package/dist/src/instruction/WebXKeyboardInstruction.js +0 -25
  136. package/dist/src/instruction/WebXKeyboardInstruction.js.map +0 -1
  137. package/dist/src/instruction/WebXMouseInstruction.d.ts +0 -28
  138. package/dist/src/instruction/WebXMouseInstruction.js +0 -27
  139. package/dist/src/instruction/WebXMouseInstruction.js.map +0 -1
  140. package/dist/src/instruction/WebXPongInstruction.d.ts +0 -18
  141. package/dist/src/instruction/WebXPongInstruction.js +0 -23
  142. package/dist/src/instruction/WebXPongInstruction.js.map +0 -1
  143. package/dist/src/instruction/WebXQualityInstruction.d.ts +0 -19
  144. package/dist/src/instruction/WebXQualityInstruction.js +0 -24
  145. package/dist/src/instruction/WebXQualityInstruction.js.map +0 -1
  146. package/dist/src/instruction/WebXScreenInstruction.d.ts +0 -12
  147. package/dist/src/instruction/WebXScreenInstruction.js +0 -20
  148. package/dist/src/instruction/WebXScreenInstruction.js.map +0 -1
  149. package/dist/src/instruction/WebXShapeInstruction.d.ts +0 -18
  150. package/dist/src/instruction/WebXShapeInstruction.js +0 -23
  151. package/dist/src/instruction/WebXShapeInstruction.js.map +0 -1
  152. package/dist/src/instruction/WebXWindowsInstruction.d.ts +0 -13
  153. package/dist/src/instruction/WebXWindowsInstruction.js +0 -21
  154. package/dist/src/instruction/WebXWindowsInstruction.js.map +0 -1
  155. package/dist/src/instruction/index.d.ts +0 -15
  156. package/dist/src/instruction/index.js +0 -32
  157. package/dist/src/instruction/index.js.map +0 -1
  158. package/dist/src/message/WebXClipboardMessage.d.ts +0 -19
  159. package/dist/src/message/WebXClipboardMessage.js +0 -23
  160. package/dist/src/message/WebXClipboardMessage.js.map +0 -1
  161. package/dist/src/message/WebXConnectionMessage.d.ts +0 -12
  162. package/dist/src/message/WebXConnectionMessage.js +0 -20
  163. package/dist/src/message/WebXConnectionMessage.js.map +0 -1
  164. package/dist/src/message/WebXCursorImageMessage.d.ts +0 -46
  165. package/dist/src/message/WebXCursorImageMessage.js +0 -35
  166. package/dist/src/message/WebXCursorImageMessage.js.map +0 -1
  167. package/dist/src/message/WebXImageMessage.d.ts +0 -41
  168. package/dist/src/message/WebXImageMessage.js +0 -33
  169. package/dist/src/message/WebXImageMessage.js.map +0 -1
  170. package/dist/src/message/WebXMessage.d.ts +0 -24
  171. package/dist/src/message/WebXMessage.js +0 -23
  172. package/dist/src/message/WebXMessage.js.map +0 -1
  173. package/dist/src/message/WebXMessageType.d.ts +0 -59
  174. package/dist/src/message/WebXMessageType.js +0 -64
  175. package/dist/src/message/WebXMessageType.js.map +0 -1
  176. package/dist/src/message/WebXMouseMessage.d.ts +0 -30
  177. package/dist/src/message/WebXMouseMessage.js +0 -29
  178. package/dist/src/message/WebXMouseMessage.js.map +0 -1
  179. package/dist/src/message/WebXNopMessage.d.ts +0 -10
  180. package/dist/src/message/WebXNopMessage.js +0 -18
  181. package/dist/src/message/WebXNopMessage.js.map +0 -1
  182. package/dist/src/message/WebXPingMessage.d.ts +0 -13
  183. package/dist/src/message/WebXPingMessage.js +0 -21
  184. package/dist/src/message/WebXPingMessage.js.map +0 -1
  185. package/dist/src/message/WebXQualityMessage.d.ts +0 -39
  186. package/dist/src/message/WebXQualityMessage.js +0 -32
  187. package/dist/src/message/WebXQualityMessage.js.map +0 -1
  188. package/dist/src/message/WebXScreenMessage.d.ts +0 -37
  189. package/dist/src/message/WebXScreenMessage.js +0 -29
  190. package/dist/src/message/WebXScreenMessage.js.map +0 -1
  191. package/dist/src/message/WebXShapeMessage.d.ts +0 -31
  192. package/dist/src/message/WebXShapeMessage.js +0 -29
  193. package/dist/src/message/WebXShapeMessage.js.map +0 -1
  194. package/dist/src/message/WebXSubImagesMessage.d.ts +0 -31
  195. package/dist/src/message/WebXSubImagesMessage.js +0 -29
  196. package/dist/src/message/WebXSubImagesMessage.js.map +0 -1
  197. package/dist/src/message/WebXWindowsMessage.d.ts +0 -21
  198. package/dist/src/message/WebXWindowsMessage.js +0 -25
  199. package/dist/src/message/WebXWindowsMessage.js.map +0 -1
  200. package/dist/src/message/index.d.ts +0 -14
  201. package/dist/src/message/index.js +0 -31
  202. package/dist/src/message/index.js.map +0 -1
  203. package/dist/src/tracer/WebXDebugImageMessageHandler.d.ts +0 -48
  204. package/dist/src/tracer/WebXDebugImageMessageHandler.js +0 -102
  205. package/dist/src/tracer/WebXDebugImageMessageHandler.js.map +0 -1
  206. package/dist/src/tracer/WebXHandler.d.ts +0 -14
  207. package/dist/src/tracer/WebXHandler.js +0 -3
  208. package/dist/src/tracer/WebXHandler.js.map +0 -1
  209. package/dist/src/tracer/WebXInstructionHandler.d.ts +0 -21
  210. package/dist/src/tracer/WebXInstructionHandler.js +0 -13
  211. package/dist/src/tracer/WebXInstructionHandler.js.map +0 -1
  212. package/dist/src/tracer/WebXMessageHandler.d.ts +0 -21
  213. package/dist/src/tracer/WebXMessageHandler.js +0 -13
  214. package/dist/src/tracer/WebXMessageHandler.js.map +0 -1
  215. package/dist/src/tracer/WebXStatsHandler.d.ts +0 -23
  216. package/dist/src/tracer/WebXStatsHandler.js +0 -13
  217. package/dist/src/tracer/WebXStatsHandler.js.map +0 -1
  218. package/dist/src/tracer/index.d.ts +0 -5
  219. package/dist/src/tracer/index.js +0 -22
  220. package/dist/src/tracer/index.js.map +0 -1
  221. package/dist/src/transport/WebXBinarySerializer.d.ts +0 -31
  222. package/dist/src/transport/WebXBinarySerializer.js +0 -63
  223. package/dist/src/transport/WebXBinarySerializer.js.map +0 -1
  224. package/dist/src/transport/WebXInstructionBuffer.d.ts +0 -55
  225. package/dist/src/transport/WebXInstructionBuffer.js +0 -109
  226. package/dist/src/transport/WebXInstructionBuffer.js.map +0 -1
  227. package/dist/src/transport/WebXInstructionEncoder.d.ts +0 -181
  228. package/dist/src/transport/WebXInstructionEncoder.js +0 -294
  229. package/dist/src/transport/WebXInstructionEncoder.js.map +0 -1
  230. package/dist/src/transport/WebXMessageBuffer.d.ts +0 -80
  231. package/dist/src/transport/WebXMessageBuffer.js +0 -104
  232. package/dist/src/transport/WebXMessageBuffer.js.map +0 -1
  233. package/dist/src/transport/WebXMessageDecoder.d.ts +0 -108
  234. package/dist/src/transport/WebXMessageDecoder.js +0 -332
  235. package/dist/src/transport/WebXMessageDecoder.js.map +0 -1
  236. package/dist/src/transport/index.d.ts +0 -5
  237. package/dist/src/transport/index.js +0 -22
  238. package/dist/src/transport/index.js.map +0 -1
  239. package/dist/src/tunnel/WebXTunnel.d.ts +0 -93
  240. package/dist/src/tunnel/WebXTunnel.js +0 -156
  241. package/dist/src/tunnel/WebXTunnel.js.map +0 -1
  242. package/dist/src/tunnel/WebXWebSocketTunnel.d.ts +0 -40
  243. package/dist/src/tunnel/WebXWebSocketTunnel.js +0 -88
  244. package/dist/src/tunnel/WebXWebSocketTunnel.js.map +0 -1
  245. package/dist/src/tunnel/index.d.ts +0 -2
  246. package/dist/src/tunnel/index.js +0 -19
  247. package/dist/src/tunnel/index.js.map +0 -1
  248. package/dist/src/utils/WebXColorGenerator.d.ts +0 -24
  249. package/dist/src/utils/WebXColorGenerator.js +0 -46
  250. package/dist/src/utils/WebXColorGenerator.js.map +0 -1
  251. package/dist/src/utils/WebXVersion.d.ts +0 -34
  252. package/dist/src/utils/WebXVersion.js +0 -25
  253. package/dist/src/utils/WebXVersion.js.map +0 -1
  254. package/dist/src/utils/index.d.ts +0 -2
  255. package/dist/src/utils/index.js +0 -19
  256. package/dist/src/utils/index.js.map +0 -1
  257. package/dist/tracer/DemoVisualMessageHandler.d.ts +0 -15
  258. package/dist/tracer/DemoVisualMessageHandler.js +0 -55
  259. package/dist/tracer/DemoVisualMessageHandler.js.map +0 -1
  260. package/dist/tracer/WebXVisualMessageHandler.d.ts +0 -15
  261. package/dist/tracer/WebXVisualMessageHandler.js +0 -55
  262. package/dist/tracer/WebXVisualMessageHandler.js.map +0 -1
  263. package/dist/tunnel/WebXDefaultQoSHandler.d.ts +0 -16
  264. package/dist/tunnel/WebXDefaultQoSHandler.js +0 -57
  265. package/dist/tunnel/WebXDefaultQoSHandler.js.map +0 -1
  266. package/dist/tunnel/WebXQoSHandler.d.ts +0 -6
  267. package/dist/tunnel/WebXQoSHandler.js +0 -7
  268. package/dist/tunnel/WebXQoSHandler.js.map +0 -1
  269. package/dist/tunnel/WebXSocketIOTunnel.d.ts +0 -15
  270. package/dist/tunnel/WebXSocketIOTunnel.js +0 -41
  271. package/dist/tunnel/WebXSocketIOTunnel.js.map +0 -1
  272. package/dist/utils/ColorGenerator.d.ts +0 -24
  273. package/dist/utils/ColorGenerator.js +0 -46
  274. package/dist/utils/ColorGenerator.js.map +0 -1
  275. package/dist/utils/Config.d.ts +0 -4
  276. package/dist/utils/Config.js +0 -10
  277. package/dist/utils/Config.js.map +0 -1
  278. package/dist/utils/WebXAsyncExec.d.ts +0 -5
  279. package/dist/utils/WebXAsyncExec.js +0 -18
  280. package/dist/utils/WebXAsyncExec.js.map +0 -1
  281. package/dist/utils/WebXColourGenerator.d.ts +0 -5
  282. package/dist/utils/WebXColourGenerator.js +0 -27
  283. package/dist/utils/WebXColourGenerator.js.map +0 -1
  284. package/dist/utils/WebXFileSize.d.ts +0 -3
  285. package/dist/utils/WebXFileSize.js +0 -14
  286. package/dist/utils/WebXFileSize.js.map +0 -1
@@ -1,40 +0,0 @@
1
- import { WebXTunnel } from './WebXTunnel';
2
- import { WebXBinarySerializer } from '../transport';
3
- /**
4
- * Represents a WebSocket-based implementation of the WebX communication tunnel.
5
- *
6
- * This class manages the WebSocket connection to the WebX Engine, handles
7
- * sending and receiving data, and processes events related to the connection.
8
- */
9
- export declare class WebXWebSocketTunnel extends WebXTunnel {
10
- private readonly _url;
11
- private _socket;
12
- private _connectionOptions;
13
- private _socketOpen;
14
- constructor(url: string, options?: any);
15
- getSocket(): WebSocket;
16
- /**
17
- * Sends data to the WebX Engine over the WebSocket connection.
18
- *
19
- * @param data The data to send.
20
- */
21
- send(data: ArrayBuffer): void;
22
- /**
23
- * Establishes a WebSocket connection to the WebX Engine.
24
- *
25
- * @param data The connection options.
26
- * @param serializer The serializer to use for encoding/decoding messages.
27
- * @returns A promise that resolves when the connection is successfully established.
28
- */
29
- connect(data: any, serializer: WebXBinarySerializer): Promise<Event>;
30
- /**
31
- * Closes the WebSocket connection to the WebX Engine.
32
- */
33
- disconnect(): void;
34
- /**
35
- * Checks if the WebSocket connection is currently open.
36
- *
37
- * @returns True if the WebSocket is open, false otherwise.
38
- */
39
- isConnected(): boolean;
40
- }
@@ -1,88 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebXWebSocketTunnel = void 0;
4
- const WebXTunnel_1 = require("./WebXTunnel");
5
- /**
6
- * Represents a WebSocket-based implementation of the WebX communication tunnel.
7
- *
8
- * This class manages the WebSocket connection to the WebX Engine, handles
9
- * sending and receiving data, and processes events related to the connection.
10
- */
11
- class WebXWebSocketTunnel extends WebXTunnel_1.WebXTunnel {
12
- constructor(url, options = {}) {
13
- super();
14
- this._socketOpen = false;
15
- this._connectionOptions = options;
16
- // Ensure that the URL is a valid WebSocket URL for older browsers
17
- if (url.substring(0, 3) !== "ws:" && url.substring(0, 4) !== "wss:") {
18
- const location = window.location;
19
- const protocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
20
- const hostname = location.hostname;
21
- const port = location.port ? `:${location.port}` : '';
22
- if (url.substring(0, 1) === "/")
23
- url = `${protocol}//${hostname}${port}${url}`;
24
- else {
25
- url = `${protocol}//${hostname}${port}/${url}`;
26
- }
27
- }
28
- this._url = url;
29
- }
30
- getSocket() {
31
- return this._socket;
32
- }
33
- /**
34
- * Sends data to the WebX Engine over the WebSocket connection.
35
- *
36
- * @param data The data to send.
37
- */
38
- send(data) {
39
- if (this._socket != null) {
40
- this._socket.send(data);
41
- this.handleSentBytes(data);
42
- }
43
- }
44
- /**
45
- * Establishes a WebSocket connection to the WebX Engine.
46
- *
47
- * @param data The connection options.
48
- * @param serializer The serializer to use for encoding/decoding messages.
49
- * @returns A promise that resolves when the connection is successfully established.
50
- */
51
- connect(data, serializer) {
52
- const options = Object.assign(Object.assign({}, this._connectionOptions), data);
53
- const parameters = new URLSearchParams(options);
54
- const url = `${this._url}?${parameters}`;
55
- this._serializer = serializer;
56
- return new Promise((resolve, reject) => {
57
- this._socket = new WebSocket(url);
58
- this._socket.binaryType = 'arraybuffer';
59
- this._socket.onopen = () => {
60
- this._socketOpen = true;
61
- resolve(null);
62
- };
63
- this._socket.onerror = (event) => reject(event);
64
- this._socket.onclose = this.handleClose.bind(this);
65
- this._socket.onmessage = (aMessage) => this.onMessage(aMessage.data);
66
- });
67
- }
68
- /**
69
- * Closes the WebSocket connection to the WebX Engine.
70
- */
71
- disconnect() {
72
- if (this._socket) {
73
- this._socketOpen = false;
74
- this._socket.close();
75
- this._socket = null;
76
- }
77
- }
78
- /**
79
- * Checks if the WebSocket connection is currently open.
80
- *
81
- * @returns True if the WebSocket is open, false otherwise.
82
- */
83
- isConnected() {
84
- return this._socketOpen;
85
- }
86
- }
87
- exports.WebXWebSocketTunnel = WebXWebSocketTunnel;
88
- //# sourceMappingURL=WebXWebSocketTunnel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WebXWebSocketTunnel.js","sourceRoot":"","sources":["../../../src/tunnel/WebXWebSocketTunnel.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAG1C;;;;;GAKG;AACH,MAAa,mBAAoB,SAAQ,uBAAU;IAMjD,YAAY,GAAW,EAAE,UAAe,EAAE;QACxC,KAAK,EAAE,CAAC;QAHF,gBAAW,GAAG,KAAK,CAAC;QAI1B,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC;QAElC,kEAAkE;QAClE,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KA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__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./WebXTunnel"), exports);
18
- __exportStar(require("./WebXWebSocketTunnel"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tunnel/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,wDAAsC"}
@@ -1,24 +0,0 @@
1
- /**
2
- * Utility class for generating colors.
3
- *
4
- * This class provides methods to generate random colors or retrieve colors
5
- * from a predefined palette based on an index.
6
- */
7
- export declare class WebXColorGenerator {
8
- private static _COLOURS;
9
- /**
10
- * Generates a random color from the predefined palette.
11
- *
12
- * @returns A random color as a hexadecimal string.
13
- */
14
- static randomColour(): string;
15
- /**
16
- * Retrieves a color from the predefined palette based on the given index.
17
- *
18
- * If the index exceeds the palette size, it wraps around using modulo.
19
- *
20
- * @param index The index of the color to retrieve.
21
- * @returns The color as a hexadecimal string.
22
- */
23
- static indexedColour(index: number): string;
24
- }
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebXColorGenerator = void 0;
4
- /**
5
- * Utility class for generating colors.
6
- *
7
- * This class provides methods to generate random colors or retrieve colors
8
- * from a predefined palette based on an index.
9
- */
10
- class WebXColorGenerator {
11
- /**
12
- * Generates a random color from the predefined palette.
13
- *
14
- * @returns A random color as a hexadecimal string.
15
- */
16
- static randomColour() {
17
- const index = Math.floor(Math.random() * WebXColorGenerator._COLOURS.length);
18
- return WebXColorGenerator._COLOURS[index];
19
- }
20
- /**
21
- * Retrieves a color from the predefined palette based on the given index.
22
- *
23
- * If the index exceeds the palette size, it wraps around using modulo.
24
- *
25
- * @param index The index of the color to retrieve.
26
- * @returns The color as a hexadecimal string.
27
- */
28
- static indexedColour(index) {
29
- index = index % WebXColorGenerator._COLOURS.length;
30
- return WebXColorGenerator._COLOURS[index];
31
- }
32
- }
33
- exports.WebXColorGenerator = WebXColorGenerator;
34
- WebXColorGenerator._COLOURS = [
35
- '#FF6633', '#FFB399', '#FF33FF', '#FFFF99', '#00B3E6',
36
- '#E6B333', '#3366E6', '#999966', '#99FF99', '#B34D4D',
37
- '#80B300', '#809900', '#E6B3B3', '#6680B3', '#66991A',
38
- '#FF99E6', '#CCFF1A', '#FF1A66', '#E6331A', '#33FFCC',
39
- '#66994D', '#B366CC', '#4D8000', '#B33300', '#CC80CC',
40
- '#66664D', '#991AFF', '#E666FF', '#4DB3FF', '#1AB399',
41
- '#E666B3', '#33991A', '#CC9999', '#B3B31A', '#00E680',
42
- '#4D8066', '#809980', '#E6FF80', '#1AFF33', '#999933',
43
- '#FF3380', '#CCCC00', '#66E64D', '#4D80CC', '#9900B3',
44
- '#E64D66', '#4DB380', '#FF4D4D', '#99E6E6', '#6666FF'
45
- ];
46
- //# sourceMappingURL=WebXColorGenerator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WebXColorGenerator.js","sourceRoot":"","sources":["../../../src/utils/WebXColorGenerator.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,MAAa,kBAAkB;IAe7B;;;;OAIG;IACI,MAAM,CAAC,YAAY;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC7E,OAAO,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,aAAa,CAAC,KAAa;QACvC,KAAK,GAAG,KAAK,GAAG,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC;QACnD,OAAO,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;;AApCH,gDAqCC;AAnCgB,2BAAQ,GAAG;IACxB,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACrD,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACrD,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACrD,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACrD,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACrD,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACrD,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACrD,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACrD,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACrD,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;CACtD,CAAA"}
@@ -1,34 +0,0 @@
1
- /**
2
- * WebXVersion class
3
- * Encapsulates a version number in the format of major.minor.patch
4
- */
5
- export declare class WebXVersion {
6
- /**
7
- * The major version number.
8
- */
9
- readonly major: number;
10
- /**
11
- * The minor version number.
12
- */
13
- readonly minor: number;
14
- /**
15
- * The patch version number.
16
- */
17
- readonly patch: number;
18
- /**
19
- * The version string.
20
- */
21
- readonly version: string;
22
- /**
23
- * The version major.minor as a number
24
- */
25
- readonly versionNumber: number;
26
- /**
27
- * Constructs a new WebXVersion object.
28
- *
29
- * @param major The major version number.
30
- * @param minor The minor version number.
31
- * @param patch The patch version number.
32
- */
33
- constructor(major?: number, minor?: number, patch?: number);
34
- }
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebXVersion = void 0;
4
- /**
5
- * WebXVersion class
6
- * Encapsulates a version number in the format of major.minor.patch
7
- */
8
- class WebXVersion {
9
- /**
10
- * Constructs a new WebXVersion object.
11
- *
12
- * @param major The major version number.
13
- * @param minor The minor version number.
14
- * @param patch The patch version number.
15
- */
16
- constructor(major = 0, minor = 0, patch = 0) {
17
- this.major = major;
18
- this.minor = minor;
19
- this.patch = patch;
20
- this.version = `${major}.${minor}.${patch}`;
21
- this.versionNumber = parseFloat(`${major}.${minor}`);
22
- }
23
- }
24
- exports.WebXVersion = WebXVersion;
25
- //# sourceMappingURL=WebXVersion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WebXVersion.js","sourceRoot":"","sources":["../../../src/utils/WebXVersion.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAa,WAAW;IA2BtB;;;;;;OAMG;IACH,YAAY,QAAgB,CAAC,EAAE,QAAgB,CAAC,EAAE,QAAgB,CAAC;QACjE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,GAAG,KAAK,IAAI,KAAK,IAAI,KAAK,EAAE,CAAC;QAC5C,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG,KAAK,IAAI,KAAK,EAAE,CAAC,CAAC;IACvD,CAAC;CACF;AAzCD,kCAyCC"}
@@ -1,2 +0,0 @@
1
- export * from './WebXColorGenerator';
2
- export * from './WebXVersion';
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./WebXColorGenerator"), exports);
18
- __exportStar(require("./WebXVersion"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAoC;AACpC,gDAA6B"}
@@ -1,15 +0,0 @@
1
- import { WebXDisplay } from "../display";
2
- import { WebXMessage } from "../message";
3
- import { WebXMessageHandler } from "./WebXMessageHandler";
4
- import { WebXHandler } from "./WebXHandler";
5
- export declare class DemoVisualMessageHandler extends WebXMessageHandler implements WebXHandler {
6
- private _display;
7
- private static _PLANE_GEOMETRY;
8
- private _scene;
9
- private _debugLayer;
10
- private _currentZ;
11
- constructor(_display: WebXDisplay);
12
- private _createMesh;
13
- handle(message: WebXMessage): void;
14
- destroy(): void;
15
- }
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DemoVisualMessageHandler = void 0;
4
- const THREE = require("three");
5
- const three_1 = require("three");
6
- const TWEEN = require("@tweenjs/tween.js");
7
- const utils_1 = require("../utils");
8
- const message_1 = require("../message");
9
- const WebXMessageHandler_1 = require("./WebXMessageHandler");
10
- class DemoVisualMessageHandler extends WebXMessageHandler_1.WebXMessageHandler {
11
- constructor(_display) {
12
- super();
13
- this._display = _display;
14
- this._debugLayer = new three_1.Object3D();
15
- this._currentZ = 0;
16
- this._debugLayer.position.set(0, 0, 999);
17
- this._scene = this._display.scene;
18
- this._scene.add(this._debugLayer);
19
- }
20
- _createMesh(x, y, width, height, colour) {
21
- const material = new THREE.MeshBasicMaterial({ color: colour, opacity: 0.8, transparent: true });
22
- material.side = THREE.BackSide;
23
- const mesh = new THREE.Mesh(DemoVisualMessageHandler._PLANE_GEOMETRY, material);
24
- mesh.position.set(x + width / 2, y + height / 2, this._currentZ);
25
- mesh.scale.set(width, height, 1);
26
- this._currentZ += 0.0001;
27
- this._debugLayer.add(mesh);
28
- new TWEEN.Tween(material)
29
- .to({ opacity: 0.0 }, 500)
30
- .easing(TWEEN.Easing.Quadratic.Out)
31
- .onComplete(() => this._debugLayer.remove(mesh))
32
- .start();
33
- }
34
- handle(message) {
35
- if (message.type === message_1.WebXMessageType.IMAGE) {
36
- const imageMessage = message;
37
- const window = this._display.getWindow(imageMessage.windowId);
38
- const { width, height } = imageMessage.colorMap.image;
39
- this._createMesh(window.x, window.y, width, height, utils_1.ColorGenerator.indexedColour(window.colorIndex));
40
- }
41
- else if (message.type === message_1.WebXMessageType.SUBIMAGES) {
42
- const subImageMessage = message;
43
- const window = this._display.getWindow(subImageMessage.windowId);
44
- subImageMessage.subImages.forEach(subImage => {
45
- this._createMesh(window.x + subImage.x, window.y + subImage.y, subImage.width, subImage.height, utils_1.ColorGenerator.indexedColour(window.colorIndex));
46
- });
47
- }
48
- }
49
- destroy() {
50
- // do nothing
51
- }
52
- }
53
- exports.DemoVisualMessageHandler = DemoVisualMessageHandler;
54
- DemoVisualMessageHandler._PLANE_GEOMETRY = new THREE.PlaneGeometry(1.0, 1.0, 2, 2);
55
- //# sourceMappingURL=DemoVisualMessageHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DemoVisualMessageHandler.js","sourceRoot":"","sources":["../../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AC,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,sBAAc,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;YACnJ,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO;QACL,aAAa;IACf,CAAC;;AAtDH,4DAwDC;AAtDgB,wCAAe,GAAwB,IAAI,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,AAA/D,CAAgE"}
@@ -1,15 +0,0 @@
1
- import { WebXDisplay } from "../display";
2
- import { WebXMessage } from "../message";
3
- import { WebXMessageHandler } from "./WebXMessageHandler";
4
- import { WebXHandler } from "./WebXHandler";
5
- export declare class WebXVisualMessageHandler extends WebXMessageHandler implements WebXHandler {
6
- private _display;
7
- private static _PLANE_GEOMETRY;
8
- private _scene;
9
- private _debugLayer;
10
- private _currentZ;
11
- constructor(_display: WebXDisplay);
12
- private _createMesh;
13
- handle(message: WebXMessage): void;
14
- destroy(): void;
15
- }
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebXVisualMessageHandler = void 0;
4
- const THREE = require("three");
5
- const three_1 = require("three");
6
- const TWEEN = require("@tweenjs/tween.js");
7
- const utils_1 = require("../utils");
8
- const message_1 = require("../message");
9
- const WebXMessageHandler_1 = require("./WebXMessageHandler");
10
- class WebXVisualMessageHandler extends WebXMessageHandler_1.WebXMessageHandler {
11
- constructor(_display) {
12
- super();
13
- this._display = _display;
14
- this._debugLayer = new three_1.Object3D();
15
- this._currentZ = 0;
16
- this._debugLayer.position.set(0, 0, 999);
17
- this._scene = this._display.scene;
18
- this._scene.add(this._debugLayer);
19
- }
20
- _createMesh(x, y, width, height, colour) {
21
- const material = new THREE.MeshBasicMaterial({ color: colour, opacity: 0.8, transparent: true });
22
- material.side = THREE.BackSide;
23
- const mesh = new THREE.Mesh(WebXVisualMessageHandler._PLANE_GEOMETRY, material);
24
- mesh.position.set(x + width / 2, y + height / 2, this._currentZ);
25
- mesh.scale.set(width, height, 1);
26
- this._currentZ += 0.0001;
27
- this._debugLayer.add(mesh);
28
- new TWEEN.Tween(material)
29
- .to({ opacity: 0.0 }, 500)
30
- .easing(TWEEN.Easing.Quadratic.Out)
31
- .onComplete(() => this._debugLayer.remove(mesh))
32
- .start();
33
- }
34
- handle(message) {
35
- if (message.type === message_1.WebXMessageType.IMAGE) {
36
- const imageMessage = message;
37
- const window = this._display.getWindow(imageMessage.windowId);
38
- const { width, height } = imageMessage.colorMap.image;
39
- this._createMesh(window.x, window.y, width, height, utils_1.ColorGenerator.indexedColour(window.colorIndex));
40
- }
41
- else if (message.type === message_1.WebXMessageType.SUBIMAGES) {
42
- const subImageMessage = message;
43
- const window = this._display.getWindow(subImageMessage.windowId);
44
- subImageMessage.subImages.forEach(subImage => {
45
- this._createMesh(window.x + subImage.x, window.y + subImage.y, subImage.width, subImage.height, utils_1.ColorGenerator.indexedColour(window.colorIndex));
46
- });
47
- }
48
- }
49
- destroy() {
50
- // do nothing
51
- }
52
- }
53
- exports.WebXVisualMessageHandler = WebXVisualMessageHandler;
54
- WebXVisualMessageHandler._PLANE_GEOMETRY = new THREE.PlaneGeometry(1.0, 1.0, 2, 2);
55
- //# sourceMappingURL=WebXVisualMessageHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WebXVisualMessageHandler.js","sourceRoot":"","sources":["../../src/tracer/WebXVisualMessageHandler.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iCAAwC;AACxC,2CAA2C;AAC3C,oCAAwC;AAExC,wCAAgG;AAChG,6DAAwD;AAGxD,MAAa,wBAAyB,SAAQ,uCAAkB;IAQ9D,YAAoB,QAAqB;QACvC,KAAK,EAAE,CAAC;QADU,aAAQ,GAAR,QAAQ,CAAa;QAHjC,gBAAW,GAAa,IAAI,gBAAQ,EAAE,CAAC;QACvC,cAAS,GAAG,CAAC,CAA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/D,CAAgE"}
@@ -1,16 +0,0 @@
1
- import { WebXQoSHandler } from './WebXQoSHandler';
2
- import { WebXTunnel } from './WebXTunnel';
3
- export declare class WebXDefaultQoSHandler extends WebXQoSHandler {
4
- private _tunnel;
5
- private _active;
6
- private _currentQueueLength;
7
- private _waiting;
8
- private _currentQuality;
9
- constructor(_tunnel: WebXTunnel);
10
- handle(messageQueueLength: number): void;
11
- setActive(isActive: boolean): void;
12
- getQuality(): number;
13
- setQuality(quality: number): void;
14
- private _decreaseQuality;
15
- private _increaseQuality;
16
- }
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebXDefaultQoSHandler = void 0;
4
- const WebXQoSHandler_1 = require("./WebXQoSHandler");
5
- const instruction_1 = require("../instruction");
6
- class WebXDefaultQoSHandler extends WebXQoSHandler_1.WebXQoSHandler {
7
- constructor(_tunnel) {
8
- super();
9
- this._tunnel = _tunnel;
10
- this._active = true;
11
- this._currentQueueLength = 0;
12
- this._waiting = false;
13
- this._currentQuality = 10;
14
- }
15
- handle(messageQueueLength) {
16
- if (this._active && !this._waiting) {
17
- if (messageQueueLength > this._currentQueueLength) {
18
- this._decreaseQuality();
19
- this._currentQueueLength = messageQueueLength;
20
- }
21
- else if (messageQueueLength == 0) {
22
- this._increaseQuality();
23
- this._currentQueueLength = messageQueueLength;
24
- }
25
- this._waiting = true;
26
- setTimeout(() => this._waiting = false, 500);
27
- }
28
- }
29
- setActive(isActive) {
30
- this._active = isActive;
31
- }
32
- getQuality() {
33
- return this._currentQuality;
34
- }
35
- setQuality(quality) {
36
- this._currentQuality = quality;
37
- this.dispatchEvent(new CustomEvent('quality', { detail: { quality: quality } }));
38
- }
39
- _decreaseQuality() {
40
- if (this._currentQuality > 1) {
41
- this.setQuality(this._currentQuality - 1);
42
- const qualityInstruction = new instruction_1.WebXQualityInstruction(this._currentQuality);
43
- this._tunnel.sendInstruction(qualityInstruction);
44
- // console.log(`setting quality to ${this._currentQuality}`);
45
- }
46
- }
47
- _increaseQuality() {
48
- if (this._currentQuality < 10) {
49
- this.setQuality(this._currentQuality + 1);
50
- const qualityInstruction = new instruction_1.WebXQualityInstruction(this._currentQuality);
51
- this._tunnel.sendInstruction(qualityInstruction);
52
- // console.log(`setting quality to ${this._currentQuality}`);
53
- }
54
- }
55
- }
56
- exports.WebXDefaultQoSHandler = WebXDefaultQoSHandler;
57
- //# sourceMappingURL=WebXDefaultQoSHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WebXDefaultQoSHandler.js","sourceRoot":"","sources":["../../src/tunnel/WebXDefaultQoSHandler.ts"],"names":[],"mappings":";;;AAAA,qDAAkD;AAElD,gDAAwD;AAExD,MAAa,qBAAsB,SAAQ,+BAAc;IAMvD,YAAoB,OAAmB;QACrC,KAAK,EAAE,CAAC;QADU,YAAO,GAAP,OAAO,CAAY;QAL/B,YAAO,GAAG,IAAI,CAAC;QACf,wBAAmB,GAAG,CAAC,CAAC;QACxB,aAAQ,GAAG,KAAK,CAAC;QACjB,oBAAe,GAAG,EAAE,CAAC;IAI7B,CAAC;IAED,MAAM,CAAC,kBAA0B;QAC/B,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnC,IAAI,kBAAkB,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;gBAClD,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACxB,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAC;YAEhD,CAAC;iBAAM,IAAI,kBAAkB,IAAI,CAAC,EAAE,CAAC;gBACnC,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACxB,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAC;YAChD,CAAC;YAED,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,SAAS,CAAC,QAAiB;QACzB,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,UAAU,CAAC,OAAe;QACxB,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC;QAC/B,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,EAAC,OAAO,EAAE,OAAO,EAAC,EAAC,CAAC,CAAC,CAAC;IAChF,CAAC;IAEO,gBAAgB;QACtB,IAAI,IAAI,CAAC,eAAe,GAAG,CAAC,EAAE,CAAC;YAC7B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;YAC1C,MAAM,kBAAkB,GAAG,IAAI,oCAAsB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YAC5E,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;YACjD,6DAA6D;QAC/D,CAAC;IACH,CAAC;IAEO,gBAAgB;QACtB,IAAI,IAAI,CAAC,eAAe,GAAG,EAAE,EAAE,CAAC;YAC9B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;YAC1C,MAAM,kBAAkB,GAAG,IAAI,oCAAsB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YAC5E,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;YACjD,6DAA6D;QAC/D,CAAC;IACH,CAAC;CAEF;AAzDD,sDAyDC"}
@@ -1,6 +0,0 @@
1
- export declare abstract class WebXQoSHandler extends EventTarget {
2
- abstract handle(messageQueueLength: number): void;
3
- abstract setActive(isActive: boolean): void;
4
- abstract getQuality(): number;
5
- abstract setQuality(quality: number): void;
6
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebXQoSHandler = void 0;
4
- class WebXQoSHandler extends EventTarget {
5
- }
6
- exports.WebXQoSHandler = WebXQoSHandler;
7
- //# sourceMappingURL=WebXQoSHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WebXQoSHandler.js","sourceRoot":"","sources":["../../src/tunnel/WebXQoSHandler.ts"],"names":[],"mappings":";;;AAAA,MAAsB,cAAe,SAAQ,WAAW;CAKvD;AALD,wCAKC"}
@@ -1,15 +0,0 @@
1
- import { WebXTunnel } from './WebXTunnel';
2
- import { WebXBinarySerializer } from '../transport';
3
- import * as SocketIOClient from 'socket.io-client';
4
- import Socket = SocketIOClient.Socket;
5
- export declare class WebXSocketIOTunnel extends WebXTunnel {
6
- private readonly _url;
7
- private readonly _eventChannel;
8
- private readonly _connectionOptions;
9
- private _socket;
10
- constructor(url: string, options: any, eventChannel: string);
11
- getSocket(): Socket;
12
- send(data: ArrayBuffer): void;
13
- connect(data: any, serializer: WebXBinarySerializer): Promise<Event>;
14
- disconnect(): void;
15
- }