nucleation 0.6.0 → 0.7.0

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 (190) hide show
  1. package/AnimationEffect.d.mts +44 -0
  2. package/AnimationEffect.d.ts +1 -1
  3. package/Autostack.d.mts +43 -0
  4. package/Autostack.d.ts +2 -2
  5. package/BlockPos.d.mts +28 -0
  6. package/BlockState.d.mts +39 -0
  7. package/BlockState.d.ts +1 -1
  8. package/Blocks.d.mts +91 -0
  9. package/Blocks.d.ts +1 -1
  10. package/Brush.d.mts +99 -0
  11. package/Brush.d.ts +21 -12
  12. package/Brush.mjs +66 -9
  13. package/BuildAnimation.d.mts +142 -0
  14. package/BuildAnimation.d.ts +5 -5
  15. package/BuildingTool.d.mts +46 -0
  16. package/BuildingTool.d.ts +4 -4
  17. package/CellularSdfConfig.d.mts +22 -0
  18. package/CellularSdfConfig.d.ts +22 -0
  19. package/CellularSdfConfig.mjs +69 -0
  20. package/ChunkMeshResult.d.mts +75 -0
  21. package/ChunkMeshResult.d.ts +7 -7
  22. package/CircuitBuilder.d.mts +118 -0
  23. package/CircuitBuilder.d.ts +6 -6
  24. package/Curve3D.d.mts +27 -0
  25. package/Curve3D.d.ts +1 -1
  26. package/DefinitionRegion.d.mts +274 -0
  27. package/DefinitionRegion.d.ts +5 -5
  28. package/Diff.d.mts +88 -0
  29. package/Diff.d.ts +2 -2
  30. package/Dimensions.d.mts +28 -0
  31. package/DistanceField.d.mts +39 -0
  32. package/DistanceField.d.ts +1 -1
  33. package/ExecutionMode.d.mts +42 -0
  34. package/ExecutionMode.d.ts +2 -2
  35. package/Field3.d.mts +40 -0
  36. package/Field3.d.ts +40 -0
  37. package/Field3.mjs +160 -0
  38. package/FieldProgram.d.mts +40 -0
  39. package/FieldProgram.d.ts +40 -0
  40. package/FieldProgram.mjs +167 -0
  41. package/FieldProgramBinaryOp.d.mts +42 -0
  42. package/FieldProgramBinaryOp.d.ts +42 -0
  43. package/FieldProgramBinaryOp.mjs +118 -0
  44. package/FieldProgramBuilder.d.mts +104 -0
  45. package/FieldProgramBuilder.d.ts +104 -0
  46. package/FieldProgramBuilder.mjs +486 -0
  47. package/FieldProgramDistanceKind.d.mts +26 -0
  48. package/FieldProgramDistanceKind.d.ts +26 -0
  49. package/FieldProgramDistanceKind.mjs +78 -0
  50. package/FieldProgramUnaryOp.d.mts +34 -0
  51. package/FieldProgramUnaryOp.d.ts +34 -0
  52. package/FieldProgramUnaryOp.mjs +102 -0
  53. package/FieldProgramValueType.d.mts +25 -0
  54. package/FieldProgramValueType.d.ts +25 -0
  55. package/FieldProgramValueType.mjs +75 -0
  56. package/FieldRange.d.mts +15 -0
  57. package/FieldRange.d.ts +15 -0
  58. package/FieldRange.mjs +108 -0
  59. package/Fingerprint.d.mts +44 -0
  60. package/Fingerprint.d.ts +2 -2
  61. package/GeneratedChunk.d.mts +35 -0
  62. package/GeneratedChunk.d.ts +35 -0
  63. package/GeneratedChunk.mjs +178 -0
  64. package/GeneratedChunkCoverage.d.mts +25 -0
  65. package/GeneratedChunkCoverage.d.ts +25 -0
  66. package/GeneratedChunkCoverage.mjs +75 -0
  67. package/GeneratedChunkOverlayMode.d.mts +24 -0
  68. package/GeneratedChunkOverlayMode.d.ts +24 -0
  69. package/GeneratedChunkOverlayMode.mjs +72 -0
  70. package/GeneratedWorldStream.d.mts +28 -0
  71. package/GeneratedWorldStream.d.ts +28 -0
  72. package/GeneratedWorldStream.mjs +86 -0
  73. package/Geo.d.mts +41 -0
  74. package/Geo.d.ts +2 -2
  75. package/InterpolationSpace.d.mts +25 -0
  76. package/IoLayout.d.mts +26 -0
  77. package/IoLayoutBuilder.d.mts +73 -0
  78. package/IoLayoutBuilder.d.ts +4 -4
  79. package/IoType.d.mts +41 -0
  80. package/ItemModelConfig.d.mts +65 -0
  81. package/ItemModelConfig.d.ts +1 -1
  82. package/ItemModelPackBuilder.d.mts +32 -0
  83. package/ItemModelPackBuilder.d.ts +1 -1
  84. package/ItemModelResult.d.mts +72 -0
  85. package/ItemModelResult.d.ts +7 -7
  86. package/ItemScale.d.mts +31 -0
  87. package/LayoutFunction.d.mts +52 -0
  88. package/LayoutFunction.d.ts +1 -1
  89. package/MchprsWorld.d.mts +131 -0
  90. package/MchprsWorld.d.ts +3 -3
  91. package/MeshBounds.d.mts +40 -0
  92. package/MeshConfig.d.mts +101 -0
  93. package/MeshConfig.d.ts +1 -1
  94. package/MeshJob.d.mts +44 -0
  95. package/MeshJob.d.ts +7 -7
  96. package/MeshPhase.d.mts +38 -0
  97. package/MeshProgress.d.mts +32 -0
  98. package/MeshProgress.d.ts +1 -1
  99. package/MeshResult.d.mts +65 -0
  100. package/MeshResult.d.ts +5 -5
  101. package/MultiMeshResult.d.mts +50 -0
  102. package/MultiMeshResult.d.ts +5 -5
  103. package/Nbt.d.mts +50 -0
  104. package/Nbt.d.ts +1 -1
  105. package/NucleationError.d.mts +41 -0
  106. package/NucleationError.d.ts +5 -0
  107. package/NucleationError.mjs +8 -1
  108. package/OutputCondition.d.mts +45 -0
  109. package/OutputCondition.d.ts +1 -1
  110. package/Palette.d.mts +145 -0
  111. package/Palette.d.ts +9 -1
  112. package/Palette.mjs +35 -0
  113. package/PaletteBuilder.d.mts +119 -0
  114. package/PaletteBuilder.d.ts +2 -2
  115. package/RawMeshExport.d.mts +74 -0
  116. package/RawMeshExport.d.ts +4 -4
  117. package/RedstoneGraph.d.mts +58 -0
  118. package/RedstoneGraph.d.ts +1 -1
  119. package/RegionBounds.d.mts +41 -0
  120. package/RenderConfig.d.mts +101 -0
  121. package/RenderConfig.d.ts +1 -1
  122. package/Renderer.d.mts +51 -0
  123. package/Renderer.d.ts +4 -4
  124. package/ResourcePack.d.mts +105 -0
  125. package/ResourcePack.d.ts +3 -3
  126. package/ResourcePackList.d.mts +32 -0
  127. package/Schematic.d.mts +734 -0
  128. package/Schematic.d.ts +4 -4
  129. package/SchematicBuilder.d.mts +103 -0
  130. package/SchematicBuilder.d.ts +2 -2
  131. package/SchematicRegions.d.mts +93 -0
  132. package/SchematicRegions.d.ts +3 -3
  133. package/Scripting.d.mts +40 -0
  134. package/Scripting.d.ts +2 -2
  135. package/Sdf.d.mts +234 -0
  136. package/Sdf.d.ts +208 -13
  137. package/Sdf.mjs +1106 -11
  138. package/SdfAxis.d.mts +25 -0
  139. package/SdfAxis.d.ts +25 -0
  140. package/SdfAxis.mjs +75 -0
  141. package/SdfBounds.d.mts +19 -0
  142. package/SdfBounds.d.ts +19 -0
  143. package/SdfBounds.mjs +160 -0
  144. package/SdfCellMode.d.mts +26 -0
  145. package/SdfCellMode.d.ts +26 -0
  146. package/SdfCellMode.mjs +78 -0
  147. package/SdfNormal.d.mts +16 -0
  148. package/SdfNormal.d.ts +16 -0
  149. package/SdfNormal.mjs +121 -0
  150. package/Shape.d.mts +143 -0
  151. package/Shape.d.ts +2 -2
  152. package/SortStrategy.d.mts +86 -0
  153. package/SortStrategy.d.ts +1 -1
  154. package/Store.d.mts +83 -0
  155. package/Store.d.ts +2 -2
  156. package/StoreIo.d.mts +71 -0
  157. package/StoreIo.d.ts +2 -2
  158. package/TextureAtlas.d.mts +40 -0
  159. package/TextureAtlas.d.ts +4 -4
  160. package/TextureInfo.d.mts +34 -0
  161. package/TypedCircuitExecutor.d.mts +101 -0
  162. package/TypedCircuitExecutor.d.ts +6 -6
  163. package/Value.d.mts +73 -0
  164. package/Value.d.ts +1 -1
  165. package/VideoConfig.d.mts +15 -0
  166. package/Voxelizer.d.mts +58 -0
  167. package/Voxelizer.d.ts +4 -4
  168. package/WorldChunkView.d.mts +75 -0
  169. package/WorldChunkView.d.ts +2 -2
  170. package/WorldGenerator.d.mts +75 -0
  171. package/WorldGenerator.d.ts +75 -0
  172. package/WorldGenerator.mjs +255 -0
  173. package/WorldSink.d.mts +50 -0
  174. package/WorldSink.d.ts +2 -2
  175. package/WorldStream.d.mts +45 -0
  176. package/WorldStream.d.ts +2 -2
  177. package/WsPartitionHints.d.mts +29 -0
  178. package/WsPartitionHints.d.ts +1 -1
  179. package/WsProfile.d.mts +46 -0
  180. package/WsProfile.d.ts +1 -1
  181. package/WsRunResult.d.mts +83 -0
  182. package/WsRunResult.d.ts +5 -5
  183. package/WsSegmentJob.d.mts +28 -0
  184. package/WsSegmentJob.d.ts +1 -1
  185. package/diplomat-runtime.d.mts +15 -0
  186. package/index.d.mts +177 -0
  187. package/index.d.ts +106 -70
  188. package/index.mjs +37 -1
  189. package/nucleation.wasm +0 -0
  190. package/package.json +2 -1
