nucleation 0.1.120 → 0.1.123

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.
@@ -225,23 +225,16 @@ function passArray8ToWasm0(arg, malloc) {
225
225
  WASM_VECTOR_LEN = arg.length;
226
226
  return ptr;
227
227
  }
228
- /**
229
- * Initialize WASM module with panic hook for better error messages
230
- */
231
- export function start() {
232
- wasm.start();
233
- }
234
-
235
228
  /**
236
229
  * @param {SchematicWrapper} schematic
237
230
  * @returns {string}
238
231
  */
239
- export function debug_schematic(schematic) {
232
+ export function debug_json_schematic(schematic) {
240
233
  let deferred1_0;
241
234
  let deferred1_1;
242
235
  try {
243
236
  _assertClass(schematic, SchematicWrapper);
244
- const ret = wasm.debug_schematic(schematic.__wbg_ptr);
237
+ const ret = wasm.debug_json_schematic(schematic.__wbg_ptr);
245
238
  deferred1_0 = ret[0];
246
239
  deferred1_1 = ret[1];
247
240
  return getStringFromWasm0(ret[0], ret[1]);
@@ -254,12 +247,12 @@ export function debug_schematic(schematic) {
254
247
  * @param {SchematicWrapper} schematic
255
248
  * @returns {string}
256
249
  */
257
- export function debug_json_schematic(schematic) {
250
+ export function debug_schematic(schematic) {
258
251
  let deferred1_0;
259
252
  let deferred1_1;
260
253
  try {
261
254
  _assertClass(schematic, SchematicWrapper);
262
- const ret = wasm.debug_json_schematic(schematic.__wbg_ptr);
255
+ const ret = wasm.debug_schematic(schematic.__wbg_ptr);
263
256
  deferred1_0 = ret[0];
264
257
  deferred1_1 = ret[1];
265
258
  return getStringFromWasm0(ret[0], ret[1]);
@@ -268,6 +261,13 @@ export function debug_json_schematic(schematic) {
268
261
  }
269
262
  }
270
263
 
264
+ /**
265
+ * Initialize WASM module with panic hook for better error messages
266
+ */
267
+ export function start() {
268
+ wasm.start();
269
+ }
270
+
271
271
  let cachedUint32ArrayMemory0 = null;
272
272
 
273
273
  function getUint32ArrayMemory0() {
@@ -603,6 +603,104 @@ export class IoLayoutBuilderWrapper {
603
603
  }
604
604
  return IoLayoutBuilderWrapper.__wrap(ret[0]);
605
605
  }
606
+ /**
607
+ * Add an input defined by a region (bounding box)
608
+ * Iterates Y (layers), then X (rows), then Z (columns)
609
+ * @param {string} name
610
+ * @param {IoTypeWrapper} io_type
611
+ * @param {LayoutFunctionWrapper} layout
612
+ * @param {BlockPosition} min
613
+ * @param {BlockPosition} max
614
+ * @returns {IoLayoutBuilderWrapper}
615
+ */
616
+ addInputRegion(name, io_type, layout, min, max) {
617
+ const ptr = this.__destroy_into_raw();
618
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
619
+ const len0 = WASM_VECTOR_LEN;
620
+ _assertClass(io_type, IoTypeWrapper);
621
+ _assertClass(layout, LayoutFunctionWrapper);
622
+ _assertClass(min, BlockPosition);
623
+ var ptr1 = min.__destroy_into_raw();
624
+ _assertClass(max, BlockPosition);
625
+ var ptr2 = max.__destroy_into_raw();
626
+ const ret = wasm.iolayoutbuilderwrapper_addInputRegion(ptr, ptr0, len0, io_type.__wbg_ptr, layout.__wbg_ptr, ptr1, ptr2);
627
+ if (ret[2]) {
628
+ throw takeFromExternrefTable0(ret[1]);
629
+ }
630
+ return IoLayoutBuilderWrapper.__wrap(ret[0]);
631
+ }
632
+ /**
633
+ * Add an output defined by a region (bounding box)
634
+ * Iterates Y (layers), then X (rows), then Z (columns)
635
+ * @param {string} name
636
+ * @param {IoTypeWrapper} io_type
637
+ * @param {LayoutFunctionWrapper} layout
638
+ * @param {BlockPosition} min
639
+ * @param {BlockPosition} max
640
+ * @returns {IoLayoutBuilderWrapper}
641
+ */
642
+ addOutputRegion(name, io_type, layout, min, max) {
643
+ const ptr = this.__destroy_into_raw();
644
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
645
+ const len0 = WASM_VECTOR_LEN;
646
+ _assertClass(io_type, IoTypeWrapper);
647
+ _assertClass(layout, LayoutFunctionWrapper);
648
+ _assertClass(min, BlockPosition);
649
+ var ptr1 = min.__destroy_into_raw();
650
+ _assertClass(max, BlockPosition);
651
+ var ptr2 = max.__destroy_into_raw();
652
+ const ret = wasm.iolayoutbuilderwrapper_addOutputRegion(ptr, ptr0, len0, io_type.__wbg_ptr, layout.__wbg_ptr, ptr1, ptr2);
653
+ if (ret[2]) {
654
+ throw takeFromExternrefTable0(ret[1]);
655
+ }
656
+ return IoLayoutBuilderWrapper.__wrap(ret[0]);
657
+ }
658
+ /**
659
+ * Add an input defined by a region with automatic layout inference
660
+ * @param {string} name
661
+ * @param {IoTypeWrapper} io_type
662
+ * @param {BlockPosition} min
663
+ * @param {BlockPosition} max
664
+ * @returns {IoLayoutBuilderWrapper}
665
+ */
666
+ addInputRegionAuto(name, io_type, min, max) {
667
+ const ptr = this.__destroy_into_raw();
668
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
669
+ const len0 = WASM_VECTOR_LEN;
670
+ _assertClass(io_type, IoTypeWrapper);
671
+ _assertClass(min, BlockPosition);
672
+ var ptr1 = min.__destroy_into_raw();
673
+ _assertClass(max, BlockPosition);
674
+ var ptr2 = max.__destroy_into_raw();
675
+ const ret = wasm.iolayoutbuilderwrapper_addInputRegionAuto(ptr, ptr0, len0, io_type.__wbg_ptr, ptr1, ptr2);
676
+ if (ret[2]) {
677
+ throw takeFromExternrefTable0(ret[1]);
678
+ }
679
+ return IoLayoutBuilderWrapper.__wrap(ret[0]);
680
+ }
681
+ /**
682
+ * Add an output defined by a region with automatic layout inference
683
+ * @param {string} name
684
+ * @param {IoTypeWrapper} io_type
685
+ * @param {BlockPosition} min
686
+ * @param {BlockPosition} max
687
+ * @returns {IoLayoutBuilderWrapper}
688
+ */
689
+ addOutputRegionAuto(name, io_type, min, max) {
690
+ const ptr = this.__destroy_into_raw();
691
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
692
+ const len0 = WASM_VECTOR_LEN;
693
+ _assertClass(io_type, IoTypeWrapper);
694
+ _assertClass(min, BlockPosition);
695
+ var ptr1 = min.__destroy_into_raw();
696
+ _assertClass(max, BlockPosition);
697
+ var ptr2 = max.__destroy_into_raw();
698
+ const ret = wasm.iolayoutbuilderwrapper_addOutputRegionAuto(ptr, ptr0, len0, io_type.__wbg_ptr, ptr1, ptr2);
699
+ if (ret[2]) {
700
+ throw takeFromExternrefTable0(ret[1]);
701
+ }
702
+ return IoLayoutBuilderWrapper.__wrap(ret[0]);
703
+ }
606
704
  /**
607
705
  * Create a new IO layout builder
608
706
  */
package/nucleation.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ export function debug_json_schematic(schematic: SchematicWrapper): string;
4
+ export function debug_schematic(schematic: SchematicWrapper): string;
3
5
  /**
4
6
  * Initialize WASM module with panic hook for better error messages
5
7
  */
6
8
  export function start(): void;
7
- export function debug_schematic(schematic: SchematicWrapper): string;
8
- export function debug_json_schematic(schematic: SchematicWrapper): string;
9
9
  export class BlockPosition {
10
10
  free(): void;
11
11
  [Symbol.dispose](): void;
@@ -64,6 +64,24 @@ export class IoLayoutBuilderWrapper {
64
64
  * Add an output with automatic layout inference
65
65
  */
66
66
  addOutputAuto(name: string, io_type: IoTypeWrapper, positions: any[]): IoLayoutBuilderWrapper;
67
+ /**
68
+ * Add an input defined by a region (bounding box)
69
+ * Iterates Y (layers), then X (rows), then Z (columns)
70
+ */
71
+ addInputRegion(name: string, io_type: IoTypeWrapper, layout: LayoutFunctionWrapper, min: BlockPosition, max: BlockPosition): IoLayoutBuilderWrapper;
72
+ /**
73
+ * Add an output defined by a region (bounding box)
74
+ * Iterates Y (layers), then X (rows), then Z (columns)
75
+ */
76
+ addOutputRegion(name: string, io_type: IoTypeWrapper, layout: LayoutFunctionWrapper, min: BlockPosition, max: BlockPosition): IoLayoutBuilderWrapper;
77
+ /**
78
+ * Add an input defined by a region with automatic layout inference
79
+ */
80
+ addInputRegionAuto(name: string, io_type: IoTypeWrapper, min: BlockPosition, max: BlockPosition): IoLayoutBuilderWrapper;
81
+ /**
82
+ * Add an output defined by a region with automatic layout inference
83
+ */
84
+ addOutputRegionAuto(name: string, io_type: IoTypeWrapper, min: BlockPosition, max: BlockPosition): IoLayoutBuilderWrapper;
67
85
  /**
68
86
  * Create a new IO layout builder
69
87
  */
@@ -597,8 +615,12 @@ export interface InitOutput {
597
615
  readonly executionmodewrapper_untilStable: (a: number, b: number) => number;
598
616
  readonly iolayoutbuilderwrapper_addInput: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
599
617
  readonly iolayoutbuilderwrapper_addInputAuto: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
618
+ readonly iolayoutbuilderwrapper_addInputRegion: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
619
+ readonly iolayoutbuilderwrapper_addInputRegionAuto: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
600
620
  readonly iolayoutbuilderwrapper_addOutput: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
601
621
  readonly iolayoutbuilderwrapper_addOutputAuto: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
622
+ readonly iolayoutbuilderwrapper_addOutputRegion: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
623
+ readonly iolayoutbuilderwrapper_addOutputRegionAuto: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
602
624
  readonly iolayoutbuilderwrapper_build: (a: number) => number;
603
625
  readonly iolayoutbuilderwrapper_new: () => number;
604
626
  readonly iolayoutwrapper_inputNames: (a: number) => [number, number];
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.120",
8
+ "version": "0.1.123",
9
9
  "license": "AGPL-3.0-only",
10
10
  "repository": {
11
11
  "type": "git",