nucleation 0.5.1 → 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
package/Shape.d.mts ADDED
@@ -0,0 +1,143 @@
1
+ // generated by diplomat-tool
2
+ import type { Curve3D } from "./Curve3D.mjs"
3
+ import type { NucleationError } from "./NucleationError.mjs"
4
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
5
+
6
+
7
+
8
+ /**
9
+ * A solid region of blocks: primitives (sphere, cuboid, …) and boolean
10
+ * combinations thereof. Wraps `ShapeEnum`.
11
+ */
12
+ export class Shape {
13
+ /** @internal */
14
+ get ffiValue(): pointer;
15
+ /** @internal */
16
+ constructor();
17
+
18
+
19
+ /**
20
+ * Thicken a sampled 3D curve into a parametric tube with the given radius.
21
+ * Inputs outside voxel-coordinate or bounded-work limits are rejected.
22
+ */
23
+ static tubeAlong(curve: Curve3D, radius: number): Shape;
24
+
25
+ /**
26
+ * Sphere centered at (`cx`, `cy`, `cz`) (truncated to block coordinates,
27
+ * matching the old `shape_sphere`).
28
+ */
29
+ static sphere(cx: number, cy: number, cz: number, radius: number): Shape;
30
+
31
+ /**
32
+ * Axis-aligned box spanning the two corners (inclusive).
33
+ */
34
+ static cuboid(minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): Shape;
35
+
36
+ /**
37
+ * A closed 2D polygon extruded between two Y levels (inclusive). The
38
+ * footprint is `polygon_json`, a JSON array of `[x, z]` world-coordinate
39
+ * pairs in order (winding does not matter; the ring closes implicitly);
40
+ * any simple polygon works, concave ones included. This is the shape
41
+ * behind extruded building footprints, lake outlines, and plot fills.
42
+ * Errors with `Parse` on invalid JSON and `InvalidArgument` on non-UTF-8
43
+ * or fewer than three vertices.
44
+ */
45
+ static polygonPrism(polygonJson: string, yMin: number, yMax: number): Shape;
46
+
47
+ /**
48
+ * Ellipsoid centered at (`cx`, `cy`, `cz`) with per-axis radii.
49
+ */
50
+ static ellipsoid(cx: number, cy: number, cz: number, rx: number, ry: number, rz: number): Shape;
51
+
52
+ /**
53
+ * Cylinder from base point along an axis vector.
54
+ */
55
+ static cylinder(bx: number, by: number, bz: number, ax: number, ay: number, az: number, radius: number, height: number): Shape;
56
+
57
+ /**
58
+ * Cylinder spanning the segment between two points.
59
+ */
60
+ static cylinderBetween(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number, radius: number): Shape;
61
+
62
+ /**
63
+ * Cone with apex at (`ax`, `ay`, `az`) opening along direction (`dx`, `dy`, `dz`).
64
+ */
65
+ static cone(ax: number, ay: number, az: number, dx: number, dy: number, dz: number, radius: number, height: number): Shape;
66
+
67
+ /**
68
+ * Torus centered at (`cx`, `cy`, `cz`) with the given major/minor radii and
69
+ * axis (`ax`, `ay`, `az`).
70
+ */
71
+ static torus(cx: number, cy: number, cz: number, majorR: number, minorR: number, ax: number, ay: number, az: number): Shape;
72
+
73
+ /**
74
+ * Rectangular pyramid: base center, half-extents, height, up-axis.
75
+ */
76
+ static pyramid(bx: number, by: number, bz: number, halfW: number, halfD: number, height: number, ax: number, ay: number, az: number): Shape;
77
+
78
+ /**
79
+ * Flat disk: center, radius, plane normal, thickness.
80
+ */
81
+ static disk(cx: number, cy: number, cz: number, radius: number, nx: number, ny: number, nz: number, thickness: number): Shape;
82
+
83
+ /**
84
+ * Finite plane patch: origin, two spanning vectors `u`/`v`, extents along
85
+ * each, thickness.
86
+ */
87
+ static plane(ox: number, oy: number, oz: number, ux: number, uy: number, uz: number, vx: number, vy: number, vz: number, uExt: number, vExt: number, thickness: number): Shape;
88
+
89
+ /**
90
+ * Filled triangle between three vertices, thickened by `thickness`.
91
+ */
92
+ static triangle(ax: number, ay: number, az: number, bx: number, by: number, bz: number, cx: number, cy: number, cz: number, thickness: number): Shape;
93
+
94
+ /**
95
+ * Line segment between two points, thickened by `thickness`.
96
+ */
97
+ static line(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number, thickness: number): Shape;
98
+
99
+ /**
100
+ * Bézier curve through `control_points` (flat `[x0, y0, z0, x1, y1, z1, …]`,
101
+ * so the length must be a non-zero multiple of 3), thickened by `thickness`
102
+ * and sampled at `resolution` steps.
103
+ */
104
+ static bezier(controlPoints: Array<number>, thickness: number, resolution: number): Shape;
105
+
106
+ /**
107
+ * Any SDF tree as a Shape: the same JSON the terrain sampler takes
108
+ * (primitives, smooth booleans, noise — see the SDF guide) becomes
109
+ * fillable with every brush, combinable with other shapes, and
110
+ * usable in masked fills. Normals come from the field gradient, so
111
+ * the shaded brush shades smooth blends smoothly. Errors with
112
+ * `Parse` on invalid JSON and `InvalidArgument` for unbounded trees
113
+ * (use `sdf_bounded`).
114
+ */
115
+ static sdf(sdfJson: string): Shape;
116
+
117
+ /**
118
+ * Like `sdf`, with explicit sampling bounds (inclusive block
119
+ * coordinates) for unbounded trees such as planes.
120
+ */
121
+ static sdfBounded(sdfJson: string, minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): Shape;
122
+
123
+ /**
124
+ * Hollowed-out copy of this shape with the given wall thickness (clones the
125
+ * input, like the old `shape_hollow`).
126
+ */
127
+ hollow(thickness: number): Shape;
128
+
129
+ /**
130
+ * Boolean union of this shape and `other` (clones both inputs).
131
+ */
132
+ unionWith(other: Shape): Shape;
133
+
134
+ /**
135
+ * Boolean intersection of this shape and `other` (clones both inputs).
136
+ */
137
+ intersectionWith(other: Shape): Shape;
138
+
139
+ /**
140
+ * Boolean difference: this shape minus `other` (clones both inputs).
141
+ */
142
+ differenceWith(other: Shape): Shape;
143
+ }
package/Shape.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // generated by diplomat-tool
2
- import type { Curve3D } from "./Curve3D"
3
- import type { NucleationError } from "./NucleationError"
2
+ import type { Curve3D } from "./Curve3D.mjs"
3
+ import type { NucleationError } from "./NucleationError.mjs"
4
4
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
5
5
 
