nucleation 0.10.21 → 0.10.23

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.
Files changed (314) hide show
  1. package/BlockPos.mjs +1 -0
  2. package/Dimensions.mjs +1 -0
  3. package/FieldRange.mjs +1 -0
  4. package/ItemScale.mjs +1 -0
  5. package/MeshBounds.mjs +1 -0
  6. package/MeshProgress.mjs +1 -0
  7. package/README.md +12 -0
  8. package/RegionBounds.mjs +1 -0
  9. package/Schematic.d.mts +32 -0
  10. package/Schematic.d.ts +32 -0
  11. package/Schematic.mjs +100 -0
  12. package/SdfBounds.mjs +1 -0
  13. package/SdfNormal.mjs +1 -0
  14. package/TextureInfo.mjs +1 -0
  15. package/diplomat-runtime.mjs +19 -14
  16. package/nucleation.wasm +0 -0
  17. package/package.json +7 -2
  18. package/renderer/AnimationEffect.d.mts +44 -0
  19. package/renderer/AnimationEffect.d.ts +44 -0
  20. package/renderer/AnimationEffect.mjs +204 -0
  21. package/renderer/Autostack.d.mts +43 -0
  22. package/renderer/Autostack.d.ts +43 -0
  23. package/renderer/Autostack.mjs +134 -0
  24. package/renderer/BlockPos.d.mts +28 -0
  25. package/renderer/BlockPos.d.ts +28 -0
  26. package/renderer/BlockPos.mjs +130 -0
  27. package/renderer/BlockState.d.mts +39 -0
  28. package/renderer/BlockState.d.ts +39 -0
  29. package/renderer/BlockState.mjs +134 -0
  30. package/renderer/Blocks.d.mts +91 -0
  31. package/renderer/Blocks.d.ts +91 -0
  32. package/renderer/Blocks.mjs +308 -0
  33. package/renderer/Brush.d.mts +99 -0
  34. package/renderer/Brush.d.ts +99 -0
  35. package/renderer/Brush.mjs +335 -0
  36. package/renderer/BuildAnimation.d.mts +179 -0
  37. package/renderer/BuildAnimation.d.ts +179 -0
  38. package/renderer/BuildAnimation.mjs +1148 -0
  39. package/renderer/BuildingTool.d.mts +46 -0
  40. package/renderer/BuildingTool.d.ts +46 -0
  41. package/renderer/BuildingTool.mjs +121 -0
  42. package/renderer/CellExecutor.d.mts +51 -0
  43. package/renderer/CellExecutor.d.ts +51 -0
  44. package/renderer/CellExecutor.mjs +171 -0
  45. package/renderer/CellularSdfConfig.d.mts +22 -0
  46. package/renderer/CellularSdfConfig.d.ts +22 -0
  47. package/renderer/CellularSdfConfig.mjs +69 -0
  48. package/renderer/ChunkMeshResult.d.mts +75 -0
  49. package/renderer/ChunkMeshResult.d.ts +75 -0
  50. package/renderer/ChunkMeshResult.mjs +253 -0
  51. package/renderer/CircuitBuilder.d.mts +118 -0
  52. package/renderer/CircuitBuilder.d.ts +118 -0
  53. package/renderer/CircuitBuilder.mjs +516 -0
  54. package/renderer/Curve3D.d.mts +27 -0
  55. package/renderer/Curve3D.d.ts +27 -0
  56. package/renderer/Curve3D.mjs +101 -0
  57. package/renderer/DefinitionRegion.d.mts +274 -0
  58. package/renderer/DefinitionRegion.d.ts +274 -0
  59. package/renderer/DefinitionRegion.mjs +973 -0
  60. package/renderer/Design.d.mts +348 -0
  61. package/renderer/Design.d.ts +348 -0
  62. package/renderer/Design.mjs +1334 -0
  63. package/renderer/Diff.d.mts +88 -0
  64. package/renderer/Diff.d.ts +88 -0
  65. package/renderer/Diff.mjs +316 -0
  66. package/renderer/Dimensions.d.mts +28 -0
  67. package/renderer/Dimensions.d.ts +28 -0
  68. package/renderer/Dimensions.mjs +130 -0
  69. package/renderer/DistanceField.d.mts +39 -0
  70. package/renderer/DistanceField.d.ts +39 -0
  71. package/renderer/DistanceField.mjs +114 -0
  72. package/renderer/ExecutionMode.d.mts +42 -0
  73. package/renderer/ExecutionMode.d.ts +42 -0
  74. package/renderer/ExecutionMode.mjs +127 -0
  75. package/renderer/Field3.d.mts +40 -0
  76. package/renderer/Field3.d.ts +40 -0
  77. package/renderer/Field3.mjs +160 -0
  78. package/renderer/FieldProgram.d.mts +40 -0
  79. package/renderer/FieldProgram.d.ts +40 -0
  80. package/renderer/FieldProgram.mjs +167 -0
  81. package/renderer/FieldProgramBinaryOp.d.mts +42 -0
  82. package/renderer/FieldProgramBinaryOp.d.ts +42 -0
  83. package/renderer/FieldProgramBinaryOp.mjs +118 -0
  84. package/renderer/FieldProgramBuilder.d.mts +104 -0
  85. package/renderer/FieldProgramBuilder.d.ts +104 -0
  86. package/renderer/FieldProgramBuilder.mjs +486 -0
  87. package/renderer/FieldProgramDistanceKind.d.mts +26 -0
  88. package/renderer/FieldProgramDistanceKind.d.ts +26 -0
  89. package/renderer/FieldProgramDistanceKind.mjs +78 -0
  90. package/renderer/FieldProgramUnaryOp.d.mts +34 -0
  91. package/renderer/FieldProgramUnaryOp.d.ts +34 -0
  92. package/renderer/FieldProgramUnaryOp.mjs +102 -0
  93. package/renderer/FieldProgramValueType.d.mts +25 -0
  94. package/renderer/FieldProgramValueType.d.ts +25 -0
  95. package/renderer/FieldProgramValueType.mjs +75 -0
  96. package/renderer/FieldRange.d.mts +15 -0
  97. package/renderer/FieldRange.d.ts +15 -0
  98. package/renderer/FieldRange.mjs +109 -0
  99. package/renderer/Fingerprint.d.mts +44 -0
  100. package/renderer/Fingerprint.d.ts +44 -0
  101. package/renderer/Fingerprint.mjs +197 -0
  102. package/renderer/GeneratedChunk.d.mts +35 -0
  103. package/renderer/GeneratedChunk.d.ts +35 -0
  104. package/renderer/GeneratedChunk.mjs +178 -0
  105. package/renderer/GeneratedChunkCoverage.d.mts +25 -0
  106. package/renderer/GeneratedChunkCoverage.d.ts +25 -0
  107. package/renderer/GeneratedChunkCoverage.mjs +75 -0
  108. package/renderer/GeneratedChunkOverlayMode.d.mts +24 -0
  109. package/renderer/GeneratedChunkOverlayMode.d.ts +24 -0
  110. package/renderer/GeneratedChunkOverlayMode.mjs +72 -0
  111. package/renderer/GeneratedWorldStream.d.mts +28 -0
  112. package/renderer/GeneratedWorldStream.d.ts +28 -0
  113. package/renderer/GeneratedWorldStream.mjs +86 -0
  114. package/renderer/Geo.d.mts +41 -0
  115. package/renderer/Geo.d.ts +41 -0
  116. package/renderer/Geo.mjs +121 -0
  117. package/renderer/Hdl.d.mts +56 -0
  118. package/renderer/Hdl.d.ts +56 -0
  119. package/renderer/Hdl.mjs +163 -0
  120. package/renderer/InterpolationSpace.d.mts +25 -0
  121. package/renderer/InterpolationSpace.d.ts +25 -0
  122. package/renderer/InterpolationSpace.mjs +73 -0
  123. package/renderer/IoLayout.d.mts +26 -0
  124. package/renderer/IoLayout.d.ts +26 -0
  125. package/renderer/IoLayout.mjs +81 -0
  126. package/renderer/IoLayoutBuilder.d.mts +73 -0
  127. package/renderer/IoLayoutBuilder.d.ts +73 -0
  128. package/renderer/IoLayoutBuilder.mjs +315 -0
  129. package/renderer/IoType.d.mts +41 -0
  130. package/renderer/IoType.d.ts +41 -0
  131. package/renderer/IoType.mjs +125 -0
  132. package/renderer/ItemModelConfig.d.mts +65 -0
  133. package/renderer/ItemModelConfig.d.ts +65 -0
  134. package/renderer/ItemModelConfig.mjs +223 -0
  135. package/renderer/ItemModelPackBuilder.d.mts +32 -0
  136. package/renderer/ItemModelPackBuilder.d.ts +32 -0
  137. package/renderer/ItemModelPackBuilder.mjs +104 -0
  138. package/renderer/ItemModelResult.d.mts +72 -0
  139. package/renderer/ItemModelResult.d.ts +72 -0
  140. package/renderer/ItemModelResult.mjs +268 -0
  141. package/renderer/ItemScale.d.mts +31 -0
  142. package/renderer/ItemScale.d.ts +31 -0
  143. package/renderer/ItemScale.mjs +133 -0
  144. package/renderer/LayoutFunction.d.mts +52 -0
  145. package/renderer/LayoutFunction.d.ts +52 -0
  146. package/renderer/LayoutFunction.mjs +159 -0
  147. package/renderer/MchprsWorld.d.mts +131 -0
  148. package/renderer/MchprsWorld.d.ts +131 -0
  149. package/renderer/MchprsWorld.mjs +423 -0
  150. package/renderer/MeshBounds.d.mts +40 -0
  151. package/renderer/MeshBounds.d.ts +40 -0
  152. package/renderer/MeshBounds.mjs +181 -0
  153. package/renderer/MeshConfig.d.mts +101 -0
  154. package/renderer/MeshConfig.d.ts +101 -0
  155. package/renderer/MeshConfig.mjs +306 -0
  156. package/renderer/MeshJob.d.mts +44 -0
  157. package/renderer/MeshJob.d.ts +44 -0
  158. package/renderer/MeshJob.mjs +116 -0
  159. package/renderer/MeshPhase.d.mts +38 -0
  160. package/renderer/MeshPhase.d.ts +38 -0
  161. package/renderer/MeshPhase.mjs +90 -0
  162. package/renderer/MeshProgress.d.mts +32 -0
  163. package/renderer/MeshProgress.d.ts +32 -0
  164. package/renderer/MeshProgress.mjs +134 -0
  165. package/renderer/MeshResult.d.mts +76 -0
  166. package/renderer/MeshResult.d.ts +76 -0
  167. package/renderer/MeshResult.mjs +269 -0
  168. package/renderer/MultiMeshResult.d.mts +50 -0
  169. package/renderer/MultiMeshResult.d.ts +50 -0
  170. package/renderer/MultiMeshResult.mjs +166 -0
  171. package/renderer/Nbt.d.mts +50 -0
  172. package/renderer/Nbt.d.ts +50 -0
  173. package/renderer/Nbt.mjs +161 -0
  174. package/renderer/NucleationError.d.mts +53 -0
  175. package/renderer/NucleationError.d.ts +53 -0
  176. package/renderer/NucleationError.mjs +136 -0
  177. package/renderer/OutputCondition.d.mts +45 -0
  178. package/renderer/OutputCondition.d.ts +45 -0
  179. package/renderer/OutputCondition.mjs +129 -0
  180. package/renderer/Palette.d.mts +157 -0
  181. package/renderer/Palette.d.ts +157 -0
  182. package/renderer/Palette.mjs +487 -0
  183. package/renderer/PaletteBuilder.d.mts +119 -0
  184. package/renderer/PaletteBuilder.d.ts +119 -0
  185. package/renderer/PaletteBuilder.mjs +457 -0
  186. package/renderer/README.md +67 -0
  187. package/renderer/RawMeshExport.d.mts +74 -0
  188. package/renderer/RawMeshExport.d.ts +74 -0
  189. package/renderer/RawMeshExport.mjs +243 -0
  190. package/renderer/RedstoneGraph.d.mts +58 -0
  191. package/renderer/RedstoneGraph.d.ts +58 -0
  192. package/renderer/RedstoneGraph.mjs +242 -0
  193. package/renderer/RegionBounds.d.mts +41 -0
  194. package/renderer/RegionBounds.d.ts +41 -0
  195. package/renderer/RegionBounds.mjs +182 -0
  196. package/renderer/RenderConfig.d.mts +101 -0
  197. package/renderer/RenderConfig.d.ts +101 -0
  198. package/renderer/RenderConfig.mjs +271 -0
  199. package/renderer/Renderer.d.mts +51 -0
  200. package/renderer/Renderer.d.ts +51 -0
  201. package/renderer/Renderer.mjs +219 -0
  202. package/renderer/ResourcePack.d.mts +105 -0
  203. package/renderer/ResourcePack.d.ts +105 -0
  204. package/renderer/ResourcePack.mjs +447 -0
  205. package/renderer/ResourcePackList.d.mts +32 -0
  206. package/renderer/ResourcePackList.d.ts +32 -0
  207. package/renderer/ResourcePackList.mjs +96 -0
  208. package/renderer/Routing.d.mts +66 -0
  209. package/renderer/Routing.d.ts +66 -0
  210. package/renderer/Routing.mjs +220 -0
  211. package/renderer/Schematic.d.mts +977 -0
  212. package/renderer/Schematic.d.ts +977 -0
  213. package/renderer/Schematic.mjs +3820 -0
  214. package/renderer/SchematicBuilder.d.mts +103 -0
  215. package/renderer/SchematicBuilder.d.ts +103 -0
  216. package/renderer/SchematicBuilder.mjs +401 -0
  217. package/renderer/SchematicRegions.d.mts +93 -0
  218. package/renderer/SchematicRegions.d.ts +93 -0
  219. package/renderer/SchematicRegions.mjs +411 -0
  220. package/renderer/SchematicSplitResult.d.mts +26 -0
  221. package/renderer/SchematicSplitResult.d.ts +26 -0
  222. package/renderer/SchematicSplitResult.mjs +84 -0
  223. package/renderer/Scripting.d.mts +40 -0
  224. package/renderer/Scripting.d.ts +40 -0
  225. package/renderer/Scripting.mjs +138 -0
  226. package/renderer/Sdf.d.mts +234 -0
  227. package/renderer/Sdf.d.ts +234 -0
  228. package/renderer/Sdf.mjs +1234 -0
  229. package/renderer/SdfAxis.d.mts +25 -0
  230. package/renderer/SdfAxis.d.ts +25 -0
  231. package/renderer/SdfAxis.mjs +75 -0
  232. package/renderer/SdfBounds.d.mts +19 -0
  233. package/renderer/SdfBounds.d.ts +19 -0
  234. package/renderer/SdfBounds.mjs +161 -0
  235. package/renderer/SdfCellMode.d.mts +26 -0
  236. package/renderer/SdfCellMode.d.ts +26 -0
  237. package/renderer/SdfCellMode.mjs +78 -0
  238. package/renderer/SdfNormal.d.mts +16 -0
  239. package/renderer/SdfNormal.d.ts +16 -0
  240. package/renderer/SdfNormal.mjs +122 -0
  241. package/renderer/Shape.d.mts +143 -0
  242. package/renderer/Shape.d.ts +143 -0
  243. package/renderer/Shape.mjs +458 -0
  244. package/renderer/SortStrategy.d.mts +86 -0
  245. package/renderer/SortStrategy.d.ts +86 -0
  246. package/renderer/SortStrategy.mjs +272 -0
  247. package/renderer/Store.d.mts +83 -0
  248. package/renderer/Store.d.ts +83 -0
  249. package/renderer/Store.mjs +369 -0
  250. package/renderer/StoreIo.d.mts +71 -0
  251. package/renderer/StoreIo.d.ts +71 -0
  252. package/renderer/StoreIo.mjs +292 -0
  253. package/renderer/TextureAtlas.d.mts +40 -0
  254. package/renderer/TextureAtlas.d.ts +40 -0
  255. package/renderer/TextureAtlas.mjs +122 -0
  256. package/renderer/TextureInfo.d.mts +34 -0
  257. package/renderer/TextureInfo.d.ts +34 -0
  258. package/renderer/TextureInfo.mjs +149 -0
  259. package/renderer/TickSettleMode.d.mts +34 -0
  260. package/renderer/TickSettleMode.d.ts +34 -0
  261. package/renderer/TickSettleMode.mjs +84 -0
  262. package/renderer/TickSimulation.d.mts +572 -0
  263. package/renderer/TickSimulation.d.ts +572 -0
  264. package/renderer/TickSimulation.mjs +1299 -0
  265. package/renderer/TypedCircuitExecutor.d.mts +101 -0
  266. package/renderer/TypedCircuitExecutor.d.ts +101 -0
  267. package/renderer/TypedCircuitExecutor.mjs +378 -0
  268. package/renderer/Value.d.mts +73 -0
  269. package/renderer/Value.d.ts +73 -0
  270. package/renderer/Value.mjs +275 -0
  271. package/renderer/VideoConfig.d.mts +15 -0
  272. package/renderer/VideoConfig.d.ts +15 -0
  273. package/renderer/VideoConfig.mjs +44 -0
  274. package/renderer/VoxelModel.d.mts +34 -0
  275. package/renderer/VoxelModel.d.ts +34 -0
  276. package/renderer/VoxelModel.mjs +113 -0
  277. package/renderer/Voxelizer.d.mts +80 -0
  278. package/renderer/Voxelizer.d.ts +80 -0
  279. package/renderer/Voxelizer.mjs +261 -0
  280. package/renderer/WorldChunkView.d.mts +75 -0
  281. package/renderer/WorldChunkView.d.ts +75 -0
  282. package/renderer/WorldChunkView.mjs +224 -0
  283. package/renderer/WorldGenerator.d.mts +75 -0
  284. package/renderer/WorldGenerator.d.ts +75 -0
  285. package/renderer/WorldGenerator.mjs +255 -0
  286. package/renderer/WorldSink.d.mts +50 -0
  287. package/renderer/WorldSink.d.ts +50 -0
  288. package/renderer/WorldSink.mjs +177 -0
  289. package/renderer/WorldStream.d.mts +45 -0
  290. package/renderer/WorldStream.d.ts +45 -0
  291. package/renderer/WorldStream.mjs +184 -0
  292. package/renderer/WsPartitionHints.d.mts +29 -0
  293. package/renderer/WsPartitionHints.d.ts +29 -0
  294. package/renderer/WsPartitionHints.mjs +102 -0
  295. package/renderer/WsProfile.d.mts +46 -0
  296. package/renderer/WsProfile.d.ts +46 -0
  297. package/renderer/WsProfile.mjs +152 -0
  298. package/renderer/WsRunResult.d.mts +83 -0
  299. package/renderer/WsRunResult.d.ts +83 -0
  300. package/renderer/WsRunResult.mjs +326 -0
  301. package/renderer/WsSegmentJob.d.mts +28 -0
  302. package/renderer/WsSegmentJob.d.ts +28 -0
  303. package/renderer/WsSegmentJob.mjs +81 -0
  304. package/renderer/diplomat-runtime.d.mts +15 -0
  305. package/renderer/diplomat-runtime.d.ts +15 -0
  306. package/renderer/diplomat-runtime.mjs +779 -0
  307. package/renderer/diplomat-wasm.mjs +52 -0
  308. package/renderer/diplomat.config.mjs +5 -0
  309. package/renderer/index.d.mts +193 -0
  310. package/renderer/index.d.ts +193 -0
  311. package/renderer/index.mjs +196 -0
  312. package/renderer/nucleation.wasm +0 -0
  313. package/renderer/veneer/design.d.ts +167 -0
  314. package/renderer/veneer/design.mjs +480 -0
