@illgrenoble/webx-client 0.1.1

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 (201) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +8 -0
  3. package/dist/WebXClient.d.ts +94 -0
  4. package/dist/WebXClient.js +302 -0
  5. package/dist/WebXClient.js.map +1 -0
  6. package/dist/display/WebXCursor.d.ts +28 -0
  7. package/dist/display/WebXCursor.js +94 -0
  8. package/dist/display/WebXCursor.js.map +1 -0
  9. package/dist/display/WebXCursorFactory.d.ts +18 -0
  10. package/dist/display/WebXCursorFactory.js +36 -0
  11. package/dist/display/WebXCursorFactory.js.map +1 -0
  12. package/dist/display/WebXDisplay.d.ts +70 -0
  13. package/dist/display/WebXDisplay.js +248 -0
  14. package/dist/display/WebXDisplay.js.map +1 -0
  15. package/dist/display/WebXSubImage.d.ts +19 -0
  16. package/dist/display/WebXSubImage.js +20 -0
  17. package/dist/display/WebXSubImage.js.map +1 -0
  18. package/dist/display/WebXTextureFactory.d.ts +14 -0
  19. package/dist/display/WebXTextureFactory.js +101 -0
  20. package/dist/display/WebXTextureFactory.js.map +1 -0
  21. package/dist/display/WebXWindow.d.ts +59 -0
  22. package/dist/display/WebXWindow.js +205 -0
  23. package/dist/display/WebXWindow.js.map +1 -0
  24. package/dist/display/WebXWindowProperties.d.ts +14 -0
  25. package/dist/display/WebXWindowProperties.js +17 -0
  26. package/dist/display/WebXWindowProperties.js.map +1 -0
  27. package/dist/display/index.d.ts +7 -0
  28. package/dist/display/index.js +24 -0
  29. package/dist/display/index.js.map +1 -0
  30. package/dist/index.d.ts +8 -0
  31. package/dist/index.js +25 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/input/WebXKeyboard.d.ts +230 -0
  34. package/dist/input/WebXKeyboard.js +593 -0
  35. package/dist/input/WebXKeyboard.js.map +1 -0
  36. package/dist/input/WebXMouse.d.ts +97 -0
  37. package/dist/input/WebXMouse.js +205 -0
  38. package/dist/input/WebXMouse.js.map +1 -0
  39. package/dist/input/index.d.ts +4 -0
  40. package/dist/input/index.js +21 -0
  41. package/dist/input/index.js.map +1 -0
  42. package/dist/input/keyboard/WebXKeyEvent.d.ts +47 -0
  43. package/dist/input/keyboard/WebXKeyEvent.js +212 -0
  44. package/dist/input/keyboard/WebXKeyEvent.js.map +1 -0
  45. package/dist/input/keyboard/WebXKeyPressEvent.d.ts +13 -0
  46. package/dist/input/keyboard/WebXKeyPressEvent.js +26 -0
  47. package/dist/input/keyboard/WebXKeyPressEvent.js.map +1 -0
  48. package/dist/input/keyboard/WebXKeyUpEvent.d.ts +12 -0
  49. package/dist/input/keyboard/WebXKeyUpEvent.js +28 -0
  50. package/dist/input/keyboard/WebXKeyUpEvent.js.map +1 -0
  51. package/dist/input/keyboard/WebXKeyboardModifierState.d.ts +47 -0
  52. package/dist/input/keyboard/WebXKeyboardModifierState.js +87 -0
  53. package/dist/input/keyboard/WebXKeyboardModifierState.js.map +1 -0
  54. package/dist/input/keyboard/WebXKeyboardUtils.d.ts +9 -0
  55. package/dist/input/keyboard/WebXKeyboardUtils.js +48 -0
  56. package/dist/input/keyboard/WebXKeyboardUtils.js.map +1 -0
  57. package/dist/input/keyboard/WebXKeydownEvent.d.ts +29 -0
  58. package/dist/input/keyboard/WebXKeydownEvent.js +71 -0
  59. package/dist/input/keyboard/WebXKeydownEvent.js.map +1 -0
  60. package/dist/input/keyboard/index.d.ts +6 -0
  61. package/dist/input/keyboard/index.js +23 -0
  62. package/dist/input/keyboard/index.js.map +1 -0
  63. package/dist/input/mouse/WebXMouseState.d.ts +78 -0
  64. package/dist/input/mouse/WebXMouseState.js +104 -0
  65. package/dist/input/mouse/WebXMouseState.js.map +1 -0
  66. package/dist/input/mouse/index.d.ts +1 -0
  67. package/dist/input/mouse/index.js +18 -0
  68. package/dist/input/mouse/index.js.map +1 -0
  69. package/dist/instruction/WebXConnectInstruction.d.ts +4 -0
  70. package/dist/instruction/WebXConnectInstruction.js +12 -0
  71. package/dist/instruction/WebXConnectInstruction.js.map +1 -0
  72. package/dist/instruction/WebXCursorImageInstruction.d.ts +6 -0
  73. package/dist/instruction/WebXCursorImageInstruction.js +16 -0
  74. package/dist/instruction/WebXCursorImageInstruction.js.map +1 -0
  75. package/dist/instruction/WebXImageInstruction.d.ts +7 -0
  76. package/dist/instruction/WebXImageInstruction.js +19 -0
  77. package/dist/instruction/WebXImageInstruction.js.map +1 -0
  78. package/dist/instruction/WebXInstruction.d.ts +13 -0
  79. package/dist/instruction/WebXInstruction.js +34 -0
  80. package/dist/instruction/WebXInstruction.js.map +1 -0
  81. package/dist/instruction/WebXInstructionResponse.d.ts +13 -0
  82. package/dist/instruction/WebXInstructionResponse.js +40 -0
  83. package/dist/instruction/WebXInstructionResponse.js.map +1 -0
  84. package/dist/instruction/WebXInstructionType.d.ts +13 -0
  85. package/dist/instruction/WebXInstructionType.js +38 -0
  86. package/dist/instruction/WebXInstructionType.js.map +1 -0
  87. package/dist/instruction/WebXKeyboardInstruction.d.ts +10 -0
  88. package/dist/instruction/WebXKeyboardInstruction.js +26 -0
  89. package/dist/instruction/WebXKeyboardInstruction.js.map +1 -0
  90. package/dist/instruction/WebXMouseInstruction.d.ts +13 -0
  91. package/dist/instruction/WebXMouseInstruction.js +33 -0
  92. package/dist/instruction/WebXMouseInstruction.js.map +1 -0
  93. package/dist/instruction/WebXQualityInstruction.d.ts +7 -0
  94. package/dist/instruction/WebXQualityInstruction.js +19 -0
  95. package/dist/instruction/WebXQualityInstruction.js.map +1 -0
  96. package/dist/instruction/WebXScreenInstruction.d.ts +4 -0
  97. package/dist/instruction/WebXScreenInstruction.js +12 -0
  98. package/dist/instruction/WebXScreenInstruction.js.map +1 -0
  99. package/dist/instruction/WebXWindowsInstruction.d.ts +4 -0
  100. package/dist/instruction/WebXWindowsInstruction.js +12 -0
  101. package/dist/instruction/WebXWindowsInstruction.js.map +1 -0
  102. package/dist/instruction/index.d.ts +11 -0
  103. package/dist/instruction/index.js +28 -0
  104. package/dist/instruction/index.js.map +1 -0
  105. package/dist/message/WebXCursorImageMessage.d.ts +17 -0
  106. package/dist/message/WebXCursorImageMessage.js +36 -0
  107. package/dist/message/WebXCursorImageMessage.js.map +1 -0
  108. package/dist/message/WebXImageMessage.d.ts +15 -0
  109. package/dist/message/WebXImageMessage.js +32 -0
  110. package/dist/message/WebXImageMessage.js.map +1 -0
  111. package/dist/message/WebXMessage.d.ts +8 -0
  112. package/dist/message/WebXMessage.js +17 -0
  113. package/dist/message/WebXMessage.js.map +1 -0
  114. package/dist/message/WebXMessageType.d.ts +10 -0
  115. package/dist/message/WebXMessageType.js +15 -0
  116. package/dist/message/WebXMessageType.js.map +1 -0
  117. package/dist/message/WebXMouseMessage.d.ts +10 -0
  118. package/dist/message/WebXMouseMessage.js +24 -0
  119. package/dist/message/WebXMouseMessage.js.map +1 -0
  120. package/dist/message/WebXPollMessage.d.ts +4 -0
  121. package/dist/message/WebXPollMessage.js +12 -0
  122. package/dist/message/WebXPollMessage.js.map +1 -0
  123. package/dist/message/WebXScreenMessage.d.ts +12 -0
  124. package/dist/message/WebXScreenMessage.js +16 -0
  125. package/dist/message/WebXScreenMessage.js.map +1 -0
  126. package/dist/message/WebXSubImagesMessage.d.ts +11 -0
  127. package/dist/message/WebXSubImagesMessage.js +24 -0
  128. package/dist/message/WebXSubImagesMessage.js.map +1 -0
  129. package/dist/message/WebXWindowsMessage.d.ts +7 -0
  130. package/dist/message/WebXWindowsMessage.js +16 -0
  131. package/dist/message/WebXWindowsMessage.js.map +1 -0
  132. package/dist/message/index.d.ts +9 -0
  133. package/dist/message/index.js +26 -0
  134. package/dist/message/index.js.map +1 -0
  135. package/dist/tracer/WebXHandler.d.ts +3 -0
  136. package/dist/tracer/WebXHandler.js +3 -0
  137. package/dist/tracer/WebXHandler.js.map +1 -0
  138. package/dist/tracer/WebXInstructionHandler.d.ts +4 -0
  139. package/dist/tracer/WebXInstructionHandler.js +7 -0
  140. package/dist/tracer/WebXInstructionHandler.js.map +1 -0
  141. package/dist/tracer/WebXMessageHandler.d.ts +4 -0
  142. package/dist/tracer/WebXMessageHandler.js +7 -0
  143. package/dist/tracer/WebXMessageHandler.js.map +1 -0
  144. package/dist/tracer/WebXStatsHandler.d.ts +7 -0
  145. package/dist/tracer/WebXStatsHandler.js +7 -0
  146. package/dist/tracer/WebXStatsHandler.js.map +1 -0
  147. package/dist/tracer/index.d.ts +4 -0
  148. package/dist/tracer/index.js +21 -0
  149. package/dist/tracer/index.js.map +1 -0
  150. package/dist/transport/WebXBinarySerializer.d.ts +11 -0
  151. package/dist/transport/WebXBinarySerializer.js +43 -0
  152. package/dist/transport/WebXBinarySerializer.js.map +1 -0
  153. package/dist/transport/WebXInstructionBuffer.d.ts +35 -0
  154. package/dist/transport/WebXInstructionBuffer.js +80 -0
  155. package/dist/transport/WebXInstructionBuffer.js.map +1 -0
  156. package/dist/transport/WebXInstructionEncoder.d.ts +101 -0
  157. package/dist/transport/WebXInstructionEncoder.js +175 -0
  158. package/dist/transport/WebXInstructionEncoder.js.map +1 -0
  159. package/dist/transport/WebXMessageBuffer.d.ts +19 -0
  160. package/dist/transport/WebXMessageBuffer.js +58 -0
  161. package/dist/transport/WebXMessageBuffer.js.map +1 -0
  162. package/dist/transport/WebXMessageDecoder.d.ts +16 -0
  163. package/dist/transport/WebXMessageDecoder.js +156 -0
  164. package/dist/transport/WebXMessageDecoder.js.map +1 -0
  165. package/dist/transport/index.d.ts +5 -0
  166. package/dist/transport/index.js +22 -0
  167. package/dist/transport/index.js.map +1 -0
  168. package/dist/tunnel/WebXDefaultQoSHandler.d.ts +16 -0
  169. package/dist/tunnel/WebXDefaultQoSHandler.js +57 -0
  170. package/dist/tunnel/WebXDefaultQoSHandler.js.map +1 -0
  171. package/dist/tunnel/WebXQoSHandler.d.ts +6 -0
  172. package/dist/tunnel/WebXQoSHandler.js +7 -0
  173. package/dist/tunnel/WebXQoSHandler.js.map +1 -0
  174. package/dist/tunnel/WebXSocketIOTunnel.d.ts +15 -0
  175. package/dist/tunnel/WebXSocketIOTunnel.js +41 -0
  176. package/dist/tunnel/WebXSocketIOTunnel.js.map +1 -0
  177. package/dist/tunnel/WebXTunnel.d.ts +24 -0
  178. package/dist/tunnel/WebXTunnel.js +106 -0
  179. package/dist/tunnel/WebXTunnel.js.map +1 -0
  180. package/dist/tunnel/WebXWebSocketTunnel.d.ts +12 -0
  181. package/dist/tunnel/WebXWebSocketTunnel.js +41 -0
  182. package/dist/tunnel/WebXWebSocketTunnel.js.map +1 -0
  183. package/dist/tunnel/index.d.ts +5 -0
  184. package/dist/tunnel/index.js +22 -0
  185. package/dist/tunnel/index.js.map +1 -0
  186. package/dist/utils/Config.d.ts +4 -0
  187. package/dist/utils/Config.js +10 -0
  188. package/dist/utils/Config.js.map +1 -0
  189. package/dist/utils/WebXAsyncExec.d.ts +5 -0
  190. package/dist/utils/WebXAsyncExec.js +18 -0
  191. package/dist/utils/WebXAsyncExec.js.map +1 -0
  192. package/dist/utils/WebXColourGenerator.d.ts +5 -0
  193. package/dist/utils/WebXColourGenerator.js +27 -0
  194. package/dist/utils/WebXColourGenerator.js.map +1 -0
  195. package/dist/utils/WebXFileSize.d.ts +3 -0
  196. package/dist/utils/WebXFileSize.js +14 -0
  197. package/dist/utils/WebXFileSize.js.map +1 -0
  198. package/dist/utils/index.d.ts +4 -0
  199. package/dist/utils/index.js +21 -0
  200. package/dist/utils/index.js.map +1 -0
  201. package/package.json +43 -0