@@ -0,0 +1,101 @@
1
+ // generated by diplomat-tool
2
+ import type { NucleationError } from "./NucleationError.mjs"
3
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
4
+
5
+
6
+
7
+ /**
8
+ * Mesh generation configuration. Wraps {@link crate::meshing::MeshConfig}.
9
+ */
10
+ export class MeshConfig {
11
+ /** @internal */
12
+ get ffiValue(): pointer;
13
+ /** @internal */
14
+ constructor();
15
+
16
+
17
+ /**
18
+ * Create a config with default settings: hidden-face culling on,
19
+ * ambient occlusion on (intensity 0.4), no biome, atlas max size 4096,
20
+ * occluded-block culling on, greedy meshing off.
21
+ */
22
+ static create(): MeshConfig;
23
+
24
+ /**
25
+ * Enable face culling between adjacent solid blocks (default: true).
26
+ */
27
+ setCullHiddenFaces(val: boolean): void;
28
+
29
+ /**
30
+ * Whether hidden-face culling is enabled.
31
+ */
32
+ cullHiddenFaces(): boolean;
33
+
34
+ /**
35
+ * Enable ambient occlusion (default: true).
36
+ */
37
+ setAmbientOcclusion(val: boolean): void;
38
+
39
+ /**
40
+ * Whether ambient occlusion is enabled.
41
+ */
42
+ ambientOcclusion(): boolean;
43
+
44
+ /**
45
+ * Set ambient-occlusion intensity, 0.0 (no darkening) to 1.0 (full
46
+ * darkening). Default: 0.4.
47
+ */
48
+ setAoIntensity(val: number): void;
49
+
50
+ /**
51
+ * The ambient-occlusion intensity (0.0–1.0).
52
+ */
53
+ aoIntensity(): number;
54
+
55
+ /**
56
+ * Set the biome used for tinting (e.g. "plains", "swamp").
57
+ */
58
+ setBiome(biome: string): void;
59
+
60
+ /**
61
+ * Clear the biome (old ABI: `meshconfig_set_biome(NULL)`).
62
+ */
63
+ clearBiome(): void;
64
+
65
+ /**
66
+ * The configured biome; `NotFound` if none is set.
67
+ */
68
+ biome(): string;
69
+
70
+ /**
71
+ * Set the maximum texture-atlas dimension in pixels (default: 4096).
72
+ */
73
+ setAtlasMaxSize(size: number): void;
74
+
75
+ /**
76
+ * The maximum texture-atlas dimension in pixels.
77
+ */
78
+ atlasMaxSize(): number;
79
+
80
+ /**
81
+ * Skip blocks fully hidden by opaque neighbors on all 6 sides
82
+ * (default: true).
83
+ */
84
+ setCullOccludedBlocks(val: boolean): void;
85
+
86
+ /**
87
+ * Whether occluded-block culling is enabled.
88
+ */
89
+ cullOccludedBlocks(): boolean;
90
+
91
+ /**
92
+ * Merge adjacent coplanar faces into larger quads to reduce triangle
93
+ * count (default: false).
94
+ */
95
+ setGreedyMeshing(val: boolean): void;
96
+
97
+ /**
98
+ * Whether greedy meshing is enabled.
99
+ */
100
+ greedyMeshing(): boolean;
101
+ }
package/MeshConfig.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // generated by diplomat-tool
2
- import type { NucleationError } from "./NucleationError"
2
+ import type { NucleationError } from "./NucleationError.mjs"
3
3
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
4
4
 
