@unyt/datex 0.0.12 → 0.0.14
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.
- package/README.md +1 -1
- package/esm/datex-web/datex_web.internal.d.ts +17 -19
- package/esm/datex-web/datex_web.internal.d.ts.map +1 -1
- package/esm/datex-web/datex_web.internal.js +88 -85
- package/esm/datex-web/datex_web.wasm +0 -0
- package/esm/deno.json +4 -4
- package/esm/dif/core.d.ts +1 -0
- package/esm/dif/core.d.ts.map +1 -1
- package/esm/dif/core.js +1 -0
- package/esm/dif/definitions.d.ts +6 -6
- package/esm/dif/definitions.d.ts.map +1 -1
- package/esm/dif/definitions.js +1 -1
- package/esm/dif/dif-handler.d.ts +7 -7
- package/esm/dif/dif-handler.d.ts.map +1 -1
- package/esm/dif/dif-handler.js +33 -7
- package/esm/dif/display.d.ts +3 -3
- package/esm/dif/display.d.ts.map +1 -1
- package/esm/dif/display.js +3 -3
- package/esm/lib/special-core-types/endpoint.d.ts.map +1 -1
- package/esm/lib/special-core-types/range.d.ts +26 -0
- package/esm/lib/special-core-types/range.d.ts.map +1 -0
- package/esm/lib/special-core-types/range.js +46 -0
- package/esm/mod.d.ts +3 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +3 -0
- package/esm/repl/mod.d.ts +8 -0
- package/esm/repl/mod.d.ts.map +1 -0
- package/esm/repl/mod.js +31 -0
- package/esm/runtime/runtime.d.ts +3 -4
- package/esm/runtime/runtime.d.ts.map +1 -1
- package/esm/runtime/runtime.js +2 -5
- package/esm/utils/devtools-formatter.js +22 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,20 +4,6 @@
|
|
|
4
4
|
* @returns {Promise<JSRuntime>}
|
|
5
5
|
*/
|
|
6
6
|
export function create_runtime(config: any, debug_config: any): Promise<JSRuntime>;
|
|
7
|
-
/**
|
|
8
|
-
* Executes a Datex script and returns the result as a string.
|
|
9
|
-
* @param {string} datex_script
|
|
10
|
-
* @param {any} decompile_options
|
|
11
|
-
* @returns {string}
|
|
12
|
-
*/
|
|
13
|
-
export function execute(datex_script: string, decompile_options: any): string;
|
|
14
|
-
/**
|
|
15
|
-
* Executes a Datex script and returns true when execution was successful.
|
|
16
|
-
* Does not return the result of the script, but only indicates success or failure.
|
|
17
|
-
* @param {string} datex_script
|
|
18
|
-
* @returns {boolean}
|
|
19
|
-
*/
|
|
20
|
-
export function execute_internal(datex_script: string): boolean;
|
|
21
7
|
export function __wbg_Error_dbcd8782dbb273a2(arg0: any, arg1: any): Error;
|
|
22
8
|
export function __wbg_Number_012552ac4683228d(arg0: any): number;
|
|
23
9
|
export function __wbg_String_8564e559799eccda(arg0: any, arg1: any): void;
|
|
@@ -76,6 +62,7 @@ export function __wbg_importKey_d5d98bc5f7c574a9(...args: any[]): any;
|
|
|
76
62
|
export function __wbg_info_3fd9a89e2dc8aaf1(arg0: any, arg1: any, arg2: any, arg3: any): void;
|
|
77
63
|
export function __wbg_instanceof_ArrayBuffer_4f2b9b5ed416155d(arg0: any): boolean;
|
|
78
64
|
export function __wbg_instanceof_CryptoKey_f4419e1bcb5414ed(arg0: any): boolean;
|
|
65
|
+
export function __wbg_instanceof_Error_e4c0d728e3dea73b(arg0: any): boolean;
|
|
79
66
|
export function __wbg_instanceof_Map_3ad422261e078a42(arg0: any): boolean;
|
|
80
67
|
export function __wbg_instanceof_Object_4ac1098d06a01a38(arg0: any): boolean;
|
|
81
68
|
export function __wbg_instanceof_ReadableStreamDefaultReader_251c05d2f717b795(arg0: any): boolean;
|
|
@@ -88,6 +75,7 @@ export function __wbg_jsruntime_new(arg0: any): any;
|
|
|
88
75
|
export function __wbg_length_f875d3a041bab91a(arg0: any): any;
|
|
89
76
|
export function __wbg_length_feaf2a40e5f9755a(arg0: any): any;
|
|
90
77
|
export function __wbg_log_876289592910878f(arg0: any, arg1: any, arg2: any, arg3: any): void;
|
|
78
|
+
export function __wbg_message_31a7950b57658baf(arg0: any): any;
|
|
91
79
|
export function __wbg_navigator_373a54253e4475fb(arg0: any): any;
|
|
92
80
|
export function __wbg_new_227d7c05414eb861(): Error;
|
|
93
81
|
export function __wbg_new_5947ca72f3fee3e6(): Map<any, any>;
|
|
@@ -242,11 +230,6 @@ export class JSComHub {
|
|
|
242
230
|
*/
|
|
243
231
|
remove_socket(socket_uuid: string): Promise<void>;
|
|
244
232
|
}
|
|
245
|
-
export class JSPointer {
|
|
246
|
-
__destroy_into_raw(): number | undefined;
|
|
247
|
-
__wbg_ptr: number | undefined;
|
|
248
|
-
free(): void;
|
|
249
|
-
}
|
|
250
233
|
export class JSRuntime {
|
|
251
234
|
static __wrap(ptr: any): any;
|
|
252
235
|
__destroy_into_raw(): number | undefined;
|
|
@@ -322,6 +305,21 @@ export class JSRuntime {
|
|
|
322
305
|
*/
|
|
323
306
|
get version(): string;
|
|
324
307
|
}
|
|
308
|
+
export class Repl {
|
|
309
|
+
/**
|
|
310
|
+
* @param {JSRuntime} runtime
|
|
311
|
+
* @param {boolean} verbose
|
|
312
|
+
*/
|
|
313
|
+
constructor(runtime: JSRuntime, verbose: boolean);
|
|
314
|
+
__destroy_into_raw(): number;
|
|
315
|
+
__wbg_ptr: number;
|
|
316
|
+
free(): void;
|
|
317
|
+
/**
|
|
318
|
+
* @param {string} script
|
|
319
|
+
* @returns {Promise<any>}
|
|
320
|
+
*/
|
|
321
|
+
execute(script: string): Promise<any>;
|
|
322
|
+
}
|
|
325
323
|
export class RuntimeDIFHandle {
|
|
326
324
|
static __wrap(ptr: any): any;
|
|
327
325
|
__destroy_into_raw(): number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datex_web.internal.d.ts","sourceRoot":"","sources":["../../src/datex-web/datex_web.internal.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"datex_web.internal.d.ts","sourceRoot":"","sources":["../../src/datex-web/datex_web.internal.js"],"names":[],"mappings":"AAofA;;;;GAIG;AACH,uCAJW,GAAG,gBACH,GAAG,GACD,OAAO,CAAC,SAAS,CAAC,CAK9B;AACD,0EAGC;AACD,iEAGC;AACD,0EAMC;AACD,gGAKC;AACD,2FAIC;AACD,2FAMC;AACD,oFAGC;AACD,uFAGC;AACD,kFAGC;AACD,8EAGC;AACD,gFAIC;AACD,uFAGC;AACD,mFAGC;AACD,0FAGC;AACD,gGAGC;AACD,yFAKC;AACD,yFAOC;AACD,oFAEC;AACD,sEAEC;AACD,8DAGC;AACD,kEAGC;AACD,iEAGgB;AAChB,iEAGgB;AAChB,iEAGgB;AAChB,iEAGgB;AAChB,8DAGC;AACD,oEAGC;AACD,kEAEgB;AAChB,mEAGgB;AAChB,4DAGC;AACD,+FAEC;AACD,oEAGgB;AAChB,uEAGgB;AAChB,mEAGgB;AAChB,4DAGC;AACD,oEAGgB;AAChB,2EAGC;AACD,+FAEC;AACD,yEAUC;AACD,8DAEC;AACD,sEAGgB;AAChB,wEAGgB;AAChB,4EAGgB;AAChB,iEAGC;AACD,sEAGgB;AAChB,sEAGC;AACD,gEAGgB;AAChB,6EAGC;AACD,gEAGgB;AAChB,uEAGC;AACD,sEAGC;AACD,gFAGC;AACD,iEAGC;AACD,mFAGC;AACD,sEAGgB;AAChB,8FAEC;AACD,kFASC;AACD,gFASC;AACD,4EASC;AACD,0EASC;AACD,6EASC;AACD,kGASC;AACD,iFASC;AACD,6EASC;AACD,yEAGC;AACD,yEAGC;AACD,0DAGC;AACD,oDAGC;AACD,8DAGC;AACD,8DAGC;AACD,6FAEC;AACD,+DAGC;AACD,iEAGC;AACD,oDAGC;AACD,4DAGC;AACD,uEAGC;AACD,qDAGC;AACD,gEAGgB;AAChB,oDAGC;AACD,6FAGC;AACD,0DAGC;AACD,qFAiBC;AACD,iEAGgB;AAChB,4DAGC;AACD,qDAGC;AACD,2DAGC;AACD,uEAGC;AACD,4DAGC;AACD,uEAGC;AACD,mEAGC;AACD,+FAEC;AACD,uEAGC;AACD,uEAEC;AACD,sEAGC;AACD,8EAMC;AACD,4DAGC;AACD,gEAGC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AG,CAQf;IACD;;;;;OAKG;IACH,sBALW,GAAG,gBACH,GAAG,cACH,MAAM,GACJ,MAAM,CAmBlB;IACD;;;;;;OAMG;IACH,gCANW,MAAM,WACN,MAAM,mBACN,GAAG,uBAED,MAAM,CAUlB;IACD;;;;;;OAMG;IACH,iCAHW,MAAM,GACJ,GAAG,CAUf;IACD;;;;OAIG;IACH,sCAHW,MAAM,GACJ,GAAG,CAUf;IACD;;;OAGG;IACH,2BAHW,MAAM,eACN,MAAM,QAShB;IACD;;;;OAIG;IACH,uBAJW,MAAM,WACN,MAAM,UACN,GAAG,QASb;IACD;;;;OAIG;IACH,iCAJW,MAAM,eACN,MAAM,mBACN,GAAG,QASb;CACJ"}
|
|
@@ -122,20 +122,6 @@ export class JSComHub {
|
|
|
122
122
|
}
|
|
123
123
|
if (Symbol.dispose)
|
|
124
124
|
JSComHub.prototype[Symbol.dispose] = JSComHub.prototype.free;
|
|
125
|
-
export class JSPointer {
|
|
126
|
-
__destroy_into_raw() {
|
|
127
|
-
const ptr = this.__wbg_ptr;
|
|
128
|
-
this.__wbg_ptr = 0;
|
|
129
|
-
JSPointerFinalization.unregister(this);
|
|
130
|
-
return ptr;
|
|
131
|
-
}
|
|
132
|
-
free() {
|
|
133
|
-
const ptr = this.__destroy_into_raw();
|
|
134
|
-
wasm.__wbg_jspointer_free(ptr, 0);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
if (Symbol.dispose)
|
|
138
|
-
JSPointer.prototype[Symbol.dispose] = JSPointer.prototype.free;
|
|
139
125
|
export class JSRuntime {
|
|
140
126
|
static __wrap(ptr) {
|
|
141
127
|
ptr = ptr >>> 0;
|
|
@@ -341,6 +327,41 @@ export class JSRuntime {
|
|
|
341
327
|
}
|
|
342
328
|
if (Symbol.dispose)
|
|
343
329
|
JSRuntime.prototype[Symbol.dispose] = JSRuntime.prototype.free;
|
|
330
|
+
export class Repl {
|
|
331
|
+
__destroy_into_raw() {
|
|
332
|
+
const ptr = this.__wbg_ptr;
|
|
333
|
+
this.__wbg_ptr = 0;
|
|
334
|
+
ReplFinalization.unregister(this);
|
|
335
|
+
return ptr;
|
|
336
|
+
}
|
|
337
|
+
free() {
|
|
338
|
+
const ptr = this.__destroy_into_raw();
|
|
339
|
+
wasm.__wbg_repl_free(ptr, 0);
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* @param {string} script
|
|
343
|
+
* @returns {Promise<any>}
|
|
344
|
+
*/
|
|
345
|
+
execute(script) {
|
|
346
|
+
const ptr0 = passStringToWasm0(script, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
347
|
+
const len0 = WASM_VECTOR_LEN;
|
|
348
|
+
const ret = wasm.repl_execute(this.__wbg_ptr, ptr0, len0);
|
|
349
|
+
return ret;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* @param {JSRuntime} runtime
|
|
353
|
+
* @param {boolean} verbose
|
|
354
|
+
*/
|
|
355
|
+
constructor(runtime, verbose) {
|
|
356
|
+
_assertClass(runtime, JSRuntime);
|
|
357
|
+
const ret = wasm.repl_new(runtime.__wbg_ptr, verbose);
|
|
358
|
+
this.__wbg_ptr = ret >>> 0;
|
|
359
|
+
ReplFinalization.register(this, this.__wbg_ptr, this);
|
|
360
|
+
return this;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (Symbol.dispose)
|
|
364
|
+
Repl.prototype[Symbol.dispose] = Repl.prototype.free;
|
|
344
365
|
export class RuntimeDIFHandle {
|
|
345
366
|
static __wrap(ptr) {
|
|
346
367
|
ptr = ptr >>> 0;
|
|
@@ -493,39 +514,6 @@ export function create_runtime(config, debug_config) {
|
|
|
493
514
|
const ret = wasm.create_runtime(config, debug_config);
|
|
494
515
|
return ret;
|
|
495
516
|
}
|
|
496
|
-
/**
|
|
497
|
-
* Executes a Datex script and returns the result as a string.
|
|
498
|
-
* @param {string} datex_script
|
|
499
|
-
* @param {any} decompile_options
|
|
500
|
-
* @returns {string}
|
|
501
|
-
*/
|
|
502
|
-
export function execute(datex_script, decompile_options) {
|
|
503
|
-
let deferred2_0;
|
|
504
|
-
let deferred2_1;
|
|
505
|
-
try {
|
|
506
|
-
const ptr0 = passStringToWasm0(datex_script, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
507
|
-
const len0 = WASM_VECTOR_LEN;
|
|
508
|
-
const ret = wasm.execute(ptr0, len0, decompile_options);
|
|
509
|
-
deferred2_0 = ret[0];
|
|
510
|
-
deferred2_1 = ret[1];
|
|
511
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
512
|
-
}
|
|
513
|
-
finally {
|
|
514
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
/**
|
|
518
|
-
* Executes a Datex script and returns true when execution was successful.
|
|
519
|
-
* Does not return the result of the script, but only indicates success or failure.
|
|
520
|
-
* @param {string} datex_script
|
|
521
|
-
* @returns {boolean}
|
|
522
|
-
*/
|
|
523
|
-
export function execute_internal(datex_script) {
|
|
524
|
-
const ptr0 = passStringToWasm0(datex_script, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
525
|
-
const len0 = WASM_VECTOR_LEN;
|
|
526
|
-
const ret = wasm.execute_internal(ptr0, len0);
|
|
527
|
-
return ret !== 0;
|
|
528
|
-
}
|
|
529
517
|
export function __wbg_Error_dbcd8782dbb273a2(arg0, arg1) {
|
|
530
518
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
531
519
|
return ret;
|
|
@@ -823,6 +811,17 @@ export function __wbg_instanceof_CryptoKey_f4419e1bcb5414ed(arg0) {
|
|
|
823
811
|
const ret = result;
|
|
824
812
|
return ret;
|
|
825
813
|
}
|
|
814
|
+
export function __wbg_instanceof_Error_e4c0d728e3dea73b(arg0) {
|
|
815
|
+
let result;
|
|
816
|
+
try {
|
|
817
|
+
result = arg0 instanceof Error;
|
|
818
|
+
}
|
|
819
|
+
catch (_) {
|
|
820
|
+
result = false;
|
|
821
|
+
}
|
|
822
|
+
const ret = result;
|
|
823
|
+
return ret;
|
|
824
|
+
}
|
|
826
825
|
export function __wbg_instanceof_Map_3ad422261e078a42(arg0) {
|
|
827
826
|
let result;
|
|
828
827
|
try {
|
|
@@ -905,6 +904,10 @@ export function __wbg_length_feaf2a40e5f9755a(arg0) {
|
|
|
905
904
|
export function __wbg_log_876289592910878f(arg0, arg1, arg2, arg3) {
|
|
906
905
|
console.log(arg0, arg1, arg2, arg3);
|
|
907
906
|
}
|
|
907
|
+
export function __wbg_message_31a7950b57658baf(arg0) {
|
|
908
|
+
const ret = arg0.message;
|
|
909
|
+
return ret;
|
|
910
|
+
}
|
|
908
911
|
export function __wbg_navigator_373a54253e4475fb(arg0) {
|
|
909
912
|
const ret = arg0.navigator;
|
|
910
913
|
return ret;
|
|
@@ -950,7 +953,7 @@ export function __wbg_new_typed_f79896f0ea5f7de8(arg0, arg1) {
|
|
|
950
953
|
const a = state0.a;
|
|
951
954
|
state0.a = 0;
|
|
952
955
|
try {
|
|
953
|
-
return
|
|
956
|
+
return wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Function_fn_wasm_bindgen_cb3f4c460819bddd___JsValue_____wasm_bindgen_cb3f4c460819bddd___sys__Undefined___js_sys_f2c01423afcdca44___Function_fn_wasm_bindgen_cb3f4c460819bddd___JsValue_____wasm_bindgen_cb3f4c460819bddd___sys__Undefined______(a, state0.b, arg0, arg1);
|
|
954
957
|
}
|
|
955
958
|
finally {
|
|
956
959
|
state0.a = a;
|
|
@@ -1171,43 +1174,43 @@ export function __wbg_write_537b90f946efe5cf(arg0, arg1) {
|
|
|
1171
1174
|
return ret;
|
|
1172
1175
|
}
|
|
1173
1176
|
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
1174
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1175
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1177
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1075, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 1076, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1178
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_cb3f4c460819bddd___closure__destroy___dyn_core_1d8485f859230fcb___ops__function__FnMut__js_sys_f2c01423afcdca44___Uint8Array____Output_______, wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Uint8Array_____);
|
|
1176
1179
|
return ret;
|
|
1177
1180
|
}
|
|
1178
1181
|
export function __wbindgen_cast_0000000000000002(arg0, arg1) {
|
|
1179
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1180
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1182
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1075, function: Function { arguments: [NamedExternref("Event")], shim_idx: 1076, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1183
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_cb3f4c460819bddd___closure__destroy___dyn_core_1d8485f859230fcb___ops__function__FnMut__js_sys_f2c01423afcdca44___Uint8Array____Output_______, wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Uint8Array______1);
|
|
1181
1184
|
return ret;
|
|
1182
1185
|
}
|
|
1183
1186
|
export function __wbindgen_cast_0000000000000003(arg0, arg1) {
|
|
1184
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1185
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1187
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1075, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 1076, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1188
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_cb3f4c460819bddd___closure__destroy___dyn_core_1d8485f859230fcb___ops__function__FnMut__js_sys_f2c01423afcdca44___Uint8Array____Output_______, wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Uint8Array______2);
|
|
1186
1189
|
return ret;
|
|
1187
1190
|
}
|
|
1188
1191
|
export function __wbindgen_cast_0000000000000004(arg0, arg1) {
|
|
1189
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1190
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1192
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1075, function: Function { arguments: [NamedExternref("SerialPort")], shim_idx: 1078, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1193
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_cb3f4c460819bddd___closure__destroy___dyn_core_1d8485f859230fcb___ops__function__FnMut__js_sys_f2c01423afcdca44___Uint8Array____Output_______, wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___wasm_bindgen_cb3f4c460819bddd___sys__Undefined__core_1d8485f859230fcb___result__Result_____wasm_bindgen_cb3f4c460819bddd___JsError__);
|
|
1191
1194
|
return ret;
|
|
1192
1195
|
}
|
|
1193
1196
|
export function __wbindgen_cast_0000000000000005(arg0, arg1) {
|
|
1194
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1195
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1197
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1075, function: Function { arguments: [NamedExternref("Uint8Array")], shim_idx: 1076, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1198
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_cb3f4c460819bddd___closure__destroy___dyn_core_1d8485f859230fcb___ops__function__FnMut__js_sys_f2c01423afcdca44___Uint8Array____Output_______, wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Uint8Array______4);
|
|
1196
1199
|
return ret;
|
|
1197
1200
|
}
|
|
1198
1201
|
export function __wbindgen_cast_0000000000000006(arg0, arg1) {
|
|
1199
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1200
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1202
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1075, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 1078, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1203
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_cb3f4c460819bddd___closure__destroy___dyn_core_1d8485f859230fcb___ops__function__FnMut__js_sys_f2c01423afcdca44___Uint8Array____Output_______, wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___wasm_bindgen_cb3f4c460819bddd___sys__Undefined__core_1d8485f859230fcb___result__Result_____wasm_bindgen_cb3f4c460819bddd___JsError___5);
|
|
1201
1204
|
return ret;
|
|
1202
1205
|
}
|
|
1203
1206
|
export function __wbindgen_cast_0000000000000007(arg0, arg1) {
|
|
1204
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1205
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1207
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1890, function: Function { arguments: [], shim_idx: 1891, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1208
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_cb3f4c460819bddd___closure__destroy___dyn_core_1d8485f859230fcb___ops__function__FnMut_____Output_______, wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke______);
|
|
1206
1209
|
return ret;
|
|
1207
1210
|
}
|
|
1208
1211
|
export function __wbindgen_cast_0000000000000008(arg0, arg1) {
|
|
1209
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1210
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1212
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1924, function: Function { arguments: [Externref], shim_idx: 1925, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1213
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_cb3f4c460819bddd___closure__destroy___dyn_core_1d8485f859230fcb___ops__function__FnMut__wasm_bindgen_cb3f4c460819bddd___JsValue____Output___core_1d8485f859230fcb___result__Result_____wasm_bindgen_cb3f4c460819bddd___JsError___, wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___wasm_bindgen_cb3f4c460819bddd___JsValue__core_1d8485f859230fcb___result__Result_____wasm_bindgen_cb3f4c460819bddd___JsError__);
|
|
1211
1214
|
return ret;
|
|
1212
1215
|
}
|
|
1213
1216
|
export function __wbindgen_cast_0000000000000009(arg0) {
|
|
@@ -1246,52 +1249,52 @@ export function __wbindgen_init_externref_table() {
|
|
|
1246
1249
|
table.set(offset + 2, true);
|
|
1247
1250
|
table.set(offset + 3, false);
|
|
1248
1251
|
}
|
|
1249
|
-
function
|
|
1250
|
-
wasm.
|
|
1252
|
+
function wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke______(arg0, arg1) {
|
|
1253
|
+
wasm.wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke______(arg0, arg1);
|
|
1251
1254
|
}
|
|
1252
|
-
function
|
|
1253
|
-
wasm.
|
|
1255
|
+
function wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Uint8Array_____(arg0, arg1, arg2) {
|
|
1256
|
+
wasm.wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Uint8Array_____(arg0, arg1, arg2);
|
|
1254
1257
|
}
|
|
1255
|
-
function
|
|
1256
|
-
wasm.
|
|
1258
|
+
function wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Uint8Array______1(arg0, arg1, arg2) {
|
|
1259
|
+
wasm.wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Uint8Array______1(arg0, arg1, arg2);
|
|
1257
1260
|
}
|
|
1258
|
-
function
|
|
1259
|
-
wasm.
|
|
1261
|
+
function wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Uint8Array______2(arg0, arg1, arg2) {
|
|
1262
|
+
wasm.wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Uint8Array______2(arg0, arg1, arg2);
|
|
1260
1263
|
}
|
|
1261
|
-
function
|
|
1262
|
-
wasm.
|
|
1264
|
+
function wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Uint8Array______4(arg0, arg1, arg2) {
|
|
1265
|
+
wasm.wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Uint8Array______4(arg0, arg1, arg2);
|
|
1263
1266
|
}
|
|
1264
|
-
function
|
|
1265
|
-
const ret = wasm.
|
|
1267
|
+
function wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___wasm_bindgen_cb3f4c460819bddd___sys__Undefined__core_1d8485f859230fcb___result__Result_____wasm_bindgen_cb3f4c460819bddd___JsError__(arg0, arg1, arg2) {
|
|
1268
|
+
const ret = wasm.wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___wasm_bindgen_cb3f4c460819bddd___sys__Undefined__core_1d8485f859230fcb___result__Result_____wasm_bindgen_cb3f4c460819bddd___JsError__(arg0, arg1, arg2);
|
|
1266
1269
|
if (ret[1]) {
|
|
1267
1270
|
throw takeFromExternrefTable0(ret[0]);
|
|
1268
1271
|
}
|
|
1269
1272
|
}
|
|
1270
|
-
function
|
|
1271
|
-
const ret = wasm.
|
|
1273
|
+
function wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___wasm_bindgen_cb3f4c460819bddd___sys__Undefined__core_1d8485f859230fcb___result__Result_____wasm_bindgen_cb3f4c460819bddd___JsError___5(arg0, arg1, arg2) {
|
|
1274
|
+
const ret = wasm.wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___wasm_bindgen_cb3f4c460819bddd___sys__Undefined__core_1d8485f859230fcb___result__Result_____wasm_bindgen_cb3f4c460819bddd___JsError___5(arg0, arg1, arg2);
|
|
1272
1275
|
if (ret[1]) {
|
|
1273
1276
|
throw takeFromExternrefTable0(ret[0]);
|
|
1274
1277
|
}
|
|
1275
1278
|
}
|
|
1276
|
-
function
|
|
1277
|
-
const ret = wasm.
|
|
1279
|
+
function wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___wasm_bindgen_cb3f4c460819bddd___JsValue__core_1d8485f859230fcb___result__Result_____wasm_bindgen_cb3f4c460819bddd___JsError__(arg0, arg1, arg2) {
|
|
1280
|
+
const ret = wasm.wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___wasm_bindgen_cb3f4c460819bddd___JsValue__core_1d8485f859230fcb___result__Result_____wasm_bindgen_cb3f4c460819bddd___JsError__(arg0, arg1, arg2);
|
|
1278
1281
|
if (ret[1]) {
|
|
1279
1282
|
throw takeFromExternrefTable0(ret[0]);
|
|
1280
1283
|
}
|
|
1281
1284
|
}
|
|
1282
|
-
function
|
|
1283
|
-
wasm.
|
|
1285
|
+
function wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Function_fn_wasm_bindgen_cb3f4c460819bddd___JsValue_____wasm_bindgen_cb3f4c460819bddd___sys__Undefined___js_sys_f2c01423afcdca44___Function_fn_wasm_bindgen_cb3f4c460819bddd___JsValue_____wasm_bindgen_cb3f4c460819bddd___sys__Undefined______(arg0, arg1, arg2, arg3) {
|
|
1286
|
+
wasm.wasm_bindgen_cb3f4c460819bddd___convert__closures_____invoke___js_sys_f2c01423afcdca44___Function_fn_wasm_bindgen_cb3f4c460819bddd___JsValue_____wasm_bindgen_cb3f4c460819bddd___sys__Undefined___js_sys_f2c01423afcdca44___Function_fn_wasm_bindgen_cb3f4c460819bddd___JsValue_____wasm_bindgen_cb3f4c460819bddd___sys__Undefined______(arg0, arg1, arg2, arg3);
|
|
1284
1287
|
}
|
|
1285
1288
|
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
1286
1289
|
const JSComHubFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1287
1290
|
? { register: () => { }, unregister: () => { } }
|
|
1288
1291
|
: new FinalizationRegistry(ptr => wasm.__wbg_jscomhub_free(ptr >>> 0, 1));
|
|
1289
|
-
const JSPointerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1290
|
-
? { register: () => { }, unregister: () => { } }
|
|
1291
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_jspointer_free(ptr >>> 0, 1));
|
|
1292
1292
|
const JSRuntimeFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1293
1293
|
? { register: () => { }, unregister: () => { } }
|
|
1294
1294
|
: new FinalizationRegistry(ptr => wasm.__wbg_jsruntime_free(ptr >>> 0, 1));
|
|
1295
|
+
const ReplFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1296
|
+
? { register: () => { }, unregister: () => { } }
|
|
1297
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_repl_free(ptr >>> 0, 1));
|
|
1295
1298
|
const RuntimeDIFHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1296
1299
|
? { register: () => { }, unregister: () => { } }
|
|
1297
1300
|
: new FinalizationRegistry(ptr => wasm.__wbg_runtimedifhandle_free(ptr >>> 0, 1));
|
|
Binary file
|
package/esm/deno.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unyt/datex",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./src/mod.ts",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
]
|
|
17
17
|
},
|
|
18
18
|
"tasks": {
|
|
19
|
-
"debug": "deno run -A scripts/build-wasm.ts --profile debug
|
|
19
|
+
"debug": "deno run -A scripts/build-wasm.ts --profile debug",
|
|
20
20
|
"release": "deno run -A scripts/build-wasm.ts --profile release",
|
|
21
|
-
"debug-unsecure": "deno run -A scripts/build-wasm.ts --profile debug --features
|
|
21
|
+
"debug-unsecure": "deno run -A scripts/build-wasm.ts --profile debug --features allow_unsigned_blocks",
|
|
22
22
|
|
|
23
23
|
"debug-no-opt": "deno task debug --no-opt",
|
|
24
24
|
"test": "deno task debug-no-opt && deno test -A",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"browser-demo-no-build": "deno task build-npm && cd datex-browser-demo && npm install && npm run dev",
|
|
32
32
|
|
|
33
33
|
"fmt": "deno fmt && cargo fmt",
|
|
34
|
-
"lint": "deno lint --fix && cargo clippy --fix
|
|
34
|
+
"lint": "deno lint --fix && cargo clippy --fix"
|
|
35
35
|
},
|
|
36
36
|
"fmt": {
|
|
37
37
|
"indentWidth": 4,
|
package/esm/dif/core.d.ts
CHANGED
package/esm/dif/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/dif/core.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/dif/core.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BlB,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEnF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;CAsBxB,CAAC"}
|
package/esm/dif/core.js
CHANGED
package/esm/dif/definitions.d.ts
CHANGED
|
@@ -36,15 +36,15 @@ export type DIFTypeDefinitionKind = typeof DIFTypeDefinitionKind[keyof typeof DI
|
|
|
36
36
|
/**
|
|
37
37
|
* Representation of reference mutability (mutable or immutable) in DIF.
|
|
38
38
|
*/
|
|
39
|
-
export declare const
|
|
39
|
+
export declare const DIFSharedValueMutability: {
|
|
40
40
|
readonly Mutable: 0;
|
|
41
41
|
readonly Immutable: 1;
|
|
42
42
|
};
|
|
43
43
|
/** A DIF reference mutability. */
|
|
44
|
-
export type
|
|
44
|
+
export type DIFSharedValueMutability = typeof DIFSharedValueMutability[keyof typeof DIFSharedValueMutability];
|
|
45
45
|
export type DIFType = DIFPointerAddress | {
|
|
46
46
|
name?: string;
|
|
47
|
-
mut?:
|
|
47
|
+
mut?: DIFSharedValueMutability;
|
|
48
48
|
def: DIFTypeDefinition;
|
|
49
49
|
};
|
|
50
50
|
/** A DIF type definition based on its kind. */
|
|
@@ -55,11 +55,11 @@ type VerboseDIFTypeDefinition<Kind extends DIFTypeDefinitionKind = DIFTypeDefini
|
|
|
55
55
|
kind: Kind;
|
|
56
56
|
def: DIFTypeDefinitionInner<Kind>;
|
|
57
57
|
};
|
|
58
|
-
/** A representation of a
|
|
59
|
-
export type
|
|
58
|
+
/** A representation of a shared value in DIF. */
|
|
59
|
+
export type DIFSharedValue = {
|
|
60
60
|
value: DIFValueContainer;
|
|
61
61
|
allowed_type: DIFTypeDefinition;
|
|
62
|
-
mut:
|
|
62
|
+
mut: DIFSharedValueMutability;
|
|
63
63
|
};
|
|
64
64
|
/** A representation of a value or pointer address in DIF. */
|
|
65
65
|
export type DIFValueContainer = DIFValue | DIFPointerAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/dif/definitions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACvC;;;GAGG;AACH,MAAM,MAAM,QAAQ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AO,aAAa,CAAC,KAAK,CAAC,CAAC;AAC/E,MAAM,MAAM,uBAAuB,GAC7B,iBAAiB,CAAC,OAAO,aAAa,CAAC,UAAU,CAAC,GAClD;IACE,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC9B,CAAC;AAEN,MAAM,MAAM,aAAa,GACnB,oBAAoB,GACpB,iBAAiB,GACjB,mBAAmB,GACnB,gBAAgB,GAChB,kBAAkB,GAClB,uBAAuB,CAAC;AAE9B,qEAAqE;AACrE,MAAM,MAAM,SAAS,GAAG;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,0CAA0C;AAC1C,MAAM,MAAM,cAAc,GAAG;IACzB,iBAAiB,EAAE,OAAO,CAAC;CAC9B,CAAC"}
|
package/esm/dif/definitions.js
CHANGED
package/esm/dif/dif-handler.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { JSRuntime, RuntimeDIFHandle } from "../datex.js";
|
|
2
2
|
import { Ref } from "../refs/ref.js";
|
|
3
|
-
import { type DIFPointerAddress, type DIFProperty,
|
|
3
|
+
import { type DIFPointerAddress, type DIFProperty, DIFSharedValueMutability, type DIFTypeDefinition, type DIFUpdate, type DIFUpdateData, type DIFValue, type DIFValueContainer, type ObserveOptions } from "./definitions.js";
|
|
4
4
|
import { type TypeBinding, TypeRegistry } from "./type-registry.js";
|
|
5
5
|
export declare const IS_PROXY_ACCESS: unique symbol;
|
|
6
6
|
export type CustomReferenceMetadata = Record<string | symbol, unknown> & {
|
|
@@ -56,13 +56,13 @@ export declare class DIFHandler {
|
|
|
56
56
|
*/
|
|
57
57
|
executeSyncDIF(datexScript: string, values?: unknown[] | null): DIFValueContainer;
|
|
58
58
|
/**
|
|
59
|
-
* Creates a new
|
|
59
|
+
* Creates a new shared value for the specified DIF value.
|
|
60
60
|
* @param difValueContainer - The DIFValueContainer value to create a pointer for.
|
|
61
61
|
* @param allowedType - The allowed type for the pointer.
|
|
62
62
|
* @param mutability - The mutability of the pointer.
|
|
63
63
|
* @returns The created pointer address.
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
createSharedValueFromDIFValue(difValueContainer: DIFValueContainer, allowedType: (DIFTypeDefinition | null) | undefined, mutability: DIFSharedValueMutability): string;
|
|
66
66
|
/**
|
|
67
67
|
* Updates the DIF value at the specified address.
|
|
68
68
|
* @param address - The address of the DIF value to update.
|
|
@@ -218,7 +218,7 @@ export declare class DIFHandler {
|
|
|
218
218
|
* Initializes a reference with the given value and mutability, by
|
|
219
219
|
* adding a proxy wrapper if necessary, and setting up observation and caching on the JS side.
|
|
220
220
|
*/
|
|
221
|
-
protected initReference<T>(pointerAddress: string, value: T, mutability:
|
|
221
|
+
protected initReference<T>(pointerAddress: string, value: T, mutability: DIFSharedValueMutability, allowedType?: DIFTypeDefinition | null): T | Ref<T>;
|
|
222
222
|
/**
|
|
223
223
|
* Handles a pointer update received from the DATEX core runtime.
|
|
224
224
|
* for non-primitive values.
|
|
@@ -249,7 +249,7 @@ export declare class DIFHandler {
|
|
|
249
249
|
* but also propagates changes between JS and the DATEX runtime.
|
|
250
250
|
* If a reference for the given value already exists, an error is thrown.
|
|
251
251
|
*/
|
|
252
|
-
createTransparentReference<V, M extends
|
|
252
|
+
createTransparentReference<V, M extends DIFSharedValueMutability = typeof DIFSharedValueMutability.Mutable>(value: V, allowedType?: DIFTypeDefinition | null, mutability?: M): PointerOut<V, M>;
|
|
253
253
|
protected isPrimitiveValue(value: unknown): value is null | undefined | boolean | number | bigint | string | symbol;
|
|
254
254
|
protected isWeakKey(value: unknown): value is WeakKey;
|
|
255
255
|
/**
|
|
@@ -325,10 +325,10 @@ export type AssignableRef<T> = Ref<T> | T & {
|
|
|
325
325
|
};
|
|
326
326
|
type Builtins = ((...args: unknown[]) => unknown) | Date | RegExp | Map<unknown, unknown> | Set<unknown> | WeakMap<WeakKey, unknown> | WeakSet<WeakKey> | Array<unknown>;
|
|
327
327
|
type IsPlainObject<T> = T extends Builtins ? false : T extends object ? true : false;
|
|
328
|
-
export type PointerOut<V, M extends
|
|
328
|
+
export type PointerOut<V, M extends DIFSharedValueMutability> = V extends Ref<infer U> ? M extends typeof DIFSharedValueMutability.Immutable ? Ref<U> : AssignableRef<U> : IsPlainObject<V> extends true ? (M extends typeof DIFSharedValueMutability.Immutable ? {
|
|
329
329
|
readonly [K in keyof V]: V[K];
|
|
330
330
|
} : {
|
|
331
331
|
[K in keyof V]: V[K];
|
|
332
|
-
}) : V extends PrimitiveValue ? Ref<M extends typeof
|
|
332
|
+
}) : V extends PrimitiveValue ? Ref<M extends typeof DIFSharedValueMutability["Immutable"] ? V : WidenLiteral<V>> : V;
|
|
333
333
|
export {};
|
|
334
334
|
//# sourceMappingURL=dif-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dif-handler.d.ts","sourceRoot":"","sources":["../../src/dif/dif-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"dif-handler.d.ts","sourceRoot":"","sources":["../../src/dif/dif-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAGrC,OAAO,EAIH,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAEhB,wBAAwB,EACxB,KAAK,iBAAiB,EAEtB,KAAK,SAAS,EACd,KAAK,aAAa,EAElB,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACtB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,WAAW,EAA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AG,KAAK,GAC5C,CAAC,SAAS,MAAM,GAAG,IAAI,GACvB,KAAK,CAAC;AAcZ,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,wBAAwB,IAAI,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC,GAChF,CAAC,SAAS,OAAO,wBAAwB,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,GAC5D,aAAa,CAAC,CAAC,CAAC,GAChB,aAAa,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,CAC1B,CAAC,SAAS,OAAO,wBAAwB,CAAC,SAAS,GAAG;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,GACjF;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAMjC,GACH,CAAC,SAAS,cAAc,GAAG,GAAG,CACxB,CAAC,SAAS,OAAO,wBAAwB,CAAC,WAAW,CAAC,GAAG,CAAC,GACpD,YAAY,CAAC,CAAC,CAAC,CACxB,GACH,CAAC,CAAC"}
|
package/esm/dif/dif-handler.js
CHANGED
|
@@ -12,7 +12,8 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
12
12
|
var _DIFHandler_runtime, _DIFHandler_handle, _DIFHandler_transceiver_id, _DIFHandler_cache, _DIFHandler_proxyMapping, _DIFHandler_referenceMetadata, _DIFHandler_observers, _DIFHandler_type_registry;
|
|
13
13
|
import { Ref } from "../refs/ref.js";
|
|
14
14
|
import { Endpoint } from "../lib/special-core-types/endpoint.js";
|
|
15
|
-
import {
|
|
15
|
+
import { Range } from "../lib/special-core-types/range.js";
|
|
16
|
+
import { DIFSharedValueMutability, DIFTypeDefinitionKind, DIFUpdateKind, } from "./definitions.js";
|
|
16
17
|
import { CoreTypeAddress, CoreTypeAddressRanges } from "./core.js";
|
|
17
18
|
import { TypeRegistry } from "./type-registry.js";
|
|
18
19
|
import { panic } from "../utils/exceptions.js";
|
|
@@ -99,13 +100,13 @@ export class DIFHandler {
|
|
|
99
100
|
return __classPrivateFieldGet(this, _DIFHandler_runtime, "f").execute_sync(datexScript, this.convertToDIFValues(values));
|
|
100
101
|
}
|
|
101
102
|
/**
|
|
102
|
-
* Creates a new
|
|
103
|
+
* Creates a new shared value for the specified DIF value.
|
|
103
104
|
* @param difValueContainer - The DIFValueContainer value to create a pointer for.
|
|
104
105
|
* @param allowedType - The allowed type for the pointer.
|
|
105
106
|
* @param mutability - The mutability of the pointer.
|
|
106
107
|
* @returns The created pointer address.
|
|
107
108
|
*/
|
|
108
|
-
|
|
109
|
+
createSharedValueFromDIFValue(difValueContainer, allowedType = null, mutability) {
|
|
109
110
|
return __classPrivateFieldGet(this, _DIFHandler_handle, "f").create_pointer(difValueContainer, allowedType, mutability);
|
|
110
111
|
}
|
|
111
112
|
/**
|
|
@@ -277,6 +278,22 @@ export class DIFHandler {
|
|
|
277
278
|
else if (type === CoreTypeAddress.endpoint) {
|
|
278
279
|
return Endpoint.get(value.value);
|
|
279
280
|
}
|
|
281
|
+
else if (type === CoreTypeAddress.range) {
|
|
282
|
+
const [start, end] = value.value;
|
|
283
|
+
const result = this.promiseAllOrSync([
|
|
284
|
+
this.resolveDIFValueContainer(start),
|
|
285
|
+
this.resolveDIFValueContainer(end),
|
|
286
|
+
]);
|
|
287
|
+
if (result instanceof Promise) {
|
|
288
|
+
return result.then(([start, end]) => {
|
|
289
|
+
return new Range(start, end);
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
const [start, end] = result;
|
|
294
|
+
return new Range(start, end);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
280
297
|
else if (type === CoreTypeAddress.list) {
|
|
281
298
|
return this.promiseAllOrSync(value.value.map((v) => this.resolveDIFValueContainer(v)));
|
|
282
299
|
} // map types are resolved from a DIFObject (aka JS Map) or Array of key-value pairs to a JS object
|
|
@@ -504,7 +521,7 @@ export class DIFHandler {
|
|
|
504
521
|
let typeBinding = null;
|
|
505
522
|
let metadata = undefined;
|
|
506
523
|
// bind js value (if mutable, nominal type)
|
|
507
|
-
const bindJSValue = mutability !==
|
|
524
|
+
const bindJSValue = mutability !== DIFSharedValueMutability.Immutable &&
|
|
508
525
|
typeof allowedType == "string";
|
|
509
526
|
if (bindJSValue && !(wrappedValue instanceof Ref)) {
|
|
510
527
|
typeBinding = this.type_registry.getTypeBinding(allowedType);
|
|
@@ -517,7 +534,7 @@ export class DIFHandler {
|
|
|
517
534
|
}
|
|
518
535
|
// if not immutable, observe to keep the pointer 'live' and receive updates
|
|
519
536
|
let observerId = null;
|
|
520
|
-
if (mutability !==
|
|
537
|
+
if (mutability !== DIFSharedValueMutability.Immutable) {
|
|
521
538
|
observerId = this.observePointerBindDirect(pointerAddress, (update) => {
|
|
522
539
|
// if source_id is not own transceiver id, handle pointer update
|
|
523
540
|
if (update.source_id !== __classPrivateFieldGet(this, _DIFHandler_transceiver_id, "f")) {
|
|
@@ -619,14 +636,14 @@ export class DIFHandler {
|
|
|
619
636
|
* but also propagates changes between JS and the DATEX runtime.
|
|
620
637
|
* If a reference for the given value already exists, an error is thrown.
|
|
621
638
|
*/
|
|
622
|
-
createTransparentReference(value, allowedType = null, mutability =
|
|
639
|
+
createTransparentReference(value, allowedType = null, mutability = DIFSharedValueMutability.Mutable) {
|
|
623
640
|
// if already bound to a reference, return the existing reference proxy (or the value itself)
|
|
624
641
|
const pointerAddress = this.getPointerAddressForValue(value);
|
|
625
642
|
if (pointerAddress) {
|
|
626
643
|
throw new Error(`Value is already bound to a reference ($${pointerAddress}). Cannot create a new reference for the same value.`);
|
|
627
644
|
}
|
|
628
645
|
const difValue = this.convertJSValueToDIFValueContainer(value);
|
|
629
|
-
const ptrAddress = this.
|
|
646
|
+
const ptrAddress = this.createSharedValueFromDIFValue(difValue, allowedType, mutability);
|
|
630
647
|
// get inferred allowed type from pointer if not explicitly set
|
|
631
648
|
if (!allowedType) {
|
|
632
649
|
allowedType = __classPrivateFieldGet(this, _DIFHandler_handle, "f").resolve_pointer_address_sync(ptrAddress).allowed_type;
|
|
@@ -794,6 +811,15 @@ export class DIFHandler {
|
|
|
794
811
|
value: value.toString(),
|
|
795
812
|
};
|
|
796
813
|
}
|
|
814
|
+
else if (value instanceof Range) {
|
|
815
|
+
return {
|
|
816
|
+
type: CoreTypeAddress.range,
|
|
817
|
+
value: [
|
|
818
|
+
this.convertJSValueToDIFValueContainer(value.start),
|
|
819
|
+
this.convertJSValueToDIFValueContainer(value.end),
|
|
820
|
+
],
|
|
821
|
+
};
|
|
822
|
+
}
|
|
797
823
|
else if (Array.isArray(value)) {
|
|
798
824
|
return {
|
|
799
825
|
value: value.map((v) => this.convertJSValueToDIFValueContainer(v)),
|
package/esm/dif/display.d.ts
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* @description
|
|
4
4
|
* This module contains helper functions to convert DIF structures to display strings.
|
|
5
5
|
*/
|
|
6
|
-
import { type
|
|
6
|
+
import { type DIFRepresentationValue, type DIFSharedValue, DIFSharedValueMutability, type DIFTypeDefinition, type DIFValueContainer } from "./definitions.js";
|
|
7
7
|
/**
|
|
8
8
|
* Converts a DIF reference mutability to a display string.
|
|
9
9
|
*/
|
|
10
|
-
export declare function mutabilityToDisplayString(mut:
|
|
10
|
+
export declare function mutabilityToDisplayString(mut: DIFSharedValueMutability): string;
|
|
11
11
|
/**
|
|
12
12
|
* Converts a DIF reference to a display string.
|
|
13
13
|
*/
|
|
14
|
-
export declare function difReferenceToDisplayString(reference:
|
|
14
|
+
export declare function difReferenceToDisplayString(reference: DIFSharedValue): string;
|
|
15
15
|
/**
|
|
16
16
|
* Converts a DIF value container to a display string.
|
|
17
17
|
*/
|
package/esm/dif/display.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/dif/display.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACH,KAAK,
|
|
1
|
+
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/dif/display.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACH,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,wBAAwB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACzB,MAAM,kBAAkB,CAAC;AAG1B;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,wBAAwB,GAAG,MAAM,CAO/E;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACvC,SAAS,EAAE,cAAc,GAC1B,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC5C,SAAS,EAAE,iBAAiB,GAC7B,MAAM,CAcR;AAED;;GAEG;AACH,wBAAgB,qCAAqC,CACjD,WAAW,EAAE,sBAAsB,GACpC,MAAM,CAuBR;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC5C,OAAO,EAAE,iBAAiB,GAC3B,MAAM,CAMR;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAS9D"}
|
package/esm/dif/display.js
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
* @description
|
|
4
4
|
* This module contains helper functions to convert DIF structures to display strings.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { DIFSharedValueMutability, } from "./definitions.js";
|
|
7
7
|
import { CoreTypeAddress } from "./core.js";
|
|
8
8
|
/**
|
|
9
9
|
* Converts a DIF reference mutability to a display string.
|
|
10
10
|
*/
|
|
11
11
|
export function mutabilityToDisplayString(mut) {
|
|
12
|
-
if (mut ===
|
|
12
|
+
if (mut === DIFSharedValueMutability.Mutable) {
|
|
13
13
|
return "&mut ";
|
|
14
14
|
}
|
|
15
|
-
else if (mut ===
|
|
15
|
+
else if (mut === DIFSharedValueMutability.Immutable) {
|
|
16
16
|
return "&";
|
|
17
17
|
}
|
|
18
18
|
throw new Error("Unknown mutability: " + mut);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../../src/lib/special-core-types/endpoint.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;IAIzB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../../src/lib/special-core-types/endpoint.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;IAIzB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;IAED,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;CACJ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a range of numbers with a start and end.
|
|
3
|
+
*/
|
|
4
|
+
export declare class Range {
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
constructor(start: number, end: number);
|
|
8
|
+
/**
|
|
9
|
+
* Gets the length of the range (end - start).
|
|
10
|
+
*/
|
|
11
|
+
get length(): number;
|
|
12
|
+
/**
|
|
13
|
+
* Checks if a given value is within the range (inclusive of start, exclusive of end).
|
|
14
|
+
* @param value The number to check.
|
|
15
|
+
* @returns True if the value is within the range, false otherwise.
|
|
16
|
+
*/
|
|
17
|
+
contains(value: number): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Turns a string representation of the range in the format
|
|
20
|
+
* @returns The string representation of the range.
|
|
21
|
+
*/
|
|
22
|
+
toString(): string;
|
|
23
|
+
get [Symbol.toStringTag](): string;
|
|
24
|
+
get [Symbol.toPrimitive](): string;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=range.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../../src/lib/special-core-types/range.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,KAAK;IACK,KAAK,EAAE,MAAM;IAAS,GAAG,EAAE,MAAM;gBAAjC,KAAK,EAAE,MAAM,EAAS,GAAG,EAAE,MAAM;IAEpD;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIvC;;;OAGG;IACI,QAAQ,IAAI,MAAM;IAIzB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;IACD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;CACJ"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a range of numbers with a start and end.
|
|
3
|
+
*/
|
|
4
|
+
export class Range {
|
|
5
|
+
constructor(start, end) {
|
|
6
|
+
Object.defineProperty(this, "start", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value: start
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(this, "end", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: end
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Gets the length of the range (end - start).
|
|
21
|
+
*/
|
|
22
|
+
get length() {
|
|
23
|
+
return this.end - this.start;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Checks if a given value is within the range (inclusive of start, exclusive of end).
|
|
27
|
+
* @param value The number to check.
|
|
28
|
+
* @returns True if the value is within the range, false otherwise.
|
|
29
|
+
*/
|
|
30
|
+
contains(value) {
|
|
31
|
+
return value >= this.start && value < this.end;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Turns a string representation of the range in the format
|
|
35
|
+
* @returns The string representation of the range.
|
|
36
|
+
*/
|
|
37
|
+
toString() {
|
|
38
|
+
return `${this.start}..${this.end}`;
|
|
39
|
+
}
|
|
40
|
+
get [Symbol.toStringTag]() {
|
|
41
|
+
return this.toString();
|
|
42
|
+
}
|
|
43
|
+
get [Symbol.toPrimitive]() {
|
|
44
|
+
return this.toString();
|
|
45
|
+
}
|
|
46
|
+
}
|
package/esm/mod.d.ts
CHANGED
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
export * from "./runtime/runtime.js";
|
|
23
23
|
export * as DIF from "./dif/mod.js";
|
|
24
24
|
export * as Network from "./network/mod.js";
|
|
25
|
+
export * from "./lib/special-core-types/endpoint.js";
|
|
26
|
+
export * from "./lib/special-core-types/range.js";
|
|
25
27
|
export * from "./refs/ref.js";
|
|
28
|
+
export * from "./repl/mod.js";
|
|
26
29
|
import "./utils/devtools-formatter.js";
|
|
27
30
|
//# sourceMappingURL=mod.d.ts.map
|
package/esm/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,qBAAqB,CAAC;AAG7B,cAAc,sBAAsB,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,OAAO,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,qBAAqB,CAAC;AAG7B,cAAc,sBAAsB,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,OAAO,+BAA+B,CAAC"}
|
package/esm/mod.js
CHANGED
|
@@ -22,5 +22,8 @@
|
|
|
22
22
|
export * from "./runtime/runtime.js";
|
|
23
23
|
export * as DIF from "./dif/mod.js";
|
|
24
24
|
export * as Network from "./network/mod.js";
|
|
25
|
+
export * from "./lib/special-core-types/endpoint.js";
|
|
26
|
+
export * from "./lib/special-core-types/range.js";
|
|
25
27
|
export * from "./refs/ref.js";
|
|
28
|
+
export * from "./repl/mod.js";
|
|
26
29
|
import "./utils/devtools-formatter.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/repl/mod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,qBAAa,IAAI;;IAED,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,OAAO,EAAE,OAAO,UAAQ;IAIxC,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAKxD"}
|
package/esm/repl/mod.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
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 _Repl_repl;
|
|
13
|
+
import { Repl as ReplInternal } from "../datex.js";
|
|
14
|
+
export class Repl {
|
|
15
|
+
constructor(runtime, verbose = false) {
|
|
16
|
+
Object.defineProperty(this, "runtime", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: runtime
|
|
21
|
+
});
|
|
22
|
+
_Repl_repl.set(this, void 0);
|
|
23
|
+
__classPrivateFieldSet(this, _Repl_repl, new ReplInternal(runtime._runtime, verbose), "f");
|
|
24
|
+
}
|
|
25
|
+
async execute(script) {
|
|
26
|
+
const result = await __classPrivateFieldGet(this, _Repl_repl, "f").execute(script);
|
|
27
|
+
const jsValue = this.runtime.dif.resolveDIFValueContainerSync(result);
|
|
28
|
+
return this.runtime.valueToString(jsValue);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
_Repl_repl = new WeakMap();
|
package/esm/runtime/runtime.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type DecompileOptions, type JSRuntime } from "../datex.js";
|
|
2
2
|
import { ComHub } from "../network/com-hub.js";
|
|
3
3
|
import { DIFHandler, type PointerOut } from "../dif/dif-handler.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { DIFSharedValueMutability, DIFTypeDefinition } from "../dif/definitions.js";
|
|
5
5
|
import type { Ref } from "../refs/ref.js";
|
|
6
6
|
/** debug flags for the runtime */
|
|
7
7
|
interface DebugConfig {
|
|
@@ -115,7 +115,6 @@ export declare class Runtime {
|
|
|
115
115
|
* @returns The string representation of the value.
|
|
116
116
|
*/
|
|
117
117
|
valueToString(value: unknown, decompileOptions?: DecompileOptions | null): string;
|
|
118
|
-
_execute_internal(datexScript: string): boolean;
|
|
119
118
|
/**
|
|
120
119
|
* Creates a new reference containg the given JS value.
|
|
121
120
|
* For primitive values, a Ref wrapper is returned.
|
|
@@ -126,7 +125,7 @@ export declare class Runtime {
|
|
|
126
125
|
* @param mutability Optional mutability of the reference (default is Mutable).
|
|
127
126
|
* @returns A proxy object representing the pointer in JS.
|
|
128
127
|
*/
|
|
129
|
-
createTransparentReference<V, M extends
|
|
128
|
+
createTransparentReference<V, M extends DIFSharedValueMutability = typeof DIFSharedValueMutability.Mutable>(value: V & {}, allowedType?: DIFTypeDefinition | null, mutability?: M): PointerOut<V, M>;
|
|
130
129
|
/**
|
|
131
130
|
* Creates or retrieves a wrapped reference for the given value.
|
|
132
131
|
* If the value is already a reference, it returns the existing reference.
|
|
@@ -136,7 +135,7 @@ export declare class Runtime {
|
|
|
136
135
|
* @param mutability
|
|
137
136
|
* @returns
|
|
138
137
|
*/
|
|
139
|
-
createOrGetWrappedReference<V, M extends
|
|
138
|
+
createOrGetWrappedReference<V, M extends DIFSharedValueMutability = typeof DIFSharedValueMutability.Mutable>(_value: V, _allowedType?: DIFTypeDefinition | null, _mutability?: M): Ref<V>;
|
|
140
139
|
startLSP(callback: (data: string) => void): (data: string) => void;
|
|
141
140
|
}
|
|
142
141
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAO1C,kCAAkC;AAClC,UAAU,WAAW;IAEjB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;CACpE;AAED,qCAAqC;AACrC,MAAM,MAAM,aAAa,GAAG;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,qBAAa,OAAO;;IAChB,SAAgB,UAAU,SAAW;IAMrC,OAAO;IAMP;;;;;OAKG;WACiB,MAAM,CACtB,MAAM,EAAE,aAAa,EACrB,WAAW,CAAC,EAAE,WAAW,GAC1B,OAAO,CAAC,OAAO,CAAC;IAOnB;;OAEG;IACH,IAAI,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BAA0B,CAC7B,CAAC,EACD,CAAC,SAAS,wBAAwB,GAAG,OAAO,wBAAwB,CAAC,OAAO,EAG5E,KAAK,EAAE,CAAC,GAAG,EAAE,EACb,WAAW,CAAC,EAAE,iBAAiB,GAAG,IAAI,EACtC,UAAU,CAAC,EAAE,CAAC,GACf,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC;IAQnB;;;;;;;;OAQG;IACI,2BAA2B,CAC9B,CAAC,EACD,CAAC,SAAS,wBAAwB,GAAG,OAAO,wBAAwB,CAAC,OAAO,EAE5E,MAAM,EAAE,CAAC,EACT,YAAY,CAAC,EAAE,iBAAiB,GAAG,IAAI,EACvC,WAAW,CAAC,EAAE,CAAC,GAChB,GAAG,CAAC,CAAC,CAAC;IAIF,QAAQ,CACX,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GACjC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;CAY5B"}
|
package/esm/runtime/runtime.js
CHANGED
|
@@ -10,13 +10,13 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
12
|
var _Runtime_instances, _Runtime_runtime, _Runtime_comHub, _Runtime_difHandler, _Runtime_executeInternal, _Runtime_executeSyncInternal, _Runtime_getScriptAndValues;
|
|
13
|
-
import { create_runtime
|
|
13
|
+
import { create_runtime } from "../datex.js";
|
|
14
14
|
import { ComHub } from "../network/com-hub.js";
|
|
15
15
|
import { DIFHandler } from "../dif/dif-handler.js";
|
|
16
16
|
import { unimplemented } from "../utils/exceptions.js";
|
|
17
17
|
// TODO: move to global.ts
|
|
18
18
|
/** auto-generated version - do not edit: */
|
|
19
|
-
const VERSION = "0.0.
|
|
19
|
+
const VERSION = "0.0.14";
|
|
20
20
|
/**
|
|
21
21
|
* The main Runtime class for executing Datex scripts and managing communication interfaces.
|
|
22
22
|
*/
|
|
@@ -116,9 +116,6 @@ export class Runtime {
|
|
|
116
116
|
valueToString(value, decompileOptions = null) {
|
|
117
117
|
return __classPrivateFieldGet(this, _Runtime_runtime, "f").value_to_string(__classPrivateFieldGet(this, _Runtime_difHandler, "f").convertJSValueToDIFValueContainer(value), decompileOptions);
|
|
118
118
|
}
|
|
119
|
-
_execute_internal(datexScript) {
|
|
120
|
-
return execute_internal(datexScript);
|
|
121
|
-
}
|
|
122
119
|
/**
|
|
123
120
|
* Creates a new reference containg the given JS value.
|
|
124
121
|
* For primitive values, a Ref wrapper is returned.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Endpoint } from "../lib/special-core-types/endpoint.js";
|
|
2
|
+
import { Range } from "../lib/special-core-types/range.js";
|
|
2
3
|
import { Ref } from "../refs/ref.js";
|
|
3
4
|
// @ts-ignore devtoolsFormatters
|
|
4
5
|
globalThis.devtoolsFormatters = [
|
|
@@ -28,6 +29,27 @@ globalThis.devtoolsFormatters = [
|
|
|
28
29
|
],
|
|
29
30
|
];
|
|
30
31
|
}
|
|
32
|
+
else if (obj instanceof Range) {
|
|
33
|
+
return [
|
|
34
|
+
"span",
|
|
35
|
+
{},
|
|
36
|
+
[
|
|
37
|
+
"span",
|
|
38
|
+
{},
|
|
39
|
+
["span", { style: "color: #d57258" }, `${obj.start}`],
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"span",
|
|
43
|
+
{},
|
|
44
|
+
["span", {}, `..`],
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"span",
|
|
48
|
+
{},
|
|
49
|
+
["span", { style: "color: #d57258" }, `${obj.end}`],
|
|
50
|
+
],
|
|
51
|
+
];
|
|
52
|
+
}
|
|
31
53
|
return null; // fall back to default
|
|
32
54
|
},
|
|
33
55
|
hasBody(_) {
|