@@ -0,0 +1,1148 @@
1
+ // generated by diplomat-tool
2
+ import { AnimationEffect } from "./AnimationEffect.mjs"
3
+ import { Brush } from "./Brush.mjs"
4
+ import { NucleationError } from "./NucleationError.mjs"
5
+ import { ResourcePack } from "./ResourcePack.mjs"
6
+ import { Schematic } from "./Schematic.mjs"
7
+ import { Shape } from "./Shape.mjs"
8
+ import wasm from "./diplomat-wasm.mjs";
9
+ import * as diplomatRuntime from "./diplomat-runtime.mjs";
10
+
11
+ const BuildAnimation_box_destroy_registry = new FinalizationRegistry((ptr) => {
12
+ wasm.BuildAnimation_destroy(ptr);
13
+ });
14
+
15
+ /**
16
+ * A schematic wrapper that records construction calls as animation targets.
17
+ */
18
+ export class BuildAnimation {
19
+ // Internal ptr reference:
20
+ #ptr = null;
21
+
22
+ // Lifetimes are only to keep dependencies alive.
23
+ // Since JS won't garbage collect until there are no incoming edges.
24
+ #selfEdge = [];
25
+
26
+ #internalConstructor(symbol, ptr, selfEdge) {
27
+ if (symbol !== diplomatRuntime.internalConstructor) {
28
+ console.error("BuildAnimation is an Opaque type. You cannot call its constructor.");
29
+ return;
30
+ }
31
+ this.#ptr = ptr;
32
+ this.#selfEdge = selfEdge;
33
+
34
+ // Are we being borrowed? If not, we can register.
35
+ if (this.#selfEdge.length === 0) {
36
+ BuildAnimation_box_destroy_registry.register(this, this.#ptr);
37
+ }
38
+
39
+ return this;
40
+ }
41
+ /** @internal */
42
+ get ffiValue() {
43
+ return this.#ptr;
44
+ }
45
+
46
+
47
+ static create(name) {
48
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
49
+
50
+ const nameSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, name)));
51
+
52
+ const result = wasm.BuildAnimation_create(nameSlice.ptr);
53
+
54
+ try {
55
+ return new BuildAnimation(diplomatRuntime.internalConstructor, result, []);
56
+ }
57
+
58
+ finally {
59
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
60
+ functionCleanupArena.free();
61
+
62
+ }
63
+ }
64
+
65
+ /**
66
+ * Clone an existing schematic into one animation group. Entity-only
67
+ * schematics are supported; overlapping block/entity integer positions
68
+ * are rejected rather than silently dropping a model.
69
+ */
70
+ static fromSchematic(schematic) {
71
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
72
+
73
+
74
+ const result = wasm.BuildAnimation_from_schematic(diplomatReceive.buffer, schematic.ffiValue);
75
+
76
+ try {
77
+ if (!diplomatReceive.resultFlag) {
78
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
79
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
80
+ }
81
+ return new BuildAnimation(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
82
+ }
83
+
84
+ finally {
85
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
86
+ diplomatReceive.free();
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Apply one effect to every existing animation group.
92
+ */
93
+ animateAll(effect) {
94
+ wasm.BuildAnimation_animate_all(this.ffiValue, effect.ffiValue);
95
+
96
+ try {}
97
+
98
+ finally {
99
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
100
+ }
101
+ }
102
+
103
+ setDefaultEffect(effect) {
104
+ wasm.BuildAnimation_set_default_effect(this.ffiValue, effect.ffiValue);
105
+
106
+ try {}
107
+
108
+ finally {
109
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
110
+ }
111
+ }
112
+
113
+ /**
114
+ * Apply an effect to exactly the next recorded operation or explicit group.
115
+ * The returned borrowed builder enables fluent calls in every generated binding.
116
+ */
117
+ withEffect(effect) {
118
+ // This lifetime edge depends on lifetimes 'a
119
+ let aEdges = [this];
120
+
121
+
122
+ const result = wasm.BuildAnimation_with_effect(this.ffiValue, effect.ffiValue);
123
+
124
+ try {
125
+ return new BuildAnimation(diplomatRuntime.internalConstructor, result, aEdges);
126
+ }
127
+
128
+ finally {
129
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
130
+ }
131
+ }
132
+
133
+ setStepMs(stepMs) {
134
+ wasm.BuildAnimation_set_step_ms(this.ffiValue, stepMs);
135
+
136
+ try {}
137
+
138
+ finally {
139
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
140
+ }
141
+ }
142
+
143
+ setStaggerTotalMs(totalMs) {
144
+ wasm.BuildAnimation_set_stagger_total_ms(this.ffiValue, totalMs);
145
+
146
+ try {}
147
+
148
+ finally {
149
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
150
+ }
151
+ }
152
+
153
+ clearStagger() {
154
+ wasm.BuildAnimation_clear_stagger(this.ffiValue);
155
+
156
+ try {}
157
+
158
+ finally {
159
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
160
+ }
161
+ }
162
+
163
+ /**
164
+ * Shift every construction group's start time. Negative offsets let a
165
+ * repeating staggered effect cross the beginning of a loop capture.
166
+ */
167
+ setStaggerOffsetMs(offsetMs) {
168
+ wasm.BuildAnimation_set_stagger_offset_ms(this.ffiValue, offsetMs);
169
+
170
+ try {}
171
+
172
+ finally {
173
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
174
+ }
175
+ }
176
+
177
+ /**
178
+ * Capture exactly one loop period, excluding the duplicate endpoint.
179
+ * The rounded frame count evenly partitions the complete period.
180
+ */
181
+ setLoopPeriodMs(periodMs) {
182
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
183
+
184
+
185
+ const result = wasm.BuildAnimation_set_loop_period_ms(diplomatReceive.buffer, this.ffiValue, periodMs);
186
+
187
+ try {
188
+ if (!diplomatReceive.resultFlag) {
189
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
190
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
191
+ }
192
+ }
193
+
194
+ finally {
195
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
196
+ diplomatReceive.free();
197
+ }
198
+ }
199
+
200
+ clearLoopPeriod() {
201
+ wasm.BuildAnimation_clear_loop_period(this.ffiValue);
202
+
203
+ try {}
204
+
205
+ finally {
206
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
207
+ }
208
+ }
209
+
210
+ beginGroup() {
211
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
212
+
213
+
214
+ const result = wasm.BuildAnimation_begin_group(diplomatReceive.buffer, this.ffiValue);
215
+
216
+ try {
217
+ if (!diplomatReceive.resultFlag) {
218
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
219
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
220
+ }
221
+ }
222
+
223
+ finally {
224
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
225
+ diplomatReceive.free();
226
+ }
227
+ }
228
+
229
+ beginKeyedGroup(key) {
230
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
231
+
232
+
233
+ const result = wasm.BuildAnimation_begin_keyed_group(diplomatReceive.buffer, this.ffiValue, key);
234
+
235
+ try {
236
+ if (!diplomatReceive.resultFlag) {
237
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
238
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
239
+ }
240
+ }
241
+
242
+ finally {
243
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
244
+ diplomatReceive.free();
245
+ }
246
+ }
247
+
248
+ endGroup() {
249
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
250
+
251
+
252
+ const result = wasm.BuildAnimation_end_group(diplomatReceive.buffer, this.ffiValue);
253
+
254
+ try {
255
+ if (!diplomatReceive.resultFlag) {
256
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
257
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
258
+ }
259
+ return (new Uint32Array(wasm.memory.buffer, diplomatReceive.buffer, 1))[0];
260
+ }
261
+
262
+ finally {
263
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
264
+ diplomatReceive.free();
265
+ }
266
+ }
267
+
268
+ setBlock(x, y, z, block) {
269
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
270
+
271
+ const blockSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, block)));
272
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
273
+
274
+
275
+ const result = wasm.BuildAnimation_set_block(diplomatReceive.buffer, this.ffiValue, x, y, z, blockSlice.ptr);
276
+
277
+ try {
278
+ if (!diplomatReceive.resultFlag) {
279
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
280
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
281
+ }
282
+ return (new Uint32Array(wasm.memory.buffer, diplomatReceive.buffer, 1))[0];
283
+ }
284
+
285
+ finally {
286
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
287
+ functionCleanupArena.free();
288
+
289
+ diplomatReceive.free();
290
+ }
291
+ }
292
+
293
+ createRegion(name, minX, minY, minZ, maxX, maxY, maxZ) {
294
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
295
+
296
+ const nameSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, name)));
297
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
298
+
299
+
300
+ const result = wasm.BuildAnimation_create_region(diplomatReceive.buffer, this.ffiValue, nameSlice.ptr, minX, minY, minZ, maxX, maxY, maxZ);
301
+
302
+ try {
303
+ if (!diplomatReceive.resultFlag) {
304
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
305
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
306
+ }
307
+ }
308
+
309
+ finally {
310
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
311
+ functionCleanupArena.free();
312
+
313
+ diplomatReceive.free();
314
+ }
315
+ }
316
+
317
+ setBlockInRegion(region, x, y, z, block) {
318
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
319
+
320
+ const regionSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, region)));
321
+ const blockSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, block)));
322
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
323
+
324
+
325
+ const result = wasm.BuildAnimation_set_block_in_region(diplomatReceive.buffer, this.ffiValue, regionSlice.ptr, x, y, z, blockSlice.ptr);
326
+
327
+ try {
328
+ if (!diplomatReceive.resultFlag) {
329
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
330
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
331
+ }
332
+ return (new Uint32Array(wasm.memory.buffer, diplomatReceive.buffer, 1))[0];
333
+ }
334
+
335
+ finally {
336
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
337
+ functionCleanupArena.free();
338
+
339
+ diplomatReceive.free();
340
+ }
341
+ }
342
+
343
+ translate(x, y, z, durationMs) {
344
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
345
+
346
+
347
+ const result = wasm.BuildAnimation_translate(diplomatReceive.buffer, this.ffiValue, x, y, z, durationMs);
348
+
349
+ try {
350
+ if (!diplomatReceive.resultFlag) {
351
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
352
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
353
+ }
354
+ }
355
+
356
+ finally {
357
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
358
+ diplomatReceive.free();
359
+ }
360
+ }
361
+
362
+ translateRegion(region, x, y, z, durationMs) {
363
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
364
+
365
+ const regionSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, region)));
366
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
367
+
368
+
369
+ const result = wasm.BuildAnimation_translate_region(diplomatReceive.buffer, this.ffiValue, regionSlice.ptr, x, y, z, durationMs);
370
+
371
+ try {
372
+ if (!diplomatReceive.resultFlag) {
373
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
374
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
375
+ }
376
+ }
377
+
378
+ finally {
379
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
380
+ functionCleanupArena.free();
381
+
382
+ diplomatReceive.free();
383
+ }
384
+ }
385
+
386
+ translateAll(x, y, z, durationMs) {
387
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
388
+
389
+
390
+ const result = wasm.BuildAnimation_translate_all(diplomatReceive.buffer, this.ffiValue, x, y, z, durationMs);
391
+
392
+ try {
393
+ if (!diplomatReceive.resultFlag) {
394
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
395
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
396
+ }
397
+ }
398
+
399
+ finally {
400
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
401
+ diplomatReceive.free();
402
+ }
403
+ }
404
+
405
+ rotateX(degrees, durationMs) {
406
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
407
+
408
+
409
+ const result = wasm.BuildAnimation_rotate_x(diplomatReceive.buffer, this.ffiValue, degrees, durationMs);
410
+
411
+ try {
412
+ if (!diplomatReceive.resultFlag) {
413
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
414
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
415
+ }
416
+ }
417
+
418
+ finally {
419
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
420
+ diplomatReceive.free();
421
+ }
422
+ }
423
+
424
+ rotateY(degrees, durationMs) {
425
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
426
+
427
+
428
+ const result = wasm.BuildAnimation_rotate_y(diplomatReceive.buffer, this.ffiValue, degrees, durationMs);
429
+
430
+ try {
431
+ if (!diplomatReceive.resultFlag) {
432
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
433
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
434
+ }
435
+ }
436
+
437
+ finally {
438
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
439
+ diplomatReceive.free();
440
+ }
441
+ }
442
+
443
+ rotateZ(degrees, durationMs) {
444
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
445
+
446
+
447
+ const result = wasm.BuildAnimation_rotate_z(diplomatReceive.buffer, this.ffiValue, degrees, durationMs);
448
+
449
+ try {
450
+ if (!diplomatReceive.resultFlag) {
451
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
452
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
453
+ }
454
+ }
455
+
456
+ finally {
457
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
458
+ diplomatReceive.free();
459
+ }
460
+ }
461
+
462
+ rotateRegionX(region, degrees, durationMs) {
463
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
464
+
465
+ const regionSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, region)));
466
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
467
+
468
+
469
+ const result = wasm.BuildAnimation_rotate_region_x(diplomatReceive.buffer, this.ffiValue, regionSlice.ptr, degrees, durationMs);
470
+
471
+ try {
472
+ if (!diplomatReceive.resultFlag) {
473
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
474
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
475
+ }
476
+ }
477
+
478
+ finally {
479
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
480
+ functionCleanupArena.free();
481
+
482
+ diplomatReceive.free();
483
+ }
484
+ }
485
+
486
+ rotateRegionY(region, degrees, durationMs) {
487
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
488
+
489
+ const regionSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, region)));
490
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
491
+
492
+
493
+ const result = wasm.BuildAnimation_rotate_region_y(diplomatReceive.buffer, this.ffiValue, regionSlice.ptr, degrees, durationMs);
494
+
495
+ try {
496
+ if (!diplomatReceive.resultFlag) {
497
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
498
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
499
+ }
500
+ }
501
+
502
+ finally {
503
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
504
+ functionCleanupArena.free();
505
+
506
+ diplomatReceive.free();
507
+ }
508
+ }
509
+
510
+ rotateRegionZ(region, degrees, durationMs) {
511
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
512
+
513
+ const regionSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, region)));
514
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
515
+
516
+
517
+ const result = wasm.BuildAnimation_rotate_region_z(diplomatReceive.buffer, this.ffiValue, regionSlice.ptr, degrees, durationMs);
518
+
519
+ try {
520
+ if (!diplomatReceive.resultFlag) {
521
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
522
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
523
+ }
524
+ }
525
+
526
+ finally {
527
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
528
+ functionCleanupArena.free();
529
+
530
+ diplomatReceive.free();
531
+ }
532
+ }
533
+
534
+ rotateAllX(degrees, durationMs) {
535
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
536
+
537
+
538
+ const result = wasm.BuildAnimation_rotate_all_x(diplomatReceive.buffer, this.ffiValue, degrees, durationMs);
539
+
540
+ try {
541
+ if (!diplomatReceive.resultFlag) {
542
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
543
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
544
+ }
545
+ }
546
+
547
+ finally {
548
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
549
+ diplomatReceive.free();
550
+ }
551
+ }
552
+
553
+ rotateAllY(degrees, durationMs) {
554
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
555
+
556
+
557
+ const result = wasm.BuildAnimation_rotate_all_y(diplomatReceive.buffer, this.ffiValue, degrees, durationMs);
558
+
559
+ try {
560
+ if (!diplomatReceive.resultFlag) {
561
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
562
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
563
+ }
564
+ }
565
+
566
+ finally {
567
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
568
+ diplomatReceive.free();
569
+ }
570
+ }
571
+
572
+ rotateAllZ(degrees, durationMs) {
573
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
574
+
575
+
576
+ const result = wasm.BuildAnimation_rotate_all_z(diplomatReceive.buffer, this.ffiValue, degrees, durationMs);
577
+
578
+ try {
579
+ if (!diplomatReceive.resultFlag) {
580
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
581
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
582
+ }
583
+ }
584
+
585
+ finally {
586
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
587
+ diplomatReceive.free();
588
+ }
589
+ }
590
+
591
+ flipX(durationMs) {
592
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
593
+
594
+
595
+ const result = wasm.BuildAnimation_flip_x(diplomatReceive.buffer, this.ffiValue, durationMs);
596
+
597
+ try {
598
+ if (!diplomatReceive.resultFlag) {
599
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
600
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
601
+ }
602
+ }
603
+
604
+ finally {
605
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
606
+ diplomatReceive.free();
607
+ }
608
+ }
609
+
610
+ flipY(durationMs) {
611
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
612
+
613
+
614
+ const result = wasm.BuildAnimation_flip_y(diplomatReceive.buffer, this.ffiValue, durationMs);
615
+
616
+ try {
617
+ if (!diplomatReceive.resultFlag) {
618
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
619
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
620
+ }
621
+ }
622
+
623
+ finally {
624
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
625
+ diplomatReceive.free();
626
+ }
627
+ }
628
+
629
+ flipZ(durationMs) {
630
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
631
+
632
+
633
+ const result = wasm.BuildAnimation_flip_z(diplomatReceive.buffer, this.ffiValue, durationMs);
634
+
635
+ try {
636
+ if (!diplomatReceive.resultFlag) {
637
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
638
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
639
+ }
640
+ }
641
+
642
+ finally {
643
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
644
+ diplomatReceive.free();
645
+ }
646
+ }
647
+
648
+ flipRegionX(region, durationMs) {
649
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
650
+
651
+ const regionSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, region)));
652
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
653
+
654
+
655
+ const result = wasm.BuildAnimation_flip_region_x(diplomatReceive.buffer, this.ffiValue, regionSlice.ptr, durationMs);
656
+
657
+ try {
658
+ if (!diplomatReceive.resultFlag) {
659
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
660
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
661
+ }
662
+ }
663
+
664
+ finally {
665
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
666
+ functionCleanupArena.free();
667
+
668
+ diplomatReceive.free();
669
+ }
670
+ }
671
+
672
+ flipRegionY(region, durationMs) {
673
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
674
+
675
+ const regionSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, region)));
676
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
677
+
678
+
679
+ const result = wasm.BuildAnimation_flip_region_y(diplomatReceive.buffer, this.ffiValue, regionSlice.ptr, durationMs);
680
+
681
+ try {
682
+ if (!diplomatReceive.resultFlag) {
683
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
684
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
685
+ }
686
+ }
687
+
688
+ finally {
689
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
690
+ functionCleanupArena.free();
691
+
692
+ diplomatReceive.free();
693
+ }
694
+ }
695
+
696
+ flipRegionZ(region, durationMs) {
697
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
698
+
699
+ const regionSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, region)));
700
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
701
+
702
+
703
+ const result = wasm.BuildAnimation_flip_region_z(diplomatReceive.buffer, this.ffiValue, regionSlice.ptr, durationMs);
704
+
705
+ try {
706
+ if (!diplomatReceive.resultFlag) {
707
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
708
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
709
+ }
710
+ }
711
+
712
+ finally {
713
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
714
+ functionCleanupArena.free();
715
+
716
+ diplomatReceive.free();
717
+ }
718
+ }
719
+
720
+ flipAllX(durationMs) {
721
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
722
+
723
+
724
+ const result = wasm.BuildAnimation_flip_all_x(diplomatReceive.buffer, this.ffiValue, durationMs);
725
+
726
+ try {
727
+ if (!diplomatReceive.resultFlag) {
728
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
729
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
730
+ }
731
+ }
732
+
733
+ finally {
734
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
735
+ diplomatReceive.free();
736
+ }
737
+ }
738
+
739
+ flipAllY(durationMs) {
740
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
741
+
742
+
743
+ const result = wasm.BuildAnimation_flip_all_y(diplomatReceive.buffer, this.ffiValue, durationMs);
744
+
745
+ try {
746
+ if (!diplomatReceive.resultFlag) {
747
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
748
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
749
+ }
750
+ }
751
+
752
+ finally {
753
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
754
+ diplomatReceive.free();
755
+ }
756
+ }
757
+
758
+ flipAllZ(durationMs) {
759
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
760
+
761
+
762
+ const result = wasm.BuildAnimation_flip_all_z(diplomatReceive.buffer, this.ffiValue, durationMs);
763
+
764
+ try {
765
+ if (!diplomatReceive.resultFlag) {
766
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
767
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
768
+ }
769
+ }
770
+
771
+ finally {
772
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
773
+ diplomatReceive.free();
774
+ }
775
+ }
776
+
777
+ stampRegion(source, region, x, y, z, exclusions, durationMs) {
778
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
779
+
780
+ const regionSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, region)));
781
+ const exclusionsSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, exclusions)));
782
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
783
+
784
+
785
+ const result = wasm.BuildAnimation_stamp_region(diplomatReceive.buffer, this.ffiValue, source.ffiValue, regionSlice.ptr, x, y, z, exclusionsSlice.ptr, durationMs);
786
+
787
+ try {
788
+ if (!diplomatReceive.resultFlag) {
789
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
790
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
791
+ }
792
+ }
793
+
794
+ finally {
795
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
796
+ functionCleanupArena.free();
797
+
798
+ diplomatReceive.free();
799
+ }
800
+ }
801
+
802
+ stampBox(source, minX, minY, minZ, maxX, maxY, maxZ, x, y, z, exclusions, durationMs) {
803
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
804
+
805
+ const exclusionsSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, exclusions)));
806
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
807
+
808
+
809
+ const result = wasm.BuildAnimation_stamp_box(diplomatReceive.buffer, this.ffiValue, source.ffiValue, minX, minY, minZ, maxX, maxY, maxZ, x, y, z, exclusionsSlice.ptr, durationMs);
810
+
811
+ try {
812
+ if (!diplomatReceive.resultFlag) {
813
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
814
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
815
+ }
816
+ }
817
+
818
+ finally {
819
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
820
+ functionCleanupArena.free();
821
+
822
+ diplomatReceive.free();
823
+ }
824
+ }
825
+
826
+ setOperationGizmos(enabled) {
827
+ wasm.BuildAnimation_set_operation_gizmos(this.ffiValue, enabled);
828
+
829
+ try {}
830
+
831
+ finally {
832
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
833
+ }
834
+ }
835
+
836
+ /**
837
+ * Record a named point on the open group, or on the most recent group.
838
+ * Coordinates are the block coordinates poses use. Returns the group
839
+ * id the anchor belongs to.
840
+ */
841
+ addAnchor(name, x, y, z) {
842
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
843
+
844
+ const nameSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, name)));
845
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
846
+
847
+
848
+ const result = wasm.BuildAnimation_add_anchor(diplomatReceive.buffer, this.ffiValue, nameSlice.ptr, x, y, z);
849
+
850
+ try {
851
+ if (!diplomatReceive.resultFlag) {
852
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
853
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
854
+ }
855
+ return (new Uint32Array(wasm.memory.buffer, diplomatReceive.buffer, 1))[0];
856
+ }
857
+
858
+ finally {
859
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
860
+ functionCleanupArena.free();
861
+
862
+ diplomatReceive.free();
863
+ }
864
+ }
865
+
866
+ /**
867
+ * Record a named point on an already recorded group.
868
+ */
869
+ addAnchorToGroup(group, name, x, y, z) {
870
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
871
+
872
+ const nameSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, name)));
873
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
874
+
875
+
876
+ const result = wasm.BuildAnimation_add_anchor_to_group(diplomatReceive.buffer, this.ffiValue, group, nameSlice.ptr, x, y, z);
877
+
878
+ try {
879
+ if (!diplomatReceive.resultFlag) {
880
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
881
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
882
+ }
883
+ }
884
+
885
+ finally {
886
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
887
+ functionCleanupArena.free();
888
+
889
+ diplomatReceive.free();
890
+ }
891
+ }
892
+
893
+ /**
894
+ * Every recorded anchor as JSON: `[{ name, group, local: [x, y, z] }]`.
895
+ */
896
+ anchorsJson() {
897
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
898
+
899
+ const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
900
+
901
+
902
+ const result = wasm.BuildAnimation_anchors_json(diplomatReceive.buffer, this.ffiValue, write.buffer);
903
+
904
+ try {
905
+ if (!diplomatReceive.resultFlag) {
906
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
907
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
908
+ }
909
+ return write.readString8();
910
+ }
911
+
912
+ finally {
913
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
914
+ diplomatReceive.free();
915
+ write.free();
916
+ }
917
+ }
918
+
919
+ /**
920
+ * The build as an animated GLB — one textured node per group, TRS
921
+ * keyframes sampled at `fps`, anchors as child nodes, and
922
+ * `extras.nucleation` for opacity/tint/emissive and the camera track —
923
+ * base64-encoded.
924
+ */
925
+ toAnimatedGlbB64(pack, fps) {
926
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
927
+
928
+ const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
929
+
930
+
931
+ const result = wasm.BuildAnimation_to_animated_glb_b64(diplomatReceive.buffer, this.ffiValue, pack.ffiValue, fps, write.buffer);
932
+
933
+ try {
934
+ if (!diplomatReceive.resultFlag) {
935
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
936
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
937
+ }
938
+ return write.readString8();
939
+ }
940
+
941
+ finally {
942
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
943
+ diplomatReceive.free();
944
+ write.free();
945
+ }
946
+ }
947
+
948
+ /**
949
+ * The finished build as a Sponge `.schem`, base64-encoded — every recorded
950
+ * placement applied, no timeline.
951
+ */
952
+ toSchemB64() {
953
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
954
+
955
+ const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
956
+
957
+
958
+ const result = wasm.BuildAnimation_to_schem_b64(diplomatReceive.buffer, this.ffiValue, write.buffer);
959
+
960
+ try {
961
+ if (!diplomatReceive.resultFlag) {
962
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
963
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
964
+ }
965
+ return write.readString8();
966
+ }
967
+
968
+ finally {
969
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
970
+ diplomatReceive.free();
971
+ write.free();
972
+ }
973
+ }
974
+
975
+ /**
976
+ * The finished build as a `.litematic`, base64-encoded.
977
+ */
978
+ toLitematicB64() {
979
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
980
+
981
+ const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
982
+
983
+
984
+ const result = wasm.BuildAnimation_to_litematic_b64(diplomatReceive.buffer, this.ffiValue, write.buffer);
985
+
986
+ try {
987
+ if (!diplomatReceive.resultFlag) {
988
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
989
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
990
+ }
991
+ return write.readString8();
992
+ }
993
+
994
+ finally {
995
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
996
+ diplomatReceive.free();
997
+ write.free();
998
+ }
999
+ }
1000
+
1001
+ operationsJson() {
1002
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
1003
+
1004
+ const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
1005
+
1006
+
1007
+ const result = wasm.BuildAnimation_operations_json(diplomatReceive.buffer, this.ffiValue, write.buffer);
1008
+
1009
+ try {
1010
+ if (!diplomatReceive.resultFlag) {
1011
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
1012
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
1013
+ }
1014
+ return write.readString8();
1015
+ }
1016
+
1017
+ finally {
1018
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
1019
+ diplomatReceive.free();
1020
+ write.free();
1021
+ }
1022
+ }
1023
+
1024
+ frameJson(timeMs) {
1025
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
1026
+
1027
+ const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
1028
+
1029
+
1030
+ const result = wasm.BuildAnimation_frame_json(diplomatReceive.buffer, this.ffiValue, timeMs, write.buffer);
1031
+
1032
+ try {
1033
+ if (!diplomatReceive.resultFlag) {
1034
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
1035
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
1036
+ }
1037
+ return write.readString8();
1038
+ }
1039
+
1040
+ finally {
1041
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
1042
+ diplomatReceive.free();
1043
+ write.free();
1044
+ }
1045
+ }
1046
+
1047
+ /**
1048
+ * Fill a parametric shape and record its voxels as ordered groups in
1049
+ * the same transactional construction operation.
1050
+ */
1051
+ fillAlongParameter(shape, brush, groupCount) {
1052
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
1053
+
1054
+
1055
+ const result = wasm.BuildAnimation_fill_along_parameter(diplomatReceive.buffer, this.ffiValue, shape.ffiValue, brush.ffiValue, groupCount);
1056
+
1057
+ try {
1058
+ if (!diplomatReceive.resultFlag) {
1059
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
1060
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
1061
+ }
1062
+ return (new Uint32Array(wasm.memory.buffer, diplomatReceive.buffer, 1))[0];
1063
+ }
1064
+
1065
+ finally {
1066
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
1067
+ diplomatReceive.free();
1068
+ }
1069
+ }
1070
+
1071
+ addArmorStand(x, y, z, yaw, armorMaterial) {
1072
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
1073
+
1074
+ const armorMaterialSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, armorMaterial)));
1075
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
1076
+
1077
+
1078
+ const result = wasm.BuildAnimation_add_armor_stand(diplomatReceive.buffer, this.ffiValue, x, y, z, yaw, armorMaterialSlice.ptr);
1079
+
1080
+ try {
1081
+ if (!diplomatReceive.resultFlag) {
1082
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
1083
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
1084
+ }
1085
+ return (new Uint32Array(wasm.memory.buffer, diplomatReceive.buffer, 1))[0];
1086
+ }
1087
+
1088
+ finally {
1089
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
1090
+ functionCleanupArena.free();
1091
+
1092
+ diplomatReceive.free();
1093
+ }
1094
+ }
1095
+
1096
+ animateCamera(effect, offsetMs) {
1097
+ wasm.BuildAnimation_animate_camera(this.ffiValue, effect.ffiValue, offsetMs);
1098
+
1099
+ try {}
1100
+
1101
+ finally {
1102
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
1103
+ }
1104
+ }
1105
+
1106
+ frameCount(fps, holdMs) {
1107
+
1108
+ const result = wasm.BuildAnimation_frame_count(this.ffiValue, fps, holdMs);
1109
+
1110
+ try {
1111
+ return result;
1112
+ }
1113
+
1114
+ finally {
1115
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
1116
+ }
1117
+ }
1118
+
1119
+ groupCount() {
1120
+
1121
+ const result = wasm.BuildAnimation_group_count(this.ffiValue);
1122
+
1123
+ try {
1124
+ return result;
1125
+ }
1126
+
1127
+ finally {
1128
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
1129
+ }
1130
+ }
1131
+
1132
+ durationMs() {
1133
+
1134
+ const result = wasm.BuildAnimation_duration_ms(this.ffiValue);
1135
+
1136
+ try {
1137
+ return result;
1138
+ }
1139
+
1140
+ finally {
1141
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
1142
+ }
1143
+ }
1144
+
1145
+ constructor(symbol, ptr, selfEdge) {
1146
+ return this.#internalConstructor(...arguments)
1147
+ }
1148
+ }