5
5
 
package/MeshJob.d.mts ADDED
@@ -0,0 +1,44 @@
1
+ // generated by diplomat-tool
2
+ import type { ChunkMeshResult } from "./ChunkMeshResult.mjs"
3
+ import type { MeshConfig } from "./MeshConfig.mjs"
4
+ import type { MeshProgress } from "./MeshProgress.mjs"
5
+ import type { NucleationError } from "./NucleationError.mjs"
6
+ import type { ResourcePack } from "./ResourcePack.mjs"
7
+ import type { Schematic } from "./Schematic.mjs"
8
+ import type { TextureAtlas } from "./TextureAtlas.mjs"
9
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
10
+
11
+
12
+
13
+ /**
14
+ * A chunk-meshing job running on a background thread. Replaces the old
15
+ * `schematic_mesh_chunks_with_atlas_progress` C callback: poll it from a
16
+ * timer loop with {@link MeshJob::poll_progress}, then call
17
+ * {@link MeshJob::take_result} once (it blocks until the job finishes and
18
+ * consumes the job — a second call returns `AlreadyConsumed`).
19
+ */
20
+ export class MeshJob {
21
+ /** @internal */
22
+ get ffiValue(): pointer;
23
+ /** @internal */
24
+ constructor();
25
+
26
+
27
+ /**
28
+ * Kick off chunk meshing with a shared atlas on a background thread
29
+ * and return immediately. Takes the same parameters as
30
+ * {@link ChunkMeshResult::create_with_atlas}.
31
+ */
32
+ static start(schematic: Schematic, pack: ResourcePack, config: MeshConfig, chunkSize: number, atlas: TextureAtlas): MeshJob;
33
+
34
+ /**
35
+ * Cheap, non-blocking progress snapshot. Call from a timer/poll loop.
36
+ */
37
+ pollProgress(): MeshProgress;
38
+
39
+ /**
40
+ * Block until the job finishes (if it hasn't already) and return the
41
+ * result. Consumes the job: a second call returns `AlreadyConsumed`.
42
+ */
43
+ takeResult(): ChunkMeshResult;
44
+ }
package/MeshJob.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  // generated by diplomat-tool
2
- import type { ChunkMeshResult } from "./ChunkMeshResult"
3
- import type { MeshConfig } from "./MeshConfig"
4
- import type { MeshProgress } from "./MeshProgress"
5
- import type { NucleationError } from "./NucleationError"
6
- import type { ResourcePack } from "./ResourcePack"
7
- import type { Schematic } from "./Schematic"
8
- import type { TextureAtlas } from "./TextureAtlas"
2
+ import type { ChunkMeshResult } from "./ChunkMeshResult.mjs"
3
+ import type { MeshConfig } from "./MeshConfig.mjs"
4
+ import type { MeshProgress } from "./MeshProgress.mjs"
5
+ import type { NucleationError } from "./NucleationError.mjs"
6
+ import type { ResourcePack } from "./ResourcePack.mjs"
7
+ import type { Schematic } from "./Schematic.mjs"
8
+ import type { TextureAtlas } from "./TextureAtlas.mjs"
9
9
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
10
10
 