6
6
 
@@ -0,0 +1,86 @@
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
+ * Ordering applied to region positions before bit assignment
9
+ * (PORTING rule 10).
10
+ */
11
+ export class SortStrategy {
12
+ /** @internal */
13
+ get ffiValue(): pointer;
14
+ /** @internal */
15
+ constructor();
16
+
17
+
18
+ /**
19
+ * Sort by Y ascending, then X, then Z (default Minecraft layer
20
+ * order). The first position after sorting is bit 0 (LSB).
21
+ */
22
+ static yxz(): SortStrategy;
23
+
24
+ /**
25
+ * Sort by X ascending, then Y, then Z.
26
+ */
27
+ static xyz(): SortStrategy;
28
+
29
+ /**
30
+ * Sort by Z ascending, then Y, then X.
31
+ */
32
+ static zyx(): SortStrategy;
33
+
34
+ /**
35
+ * Sort by Y descending, then X ascending, then Z ascending.
36
+ */
37
+ static yDescXz(): SortStrategy;
38
+
39
+ /**
40
+ * Sort by X descending, then Y ascending, then Z ascending.
41
+ */
42
+ static xDescYz(): SortStrategy;
43
+
44
+ /**
45
+ * Sort by Z descending, then Y ascending, then X ascending.
46
+ */
47
+ static zDescYx(): SortStrategy;
48
+
49
+ /**
50
+ * Old ABI name: `sort_strategy_descending`.
51
+ */
52
+ static descending(): SortStrategy;
53
+
54
+ /**
55
+ * Sort by Euclidean distance from the reference point, closest
56
+ * first (ties broken by Y, X, Z ascending).
57
+ */
58
+ static distanceFrom(x: number, y: number, z: number): SortStrategy;
59
+
60
+ /**
61
+ * Sort by Euclidean distance from the reference point, farthest
62
+ * first (ties broken by Y, X, Z descending).
63
+ */
64
+ static distanceFromDesc(x: number, y: number, z: number): SortStrategy;
65
+
66
+ /**
67
+ * Keep positions in the order they were added (no sorting). Useful
68
+ * when positions were ordered manually or box order matters.
69
+ */
70
+ static preserve(): SortStrategy;
71
+
72
+ /**
73
+ * Reverse of the order positions were added.
74
+ */
75
+ static reverse(): SortStrategy;
76
+
77
+ /**
78
+ * Parse from a name (e.g. "yxz", "descending", "preserve").
79
+ */
80
+ static fromString(s: string): SortStrategy;
81
+
82
+ /**
83
+ * The strategy name.
84
+ */
85
+ name(): string;
86
+ }
package/SortStrategy.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/Store.d.mts ADDED
@@ -0,0 +1,83 @@
1
+ // generated by diplomat-tool
2
+ import type { NucleationError } from "./NucleationError.mjs"
3
+ import type { Schematic } from "./Schematic.mjs"
4
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
5
+
6
+
7
+
8
+ /**
9
+ * A key/value store opened from a URL (e.g. `mem://`, `file:///path`,
10
+ * `s3://bucket/prefix`, `redis://…`, `postgres://…`).
11
+ */
12
+ export class Store {
13
+ /** @internal */
14
+ get ffiValue(): pointer;
15
+ /** @internal */
16
+ constructor();
17
+
18
+
19
+ /**
20
+ * Open a store from a URL. Errors with `Store` on an unknown scheme or
21
+ * connection failure.
22
+ */
23
+ static open(url: string): Store;
24
+
25
+ /**
26
+ * Fetch `key`, writing the value as base64 (PORTING rule 6). Errors with
27
+ * `NotFound` when the key is absent.
28
+ */
29
+ getB64(key: string): string;
30
+
31
+ /**
32
+ * Store `data` at `key`.
33
+ */
34
+ put(key: string, data: Array<number>): void;
35
+
36
+ /**
37
+ * Whether `key` exists.
38
+ */
39
+ exists(key: string): boolean;
40
+
41
+ /**
42
+ * Delete `key` (idempotent).
43
+ */
44
+ delete_(key: string): void;
45
+
46
+ /**
47
+ * List keys under `prefix`, written as a JSON array string.
48
+ */
49
+ list(prefix: string): string;
50
+
51
+ /**
52
+ * Atomically write `data` at `key` only if it does not already exist.
53
+ * Returns `true` if written, `false` if the key existed.
54
+ */
55
+ putIfAbsent(key: string, data: Array<number>): boolean;
56
+
57
+ /**
58
+ * A keyset page of keys under `prefix`. `after` is the exclusive cursor
59
+ * (empty string for the first page); at most `limit` keys are returned.
60
+ * Writes a JSON object string `{"keys":[...],"next":"…"|null}`.
61
+ */
62
+ listPaginated(prefix: string, after: string, limit: number): string;
63
+
64
+ /**
65
+ * Health check: `Ok` when the store is usable.
66
+ */
67
+ health(): void;
68
+
69
+ /**
70
+ * Open a schematic stored at `key` in this store. Works for every
71
+ * backend, including `redis://`/`postgres://`/`mem://` that the
72
+ * single-string URI form (`StoreIo::open`) rejects.
73
+ */
74
+ openSchematic(key: string): Schematic;
75
+
76
+ /**
77
+ * Save a schematic at `key` in this store. `version` selects the format
78
+ * version (empty string = format default). Works for every backend,
79
+ * including `redis://`/`postgres://`/`mem://` that the single-string URI
80
+ * form (`StoreIo::save`) rejects.
81
+ */
82
+ saveSchematic(schematic: Schematic, key: string, version: string): void;
83
+ }
package/Store.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // generated by diplomat-tool
2
- import type { NucleationError } from "./NucleationError"
3
- import type { Schematic } from "./Schematic"
2
+ import type { NucleationError } from "./NucleationError.mjs"
3
+ import type { Schematic } from "./Schematic.mjs"
4
4
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
5
5
 
