nucleation 0.5.0 → 0.5.1

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/MeshResult.d.ts CHANGED
@@ -33,6 +33,11 @@ export class MeshResult {
33
33
  */
34
34
  glbDataB64(): string;
35
35
 
36
+ /**
37
+ * The mesh as a USDZ archive, base64-encoded.
38
+ */
39
+ usdzDataB64(): string;
40
+
36
41
  /**
37
42
  * The mesh serialized in the NUCM cache format, base64-encoded.
38
43
  */
package/MeshResult.mjs CHANGED
@@ -115,6 +115,32 @@ export class MeshResult {
115
115
  }
116
116
  }
117
117
 
118
+ /**
119
+ * The mesh as a USDZ archive, base64-encoded.
120
+ */
121
+ usdzDataB64() {
122
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
123
+
124
+ const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
125
+
126
+
127
+ const result = wasm.MeshResult_usdz_data_b64(diplomatReceive.buffer, this.ffiValue, write.buffer);
128
+
129
+ try {
130
+ if (!diplomatReceive.resultFlag) {
131
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
132
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
133
+ }
134
+ return write.readString8();
135
+ }
136
+
137
+ finally {
138
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
139
+ diplomatReceive.free();
140
+ write.free();
141
+ }
142
+ }
143
+
118
144
  /**
119
145
  * The mesh serialized in the NUCM cache format, base64-encoded.
120
146
  */
package/nucleation.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nucleation",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "A high-performance Minecraft schematic parser and utility library",
5
5
  "type": "module",
6
6
  "main": "index.mjs",