11
11
 
@@ -0,0 +1,38 @@
1
+ // generated by diplomat-tool
2
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
3
+
4
+
5
+
6
+ /**
7
+ * Phase of a running {@link MeshJob}.
8
+ */
9
+ export class MeshPhase {
10
+
11
+ /** @internal */
12
+ static fromValue(value: MeshPhase | string): MeshPhase;
13
+
14
+ get value(): string;
15
+
16
+ /** @internal */
17
+ get ffiValue(): number;
18
+
19
+ /**
20
+ * Scanning palettes / building the shared texture atlas.
21
+ */
22
+ static BuildingAtlas : MeshPhase;
23
+ /**
24
+ * Meshing individual chunks (`current` / `total` advance here).
25
+ */
26
+ static MeshingChunks : MeshPhase;
27
+ /**
28
+ * All chunks meshed; `take_result` will not block.
29
+ */
30
+ static Complete : MeshPhase;
31
+ /**
32
+ * The job failed; `take_result` returns the error.
33
+ */
34
+ static Failed : MeshPhase;
35
+
36
+
37
+ constructor(value: MeshPhase | string );
38
+ }
@@ -0,0 +1,32 @@
1
+ // generated by diplomat-tool
2
+ import type { MeshPhase } from "./MeshPhase.mjs"
3
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
4
+
5
+ export type MeshProgress_obj = {
6
+ phase: MeshPhase;
7
+ current: number;
8
+ total: number;
9
+ };
10
+
11
+
12
+
13
+ /**
14
+ * Snapshot of a {@link MeshJob}'s progress.
15
+ */
16
+ export class MeshProgress {
17
+ get phase(): MeshPhase;
18
+ set phase(value: MeshPhase);
19
+ get current(): number;
20
+ set current(value: number);
21
+ get total(): number;
22
+ set total(value: number);
23
+ /** @internal */
24
+ static fromFields(structObj : MeshProgress_obj) : MeshProgress;
25
+
26
+ /**
27
+ * Create `MeshProgress` from an object that contains all of `MeshProgress`s fields.
28
+ * Optional fields do not need to be included in the provided object.
29
+ */
30
+ constructor(structObj: MeshProgress_obj);
31
+
32
+ }
package/MeshProgress.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // generated by diplomat-tool
2
- import type { MeshPhase } from "./MeshPhase"
2
+ import type { MeshPhase } from "./MeshPhase.mjs"
3
3
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
4
4
 
