@unyt/datex 0.0.10 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +10 -14
  2. package/esm/datex-web/datex_web.d.ts +2 -0
  3. package/esm/datex-web/datex_web.d.ts.map +1 -0
  4. package/esm/datex-web/datex_web.internal.d.ts +383 -0
  5. package/esm/datex-web/datex_web.internal.d.ts.map +1 -0
  6. package/esm/{datex-core/datex_core_js.internal.js → datex-web/datex_web.internal.js} +794 -1141
  7. package/esm/datex-web/datex_web.js +18 -0
  8. package/esm/datex-web/datex_web.wasm +0 -0
  9. package/esm/datex-web/wasm_url.node.js +1 -0
  10. package/esm/{datex-core.d.ts → datex.d.ts} +3 -3
  11. package/esm/datex.d.ts.map +1 -0
  12. package/esm/{datex-core.js → datex.js} +3 -3
  13. package/esm/default.d.ts.map +1 -1
  14. package/esm/default.js +2 -3
  15. package/esm/deno.json +28 -20
  16. package/esm/dif/core.d.ts +5 -3
  17. package/esm/dif/core.d.ts.map +1 -1
  18. package/esm/dif/core.js +7 -5
  19. package/esm/dif/definitions.d.ts +45 -34
  20. package/esm/dif/definitions.d.ts.map +1 -1
  21. package/esm/dif/definitions.js +14 -9
  22. package/esm/dif/dif-handler.d.ts +135 -35
  23. package/esm/dif/dif-handler.d.ts.map +1 -1
  24. package/esm/dif/dif-handler.js +378 -159
  25. package/esm/dif/display.d.ts +3 -3
  26. package/esm/dif/display.d.ts.map +1 -1
  27. package/esm/dif/display.js +5 -7
  28. package/esm/dif/js-lib.d.ts +8 -0
  29. package/esm/dif/js-lib.d.ts.map +1 -0
  30. package/esm/dif/js-lib.js +3 -0
  31. package/esm/dif/mod.d.ts +0 -1
  32. package/esm/dif/mod.d.ts.map +1 -1
  33. package/esm/dif/mod.js +0 -1
  34. package/esm/dif/type-registry.d.ts +80 -0
  35. package/esm/dif/type-registry.d.ts.map +1 -0
  36. package/esm/dif/type-registry.js +166 -0
  37. package/esm/global.d.ts +2 -0
  38. package/esm/global.d.ts.map +1 -0
  39. package/esm/global.js +1 -0
  40. package/esm/{runtime/special-core-types.d.ts → lib/special-core-types/endpoint.d.ts} +3 -1
  41. package/esm/lib/special-core-types/endpoint.d.ts.map +1 -0
  42. package/esm/{runtime/special-core-types.js → lib/special-core-types/endpoint.js} +6 -1
  43. package/esm/mod.d.ts +3 -1
  44. package/esm/mod.d.ts.map +1 -1
  45. package/esm/mod.js +3 -1
  46. package/esm/network/com-hub.d.ts +20 -22
  47. package/esm/network/com-hub.d.ts.map +1 -1
  48. package/esm/network/com-hub.js +30 -49
  49. package/esm/network/interfaces/websocket-server-base.d.ts +8 -0
  50. package/esm/network/interfaces/websocket-server-base.d.ts.map +1 -0
  51. package/esm/network/interfaces/websocket-server-base.js +93 -0
  52. package/esm/network/interfaces/websocket-server-deno.d.ts +4 -0
  53. package/esm/network/interfaces/websocket-server-deno.d.ts.map +1 -0
  54. package/esm/network/interfaces/websocket-server-deno.js +22 -0
  55. package/esm/network/mod.d.ts +0 -1
  56. package/esm/network/mod.d.ts.map +1 -1
  57. package/esm/network/mod.js +0 -1
  58. package/esm/refs/ref.d.ts.map +1 -1
  59. package/esm/refs/ref.js +1 -2
  60. package/esm/runtime/runtime.d.ts +25 -62
  61. package/esm/runtime/runtime.d.ts.map +1 -1
  62. package/esm/runtime/runtime.js +42 -26
  63. package/esm/utils/devtools-formatter.d.ts +2 -0
  64. package/esm/utils/devtools-formatter.d.ts.map +1 -0
  65. package/esm/utils/devtools-formatter.js +40 -0
  66. package/esm/utils/exceptions.d.ts +4 -0
  67. package/esm/utils/exceptions.d.ts.map +1 -0
  68. package/esm/utils/exceptions.js +9 -0
  69. package/esm/utils/js-runtime-compat/js-runtime.d.ts.map +1 -1
  70. package/package.json +7 -7
  71. package/esm/datex-core/datex_core_js.d.ts +0 -2
  72. package/esm/datex-core/datex_core_js.d.ts.map +0 -1
  73. package/esm/datex-core/datex_core_js.internal.d.ts +0 -512
  74. package/esm/datex-core/datex_core_js.internal.d.ts.map +0 -1
  75. package/esm/datex-core/datex_core_js.js +0 -21
  76. package/esm/datex-core/datex_core_js.wasm +0 -0
  77. package/esm/datex-core/wasm_url.node.js +0 -1
  78. package/esm/datex-core.d.ts.map +0 -1
  79. package/esm/dif/builders.d.ts +0 -16
  80. package/esm/dif/builders.d.ts.map +0 -1
  81. package/esm/dif/builders.js +0 -28
  82. package/esm/network/com-interface.d.ts +0 -35
  83. package/esm/network/com-interface.d.ts.map +0 -1
  84. package/esm/network/com-interface.js +0 -75
  85. package/esm/network/interface-impls/base.d.ts +0 -46
  86. package/esm/network/interface-impls/base.d.ts.map +0 -1
  87. package/esm/network/interface-impls/base.js +0 -47
  88. package/esm/network/interface-impls/websocket-client.d.ts +0 -8
  89. package/esm/network/interface-impls/websocket-client.d.ts.map +0 -1
  90. package/esm/network/interface-impls/websocket-client.js +0 -8
  91. package/esm/runtime/special-core-types.d.ts.map +0 -1