6
6
 
package/StoreIo.d.mts ADDED
@@ -0,0 +1,71 @@
1
+ // generated by diplomat-tool
2
+ import type { NucleationError } from "./NucleationError.mjs"
3
+ import type { Schematic } from "./Schematic.mjs"
4
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
5
+
6
+
7
+
8
+ /**
9
+ * Namespace type for the URI-based transparent I/O and format-manager
10
+ * queries (PORTING rule 12).
11
+ */
12
+ export class StoreIo {
13
+ /** @internal */
14
+ get ffiValue(): pointer;
15
+ /** @internal */
16
+ constructor();
17
+
18
+
19
+ /**
20
+ * Open a schematic from a URI: a local path, `file://...`, or
21
+ * `s3://bucket/key.schem`. The format is auto-detected from the URI's
22
+ * extension. Single-string URIs for `redis://`, `postgres://`, and
23
+ * `mem://` are rejected by the core resolver; use `Store::open_schematic`
24
+ * with an explicit store for those backends.
25
+ */
26
+ static open(uri: string): Schematic;
27
+
28
+ /**
29
+ * Save a schematic to a URI: a local path, `file://...`, or
30
+ * `s3://bucket/key.schem`. The format is auto-detected from the URI's
31
+ * extension; `version` selects the format version (empty string =
32
+ * format default). Single-string URIs for `redis://`, `postgres://`, and
33
+ * `mem://` are rejected by the core resolver; use `Store::save_schematic`
34
+ * with an explicit store for those backends.
35
+ */
36
+ static save(schematic: Schematic, uri: string, version: string): void;
37
+
38
+ /**
39
+ * The JSON schema describing the export settings of `format`. Errors
40
+ * with `NotFound` for an unknown format.
41
+ */
42
+ static exportSettingsSchema(format: string): string;
43
+
44
+ /**
45
+ * The JSON schema describing the import settings of `format`. Errors
46
+ * with `NotFound` for an unknown format.
47
+ */
48
+ static importSettingsSchema(format: string): string;
49
+
50
+ /**
51
+ * The supported import formats, written as a JSON array string.
52
+ */
53
+ static supportedImportFormats(): string;
54
+
55
+ /**
56
+ * The supported export formats, written as a JSON array string.
57
+ */
58
+ static supportedExportFormats(): string;
59
+
60
+ /**
61
+ * The known versions of an export format, written as a JSON array string
62
+ * (empty array for an unknown format, matching the old ABI).
63
+ */
64
+ static formatVersions(format: string): string;
65
+
66
+ /**
67
+ * The default version of an export format. Errors with `NotFound` for an
68
+ * unknown format.
69
+ */
70
+ static defaultFormatVersion(format: string): string;
71
+ }
package/StoreIo.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // generated by diplomat-tool
2
- import type { NucleationError } from "./NucleationError"
3
- import type { Schematic } from "./Schematic"
2
+ import type { NucleationError } from "./NucleationError.mjs"
3
+ import type { Schematic } from "./Schematic.mjs"
4
4
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
5
5
 