@@ -0,0 +1,4 @@
1
+ import { WebXMessage } from './WebXMessage';
2
+ export declare class WebXPollMessage extends WebXMessage {
3
+ constructor();
4
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebXPollMessage = void 0;
4
+ const WebXMessage_1 = require("./WebXMessage");
5
+ const WebXMessageType_1 = require("./WebXMessageType");
6
+ class WebXPollMessage extends WebXMessage_1.WebXMessage {
7
+ constructor() {
8
+ super(WebXMessageType_1.WebXMessageType.POLL);
9
+ }
10
+ }
11
+ exports.WebXPollMessage = WebXPollMessage;
12
+ //# sourceMappingURL=WebXPollMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXPollMessage.js","sourceRoot":"","sources":["../../src/message/WebXPollMessage.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,uDAAoD;AAEpD,MAAa,eAAgB,SAAQ,yBAAW;IAC9C;QACE,KAAK,CAAC,iCAAe,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF;AAJD,0CAIC"}
@@ -0,0 +1,12 @@
1
+ import { WebXMessage } from './WebXMessage';
2
+ export declare class WebXScreenMessage extends WebXMessage {
3
+ private _screenSize;
4
+ get screenSize(): {
5
+ width: number;
6
+ height: number;
7
+ };
8
+ constructor(_screenSize: {
9
+ width: number;
10
+ height: number;
11
+ }, commandId: number);
12
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebXScreenMessage = void 0;
4
+ const WebXMessage_1 = require("./WebXMessage");
5
+ const WebXMessageType_1 = require("./WebXMessageType");
6
+ class WebXScreenMessage extends WebXMessage_1.WebXMessage {
7
+ constructor(_screenSize, commandId) {
8
+ super(WebXMessageType_1.WebXMessageType.SCREEN, commandId);
9
+ this._screenSize = _screenSize;
10
+ }
11
+ get screenSize() {
12
+ return this._screenSize;
13
+ }
14
+ }
15
+ exports.WebXScreenMessage = WebXScreenMessage;
16
+ //# sourceMappingURL=WebXScreenMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXScreenMessage.js","sourceRoot":"","sources":["../../src/message/WebXScreenMessage.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,uDAAoD;AAEpD,MAAa,iBAAkB,SAAQ,yBAAW;IAKhD,YAAoB,WAA8C,EAAE,SAAiB;QACnF,KAAK,CAAC,iCAAe,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QADvB,gBAAW,GAAX,WAAW,CAAmC;IAElE,CAAC;IAND,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CAKF;AARD,8CAQC"}
@@ -0,0 +1,11 @@
1
+ import { WebXMessage } from './WebXMessage';
2
+ import { WebXSubImage } from '../display';
3
+ export declare class WebXSubImagesMessage extends WebXMessage {
4
+ private _windowId;
5
+ private _subImages;
6
+ private _size;
7
+ get windowId(): number;
8
+ get subImages(): WebXSubImage[];
9
+ get size(): number;
10
+ constructor(_windowId: number, _subImages: WebXSubImage[], commandId: number, _size: number);
11
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebXSubImagesMessage = void 0;
4
+ const WebXMessage_1 = require("./WebXMessage");
5
+ const WebXMessageType_1 = require("./WebXMessageType");
6
+ class WebXSubImagesMessage extends WebXMessage_1.WebXMessage {
7
+ constructor(_windowId, _subImages, commandId, _size) {
8
+ super(WebXMessageType_1.WebXMessageType.SUBIMAGES, commandId);
9
+ this._windowId = _windowId;
10
+ this._subImages = _subImages;
11
+ this._size = _size;
12
+ }
13
+ get windowId() {
14
+ return this._windowId;
15
+ }
16
+ get subImages() {
17
+ return this._subImages;
18
+ }
19
+ get size() {
20
+ return this._size;
21
+ }
22
+ }
23
+ exports.WebXSubImagesMessage = WebXSubImagesMessage;
24
+ //# sourceMappingURL=WebXSubImagesMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXSubImagesMessage.js","sourceRoot":"","sources":["../../src/message/WebXSubImagesMessage.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,uDAAoD;AAGpD,MAAa,oBAAqB,SAAQ,yBAAW;IAanD,YAAoB,SAAiB,EAAU,UAA0B,EAAE,SAAiB,EAAU,KAAa;QACjH,KAAK,CAAC,iCAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAD1B,cAAS,GAAT,SAAS,CAAQ;QAAU,eAAU,GAAV,UAAU,CAAgB;QAA6B,UAAK,GAAL,KAAK,CAAQ;IAEnH,CAAC;IAdD,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CAKF;AAhBD,oDAgBC"}
@@ -0,0 +1,7 @@
1
+ import { WebXMessage } from './WebXMessage';
2
+ import { WebXWindowProperties } from '../display';
3
+ export declare class WebXWindowsMessage extends WebXMessage {
4
+ private _windows;
5
+ get windows(): Array<WebXWindowProperties>;
6
+ constructor(_windows: Array<WebXWindowProperties>, commandId: number);
7
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebXWindowsMessage = void 0;
4
+ const WebXMessage_1 = require("./WebXMessage");
5
+ const WebXMessageType_1 = require("./WebXMessageType");
6
+ class WebXWindowsMessage extends WebXMessage_1.WebXMessage {
7
+ constructor(_windows, commandId) {
8
+ super(WebXMessageType_1.WebXMessageType.WINDOWS, commandId);
9
+ this._windows = _windows;
10
+ }
11
+ get windows() {
12
+ return this._windows;
13
+ }
14
+ }
15
+ exports.WebXWindowsMessage = WebXWindowsMessage;
16
+ //# sourceMappingURL=WebXWindowsMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXWindowsMessage.js","sourceRoot":"","sources":["../../src/message/WebXWindowsMessage.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAE5C,uDAAoD;AAEpD,MAAa,kBAAmB,SAAQ,yBAAW;IAKjD,YAAoB,QAAqC,EAAE,SAAiB;QAC1E,KAAK,CAAC,iCAAe,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QADxB,aAAQ,GAAR,QAAQ,CAA6B;IAEzD,CAAC;IAND,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CAKF;AARD,gDAQC"}
@@ -0,0 +1,9 @@
1
+ export * from './WebXMessage';
2
+ export * from './WebXMessageType';
3
+ export * from './WebXScreenMessage';
4
+ export * from './WebXWindowsMessage';
5
+ export * from './WebXImageMessage';
6
+ export * from './WebXSubImagesMessage';
7
+ export * from './WebXMouseMessage';
8
+ export * from './WebXCursorImageMessage';
9
+ export * from './WebXPollMessage';
@@ -0,0 +1,26 @@
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("./WebXMessage"), exports);
18
+ __exportStar(require("./WebXMessageType"), exports);
19
+ __exportStar(require("./WebXScreenMessage"), exports);
20
+ __exportStar(require("./WebXWindowsMessage"), exports);
21
+ __exportStar(require("./WebXImageMessage"), exports);
22
+ __exportStar(require("./WebXSubImagesMessage"), exports);
23
+ __exportStar(require("./WebXMouseMessage"), exports);
24
+ __exportStar(require("./WebXCursorImageMessage"), exports);
25
+ __exportStar(require("./WebXPollMessage"), exports);
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/message/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,oDAAkC;AAClC,sDAAoC;AACpC,uDAAqC;AACrC,qDAAmC;AACnC,yDAAuC;AACvC,qDAAmC;AACnC,2DAAyC;AACzC,oDAAkC"}
@@ -0,0 +1,3 @@
1
+ export interface WebXHandler {
2
+ destroy(): void;
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=WebXHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXHandler.js","sourceRoot":"","sources":["../../src/tracer/WebXHandler.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { WebXInstruction } from '../instruction';
2
+ export declare abstract class WebXInstructionHandler {
3
+ abstract handle(instruction: WebXInstruction): void;
4
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebXInstructionHandler = void 0;
4
+ class WebXInstructionHandler {
5
+ }
6
+ exports.WebXInstructionHandler = WebXInstructionHandler;
7
+ //# sourceMappingURL=WebXInstructionHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXInstructionHandler.js","sourceRoot":"","sources":["../../src/tracer/WebXInstructionHandler.ts"],"names":[],"mappings":";;;AAEA,MAAsB,sBAAsB;CAG3C;AAHD,wDAGC"}
@@ -0,0 +1,4 @@
1
+ import { WebXMessage } from '../message';
2
+ export declare abstract class WebXMessageHandler {
3
+ abstract handle(message: WebXMessage): void;
4
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebXMessageHandler = void 0;
4
+ class WebXMessageHandler {
5
+ }
6
+ exports.WebXMessageHandler = WebXMessageHandler;
7
+ //# sourceMappingURL=WebXMessageHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXMessageHandler.js","sourceRoot":"","sources":["../../src/tracer/WebXMessageHandler.ts"],"names":[],"mappings":";;;AAEA,MAAsB,kBAAkB;CAIvC;AAJD,gDAIC"}
@@ -0,0 +1,7 @@
1
+ export declare abstract class WebXStatsHandler {
2
+ abstract handle(stats: {
3
+ received: number;
4
+ sent: number;
5
+ }): void;
6
+ abstract destroy(): void;
7
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebXStatsHandler = void 0;
4
+ class WebXStatsHandler {
5
+ }
6
+ exports.WebXStatsHandler = WebXStatsHandler;
7
+ //# sourceMappingURL=WebXStatsHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXStatsHandler.js","sourceRoot":"","sources":["../../src/tracer/WebXStatsHandler.ts"],"names":[],"mappings":";;;AAAA,MAAsB,gBAAgB;CAGrC;AAHD,4CAGC"}
@@ -0,0 +1,4 @@
1
+ export * from './WebXInstructionHandler';
2
+ export * from './WebXMessageHandler';
3
+ export * from './WebXStatsHandler';
4
+ export * from './WebXHandler';
@@ -0,0 +1,21 @@
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("./WebXInstructionHandler"), exports);
18
+ __exportStar(require("./WebXMessageHandler"), exports);
19
+ __exportStar(require("./WebXStatsHandler"), exports);
20
+ __exportStar(require("./WebXHandler"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tracer/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,uDAAqC;AACrC,qDAAmC;AACnC,gDAA8B"}
@@ -0,0 +1,11 @@
1
+ import { WebXInstruction } from '../instruction';
2
+ import { WebXMessage } from '../message';
3
+ import { WebXMessageBuffer } from '.';
4
+ import { WebXTextureFactory } from '../display';
5
+ export declare class WebXBinarySerializer {
6
+ private readonly _instructionEncoder;
7
+ private readonly _messageDecoder;
8
+ constructor(textureFactory: WebXTextureFactory);
9
+ serializeInstruction(instruction: WebXInstruction): ArrayBuffer;
10
+ deserializeMessage(buffer: WebXMessageBuffer): Promise<WebXMessage>;
11
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.WebXBinarySerializer = void 0;
13
+ const _1 = require(".");
14
+ class WebXBinarySerializer {
15
+ constructor(textureFactory) {
16
+ this._instructionEncoder = new _1.WebXInstructionEncoder();
17
+ this._messageDecoder = new _1.WebXMessageDecoder(textureFactory);
18
+ }
19
+ serializeInstruction(instruction) {
20
+ // return instruction.toJsonString();
21
+ const encoded = this._instructionEncoder.encode(instruction);
22
+ if (encoded == null) {
23
+ console.warn('Could not serialize instruction: Unknown type');
24
+ }
25
+ return encoded;
26
+ }
27
+ deserializeMessage(buffer) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ try {
30
+ const message = yield this._messageDecoder.decode(buffer);
31
+ if (message == null) {
32
+ console.error(`Failed to decode message data`);
33
+ }
34
+ return message;
35
+ }
36
+ catch (error) {
37
+ console.error(`Caught error decoding message data: ${error.message}`);
38
+ }
39
+ });
40
+ }
41
+ }
42
+ exports.WebXBinarySerializer = WebXBinarySerializer;
43
+ //# sourceMappingURL=WebXBinarySerializer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXBinarySerializer.js","sourceRoot":"","sources":["../../src/transport/WebXBinarySerializer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,wBAAkF;AAGlF,MAAa,oBAAoB;IAK/B,YAAY,cAAkC;QAC5C,IAAI,CAAC,mBAAmB,GAAG,IAAI,yBAAsB,EAAE,CAAC;QACxD,IAAI,CAAC,eAAe,GAAG,IAAI,qBAAkB,CAAC,cAAc,CAAC,CAAC;IAChE,CAAC;IAED,oBAAoB,CAAC,WAA4B;QAC/C,qCAAqC;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC7D,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;SAC/D;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAEK,kBAAkB,CAAC,MAAyB;;YAChD,IAAI;gBACF,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC1D,IAAI,OAAO,IAAI,IAAI,EAAE;oBACnB,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;iBAChD;gBACD,OAAO,OAAO,CAAC;aAEhB;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,uCAAuC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;aACvE;QACH,CAAC;KAAA;CAGF;AAjCD,oDAiCC"}
@@ -0,0 +1,35 @@
1
+ import { WebXInstruction } from '../instruction';
2
+ export declare class WebXInstructionBuffer {
3
+ private readonly _buffer;
4
+ private _offset;
5
+ constructor(instruction: WebXInstruction, length: number);
6
+ private _getNextOffset;
7
+ /**
8
+ * Write a signed 32 bit integer to the buffer
9
+ */
10
+ putInt32(value: number): WebXInstructionBuffer;
11
+ /**
12
+ * Write an unsigned 8 bit integer to the buffer
13
+ * @param value the value to write
14
+ */
15
+ putUInt8(value: number): WebXInstructionBuffer;
16
+ /**
17
+ * Write an unsigned 32 bit integer to the buffer
18
+ * @param value the value to write
19
+ */
20
+ putUInt32(value: number): WebXInstructionBuffer;
21
+ /**
22
+ * Write a string to the buffer
23
+ * @param value the value to write
24
+ */
25
+ putString(value: string): WebXInstructionBuffer;
26
+ /**
27
+ * Write a boolean to the buffer
28
+ * @param value the value to write
29
+ */
30
+ putBoolean(value: boolean): WebXInstructionBuffer;
31
+ /**
32
+ * Get the array buffer
33
+ */
34
+ buffer(): ArrayBuffer;
35
+ }
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebXInstructionBuffer = void 0;
4
+ class WebXInstructionBuffer {
5
+ constructor(instruction, length) {
6
+ const headerSize = 24; // 16 for sessionID place holder (set by the relay) and 8 for the instruction type and id
7
+ this._buffer = new ArrayBuffer(length + headerSize);
8
+ this._offset = 16;
9
+ // add the header
10
+ if (instruction.synchronous) {
11
+ this.putUInt32(0x80000000 | instruction.type);
12
+ }
13
+ else {
14
+ this.putUInt32(instruction.type);
15
+ }
16
+ this.putUInt32(instruction.id);
17
+ }
18
+ _getNextOffset(sizeOfData) {
19
+ // Ensure alignment
20
+ const padding = this._offset % sizeOfData > 0 ? sizeOfData - (this._offset % sizeOfData) : 0;
21
+ const position = this._offset + padding;
22
+ this._offset += sizeOfData + padding;
23
+ return position;
24
+ }
25
+ /**
26
+ * Write a signed 32 bit integer to the buffer
27
+ */
28
+ putInt32(value) {
29
+ const offset = this._getNextOffset(4);
30
+ const typedArray = new Int32Array(this._buffer, offset, 1);
31
+ typedArray[0] = value;
32
+ return this;
33
+ }
34
+ /**
35
+ * Write an unsigned 8 bit integer to the buffer
36
+ * @param value the value to write
37
+ */
38
+ putUInt8(value) {
39
+ const offset = this._getNextOffset(1);
40
+ const typedArray = new Uint8Array(this._buffer, offset, 1);
41
+ typedArray[0] = value;
42
+ return this;
43
+ }
44
+ /**
45
+ * Write an unsigned 32 bit integer to the buffer
46
+ * @param value the value to write
47
+ */
48
+ putUInt32(value) {
49
+ const offset = this._getNextOffset(4);
50
+ const typedArray = new Uint32Array(this._buffer, offset, 1);
51
+ typedArray[0] = value;
52
+ return this;
53
+ }
54
+ /**
55
+ * Write a string to the buffer
56
+ * @param value the value to write
57
+ */
58
+ putString(value) {
59
+ for (let i = 0; i < value.length; i++) {
60
+ this.putUInt8(value.charCodeAt(i));
61
+ }
62
+ return this;
63
+ }
64
+ /**
65
+ * Write a boolean to the buffer
66
+ * @param value the value to write
67
+ */
68
+ putBoolean(value) {
69
+ this.putUInt32(value === true ? 0xff : 0x00);
70
+ return this;
71
+ }
72
+ /**
73
+ * Get the array buffer
74
+ */
75
+ buffer() {
76
+ return this._buffer;
77
+ }
78
+ }
79
+ exports.WebXInstructionBuffer = WebXInstructionBuffer;
80
+ //# sourceMappingURL=WebXInstructionBuffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXInstructionBuffer.js","sourceRoot":"","sources":["../../src/transport/WebXInstructionBuffer.ts"],"names":[],"mappings":";;;AAEA,MAAa,qBAAqB;IAKhC,YAAY,WAA4B,EAAE,MAAc;QACtD,MAAM,UAAU,GAAG,EAAE,CAAC,CAAC,yFAAyF;QAChH,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;QAEpD,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAElB,iBAAiB;QACjB,IAAI,WAAW,CAAC,WAAW,EAAE;YAC3B,IAAI,CAAC,SAAS,CAAC,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;SAC/C;aAAM;YACL,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SAClC;QACD,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;IAEO,cAAc,CAAC,UAAkB;QACvC,mBAAmB;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAExC,IAAI,CAAC,OAAO,IAAI,UAAU,GAAG,OAAO,CAAC;QAErC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,KAAa;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QACtC,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAC3D,UAAU,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACI,QAAQ,CAAC,KAAa;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QACtC,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAC3D,UAAU,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,KAAa;QACrB,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QACtC,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAC5D,UAAU,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,KAAa;QAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;SACpC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,KAAc;QAC9B,IAAI,CAAC,SAAS,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACI,MAAM;QACX,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CAEF;AAzFD,sDAyFC"}
@@ -0,0 +1,101 @@
1
+ import { WebXInstruction } from '../instruction';
2
+ export declare class WebXInstructionEncoder {
3
+ /**
4
+ * Convert the given instruction to an array buffer ready to be sent along the wire
5
+ * @param instruction the instruction to encode
6
+ */
7
+ encode(instruction: WebXInstruction): ArrayBuffer;
8
+ /**
9
+ * Create a new mouse instruction
10
+ * @param instruction the mouse instruction to encode
11
+ * Structure:
12
+ * Header: 24 bytes
13
+ * sessionId: 16 bytes
14
+ * type: 4 bytes
15
+ * id: 4 bytes
16
+ * Content: 4 bytes
17
+ * x: 4 bytes
18
+ * y: 4 bytes
19
+ * buttonMask: 4 bytes
20
+ */
21
+ private _createMouseInstruction;
22
+ /**
23
+ * Create a new cursor image instruction
24
+ * @param instruction the cursor image instruction to encode
25
+ * Structure:
26
+ * Header: 24 bytes
27
+ * sessionId: 16 bytes
28
+ * type: 4 bytes
29
+ * id: 4 bytes
30
+ * Content: 4 bytes
31
+ * cursorId: 4 bytes
32
+ */
33
+ private _createCursorImageInstruction;
34
+ /**
35
+ * Create a new image instruction
36
+ * @param instruction the image instruction to encode
37
+ * Structure:
38
+ * Header: 24 bytes
39
+ * sessionId: 16 bytes
40
+ * type: 4 bytes
41
+ * id: 4 bytes
42
+ * Content: 4 bytes
43
+ * windowId: 4 bytes
44
+ */
45
+ private _createImageInstruction;
46
+ /**
47
+ * Create a keyboard instruction
48
+ * @param instruction the keyboard instruction to encode
49
+ * Structure:
50
+ * Header: 24 bytes
51
+ * sessionId: 16 bytes
52
+ * type: 4 bytes
53
+ * id: 4 bytes
54
+ * Content: 8 bytes
55
+ * key (the keyboard key code): 4 bytes
56
+ * pressed: 4 bytes
57
+ */
58
+ private _createKeyboardInstruction;
59
+ /**
60
+ * Create a screen instruction
61
+ * @param instruction the screen instruction to encode
62
+ * Structure:
63
+ * Header: 24 bytes
64
+ * sessionId: 16 bytes
65
+ * type: 4 bytes
66
+ * id: 4 bytes
67
+ */
68
+ private _createScreenInstruction;
69
+ /**
70
+ * Create a windows instruction
71
+ * Structure:
72
+ * Header: 24 bytes
73
+ * sessionId: 16 bytes
74
+ * type: 4 bytes
75
+ * id: 4 bytes
76
+ * @param instruction the windows instruction to encode
77
+ */
78
+ private _createWindowsInstruction;
79
+ /**
80
+ * Create a connect instruction
81
+ * @param instruction the connect instruction to encode
82
+ * Structure:
83
+ * Header: 24 bytes
84
+ * sessionId: 16 bytes
85
+ * type: 4 bytes
86
+ * id: 4 bytes
87
+ */
88
+ private _createConnectInstruction;
89
+ /**
90
+ * Create a new quality instruction
91
+ * @param instruction the quality instruction to encode
92
+ * Structure:
93
+ * Header: 24 bytes
94
+ * sessionId: 16 bytes
95
+ * type: 4 bytes
96
+ * id: 4 bytes
97
+ * Content: 4 bytes
98
+ * qualityIndex: 4 bytes
99
+ */
100
+ private _createQualityInstruction;
101
+ }