@unyt/datex 0.0.6 → 0.0.7

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 (42) hide show
  1. package/README.md +6 -4
  2. package/esm/_dnt.shims.d.ts +1 -1
  3. package/esm/datex-core/datex_core_js.internal.d.ts +283 -212
  4. package/esm/datex-core/datex_core_js.internal.d.ts.map +1 -1
  5. package/esm/datex-core/datex_core_js.internal.js +834 -548
  6. package/esm/datex-core/datex_core_js.wasm +0 -0
  7. package/esm/deno.json +11 -2
  8. package/esm/dif/builders.d.ts +11 -0
  9. package/esm/dif/builders.d.ts.map +1 -0
  10. package/esm/dif/builders.js +23 -0
  11. package/esm/dif/definitions.d.ts +116 -0
  12. package/esm/dif/definitions.d.ts.map +1 -0
  13. package/esm/dif/definitions.js +70 -0
  14. package/esm/dif/dif-handler.d.ts +217 -0
  15. package/esm/dif/dif-handler.d.ts.map +1 -0
  16. package/esm/dif/dif-handler.js +688 -0
  17. package/esm/dif/display.d.ts +8 -0
  18. package/esm/dif/display.d.ts.map +1 -0
  19. package/esm/dif/display.js +74 -0
  20. package/esm/mod.js +8 -6
  21. package/esm/network/com-hub.d.ts +1 -0
  22. package/esm/network/com-hub.d.ts.map +1 -1
  23. package/esm/network/com-hub.js +3 -0
  24. package/esm/network/interface-impls/base.d.ts +11 -0
  25. package/esm/network/interface-impls/base.d.ts.map +1 -0
  26. package/esm/network/interface-impls/base.js +21 -0
  27. package/esm/network/interface-impls/websocket-client.d.ts +6 -0
  28. package/esm/network/interface-impls/websocket-client.d.ts.map +1 -0
  29. package/esm/network/interface-impls/websocket-client.js +6 -0
  30. package/esm/network/interface-impls/websocket-server-deno.d.ts +9 -0
  31. package/esm/network/interface-impls/websocket-server-deno.d.ts.map +1 -0
  32. package/esm/network/interface-impls/websocket-server-deno.js +45 -0
  33. package/esm/refs/ref.d.ts +27 -0
  34. package/esm/refs/ref.d.ts.map +1 -0
  35. package/esm/refs/ref.js +58 -0
  36. package/esm/runtime/runtime.d.ts +97 -5
  37. package/esm/runtime/runtime.d.ts.map +1 -1
  38. package/esm/runtime/runtime.js +69 -13
  39. package/esm/runtime/special-core-types.d.ts +10 -0
  40. package/esm/runtime/special-core-types.d.ts.map +1 -0
  41. package/esm/runtime/special-core-types.js +51 -0
  42. package/package.json +10 -1
@@ -0,0 +1,51 @@
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 _Endpoint_endpoint;
13
+ import * as dntShim from "../_dnt.shims.js";
14
+ export class Endpoint {
15
+ constructor(endpoint) {
16
+ _Endpoint_endpoint.set(this, void 0);
17
+ __classPrivateFieldSet(this, _Endpoint_endpoint, endpoint, "f");
18
+ Endpoint.registerEndpoint(this);
19
+ }
20
+ static registerEndpoint(endpoint) {
21
+ // set as a weak reference in the static map
22
+ const weakRef = new dntShim.WeakRef(endpoint);
23
+ Endpoint.endpoints.set(endpoint.toString(), weakRef);
24
+ new FinalizationRegistry((key) => {
25
+ Endpoint.endpoints.delete(key);
26
+ }).register(endpoint, endpoint.toString());
27
+ }
28
+ static get(endpoint) {
29
+ if (Endpoint.endpoints.has(endpoint)) {
30
+ const weakRef = Endpoint.endpoints.get(endpoint);
31
+ if (weakRef) {
32
+ const existingEndpoint = weakRef.deref();
33
+ if (existingEndpoint) {
34
+ return existingEndpoint;
35
+ }
36
+ }
37
+ }
38
+ return new Endpoint(endpoint);
39
+ }
40
+ toString() {
41
+ return __classPrivateFieldGet(this, _Endpoint_endpoint, "f");
42
+ }
43
+ }
44
+ _Endpoint_endpoint = new WeakMap();
45
+ // map with weak values that keeps track of all currently instantiated endpoints
46
+ Object.defineProperty(Endpoint, "endpoints", {
47
+ enumerable: true,
48
+ configurable: true,
49
+ writable: true,
50
+ value: new Map()
51
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unyt/datex",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/unyt-org/datex-core-js.git"
@@ -13,6 +13,15 @@
13
13
  "exports": {
14
14
  ".": {
15
15
  "import": "./esm/mod.js"
16
+ },
17
+ "./src/network/interface-impls/websocket-client.js": {
18
+ "import": "./esm/network/interface-impls/websocket-client.js"
19
+ },
20
+ "./src/network/interface-impls/websocket-server-deno.js": {
21
+ "import": "./esm/network/interface-impls/websocket-server-deno.js"
22
+ },
23
+ "./src/network/interface-impls/base.js": {
24
+ "import": "./esm/network/interface-impls/base.js"
16
25
  }
17
26
  },
18
27
  "scripts": {},