6
6
 
@@ -0,0 +1,40 @@
1
+ // generated by diplomat-tool
2
+ import type { MeshConfig } from "./MeshConfig.mjs"
3
+ import type { NucleationError } from "./NucleationError.mjs"
4
+ import type { ResourcePack } from "./ResourcePack.mjs"
5
+ import type { Schematic } from "./Schematic.mjs"
6
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
7
+
8
+
9
+
10
+ /**
11
+ * A packed texture atlas. Wraps {@link schematic_mesher::TextureAtlas}.
12
+ */
13
+ export class TextureAtlas {
14
+ /** @internal */
15
+ get ffiValue(): pointer;
16
+ /** @internal */
17
+ constructor();
18
+
19
+
20
+ /**
21
+ * Build a single shared atlas from every unique block state in the
22
+ * schematic (old ABI: `schematic_build_global_atlas`).
23
+ */
24
+ static buildGlobal(schematic: Schematic, pack: ResourcePack, config: MeshConfig): TextureAtlas;
25
+
26
+ /**
27
+ * Atlas width in pixels.
28
+ */
29
+ width(): number;
30
+
31
+ /**
32
+ * Atlas height in pixels.
33
+ */
34
+ height(): number;
35
+
36
+ /**
37
+ * Raw RGBA atlas pixels, base64-encoded.
38
+ */
39
+ rgbaDataB64(): string;
40
+ }
package/TextureAtlas.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  // generated by diplomat-tool
2
- import type { MeshConfig } from "./MeshConfig"
3
- import type { NucleationError } from "./NucleationError"
4
- import type { ResourcePack } from "./ResourcePack"
5
- import type { Schematic } from "./Schematic"
2
+ import type { MeshConfig } from "./MeshConfig.mjs"
3
+ import type { NucleationError } from "./NucleationError.mjs"
4
+ import type { ResourcePack } from "./ResourcePack.mjs"
5
+ import type { Schematic } from "./Schematic.mjs"
6
6
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
7
7
 
