nucleation 0.1.101 → 0.1.103

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.
@@ -243,10 +243,6 @@ export function debug_schematic(schematic) {
243
243
  }
244
244
  }
245
245
 
246
- export function start() {
247
- wasm.start();
248
- }
249
-
250
246
  /**
251
247
  * @param {SchematicWrapper} schematic
252
248
  * @returns {string}
@@ -265,6 +261,13 @@ export function debug_json_schematic(schematic) {
265
261
  }
266
262
  }
267
263
 
264
+ /**
265
+ * Initialize WASM module with panic hook for better error messages
266
+ */
267
+ export function start() {
268
+ wasm.start();
269
+ }
270
+
268
271
  let cachedUint32ArrayMemory0 = null;
269
272
 
270
273
  function getUint32ArrayMemory0() {
@@ -2072,6 +2075,19 @@ export class TypedCircuitExecutorWrapper {
2072
2075
  const ptr = this.__destroy_into_raw();
2073
2076
  wasm.__wbg_typedcircuitexecutorwrapper_free(ptr, 0);
2074
2077
  }
2078
+ /**
2079
+ * Create executor from Insign annotations in schematic
2080
+ * @param {SchematicWrapper} schematic
2081
+ * @returns {TypedCircuitExecutorWrapper}
2082
+ */
2083
+ static fromInsign(schematic) {
2084
+ _assertClass(schematic, SchematicWrapper);
2085
+ const ret = wasm.typedcircuitexecutorwrapper_fromInsign(schematic.__wbg_ptr);
2086
+ if (ret[2]) {
2087
+ throw takeFromExternrefTable0(ret[1]);
2088
+ }
2089
+ return TypedCircuitExecutorWrapper.__wrap(ret[0]);
2090
+ }
2075
2091
  /**
2076
2092
  * Create executor from world and layout
2077
2093
  * @param {MchprsWorldWrapper} world
@@ -2341,6 +2357,17 @@ function __wbg_get_imports() {
2341
2357
  const ret = Object.entries(arg0);
2342
2358
  return ret;
2343
2359
  };
2360
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
2361
+ let deferred0_0;
2362
+ let deferred0_1;
2363
+ try {
2364
+ deferred0_0 = arg0;
2365
+ deferred0_1 = arg1;
2366
+ console.error(getStringFromWasm0(arg0, arg1));
2367
+ } finally {
2368
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2369
+ }
2370
+ };
2344
2371
  imports.wbg.__wbg_error_a7f8fbb0523dae15 = function(arg0) {
2345
2372
  console.error(arg0);
2346
2373
  };
@@ -2389,6 +2416,10 @@ function __wbg_get_imports() {
2389
2416
  const ret = new Map();
2390
2417
  return ret;
2391
2418
  };
2419
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
2420
+ const ret = new Error();
2421
+ return ret;
2422
+ };
2392
2423
  imports.wbg.__wbg_new_e17d9f43105b08be = function() {
2393
2424
  const ret = new Array();
2394
2425
  return ret;
@@ -2419,6 +2450,13 @@ function __wbg_get_imports() {
2419
2450
  const ret = Reflect.set(arg0, arg1, arg2);
2420
2451
  return ret;
2421
2452
  }, arguments) };
2453
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
2454
+ const ret = arg1.stack;
2455
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2456
+ const len1 = WASM_VECTOR_LEN;
2457
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2458
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2459
+ };
2422
2460
  imports.wbg.__wbg_warn_1d74dddbe2fd1dbb = function(arg0) {
2423
2461
  console.warn(arg0);
2424
2462
  };
package/nucleation.d.ts CHANGED
@@ -1,8 +1,11 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export function debug_schematic(schematic: SchematicWrapper): string;
4
- export function start(): void;
5
4
  export function debug_json_schematic(schematic: SchematicWrapper): string;
5
+ /**
6
+ * Initialize WASM module with panic hook for better error messages
7
+ */
8
+ export function start(): void;
6
9
  export class BlockPosition {
7
10
  free(): void;
8
11
  [Symbol.dispose](): void;
@@ -486,6 +489,10 @@ export class TypedCircuitExecutorWrapper {
486
489
  private constructor();
487
490
  free(): void;
488
491
  [Symbol.dispose](): void;
492
+ /**
493
+ * Create executor from Insign annotations in schematic
494
+ */
495
+ static fromInsign(schematic: SchematicWrapper): TypedCircuitExecutorWrapper;
489
496
  /**
490
497
  * Create executor from world and layout
491
498
  */
@@ -690,6 +697,7 @@ export interface InitOutput {
690
697
  readonly simulationoptionswrapper_set_io_only: (a: number, b: number) => void;
691
698
  readonly simulationoptionswrapper_set_optimize: (a: number, b: number) => void;
692
699
  readonly typedcircuitexecutorwrapper_execute: (a: number, b: any, c: number) => [number, number, number];
700
+ readonly typedcircuitexecutorwrapper_fromInsign: (a: number) => [number, number, number];
693
701
  readonly typedcircuitexecutorwrapper_fromLayout: (a: number, b: number) => [number, number, number];
694
702
  readonly typedcircuitexecutorwrapper_fromLayoutWithOptions: (a: number, b: number, c: number) => [number, number, number];
695
703
  readonly typedcircuitexecutorwrapper_reset: (a: number) => [number, number];
@@ -701,9 +709,9 @@ export interface InitOutput {
701
709
  readonly valuewrapper_fromU32: (a: number) => number;
702
710
  readonly valuewrapper_toJs: (a: number) => any;
703
711
  readonly valuewrapper_typeName: (a: number) => [number, number];
712
+ readonly start: () => void;
704
713
  readonly schematicwrapper_create_simulation_world_with_options: (a: number, b: number) => [number, number, number];
705
714
  readonly schematicwrapper_create_simulation_world: (a: number) => [number, number, number];
706
- readonly start: () => void;
707
715
  readonly __wbg_blockposition_free: (a: number, b: number) => void;
708
716
  readonly __wbg_get_blockposition_x: (a: number) => number;
709
717
  readonly __wbg_get_blockposition_y: (a: number) => number;
@@ -714,10 +722,10 @@ export interface InitOutput {
714
722
  readonly blockposition_new: (a: number, b: number, c: number) => number;
715
723
  readonly __wbindgen_malloc: (a: number, b: number) => number;
716
724
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
725
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
717
726
  readonly __wbindgen_exn_store: (a: number) => void;
718
727
  readonly __externref_table_alloc: () => number;
719
728
  readonly __wbindgen_externrefs: WebAssembly.Table;
720
- readonly __wbindgen_free: (a: number, b: number, c: number) => void;
721
729
  readonly __externref_drop_slice: (a: number, b: number) => void;
722
730
  readonly __externref_table_dealloc: (a: number) => void;
723
731
  readonly __wbindgen_start: () => void;
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Nano nano@schem.at"
6
6
  ],
7
7
  "description": "A high-performance Minecraft schematic parser and utility library",
8
- "version": "0.1.101",
8
+ "version": "0.1.103",
9
9
  "license": "AGPL-3.0-only",
10
10
  "repository": {
11
11
  "type": "git",