logic-mesh 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -33,11 +33,11 @@ export type JsBlock = {
33
33
  desc: BlockDesc
34
34
 
35
35
  /**
36
- * The block function
36
+ * An optional block function that is called when the block is executed.
37
37
  * @param inputs The block inputs that have been set
38
38
  * @returns The block outputs that have to be set
39
39
  */
40
- function: (inputs: unknown[]) => Promise<unknown[]>
40
+ function?: (inputs: unknown[]) => Promise<unknown[]>
41
41
  }
42
42
 
43
43
  /**
package/logic_mesh.d.ts CHANGED
@@ -32,16 +32,17 @@ export class BlocksEngine {
32
32
  *
33
33
  * # Arguments
34
34
  * * `desc` - The description of the block
35
- * * `func` - The function that implements the block
35
+ * * `func` - Optional function that implements the block
36
+ * logic. If not provided, the block would do nothing.
36
37
  *
37
38
  * # Returns
38
39
  * The name of the block
39
40
  *
40
41
  * @param {any} desc
41
- * @param {Function} func
42
+ * @param {Function | undefined} func
42
43
  * @returns {string}
43
44
  */
44
- registerBlock(desc: any, func: Function): string;
45
+ registerBlock(desc: any, func?: Function): string;
45
46
  /**
46
47
  * @returns {EngineCommand}
47
48
  */
package/logic_mesh_bg.js CHANGED
@@ -312,13 +312,14 @@ export class BlocksEngine {
312
312
  *
313
313
  * # Arguments
314
314
  * * `desc` - The description of the block
315
- * * `func` - The function that implements the block
315
+ * * `func` - Optional function that implements the block
316
+ * logic. If not provided, the block would do nothing.
316
317
  *
317
318
  * # Returns
318
319
  * The name of the block
319
320
  *
320
321
  * @param {any} desc
321
- * @param {Function} func
322
+ * @param {Function | undefined} func
322
323
  * @returns {string}
323
324
  */
324
325
  registerBlock(desc, func) {
@@ -326,7 +327,7 @@ export class BlocksEngine {
326
327
  let deferred2_1;
327
328
  try {
328
329
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
329
- wasm.blocksengine_registerBlock(retptr, this.__wbg_ptr, addHeapObject(desc), addHeapObject(func));
330
+ wasm.blocksengine_registerBlock(retptr, this.__wbg_ptr, addHeapObject(desc), isLikeNone(func) ? 0 : addHeapObject(func));
330
331
  var r0 = getInt32Memory0()[retptr / 4 + 0];
331
332
  var r1 = getInt32Memory0()[retptr / 4 + 1];
332
333
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -1027,8 +1028,8 @@ export function __wbindgen_memory() {
1027
1028
  return addHeapObject(ret);
1028
1029
  };
1029
1030
 
1030
- export function __wbindgen_closure_wrapper2599(arg0, arg1, arg2) {
1031
- const ret = makeMutClosure(arg0, arg1, 966, __wbg_adapter_50);
1031
+ export function __wbindgen_closure_wrapper2705(arg0, arg1, arg2) {
1032
+ const ret = makeMutClosure(arg0, arg1, 983, __wbg_adapter_50);
1032
1033
  return addHeapObject(ret);
1033
1034
  };
1034
1035
 
Binary file
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "Radu Racariu <radu.racariu@gmail.com>"
5
5
  ],
6
6
  "description": "Control logic engine using event based and reactive blocks written in Rust.",
7
- "version": "0.1.3",
7
+ "version": "0.1.4",
8
8
  "license": "BSD-3-Clause",
9
9
  "repository": {
10
10
  "type": "git",