@@ -1,35 +0,0 @@
1
- import type { JSComHub } from "../datex-core/datex_core_js";
2
- /**
3
- * Abstract base class for communication interface implementations.
4
- */
5
- export declare abstract class ComInterfaceImpl<SetupData> {
6
- protected readonly uuid: string;
7
- protected readonly setupData: SetupData;
8
- protected readonly jsComHub: JSComHub;
9
- constructor(uuid: string, setupData: SetupData, jsComHub: JSComHub);
10
- /**
11
- * Initializes the communication interface.
12
- */
13
- init?(): Promise<void> | void;
14
- /**
15
- * Cleans up the communication interface.
16
- */
17
- cleanup?(): Promise<void> | void;
18
- }
19
- /**
20
- * Represents a communication interface.
21
- */
22
- export declare class ComInterface<T extends ComInterfaceImpl<unknown>> {
23
- #private;
24
- /** The UUID of the interface. */
25
- readonly uuid: string;
26
- /** The implementation of the interface. */
27
- readonly impl: T;
28
- constructor(uuid: string, impl: T, jsComHub: JSComHub);
29
- /**
30
- * Closes the communication interface.
31
- * @returns True if the interface was closed successfully, false otherwise.
32
- */
33
- close(): Promise<boolean>;
34
- }
35
- //# sourceMappingURL=com-interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"com-interface.d.ts","sourceRoot":"","sources":["../../src/network/com-interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE5D;;GAEG;AACH,8BAAsB,gBAAgB,CAAC,SAAS;IAC5C,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACjC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAG,SAAS,CAAC;IACzC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAG,QAAQ,CAAC;gBAE3B,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ;IAKlE;;OAEG;IACH,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAC7B;;OAEG;IACH,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;CACnC;AAED;;GAEG;AACH,qBAAa,YAAY,CAAC,CAAC,SAAS,gBAAgB,CAAC,OAAO,CAAC;;IACzD,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,2CAA2C;IAC3C,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;gBAKL,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ;IAMrD;;;OAGG;IACU,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;CAIzC"}
@@ -1,75 +0,0 @@
1
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
- if (kind === "m") throw new TypeError("Private method is not writable");
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
- };
7
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
- };
12
- var _ComInterface_jsComHub;
13
- /**
14
- * Abstract base class for communication interface implementations.
15
- */
16
- export class ComInterfaceImpl {
17
- constructor(uuid, setupData, jsComHub) {
18
- Object.defineProperty(this, "uuid", {
19
- enumerable: true,
20
- configurable: true,
21
- writable: true,
22
- value: void 0
23
- });
24
- Object.defineProperty(this, "setupData", {
25
- enumerable: true,
26
- configurable: true,
27
- writable: true,
28
- value: void 0
29
- });
30
- Object.defineProperty(this, "jsComHub", {
31
- enumerable: true,
32
- configurable: true,
33
- writable: true,
34
- value: void 0
35
- });
36
- this.uuid = uuid;
37
- this.setupData = setupData;
38
- this.jsComHub = jsComHub;
39
- }
40
- }
41
- /**
42
- * Represents a communication interface.
43
- */
44
- export class ComInterface {
45
- constructor(uuid, impl, jsComHub) {
46
- /** The UUID of the interface. */
47
- Object.defineProperty(this, "uuid", {
48
- enumerable: true,
49
- configurable: true,
50
- writable: true,
51
- value: void 0
52
- });
53
- /** The implementation of the interface. */
54
- Object.defineProperty(this, "impl", {
55
- enumerable: true,
56
- configurable: true,
57
- writable: true,
58
- value: void 0
59
- });
60
- /** The JS communication hub. */
61
- _ComInterface_jsComHub.set(this, void 0);
62
- this.uuid = uuid;
63
- this.impl = impl;
64
- __classPrivateFieldSet(this, _ComInterface_jsComHub, jsComHub, "f");
65
- }
66
- /**
67
- * Closes the communication interface.
68
- * @returns True if the interface was closed successfully, false otherwise.
69
- */
70
- async close() {
71
- await this.impl.cleanup?.();
72
- return __classPrivateFieldGet(this, _ComInterface_jsComHub, "f").close_interface(this.uuid);
73
- }
74
- }
75
- _ComInterface_jsComHub = new WeakMap();
@@ -1,46 +0,0 @@
1
- import { ComInterfaceImpl } from "../com-interface.js";
2
- import type { BaseInterfaceSetupData, InterfaceDirection } from "../../datex-core/datex_core_js";
3
- export type {
4
- /**
5
- * Setup data for the base communication interface.
6
- */
7
- BaseInterfaceSetupData,
8
- /**
9
- * Direction of the communication interface (In/Out/InOut).
10
- */
11
- InterfaceDirection, };
12
- /**
13
- * Implementation of the base communication interface.
14
- */
15
- export declare class BaseInterfaceImpl extends ComInterfaceImpl<BaseInterfaceSetupData> {
16
- /**
17
- * Registers a socket for the communication interface.
18
- * @param interfaceDirection The direction of the interface (incoming/outgoing).
19
- * @returns The UUID of the registered socket.
20
- */
21
- registerSocket(interfaceDirection: InterfaceDirection): string;
22
- /**
23
- * Destroys a socket for the communication interface.
24
- * @param socketUUID The UUID of the socket to destroy.
25
- */
26
- destroySocket(socketUUID: string): void;
27
- /**
28
- * Receives a data block for the communication interface.
29
- * @param socketUUID The UUID of the socket to receive data on.
30
- * @param data The data block to receive.
31
- */
32
- receive(socketUUID: string, data: Uint8Array): void;
33
- /**
34
- * Tests sending a data block for the communication interface.
35
- * @param socketUUID The UUID of the socket to send data on.
36
- * @param data The data block to send.
37
- * @returns A promise that resolves to true if the block was sent successfully, false otherwise.
38
- */
39
- testSendBlock(socketUUID: string, data: Uint8Array): Promise<boolean>;
40
- /**
41
- * Registers a callback to handle sending data blocks.
42
- * @param callback The callback to be invoked when sending data.
43
- */
44
- onSend(callback: (data: Uint8Array, receiver_socket_uuid: string) => Promise<boolean>): void;
45
- }
46
- //# sourceMappingURL=base.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/network/interface-impls/base.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EACR,sBAAsB,EACtB,kBAAkB,EACrB,MAAM,gCAAgC,CAAC;AAExC,YAAY;AACR;;GAEG;AACH,sBAAsB;AACtB;;GAEG;AACH,kBAAkB,GACrB,CAAC;AAEF;;GAEG;AACH,qBAAa,iBACT,SAAQ,gBAAgB,CAAC,sBAAsB,CAAC;IAChD;;;;OAIG;IACI,cAAc,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,MAAM;IAOrE;;;OAGG;IACI,aAAa,CAAC,UAAU,EAAE,MAAM;IAOvC;;;;OAIG;IACI,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU;IAQnD;;;;;OAKG;IACI,aAAa,CAChB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,UAAU,GACjB,OAAO,CAAC,OAAO,CAAC;IAQnB;;;OAGG;IACI,MAAM,CACT,QAAQ,EAAE,CACN,IAAI,EAAE,UAAU,EAChB,oBAAoB,EAAE,MAAM,KAC3B,OAAO,CAAC,OAAO,CAAC;CAI5B"}
@@ -1,47 +0,0 @@
1
- import { ComInterfaceImpl } from "../com-interface.js";
2
- import { ComHub } from "../com-hub.js";
3
- /**
4
- * Implementation of the base communication interface.
5
- */
6
- export class BaseInterfaceImpl extends ComInterfaceImpl {
7
- /**
8
- * Registers a socket for the communication interface.
9
- * @param interfaceDirection The direction of the interface (incoming/outgoing).
10
- * @returns The UUID of the registered socket.
11
- */
12
- registerSocket(interfaceDirection) {
13
- return this.jsComHub.base_interface_register_socket(this.uuid, interfaceDirection);
14
- }
15
- /**
16
- * Destroys a socket for the communication interface.
17
- * @param socketUUID The UUID of the socket to destroy.
18
- */
19
- destroySocket(socketUUID) {
20
- this.jsComHub.base_interface_destroy_socket(this.uuid, socketUUID);
21
- }
22
- /**
23
- * Receives a data block for the communication interface.
24
- * @param socketUUID The UUID of the socket to receive data on.
25
- * @param data The data block to receive.
26
- */
27
- receive(socketUUID, data) {
28
- this.jsComHub.base_interface_receive(this.uuid, socketUUID, data);
29
- }
30
- /**
31
- * Tests sending a data block for the communication interface.
32
- * @param socketUUID The UUID of the socket to send data on.
33
- * @param data The data block to send.
34
- * @returns A promise that resolves to true if the block was sent successfully, false otherwise.
35
- */
36
- testSendBlock(socketUUID, data) {
37
- return this.jsComHub.base_interface_test_send_block(this.uuid, socketUUID, data);
38
- }
39
- /**
40
- * Registers a callback to handle sending data blocks.
41
- * @param callback The callback to be invoked when sending data.
42
- */
43
- onSend(callback) {
44
- this.jsComHub.base_interface_on_send(this.uuid, callback);
45
- }
46
- }
47
- ComHub.registerInterfaceImpl("base", BaseInterfaceImpl);
@@ -1,8 +0,0 @@
1
- import { ComInterfaceImpl } from "../com-interface.js";
2
- import type { WebSocketClientInterfaceSetupData } from "../../datex-core/datex_core_js";
3
- /**
4
- * Implementation of the WebSocket client communication interface.
5
- */
6
- export declare class WebSocketClientInterfaceImpl extends ComInterfaceImpl<WebSocketClientInterfaceSetupData> {
7
- }
8
- //# sourceMappingURL=websocket-client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"websocket-client.d.ts","sourceRoot":"","sources":["../../../src/network/interface-impls/websocket-client.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAC;AAGxF;;GAEG;AACH,qBAAa,4BACT,SAAQ,gBAAgB,CAAC,iCAAiC,CAAC;CAC9D"}
@@ -1,8 +0,0 @@
1
- import { ComInterfaceImpl } from "../com-interface.js";
2
- import { ComHub } from "../com-hub.js";
3
- /**
4
- * Implementation of the WebSocket client communication interface.
5
- */
6
- export class WebSocketClientInterfaceImpl extends ComInterfaceImpl {
7
- }
8
- ComHub.registerInterfaceImpl("websocket-client", WebSocketClientInterfaceImpl);
@@ -1 +0,0 @@
1
- {"version":3,"file":"special-core-types.d.ts","sourceRoot":"","sources":["../../src/runtime/special-core-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,QAAQ;;IAIjB,oFAAoF;IACpF,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAa;IAE7D,OAAO;IAKP;;;OAGG;WACW,gBAAgB,CAAC,QAAQ,EAAE,QAAQ;IASjD;;;;OAIG;WACW,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ;IAa7C;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAG5B"}