8
8
 
@@ -0,0 +1,34 @@
1
+ // generated by diplomat-tool
2
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
3
+
4
+ export type TextureInfo_obj = {
5
+ width: number;
6
+ height: number;
7
+ animated: boolean;
8
+ frameCount: number;
9
+ };
10
+
11
+
12
+
13
+ /**
14
+ * Texture size/animation metadata for one texture in a resource pack.
15
+ */
16
+ export class TextureInfo {
17
+ get width(): number;
18
+ set width(value: number);
19
+ get height(): number;
20
+ set height(value: number);
21
+ get animated(): boolean;
22
+ set animated(value: boolean);
23
+ get frameCount(): number;
24
+ set frameCount(value: number);
25
+ /** @internal */
26
+ static fromFields(structObj : TextureInfo_obj) : TextureInfo;
27
+
28
+ /**
29
+ * Create `TextureInfo` from an object that contains all of `TextureInfo`s fields.
30
+ * Optional fields do not need to be included in the provided object.
31
+ */
32
+ constructor(structObj: TextureInfo_obj);
33
+
34
+ }
@@ -0,0 +1,101 @@
1
+ // generated by diplomat-tool
2
+ import type { ExecutionMode } from "./ExecutionMode.mjs"
3
+ import type { IoLayout } from "./IoLayout.mjs"
4
+ import type { MchprsWorld } from "./MchprsWorld.mjs"
5
+ import type { NucleationError } from "./NucleationError.mjs"
6
+ import type { Schematic } from "./Schematic.mjs"
7
+ import type { Value } from "./Value.mjs"
8
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
9
+
10
+
11
+
12
+ /**
13
+ * A typed circuit executor. Wraps
14
+ * {@link crate::simulation::typed_executor::TypedCircuitExecutor}.
15
+ */
16
+ export class TypedCircuitExecutor {
17
+ /** @internal */
18
+ get ffiValue(): pointer;
19
+ /** @internal */
20
+ constructor();
21
+
22
+
23
+ /**
24
+ * Create from a world and layout. Builds a fresh world from the
25
+ * world's schematic (matches the old ABI, which cloned internally).
26
+ */
27
+ static fromLayout(world: MchprsWorld, layout: IoLayout): TypedCircuitExecutor;
28
+
29
+ /**
30
+ * Create from a world and layout with simulation options.
31
+ */
32
+ static fromLayoutWithOptions(world: MchprsWorld, layout: IoLayout, optimize: boolean, ioOnly: boolean): TypedCircuitExecutor;
33
+
34
+ /**
35
+ * Create from Insign annotations in a schematic.
36
+ */
37
+ static fromInsign(schematic: Schematic): TypedCircuitExecutor;
38
+
39
+ /**
40
+ * Create from Insign annotations with options.
41
+ */
42
+ static fromInsignWithOptions(schematic: Schematic, optimize: boolean, ioOnly: boolean): TypedCircuitExecutor;
43
+
44
+ /**
45
+ * Set the state mode ("stateless" | "stateful" | "manual").
46
+ */
47
+ setStateMode(mode: string): void;
48
+
49
+ /**
50
+ * Reset the executor to its initial state.
51
+ */
52
+ reset(): void;
53
+
54
+ /**
55
+ * Advance the simulation by `ticks` ticks.
56
+ */
57
+ tick(ticks: number): void;
58
+
59
+ /**
60
+ * Flush pending changes.
61
+ */
62
+ flush(): void;
63
+
64
+ /**
65
+ * Set a single input value.
66
+ */
67
+ setInput(name: string, value: Value): void;
68
+
69
+ /**
70
+ * Read a single output value.
71
+ */
72
+ readOutput(name: string): Value;
73
+
74
+ /**
75
+ * Execute the circuit. `inputs_json` is a JSON object like
76
+ * `{"input_name": {"type": "u32", "value": 42}}`; writes a JSON
77
+ * object with `outputs`, `ticks_elapsed` and `condition_met`.
78
+ */
79
+ execute(inputsJson: string, mode: ExecutionMode): string;
80
+
81
+ /**
82
+ * Input names as a JSON array string.
83
+ */
84
+ inputNamesJson(): string;
85
+
86
+ /**
87
+ * Output names as a JSON array string.
88
+ */
89
+ outputNamesJson(): string;
90
+
91
+ /**
92
+ * Layout info as a JSON object string
93
+ * (old ABI: `typed_executor_get_layout_info`).
94
+ */
95
+ layoutInfoJson(): string;
96
+
97
+ /**
98
+ * Sync the simulation state and return the schematic (cloned).
99
+ */
100
+ syncToSchematic(): Schematic;
101
+ }
@@ -1,10 +1,10 @@
1
1
  // generated by diplomat-tool
2
- import type { ExecutionMode } from "./ExecutionMode"
3
- import type { IoLayout } from "./IoLayout"
4
- import type { MchprsWorld } from "./MchprsWorld"
5
- import type { NucleationError } from "./NucleationError"
6
- import type { Schematic } from "./Schematic"
7
- import type { Value } from "./Value"
2
+ import type { ExecutionMode } from "./ExecutionMode.mjs"
3
+ import type { IoLayout } from "./IoLayout.mjs"
4
+ import type { MchprsWorld } from "./MchprsWorld.mjs"
5
+ import type { NucleationError } from "./NucleationError.mjs"
6
+ import type { Schematic } from "./Schematic.mjs"
7
+ import type { Value } from "./Value.mjs"
8
8
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
9
9
 
10
10