5
5
  export type MeshProgress_obj = {
@@ -0,0 +1,65 @@
1
+ // generated by diplomat-tool
2
+ import type { MeshBounds } from "./MeshBounds.mjs"
3
+ import type { MeshConfig } from "./MeshConfig.mjs"
4
+ import type { NucleationError } from "./NucleationError.mjs"
5
+ import type { ResourcePack } from "./ResourcePack.mjs"
6
+ import type { Schematic } from "./Schematic.mjs"
7
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
8
+
9
+
10
+
11
+ /**
12
+ * A single mesh output. Wraps {@link crate::meshing::MeshResult}.
13
+ */
14
+ export class MeshResult {
15
+ /** @internal */
16
+ get ffiValue(): pointer;
17
+ /** @internal */
18
+ constructor();
19
+
20
+
21
+ /**
22
+ * Mesh an entire schematic in one pass (old ABI: `schematic_to_mesh`).
23
+ */
24
+ static create(schematic: Schematic, pack: ResourcePack, config: MeshConfig): MeshResult;
25
+
26
+ /**
27
+ * Mesh a schematic with USDZ-compatible output (old ABI: `schematic_to_usdz`).
28
+ */
29
+ static createUsdz(schematic: Schematic, pack: ResourcePack, config: MeshConfig): MeshResult;
30
+
31
+ /**
32
+ * The mesh as a binary GLB, base64-encoded.
33
+ */
34
+ glbDataB64(): string;
35
+
36
+ /**
37
+ * The mesh as a USDZ archive, base64-encoded.
38
+ */
39
+ usdzDataB64(): string;
40
+
41
+ /**
42
+ * The mesh serialized in the NUCM cache format, base64-encoded.
43
+ */
44
+ nucmDataB64(): string;
45
+
46
+ /**
47
+ * Total number of vertices in the mesh.
48
+ */
49
+ vertexCount(): number;
50
+
51
+ /**
52
+ * Total number of triangles in the mesh.
53
+ */
54
+ triangleCount(): number;
55
+
56
+ /**
57
+ * Whether the mesh contains any transparent or translucent geometry.
58
+ */
59
+ hasTransparency(): boolean;
60
+
61
+ /**
62
+ * Axis-aligned bounding box of the mesh, in world units.
63
+ */
64
+ bounds(): MeshBounds;
65
+ }
package/MeshResult.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  // generated by diplomat-tool
2
- import type { MeshBounds } from "./MeshBounds"
3
- import type { MeshConfig } from "./MeshConfig"
4
- import type { NucleationError } from "./NucleationError"
5
- import type { ResourcePack } from "./ResourcePack"
6
- import type { Schematic } from "./Schematic"
2
+ import type { MeshBounds } from "./MeshBounds.mjs"
3
+ import type { MeshConfig } from "./MeshConfig.mjs"
4
+ import type { NucleationError } from "./NucleationError.mjs"
5
+ import type { ResourcePack } from "./ResourcePack.mjs"
6
+ import type { Schematic } from "./Schematic.mjs"
7
7
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
8
8
 
9
9
 
@@ -0,0 +1,50 @@
1
+ // generated by diplomat-tool
2
+ import type { MeshConfig } from "./MeshConfig.mjs"
3
+ import type { MeshResult } from "./MeshResult.mjs"
4
+ import type { NucleationError } from "./NucleationError.mjs"
5
+ import type { ResourcePack } from "./ResourcePack.mjs"
6
+ import type { Schematic } from "./Schematic.mjs"
7
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
8
+
9
+
10
+
11
+ /**
12
+ * Per-region mesh results. Wraps {@link crate::meshing::MultiMeshResult}.
13
+ */
14
+ export class MultiMeshResult {
15
+ /** @internal */
16
+ get ffiValue(): pointer;
17
+ /** @internal */
18
+ constructor();
19
+
20
+
21
+ /**
22
+ * Mesh each region separately (old ABI: `schematic_mesh_by_region`).
23
+ */
24
+ static create(schematic: Schematic, pack: ResourcePack, config: MeshConfig): MultiMeshResult;
25
+
26
+ /**
27
+ * Region names, as a JSON array string.
28
+ */
29
+ regionNamesJson(): string;
30
+
31
+ /**
32
+ * The mesh for one region (cloned).
33
+ */
34
+ getMesh(regionName: string): MeshResult;
35
+
36
+ /**
37
+ * Total vertex count across all region meshes.
38
+ */
39
+ totalVertexCount(): number;
40
+
41
+ /**
42
+ * Total triangle count across all region meshes.
43
+ */
44
+ totalTriangleCount(): number;
45
+
46
+ /**
47
+ * Number of region meshes.
48
+ */
49
+ meshCount(): number;
50
+ }
@@ -1,9 +1,9 @@
1
1
  // generated by diplomat-tool
2
- import type { MeshConfig } from "./MeshConfig"
3
- import type { MeshResult } from "./MeshResult"
4
- import type { NucleationError } from "./NucleationError"
5
- import type { ResourcePack } from "./ResourcePack"
6
- import type { Schematic } from "./Schematic"
2
+ import type { MeshConfig } from "./MeshConfig.mjs"
3
+ import type { MeshResult } from "./MeshResult.mjs"
4
+ import type { NucleationError } from "./NucleationError.mjs"
5
+ import type { ResourcePack } from "./ResourcePack.mjs"
6
+ import type { Schematic } from "./Schematic.mjs"
7
7
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
8
8
 
9
9
 
package/Nbt.d.mts ADDED
@@ -0,0 +1,50 @@
1
+ // generated by diplomat-tool
2
+ import type { NucleationError } from "./NucleationError.mjs"
3
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
4
+
5
+
6
+
7
+ /**
8
+ * Namespace type for the free-standing NBT builder helpers (the old
9
+ * `nbt_text_build` / `nbt_chest_build` / `nbt_sign_build`), following the
10
+ * static-methods-on-a-dummy-opaque pattern.
11
+ */
12
+ export class Nbt {
13
+ /** @internal */
14
+ get ffiValue(): pointer;
15
+ /** @internal */
16
+ constructor();
17
+
18
+
19
+ /**
20
+ * Build a Minecraft JSON text-component string.
21
+ *
22
+ * `color` may be empty (no color). `bold` and `italic` use `-1` for
23
+ * unset, `0` for false, nonzero for true.
24
+ */
25
+ static textBuild(s: string, color: string, bold: number, italic: number): string;
26
+
27
+ /**
28
+ * Build a chest-NBT SNBT string for use as the `{...}` portion of a block
29
+ * string.
30
+ *
31
+ * `items_json` is a JSON array of `{"id": string, "count"?: int,
32
+ * "slot"?: int}` entries (may be empty or `[]`); a missing/non-positive
33
+ * `count` defaults to 1, a missing/negative `slot` auto-assigns
34
+ * positionally. `name` is an optional plain-text custom name (empty = no
35
+ * `CustomName`); it is wrapped in a JSON text component automatically
36
+ * unless it already starts with `{`.
37
+ */
38
+ static chestBuild(itemsJson: string, name: string): string;
39
+
40
+ /**
41
+ * Build a modern (1.20+) sign-NBT SNBT string.
42
+ *
43
+ * `front_json` and `back_json` are JSON arrays of up to 4 line strings
44
+ * (either may be empty or `[]`). Each line may be a plain string
45
+ * (auto-wrapped via `text_build`) or an already-built JSON component
46
+ * (starts with `{`). `color` is the dye color string (empty defaults to
47
+ * `"black"`).
48
+ */
49
+ static signBuild(frontJson: string, backJson: string, color: string, glowing: boolean, waxed: boolean): string;
50
+ }
package/Nbt.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // generated by diplomat-tool
2
- import type { NucleationError } from "./NucleationError"
2
+ import type { NucleationError } from "./NucleationError.mjs"
3
3
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
4
4
 
5
5
 
@@ -0,0 +1,41 @@
1
+ // generated by diplomat-tool
2
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
3
+
4
+
5
+
6
+ /**
7
+ * Every fallible method in the bridge returns `Result<T, NucleationError>` —
8
+ * see `stencil/docs/nucleation-error.md` for how these variants were derived from
9
+ * the three error conventions the old hand-written `ffi` module mixed.
10
+ */
11
+ export class NucleationError {
12
+
13
+ /** @internal */
14
+ static fromValue(value: NucleationError | string): NucleationError;
15
+
16
+ get value(): string;
17
+
18
+ /** @internal */
19
+ get ffiValue(): number;
20
+
21
+ static NullArgument : NucleationError;
22
+ static InvalidArgument : NucleationError;
23
+ static Parse : NucleationError;
24
+ static Serialize : NucleationError;
25
+ static Io : NucleationError;
26
+ static Lock : NucleationError;
27
+ static Store : NucleationError;
28
+ static Mesh : NucleationError;
29
+ static Render : NucleationError;
30
+ static Simulation : NucleationError;
31
+ static AlreadyConsumed : NucleationError;
32
+ static NotFound : NucleationError;
33
+ /**
34
+ * A world-generation source failed while producing a chunk, even though
35
+ * the request itself was well-formed (see `world_generation`).
36
+ */
37
+ static Generation : NucleationError;
38
+
39
+
40
+ constructor(value: NucleationError | string );
41
+ }
@@ -30,6 +30,11 @@ export class NucleationError {
30
30
  static Simulation : NucleationError;
31
31
  static AlreadyConsumed : NucleationError;
32
32
  static NotFound : NucleationError;
33
+ /**
34
+ * A world-generation source failed while producing a chunk, even though
35
+ * the request itself was well-formed (see `world_generation`).
36
+ */
37
+ static Generation : NucleationError;
33
38
 
34
39
 
35
40
  constructor(value: NucleationError | string );
@@ -24,7 +24,8 @@ export class NucleationError {
24
24
  ["Render", 8],
25
25
  ["Simulation", 9],
26
26
  ["AlreadyConsumed", 10],
27
- ["NotFound", 11]
27
+ ["NotFound", 11],
28
+ ["Generation", 12]
28
29
  ]);
29
30
 
30
31
  static getAllEntries() {
@@ -82,6 +83,7 @@ export class NucleationError {
82
83
  new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 9),
83
84
  new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 10),
84
85
  new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 11),
86
+ new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 12),
85
87
  ];
86
88
 
87
89
  static NullArgument = NucleationError.#objectValues[0];
@@ -96,6 +98,11 @@ export class NucleationError {
96
98
  static Simulation = NucleationError.#objectValues[9];
97
99
  static AlreadyConsumed = NucleationError.#objectValues[10];
98
100
  static NotFound = NucleationError.#objectValues[11];
101
+ /**
102
+ * A world-generation source failed while producing a chunk, even though
103
+ * the request itself was well-formed (see `world_generation`).
104
+ */
105
+ static Generation = NucleationError.#objectValues[12];
99
106
 
100
107
 
101
108
  constructor(value) {
@@ -0,0 +1,45 @@
1
+ // generated by diplomat-tool
2
+ import type { Value } from "./Value.mjs"
3
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
4
+
5
+
6
+
7
+ /**
8
+ * A condition on an output value, for `ExecutionMode::until_condition`
9
+ * (PORTING rule 10).
10
+ */
11
+ export class OutputCondition {
12
+ /** @internal */
13
+ get ffiValue(): pointer;
14
+ /** @internal */
15
+ constructor();
16
+
17
+
18
+ /**
19
+ * Met when the output equals `value`.
20
+ */
21
+ static equals(value: Value): OutputCondition;
22
+
23
+ /**
24
+ * Met when the output does not equal `value`.
25
+ */
26
+ static notEquals(value: Value): OutputCondition;
27
+
28
+ /**
29
+ * Met when the output is greater than `value`. Numeric only: both
30
+ * sides must be the same numeric type (u32/i32/f32), else never met.
31
+ */
32
+ static greaterThan(value: Value): OutputCondition;
33
+
34
+ /**
35
+ * Met when the output is less than `value`. Numeric only: both sides
36
+ * must be the same numeric type (u32/i32/f32), else never met.
37
+ */
38
+ static lessThan(value: Value): OutputCondition;
39
+
40
+ /**
41
+ * Met when `output & mask` is non-zero (flag checking). Integer
42
+ * outputs (u32/i32) only; never met for other types.
43
+ */
44
+ static bitwiseAnd(mask: number): OutputCondition;
45
+ }
@@ -1,5 +1,5 @@
1
1
  // generated by diplomat-tool
2
- import type { Value } from "./Value"
2
+ import type { Value } from "./Value.mjs"
3
3
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
4
4
 
5
5