nucleation 0.10.22 → 0.10.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/Schematic.d.mts +23 -0
- package/Schematic.d.ts +23 -0
- package/Schematic.mjs +70 -0
- package/nucleation.wasm +0 -0
- package/package.json +7 -2
- package/renderer/AnimationEffect.d.mts +44 -0
- package/renderer/AnimationEffect.d.ts +44 -0
- package/renderer/AnimationEffect.mjs +204 -0
- package/renderer/Autostack.d.mts +43 -0
- package/renderer/Autostack.d.ts +43 -0
- package/renderer/Autostack.mjs +134 -0
- package/renderer/BlockPos.d.mts +28 -0
- package/renderer/BlockPos.d.ts +28 -0
- package/renderer/BlockPos.mjs +130 -0
- package/renderer/BlockState.d.mts +39 -0
- package/renderer/BlockState.d.ts +39 -0
- package/renderer/BlockState.mjs +134 -0
- package/renderer/Blocks.d.mts +91 -0
- package/renderer/Blocks.d.ts +91 -0
- package/renderer/Blocks.mjs +308 -0
- package/renderer/Brush.d.mts +99 -0
- package/renderer/Brush.d.ts +99 -0
- package/renderer/Brush.mjs +335 -0
- package/renderer/BuildAnimation.d.mts +179 -0
- package/renderer/BuildAnimation.d.ts +179 -0
- package/renderer/BuildAnimation.mjs +1148 -0
- package/renderer/BuildingTool.d.mts +46 -0
- package/renderer/BuildingTool.d.ts +46 -0
- package/renderer/BuildingTool.mjs +121 -0
- package/renderer/CellExecutor.d.mts +51 -0
- package/renderer/CellExecutor.d.ts +51 -0
- package/renderer/CellExecutor.mjs +171 -0
- package/renderer/CellularSdfConfig.d.mts +22 -0
- package/renderer/CellularSdfConfig.d.ts +22 -0
- package/renderer/CellularSdfConfig.mjs +69 -0
- package/renderer/ChunkMeshResult.d.mts +75 -0
- package/renderer/ChunkMeshResult.d.ts +75 -0
- package/renderer/ChunkMeshResult.mjs +253 -0
- package/renderer/CircuitBuilder.d.mts +118 -0
- package/renderer/CircuitBuilder.d.ts +118 -0
- package/renderer/CircuitBuilder.mjs +516 -0
- package/renderer/Curve3D.d.mts +27 -0
- package/renderer/Curve3D.d.ts +27 -0
- package/renderer/Curve3D.mjs +101 -0
- package/renderer/DefinitionRegion.d.mts +274 -0
- package/renderer/DefinitionRegion.d.ts +274 -0
- package/renderer/DefinitionRegion.mjs +973 -0
- package/renderer/Design.d.mts +348 -0
- package/renderer/Design.d.ts +348 -0
- package/renderer/Design.mjs +1334 -0
- package/renderer/Diff.d.mts +88 -0
- package/renderer/Diff.d.ts +88 -0
- package/renderer/Diff.mjs +316 -0
- package/renderer/Dimensions.d.mts +28 -0
- package/renderer/Dimensions.d.ts +28 -0
- package/renderer/Dimensions.mjs +130 -0
- package/renderer/DistanceField.d.mts +39 -0
- package/renderer/DistanceField.d.ts +39 -0
- package/renderer/DistanceField.mjs +114 -0
- package/renderer/ExecutionMode.d.mts +42 -0
- package/renderer/ExecutionMode.d.ts +42 -0
- package/renderer/ExecutionMode.mjs +127 -0
- package/renderer/Field3.d.mts +40 -0
- package/renderer/Field3.d.ts +40 -0
- package/renderer/Field3.mjs +160 -0
- package/renderer/FieldProgram.d.mts +40 -0
- package/renderer/FieldProgram.d.ts +40 -0
- package/renderer/FieldProgram.mjs +167 -0
- package/renderer/FieldProgramBinaryOp.d.mts +42 -0
- package/renderer/FieldProgramBinaryOp.d.ts +42 -0
- package/renderer/FieldProgramBinaryOp.mjs +118 -0
- package/renderer/FieldProgramBuilder.d.mts +104 -0
- package/renderer/FieldProgramBuilder.d.ts +104 -0
- package/renderer/FieldProgramBuilder.mjs +486 -0
- package/renderer/FieldProgramDistanceKind.d.mts +26 -0
- package/renderer/FieldProgramDistanceKind.d.ts +26 -0
- package/renderer/FieldProgramDistanceKind.mjs +78 -0
- package/renderer/FieldProgramUnaryOp.d.mts +34 -0
- package/renderer/FieldProgramUnaryOp.d.ts +34 -0
- package/renderer/FieldProgramUnaryOp.mjs +102 -0
- package/renderer/FieldProgramValueType.d.mts +25 -0
- package/renderer/FieldProgramValueType.d.ts +25 -0
- package/renderer/FieldProgramValueType.mjs +75 -0
- package/renderer/FieldRange.d.mts +15 -0
- package/renderer/FieldRange.d.ts +15 -0
- package/renderer/FieldRange.mjs +109 -0
- package/renderer/Fingerprint.d.mts +44 -0
- package/renderer/Fingerprint.d.ts +44 -0
- package/renderer/Fingerprint.mjs +197 -0
- package/renderer/GeneratedChunk.d.mts +35 -0
- package/renderer/GeneratedChunk.d.ts +35 -0
- package/renderer/GeneratedChunk.mjs +178 -0
- package/renderer/GeneratedChunkCoverage.d.mts +25 -0
- package/renderer/GeneratedChunkCoverage.d.ts +25 -0
- package/renderer/GeneratedChunkCoverage.mjs +75 -0
- package/renderer/GeneratedChunkOverlayMode.d.mts +24 -0
- package/renderer/GeneratedChunkOverlayMode.d.ts +24 -0
- package/renderer/GeneratedChunkOverlayMode.mjs +72 -0
- package/renderer/GeneratedWorldStream.d.mts +28 -0
- package/renderer/GeneratedWorldStream.d.ts +28 -0
- package/renderer/GeneratedWorldStream.mjs +86 -0
- package/renderer/Geo.d.mts +41 -0
- package/renderer/Geo.d.ts +41 -0
- package/renderer/Geo.mjs +121 -0
- package/renderer/Hdl.d.mts +56 -0
- package/renderer/Hdl.d.ts +56 -0
- package/renderer/Hdl.mjs +163 -0
- package/renderer/InterpolationSpace.d.mts +25 -0
- package/renderer/InterpolationSpace.d.ts +25 -0
- package/renderer/InterpolationSpace.mjs +73 -0
- package/renderer/IoLayout.d.mts +26 -0
- package/renderer/IoLayout.d.ts +26 -0
- package/renderer/IoLayout.mjs +81 -0
- package/renderer/IoLayoutBuilder.d.mts +73 -0
- package/renderer/IoLayoutBuilder.d.ts +73 -0
- package/renderer/IoLayoutBuilder.mjs +315 -0
- package/renderer/IoType.d.mts +41 -0
- package/renderer/IoType.d.ts +41 -0
- package/renderer/IoType.mjs +125 -0
- package/renderer/ItemModelConfig.d.mts +65 -0
- package/renderer/ItemModelConfig.d.ts +65 -0
- package/renderer/ItemModelConfig.mjs +223 -0
- package/renderer/ItemModelPackBuilder.d.mts +32 -0
- package/renderer/ItemModelPackBuilder.d.ts +32 -0
- package/renderer/ItemModelPackBuilder.mjs +104 -0
- package/renderer/ItemModelResult.d.mts +72 -0
- package/renderer/ItemModelResult.d.ts +72 -0
- package/renderer/ItemModelResult.mjs +268 -0
- package/renderer/ItemScale.d.mts +31 -0
- package/renderer/ItemScale.d.ts +31 -0
- package/renderer/ItemScale.mjs +133 -0
- package/renderer/LayoutFunction.d.mts +52 -0
- package/renderer/LayoutFunction.d.ts +52 -0
- package/renderer/LayoutFunction.mjs +159 -0
- package/renderer/MchprsWorld.d.mts +131 -0
- package/renderer/MchprsWorld.d.ts +131 -0
- package/renderer/MchprsWorld.mjs +423 -0
- package/renderer/MeshBounds.d.mts +40 -0
- package/renderer/MeshBounds.d.ts +40 -0
- package/renderer/MeshBounds.mjs +181 -0
- package/renderer/MeshConfig.d.mts +101 -0
- package/renderer/MeshConfig.d.ts +101 -0
- package/renderer/MeshConfig.mjs +306 -0
- package/renderer/MeshJob.d.mts +44 -0
- package/renderer/MeshJob.d.ts +44 -0
- package/renderer/MeshJob.mjs +116 -0
- package/renderer/MeshPhase.d.mts +38 -0
- package/renderer/MeshPhase.d.ts +38 -0
- package/renderer/MeshPhase.mjs +90 -0
- package/renderer/MeshProgress.d.mts +32 -0
- package/renderer/MeshProgress.d.ts +32 -0
- package/renderer/MeshProgress.mjs +134 -0
- package/renderer/MeshResult.d.mts +76 -0
- package/renderer/MeshResult.d.ts +76 -0
- package/renderer/MeshResult.mjs +269 -0
- package/renderer/MultiMeshResult.d.mts +50 -0
- package/renderer/MultiMeshResult.d.ts +50 -0
- package/renderer/MultiMeshResult.mjs +166 -0
- package/renderer/Nbt.d.mts +50 -0
- package/renderer/Nbt.d.ts +50 -0
- package/renderer/Nbt.mjs +161 -0
- package/renderer/NucleationError.d.mts +53 -0
- package/renderer/NucleationError.d.ts +53 -0
- package/renderer/NucleationError.mjs +136 -0
- package/renderer/OutputCondition.d.mts +45 -0
- package/renderer/OutputCondition.d.ts +45 -0
- package/renderer/OutputCondition.mjs +129 -0
- package/renderer/Palette.d.mts +157 -0
- package/renderer/Palette.d.ts +157 -0
- package/renderer/Palette.mjs +487 -0
- package/renderer/PaletteBuilder.d.mts +119 -0
- package/renderer/PaletteBuilder.d.ts +119 -0
- package/renderer/PaletteBuilder.mjs +457 -0
- package/renderer/README.md +67 -0
- package/renderer/RawMeshExport.d.mts +74 -0
- package/renderer/RawMeshExport.d.ts +74 -0
- package/renderer/RawMeshExport.mjs +243 -0
- package/renderer/RedstoneGraph.d.mts +58 -0
- package/renderer/RedstoneGraph.d.ts +58 -0
- package/renderer/RedstoneGraph.mjs +242 -0
- package/renderer/RegionBounds.d.mts +41 -0
- package/renderer/RegionBounds.d.ts +41 -0
- package/renderer/RegionBounds.mjs +182 -0
- package/renderer/RenderConfig.d.mts +101 -0
- package/renderer/RenderConfig.d.ts +101 -0
- package/renderer/RenderConfig.mjs +271 -0
- package/renderer/Renderer.d.mts +51 -0
- package/renderer/Renderer.d.ts +51 -0
- package/renderer/Renderer.mjs +219 -0
- package/renderer/ResourcePack.d.mts +105 -0
- package/renderer/ResourcePack.d.ts +105 -0
- package/renderer/ResourcePack.mjs +447 -0
- package/renderer/ResourcePackList.d.mts +32 -0
- package/renderer/ResourcePackList.d.ts +32 -0
- package/renderer/ResourcePackList.mjs +96 -0
- package/renderer/Routing.d.mts +66 -0
- package/renderer/Routing.d.ts +66 -0
- package/renderer/Routing.mjs +220 -0
- package/renderer/Schematic.d.mts +977 -0
- package/renderer/Schematic.d.ts +977 -0
- package/renderer/Schematic.mjs +3820 -0
- package/renderer/SchematicBuilder.d.mts +103 -0
- package/renderer/SchematicBuilder.d.ts +103 -0
- package/renderer/SchematicBuilder.mjs +401 -0
- package/renderer/SchematicRegions.d.mts +93 -0
- package/renderer/SchematicRegions.d.ts +93 -0
- package/renderer/SchematicRegions.mjs +411 -0
- package/renderer/SchematicSplitResult.d.mts +26 -0
- package/renderer/SchematicSplitResult.d.ts +26 -0
- package/renderer/SchematicSplitResult.mjs +84 -0
- package/renderer/Scripting.d.mts +40 -0
- package/renderer/Scripting.d.ts +40 -0
- package/renderer/Scripting.mjs +138 -0
- package/renderer/Sdf.d.mts +234 -0
- package/renderer/Sdf.d.ts +234 -0
- package/renderer/Sdf.mjs +1234 -0
- package/renderer/SdfAxis.d.mts +25 -0
- package/renderer/SdfAxis.d.ts +25 -0
- package/renderer/SdfAxis.mjs +75 -0
- package/renderer/SdfBounds.d.mts +19 -0
- package/renderer/SdfBounds.d.ts +19 -0
- package/renderer/SdfBounds.mjs +161 -0
- package/renderer/SdfCellMode.d.mts +26 -0
- package/renderer/SdfCellMode.d.ts +26 -0
- package/renderer/SdfCellMode.mjs +78 -0
- package/renderer/SdfNormal.d.mts +16 -0
- package/renderer/SdfNormal.d.ts +16 -0
- package/renderer/SdfNormal.mjs +122 -0
- package/renderer/Shape.d.mts +143 -0
- package/renderer/Shape.d.ts +143 -0
- package/renderer/Shape.mjs +458 -0
- package/renderer/SortStrategy.d.mts +86 -0
- package/renderer/SortStrategy.d.ts +86 -0
- package/renderer/SortStrategy.mjs +272 -0
- package/renderer/Store.d.mts +83 -0
- package/renderer/Store.d.ts +83 -0
- package/renderer/Store.mjs +369 -0
- package/renderer/StoreIo.d.mts +71 -0
- package/renderer/StoreIo.d.ts +71 -0
- package/renderer/StoreIo.mjs +292 -0
- package/renderer/TextureAtlas.d.mts +40 -0
- package/renderer/TextureAtlas.d.ts +40 -0
- package/renderer/TextureAtlas.mjs +122 -0
- package/renderer/TextureInfo.d.mts +34 -0
- package/renderer/TextureInfo.d.ts +34 -0
- package/renderer/TextureInfo.mjs +149 -0
- package/renderer/TickSettleMode.d.mts +34 -0
- package/renderer/TickSettleMode.d.ts +34 -0
- package/renderer/TickSettleMode.mjs +84 -0
- package/renderer/TickSimulation.d.mts +572 -0
- package/renderer/TickSimulation.d.ts +572 -0
- package/renderer/TickSimulation.mjs +1299 -0
- package/renderer/TypedCircuitExecutor.d.mts +101 -0
- package/renderer/TypedCircuitExecutor.d.ts +101 -0
- package/renderer/TypedCircuitExecutor.mjs +378 -0
- package/renderer/Value.d.mts +73 -0
- package/renderer/Value.d.ts +73 -0
- package/renderer/Value.mjs +275 -0
- package/renderer/VideoConfig.d.mts +15 -0
- package/renderer/VideoConfig.d.ts +15 -0
- package/renderer/VideoConfig.mjs +44 -0
- package/renderer/VoxelModel.d.mts +34 -0
- package/renderer/VoxelModel.d.ts +34 -0
- package/renderer/VoxelModel.mjs +113 -0
- package/renderer/Voxelizer.d.mts +80 -0
- package/renderer/Voxelizer.d.ts +80 -0
- package/renderer/Voxelizer.mjs +261 -0
- package/renderer/WorldChunkView.d.mts +75 -0
- package/renderer/WorldChunkView.d.ts +75 -0
- package/renderer/WorldChunkView.mjs +224 -0
- package/renderer/WorldGenerator.d.mts +75 -0
- package/renderer/WorldGenerator.d.ts +75 -0
- package/renderer/WorldGenerator.mjs +255 -0
- package/renderer/WorldSink.d.mts +50 -0
- package/renderer/WorldSink.d.ts +50 -0
- package/renderer/WorldSink.mjs +177 -0
- package/renderer/WorldStream.d.mts +45 -0
- package/renderer/WorldStream.d.ts +45 -0
- package/renderer/WorldStream.mjs +184 -0
- package/renderer/WsPartitionHints.d.mts +29 -0
- package/renderer/WsPartitionHints.d.ts +29 -0
- package/renderer/WsPartitionHints.mjs +102 -0
- package/renderer/WsProfile.d.mts +46 -0
- package/renderer/WsProfile.d.ts +46 -0
- package/renderer/WsProfile.mjs +152 -0
- package/renderer/WsRunResult.d.mts +83 -0
- package/renderer/WsRunResult.d.ts +83 -0
- package/renderer/WsRunResult.mjs +326 -0
- package/renderer/WsSegmentJob.d.mts +28 -0
- package/renderer/WsSegmentJob.d.ts +28 -0
- package/renderer/WsSegmentJob.mjs +81 -0
- package/renderer/diplomat-runtime.d.mts +15 -0
- package/renderer/diplomat-runtime.d.ts +15 -0
- package/renderer/diplomat-runtime.mjs +779 -0
- package/renderer/diplomat-wasm.mjs +52 -0
- package/renderer/diplomat.config.mjs +5 -0
- package/renderer/index.d.mts +193 -0
- package/renderer/index.d.ts +193 -0
- package/renderer/index.mjs +196 -0
- package/renderer/nucleation.wasm +0 -0
- package/renderer/veneer/design.d.ts +167 -0
- package/renderer/veneer/design.mjs +480 -0
|
@@ -0,0 +1,348 @@
|
|
|
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 composition document: loose blocks + cell instances + bus layers
|
|
10
|
+
* over a shared coordinate space.
|
|
11
|
+
*/
|
|
12
|
+
export class Design {
|
|
13
|
+
/** @internal */
|
|
14
|
+
get ffiValue(): pointer;
|
|
15
|
+
/** @internal */
|
|
16
|
+
constructor();
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* An empty design.
|
|
21
|
+
*/
|
|
22
|
+
static create(name: string): Design;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A design whose loose block layer is a copy of `base` (endpoint
|
|
26
|
+
* hardware placed with raw `set_block`).
|
|
27
|
+
*/
|
|
28
|
+
static forSchematic(name: string, base: Schematic): Design;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Register a library cell; its contract is resolved from the
|
|
32
|
+
* schematic (embedded metadata first, Insign signs as fallback)
|
|
33
|
+
* and registration fails loudly when no source defines one.
|
|
34
|
+
* Writes resolution warnings as a JSON array of strings.
|
|
35
|
+
*/
|
|
36
|
+
addCell(name: string, cell: Schematic): string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Place an instance layer referencing a library cell. `rot_y` is
|
|
40
|
+
* in degrees, a multiple of 90.
|
|
41
|
+
*/
|
|
42
|
+
place(name: string, cell: string, x: number, y: number, z: number, rotY: number): void;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Declare a drivable input port: anchor = bit-0 connection cell,
|
|
46
|
+
* step to the next bit, `width` bits of `ty` (`"uint"` or
|
|
47
|
+
* `"bool"`). The hardware is scanned (adjacent lever per bit) and
|
|
48
|
+
* validated loudly.
|
|
49
|
+
*/
|
|
50
|
+
declareInput(name: string, ax: number, ay: number, az: number, sx: number, sy: number, sz: number, width: number, ty: string): void;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Declare a readable output port (adjacent lamp per bit); same
|
|
54
|
+
* shape as `declare_input`.
|
|
55
|
+
*/
|
|
56
|
+
declareOutput(name: string, ax: number, ay: number, az: number, sx: number, sy: number, sz: number, width: number, ty: string): void;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Declare AND realize a bus. `sinks_json` is a JSON array of port
|
|
60
|
+
* names; `gates_json` an array of `{"name", "anchor": [x,y,z],
|
|
61
|
+
* "step": [x,y,z]}` (pass `[]` for none); `style_json` an object
|
|
62
|
+
* with optional `bus_block` / `transparent_block`. Declaration
|
|
63
|
+
* errors are error returns; geometric unroutability is the
|
|
64
|
+
* written STATE: `"routed"` or `"failed: reason"` — realization
|
|
65
|
+
* is atomic, never half-routed.
|
|
66
|
+
*/
|
|
67
|
+
routeBus(name: string, driver: string, sinksJson: string, gatesJson: string, styleJson: string): string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Declare AND realize a wired-OR bus: `drivers_json` is a JSON
|
|
71
|
+
* array of port names — multiple drivers are legal ONLY through
|
|
72
|
+
* this explicit merge (`merge="or"`). Extra drivers join the
|
|
73
|
+
* trunk as diode-isolated dust-merge branches; the LVS intent
|
|
74
|
+
* stays ONE net per bit. Same shapes as `route_bus` otherwise.
|
|
75
|
+
*/
|
|
76
|
+
routeBusOr(name: string, driversJson: string, sinksJson: string, gatesJson: string, styleJson: string): string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Edit the loose block layer: plain `set_block` on the base
|
|
80
|
+
* schematic (participates in occupancy and flatten).
|
|
81
|
+
*/
|
|
82
|
+
setBlock(x: number, y: number, z: number, block: string): void;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Drag an instance layer to a new position/rotation. The move
|
|
86
|
+
* itself ALWAYS succeeds (the document's truth); the affected bus
|
|
87
|
+
* set — fragments intersecting the old or new footprint +
|
|
88
|
+
* influence halo, plus every already-failed bus — is ripped and
|
|
89
|
+
* co-rerouted deterministically with bounded retry rounds.
|
|
90
|
+
* Writes `{"rerouted": [...], "failed": {name: reason}}`.
|
|
91
|
+
*/
|
|
92
|
+
moveInstance(name: string, x: number, y: number, z: number, rotY: number): string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Remove an instance layer. Buses that terminate on one of its
|
|
96
|
+
* ports are DELETED (they lost an endpoint); buses that merely
|
|
97
|
+
* crossed its space are ripped and co-rerouted. Writes
|
|
98
|
+
* `{"removed_buses": [...], "rerouted": [...], "failed": {...}}`.
|
|
99
|
+
*/
|
|
100
|
+
removeInstance(name: string): string;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Re-realize a bus from its stored declaration (the counterpart to
|
|
104
|
+
* `rip`); writes the resulting bus state.
|
|
105
|
+
*/
|
|
106
|
+
reroute(name: string): string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Delete a bus outright — fragment AND declaration, freeing the
|
|
110
|
+
* name. `rip` keeps the declaration so the bus can be rerouted.
|
|
111
|
+
*/
|
|
112
|
+
removeBus(name: string): void;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The flattened artifact as `.schem` bytes, base64. Unlike
|
|
116
|
+
* `flatten()` + the schematic writer, this composites the layer
|
|
117
|
+
* stack into ONE region first: `.schem` has no layers, and the
|
|
118
|
+
* region merge drops named-layer cells that the loose layer's
|
|
119
|
+
* bounding box shadows.
|
|
120
|
+
*/
|
|
121
|
+
toSchemB64(): string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The flattened artifact composited into ONE region (see
|
|
125
|
+
* `to_schem_b64`) — the shape an interchange export wants.
|
|
126
|
+
*/
|
|
127
|
+
flattenComposite(): Schematic;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Every routing endpoint the placed instances expose, as a JSON
|
|
131
|
+
* array of `{name, instance, port, role, ty, width, hardware,
|
|
132
|
+
* wires, step, routable, blocked}`. `name` is `{instance}.{port}`
|
|
133
|
+
* — exactly what `route_bus` accepts; `role` is the CELL-facing
|
|
134
|
+
* direction, so `"output"` drives a bus and `"input"` receives
|
|
135
|
+
* one. A port whose bits have no dust connection cell (a lever
|
|
136
|
+
* input, say) reports `routable: false` and why in `blocked`.
|
|
137
|
+
*/
|
|
138
|
+
instancePorts(): string;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Switch a port between executor hardware and a routable dust input.
|
|
142
|
+
*
|
|
143
|
+
* `mode` is `"bus"` or `"executor"`. Community cells name LEVERS for
|
|
144
|
+
* their inputs and nothing in redstone drives a lever, so a port must
|
|
145
|
+
* be in `"bus"` mode before a bus can land on it. The switch is a
|
|
146
|
+
* reversible per-instance patch — `"executor"` restores the shipped
|
|
147
|
+
* blocks byte-exactly.
|
|
148
|
+
*
|
|
149
|
+
* Returns the report as JSON: `{port, mode, note, changed:[{at,from,
|
|
150
|
+
* to}], removed_buses, moves, patch}` — `note` is a ready-made toast
|
|
151
|
+
* and `changed` is in WORLD coordinates.
|
|
152
|
+
*/
|
|
153
|
+
setPortMode(instance: string, port: string, mode: string): string;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Every port whose mode has been switched, as JSON:
|
|
157
|
+
* `[{"name":"u0.bin","mode":"bus","patch":{..}}]`. Ports absent from
|
|
158
|
+
* the array are in `"executor"` mode.
|
|
159
|
+
*/
|
|
160
|
+
portModes(): string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Describe (without applying) what switching a port to `"bus"` mode
|
|
164
|
+
* would do: `{"wires","hardware","step","removed","added","pivoted",
|
|
165
|
+
* "note"}`. Errors when the port cannot be promoted, with the reason.
|
|
166
|
+
*/
|
|
167
|
+
planPortPromotion(instance: string, port: string): string;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Resolve one routing endpoint name — a declared design port or an
|
|
171
|
+
* instance port `{instance}.{port}` — to the geometry a bus would
|
|
172
|
+
* use: `{"name","anchor","step","width","direction","connectable"}`.
|
|
173
|
+
* `direction` is DESIGN-facing (`"input"` drives buses).
|
|
174
|
+
*/
|
|
175
|
+
resolvePort(name: string): string;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Add a gate to an existing bus (splitting the segment it lands
|
|
179
|
+
* in) and re-realize it. Writes the resulting bus state.
|
|
180
|
+
*/
|
|
181
|
+
addGate(bus: string, gate: string, x: number, y: number, z: number, sx: number, sy: number, sz: number): string;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Drag a gate: the anchor moves unconditionally, then EXACTLY the
|
|
185
|
+
* two adjacent segments are ripped and rerouted atomically. An
|
|
186
|
+
* unroutable move leaves the bus `failed: reason` — visible,
|
|
187
|
+
* never half-routed. Writes `{"state": "...",
|
|
188
|
+
* "rerouted_segments": n, "changed": [layer, ...]}`, where `changed`
|
|
189
|
+
* is the COMPLETE redraw set (see `changed_layers_since`).
|
|
190
|
+
*/
|
|
191
|
+
moveGate(bus: string, gate: string, x: number, y: number, z: number): string;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Remove a gate by index and re-realize the bus, so the two spans it
|
|
195
|
+
* separated MERGE and route as one — removing a checkpoint relaxes a
|
|
196
|
+
* constraint, so the result is shorter and straighter, not the two old
|
|
197
|
+
* legs stitched together. Writes the same JSON as `move_gate`:
|
|
198
|
+
* `{"state", "rerouted_segments", "changed"}`.
|
|
199
|
+
*/
|
|
200
|
+
removeGate(bus: string, index: number): string;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Undo a design port declaration. Removing an ENDPOINT changes the
|
|
204
|
+
* netlist, so every bus that named it is deleted — pass `force=false`
|
|
205
|
+
* first to be refused with the list and confirm. An instance port is
|
|
206
|
+
* derived from its cell's contract; use `set_port_mode` there.
|
|
207
|
+
*
|
|
208
|
+
* Writes `{"removed_buses":[...],"rerouted":[...],"failed":{...},
|
|
209
|
+
* "changed":[...]}`.
|
|
210
|
+
*/
|
|
211
|
+
removePort(name: string, force: boolean): string;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Declare and route a bus with an explicit WIDTH-ADAPTATION policy, so
|
|
215
|
+
* a narrower word can drive a wider port.
|
|
216
|
+
*
|
|
217
|
+
* `align`: 0 = lsb (bit 0 to bit 0, magnitude preserved), 1 = msb (top
|
|
218
|
+
* bit to top bit — a shift up by the width difference), 2 = use
|
|
219
|
+
* `shift` verbatim (positive moves toward the MSB). `truncate` permits
|
|
220
|
+
* DROPPING source bits that fall outside the destination; without it a
|
|
221
|
+
* lossy connection is refused, because losing a word's high bits is not
|
|
222
|
+
* the router's call. Destination bits nothing drives read 0 with no
|
|
223
|
+
* hardware at all.
|
|
224
|
+
*
|
|
225
|
+
* Writes the resulting bus state; `bus_width_map` reports the mapping.
|
|
226
|
+
*/
|
|
227
|
+
routeBusAdapted(name: string, driver: string, sinksCsv: string, gatesJson: string, styleJson: string, align: number, shift: number, truncate: boolean): string;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* The resolved bit mapping of a width-adapted bus (`null` when the
|
|
231
|
+
* widths matched): `{"map":{...,"pairs":[[dbit,sbit],..]},"note":".."}`.
|
|
232
|
+
*/
|
|
233
|
+
busWidthMap(name: string): string;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* The current bus-layer GEOMETRY REVISION. Read it before a mutating
|
|
237
|
+
* call, pass it to `changed_layers_since` after, and redraw exactly
|
|
238
|
+
* the layers named.
|
|
239
|
+
*/
|
|
240
|
+
layerRevision(): bigint;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* The COMPLETE set of bus layers whose geometry was rewritten since
|
|
244
|
+
* `rev`, as a JSON array of names.
|
|
245
|
+
*
|
|
246
|
+
* This is the contract a viewer must trust: it is stamped at every
|
|
247
|
+
* write to a layer's fragment, so it also names layers changed
|
|
248
|
+
* INDIRECTLY — a crossing stamps a through-bus station into a bus
|
|
249
|
+
* that was never ripped and appears in no other report. It also names
|
|
250
|
+
* DELETED layers (a name here that `bus_state` no longer knows means
|
|
251
|
+
* drop the mesh). `route_bus`, which returns only a state, is covered
|
|
252
|
+
* by this too: bracket it with `layer_revision`.
|
|
253
|
+
*/
|
|
254
|
+
changedLayersSince(rev: bigint): string;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Attach a net-class discipline to a bus (JSON `NetClassRule`:
|
|
258
|
+
* optional `max_len_rt` delay budget, `y_band` layer band, …);
|
|
259
|
+
* `check()` enforces it.
|
|
260
|
+
*/
|
|
261
|
+
setBusRule(bus: string, ruleJson: string): void;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Per-bus skew from the routed fragment: writes
|
|
265
|
+
* `{"per_bit_rt": [...], "skew_rt": n, "max_rt": n}`.
|
|
266
|
+
*/
|
|
267
|
+
busSkew(name: string): string;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* The lifecycle state of a bus: `"intended"`, `"routed"` or
|
|
271
|
+
* `"failed: reason"`.
|
|
272
|
+
*/
|
|
273
|
+
busState(name: string): string;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* ONE bus layer's cells as `[[x,y,z,"block"],..]`.
|
|
277
|
+
*
|
|
278
|
+
* The live-re-route fast path: `flatten()` rebuilds every layer in the
|
|
279
|
+
* document to answer "what changed about this one bus". An unrouted bus
|
|
280
|
+
* yields `[]`.
|
|
281
|
+
*/
|
|
282
|
+
busBlocksJson(name: string): string;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* ONE instance's placed cells as `[[x,y,z,"block"],..]`, transform
|
|
286
|
+
* applied. Same fast path as `bus_blocks_json`.
|
|
287
|
+
*/
|
|
288
|
+
instanceBlocksJson(name: string): string;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Rip a bus: clear its fragment, back to `intended`.
|
|
292
|
+
*/
|
|
293
|
+
rip(name: string): void;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Collapse the layer stack into ONE self-describing schematic:
|
|
297
|
+
* named regions per layer (`inst:x`, `bus:y`) and the merged
|
|
298
|
+
* contract embedded in the metadata — itself placeable as a cell.
|
|
299
|
+
*/
|
|
300
|
+
flatten(): Schematic;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* DRC + LVS over the flattened artifact. Writes `{"clean",
|
|
304
|
+
* "drc": [...], "lvs": {...}, "buses": {...}}`.
|
|
305
|
+
*/
|
|
306
|
+
check(): string;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Settle the flattened artifact in the vanilla-accurate tick
|
|
310
|
+
* engine and return it with every settled state written back and
|
|
311
|
+
* `InitialState::Baked` stamped into the embedded contract (needs
|
|
312
|
+
* the `mc-tick` feature, else errors).
|
|
313
|
+
*/
|
|
314
|
+
bake(budget: number): Schematic;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Serialize the FULL design document to `.nucm` project-tier
|
|
318
|
+
* bytes (magic `NUCM`): cells deduped by content hash, instance
|
|
319
|
+
* transforms, ports with scanned hardware, every bus layer with
|
|
320
|
+
* its fragment, runs and `intended`/`routed`/`failed: reason`
|
|
321
|
+
* state, and the loose base layer. Base64 across the bridge.
|
|
322
|
+
*/
|
|
323
|
+
toNucmB64(): string;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Reopen a `.nucm` design document from raw bytes. The reloaded
|
|
327
|
+
* design is the same model mid-edit: rerouting works.
|
|
328
|
+
*/
|
|
329
|
+
static fromNucm(data: Array<number>): Design;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Export the design as a LAYERED `.litematic` (interchange tier):
|
|
333
|
+
* one named region per layer (`inst:{name}`, `bus:{name}`, loose
|
|
334
|
+
* base) plus the design manifest as a root-level
|
|
335
|
+
* `NucleationDesign` tag. Opens in Litematica as a plain
|
|
336
|
+
* multi-region litematic; reimports as a design whose cell
|
|
337
|
+
* references have degraded to embedded copies. Base64 across the
|
|
338
|
+
* bridge.
|
|
339
|
+
*/
|
|
340
|
+
toLitematicB64(): string;
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Import a layered `.litematic` (with a `NucleationDesign`
|
|
344
|
+
* manifest) from raw bytes; a plain litematic errors loudly —
|
|
345
|
+
* open those with `Schematic.from_litematic`.
|
|
346
|
+
*/
|
|
347
|
+
static fromLitematic(data: Array<number>): Design;
|
|
348
|
+
}
|
|
@@ -0,0 +1,348 @@
|
|
|
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 composition document: loose blocks + cell instances + bus layers
|
|
10
|
+
* over a shared coordinate space.
|
|
11
|
+
*/
|
|
12
|
+
export class Design {
|
|
13
|
+
/** @internal */
|
|
14
|
+
get ffiValue(): pointer;
|
|
15
|
+
/** @internal */
|
|
16
|
+
constructor();
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* An empty design.
|
|
21
|
+
*/
|
|
22
|
+
static create(name: string): Design;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A design whose loose block layer is a copy of `base` (endpoint
|
|
26
|
+
* hardware placed with raw `set_block`).
|
|
27
|
+
*/
|
|
28
|
+
static forSchematic(name: string, base: Schematic): Design;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Register a library cell; its contract is resolved from the
|
|
32
|
+
* schematic (embedded metadata first, Insign signs as fallback)
|
|
33
|
+
* and registration fails loudly when no source defines one.
|
|
34
|
+
* Writes resolution warnings as a JSON array of strings.
|
|
35
|
+
*/
|
|
36
|
+
addCell(name: string, cell: Schematic): string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Place an instance layer referencing a library cell. `rot_y` is
|
|
40
|
+
* in degrees, a multiple of 90.
|
|
41
|
+
*/
|
|
42
|
+
place(name: string, cell: string, x: number, y: number, z: number, rotY: number): void;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Declare a drivable input port: anchor = bit-0 connection cell,
|
|
46
|
+
* step to the next bit, `width` bits of `ty` (`"uint"` or
|
|
47
|
+
* `"bool"`). The hardware is scanned (adjacent lever per bit) and
|
|
48
|
+
* validated loudly.
|
|
49
|
+
*/
|
|
50
|
+
declareInput(name: string, ax: number, ay: number, az: number, sx: number, sy: number, sz: number, width: number, ty: string): void;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Declare a readable output port (adjacent lamp per bit); same
|
|
54
|
+
* shape as `declare_input`.
|
|
55
|
+
*/
|
|
56
|
+
declareOutput(name: string, ax: number, ay: number, az: number, sx: number, sy: number, sz: number, width: number, ty: string): void;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Declare AND realize a bus. `sinks_json` is a JSON array of port
|
|
60
|
+
* names; `gates_json` an array of `{"name", "anchor": [x,y,z],
|
|
61
|
+
* "step": [x,y,z]}` (pass `[]` for none); `style_json` an object
|
|
62
|
+
* with optional `bus_block` / `transparent_block`. Declaration
|
|
63
|
+
* errors are error returns; geometric unroutability is the
|
|
64
|
+
* written STATE: `"routed"` or `"failed: reason"` — realization
|
|
65
|
+
* is atomic, never half-routed.
|
|
66
|
+
*/
|
|
67
|
+
routeBus(name: string, driver: string, sinksJson: string, gatesJson: string, styleJson: string): string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Declare AND realize a wired-OR bus: `drivers_json` is a JSON
|
|
71
|
+
* array of port names — multiple drivers are legal ONLY through
|
|
72
|
+
* this explicit merge (`merge="or"`). Extra drivers join the
|
|
73
|
+
* trunk as diode-isolated dust-merge branches; the LVS intent
|
|
74
|
+
* stays ONE net per bit. Same shapes as `route_bus` otherwise.
|
|
75
|
+
*/
|
|
76
|
+
routeBusOr(name: string, driversJson: string, sinksJson: string, gatesJson: string, styleJson: string): string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Edit the loose block layer: plain `set_block` on the base
|
|
80
|
+
* schematic (participates in occupancy and flatten).
|
|
81
|
+
*/
|
|
82
|
+
setBlock(x: number, y: number, z: number, block: string): void;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Drag an instance layer to a new position/rotation. The move
|
|
86
|
+
* itself ALWAYS succeeds (the document's truth); the affected bus
|
|
87
|
+
* set — fragments intersecting the old or new footprint +
|
|
88
|
+
* influence halo, plus every already-failed bus — is ripped and
|
|
89
|
+
* co-rerouted deterministically with bounded retry rounds.
|
|
90
|
+
* Writes `{"rerouted": [...], "failed": {name: reason}}`.
|
|
91
|
+
*/
|
|
92
|
+
moveInstance(name: string, x: number, y: number, z: number, rotY: number): string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Remove an instance layer. Buses that terminate on one of its
|
|
96
|
+
* ports are DELETED (they lost an endpoint); buses that merely
|
|
97
|
+
* crossed its space are ripped and co-rerouted. Writes
|
|
98
|
+
* `{"removed_buses": [...], "rerouted": [...], "failed": {...}}`.
|
|
99
|
+
*/
|
|
100
|
+
removeInstance(name: string): string;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Re-realize a bus from its stored declaration (the counterpart to
|
|
104
|
+
* `rip`); writes the resulting bus state.
|
|
105
|
+
*/
|
|
106
|
+
reroute(name: string): string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Delete a bus outright — fragment AND declaration, freeing the
|
|
110
|
+
* name. `rip` keeps the declaration so the bus can be rerouted.
|
|
111
|
+
*/
|
|
112
|
+
removeBus(name: string): void;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The flattened artifact as `.schem` bytes, base64. Unlike
|
|
116
|
+
* `flatten()` + the schematic writer, this composites the layer
|
|
117
|
+
* stack into ONE region first: `.schem` has no layers, and the
|
|
118
|
+
* region merge drops named-layer cells that the loose layer's
|
|
119
|
+
* bounding box shadows.
|
|
120
|
+
*/
|
|
121
|
+
toSchemB64(): string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The flattened artifact composited into ONE region (see
|
|
125
|
+
* `to_schem_b64`) — the shape an interchange export wants.
|
|
126
|
+
*/
|
|
127
|
+
flattenComposite(): Schematic;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Every routing endpoint the placed instances expose, as a JSON
|
|
131
|
+
* array of `{name, instance, port, role, ty, width, hardware,
|
|
132
|
+
* wires, step, routable, blocked}`. `name` is `{instance}.{port}`
|
|
133
|
+
* — exactly what `route_bus` accepts; `role` is the CELL-facing
|
|
134
|
+
* direction, so `"output"` drives a bus and `"input"` receives
|
|
135
|
+
* one. A port whose bits have no dust connection cell (a lever
|
|
136
|
+
* input, say) reports `routable: false` and why in `blocked`.
|
|
137
|
+
*/
|
|
138
|
+
instancePorts(): string;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Switch a port between executor hardware and a routable dust input.
|
|
142
|
+
*
|
|
143
|
+
* `mode` is `"bus"` or `"executor"`. Community cells name LEVERS for
|
|
144
|
+
* their inputs and nothing in redstone drives a lever, so a port must
|
|
145
|
+
* be in `"bus"` mode before a bus can land on it. The switch is a
|
|
146
|
+
* reversible per-instance patch — `"executor"` restores the shipped
|
|
147
|
+
* blocks byte-exactly.
|
|
148
|
+
*
|
|
149
|
+
* Returns the report as JSON: `{port, mode, note, changed:[{at,from,
|
|
150
|
+
* to}], removed_buses, moves, patch}` — `note` is a ready-made toast
|
|
151
|
+
* and `changed` is in WORLD coordinates.
|
|
152
|
+
*/
|
|
153
|
+
setPortMode(instance: string, port: string, mode: string): string;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Every port whose mode has been switched, as JSON:
|
|
157
|
+
* `[{"name":"u0.bin","mode":"bus","patch":{..}}]`. Ports absent from
|
|
158
|
+
* the array are in `"executor"` mode.
|
|
159
|
+
*/
|
|
160
|
+
portModes(): string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Describe (without applying) what switching a port to `"bus"` mode
|
|
164
|
+
* would do: `{"wires","hardware","step","removed","added","pivoted",
|
|
165
|
+
* "note"}`. Errors when the port cannot be promoted, with the reason.
|
|
166
|
+
*/
|
|
167
|
+
planPortPromotion(instance: string, port: string): string;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Resolve one routing endpoint name — a declared design port or an
|
|
171
|
+
* instance port `{instance}.{port}` — to the geometry a bus would
|
|
172
|
+
* use: `{"name","anchor","step","width","direction","connectable"}`.
|
|
173
|
+
* `direction` is DESIGN-facing (`"input"` drives buses).
|
|
174
|
+
*/
|
|
175
|
+
resolvePort(name: string): string;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Add a gate to an existing bus (splitting the segment it lands
|
|
179
|
+
* in) and re-realize it. Writes the resulting bus state.
|
|
180
|
+
*/
|
|
181
|
+
addGate(bus: string, gate: string, x: number, y: number, z: number, sx: number, sy: number, sz: number): string;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Drag a gate: the anchor moves unconditionally, then EXACTLY the
|
|
185
|
+
* two adjacent segments are ripped and rerouted atomically. An
|
|
186
|
+
* unroutable move leaves the bus `failed: reason` — visible,
|
|
187
|
+
* never half-routed. Writes `{"state": "...",
|
|
188
|
+
* "rerouted_segments": n, "changed": [layer, ...]}`, where `changed`
|
|
189
|
+
* is the COMPLETE redraw set (see `changed_layers_since`).
|
|
190
|
+
*/
|
|
191
|
+
moveGate(bus: string, gate: string, x: number, y: number, z: number): string;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Remove a gate by index and re-realize the bus, so the two spans it
|
|
195
|
+
* separated MERGE and route as one — removing a checkpoint relaxes a
|
|
196
|
+
* constraint, so the result is shorter and straighter, not the two old
|
|
197
|
+
* legs stitched together. Writes the same JSON as `move_gate`:
|
|
198
|
+
* `{"state", "rerouted_segments", "changed"}`.
|
|
199
|
+
*/
|
|
200
|
+
removeGate(bus: string, index: number): string;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Undo a design port declaration. Removing an ENDPOINT changes the
|
|
204
|
+
* netlist, so every bus that named it is deleted — pass `force=false`
|
|
205
|
+
* first to be refused with the list and confirm. An instance port is
|
|
206
|
+
* derived from its cell's contract; use `set_port_mode` there.
|
|
207
|
+
*
|
|
208
|
+
* Writes `{"removed_buses":[...],"rerouted":[...],"failed":{...},
|
|
209
|
+
* "changed":[...]}`.
|
|
210
|
+
*/
|
|
211
|
+
removePort(name: string, force: boolean): string;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Declare and route a bus with an explicit WIDTH-ADAPTATION policy, so
|
|
215
|
+
* a narrower word can drive a wider port.
|
|
216
|
+
*
|
|
217
|
+
* `align`: 0 = lsb (bit 0 to bit 0, magnitude preserved), 1 = msb (top
|
|
218
|
+
* bit to top bit — a shift up by the width difference), 2 = use
|
|
219
|
+
* `shift` verbatim (positive moves toward the MSB). `truncate` permits
|
|
220
|
+
* DROPPING source bits that fall outside the destination; without it a
|
|
221
|
+
* lossy connection is refused, because losing a word's high bits is not
|
|
222
|
+
* the router's call. Destination bits nothing drives read 0 with no
|
|
223
|
+
* hardware at all.
|
|
224
|
+
*
|
|
225
|
+
* Writes the resulting bus state; `bus_width_map` reports the mapping.
|
|
226
|
+
*/
|
|
227
|
+
routeBusAdapted(name: string, driver: string, sinksCsv: string, gatesJson: string, styleJson: string, align: number, shift: number, truncate: boolean): string;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* The resolved bit mapping of a width-adapted bus (`null` when the
|
|
231
|
+
* widths matched): `{"map":{...,"pairs":[[dbit,sbit],..]},"note":".."}`.
|
|
232
|
+
*/
|
|
233
|
+
busWidthMap(name: string): string;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* The current bus-layer GEOMETRY REVISION. Read it before a mutating
|
|
237
|
+
* call, pass it to `changed_layers_since` after, and redraw exactly
|
|
238
|
+
* the layers named.
|
|
239
|
+
*/
|
|
240
|
+
layerRevision(): bigint;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* The COMPLETE set of bus layers whose geometry was rewritten since
|
|
244
|
+
* `rev`, as a JSON array of names.
|
|
245
|
+
*
|
|
246
|
+
* This is the contract a viewer must trust: it is stamped at every
|
|
247
|
+
* write to a layer's fragment, so it also names layers changed
|
|
248
|
+
* INDIRECTLY — a crossing stamps a through-bus station into a bus
|
|
249
|
+
* that was never ripped and appears in no other report. It also names
|
|
250
|
+
* DELETED layers (a name here that `bus_state` no longer knows means
|
|
251
|
+
* drop the mesh). `route_bus`, which returns only a state, is covered
|
|
252
|
+
* by this too: bracket it with `layer_revision`.
|
|
253
|
+
*/
|
|
254
|
+
changedLayersSince(rev: bigint): string;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Attach a net-class discipline to a bus (JSON `NetClassRule`:
|
|
258
|
+
* optional `max_len_rt` delay budget, `y_band` layer band, …);
|
|
259
|
+
* `check()` enforces it.
|
|
260
|
+
*/
|
|
261
|
+
setBusRule(bus: string, ruleJson: string): void;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Per-bus skew from the routed fragment: writes
|
|
265
|
+
* `{"per_bit_rt": [...], "skew_rt": n, "max_rt": n}`.
|
|
266
|
+
*/
|
|
267
|
+
busSkew(name: string): string;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* The lifecycle state of a bus: `"intended"`, `"routed"` or
|
|
271
|
+
* `"failed: reason"`.
|
|
272
|
+
*/
|
|
273
|
+
busState(name: string): string;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* ONE bus layer's cells as `[[x,y,z,"block"],..]`.
|
|
277
|
+
*
|
|
278
|
+
* The live-re-route fast path: `flatten()` rebuilds every layer in the
|
|
279
|
+
* document to answer "what changed about this one bus". An unrouted bus
|
|
280
|
+
* yields `[]`.
|
|
281
|
+
*/
|
|
282
|
+
busBlocksJson(name: string): string;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* ONE instance's placed cells as `[[x,y,z,"block"],..]`, transform
|
|
286
|
+
* applied. Same fast path as `bus_blocks_json`.
|
|
287
|
+
*/
|
|
288
|
+
instanceBlocksJson(name: string): string;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Rip a bus: clear its fragment, back to `intended`.
|
|
292
|
+
*/
|
|
293
|
+
rip(name: string): void;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Collapse the layer stack into ONE self-describing schematic:
|
|
297
|
+
* named regions per layer (`inst:x`, `bus:y`) and the merged
|
|
298
|
+
* contract embedded in the metadata — itself placeable as a cell.
|
|
299
|
+
*/
|
|
300
|
+
flatten(): Schematic;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* DRC + LVS over the flattened artifact. Writes `{"clean",
|
|
304
|
+
* "drc": [...], "lvs": {...}, "buses": {...}}`.
|
|
305
|
+
*/
|
|
306
|
+
check(): string;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Settle the flattened artifact in the vanilla-accurate tick
|
|
310
|
+
* engine and return it with every settled state written back and
|
|
311
|
+
* `InitialState::Baked` stamped into the embedded contract (needs
|
|
312
|
+
* the `mc-tick` feature, else errors).
|
|
313
|
+
*/
|
|
314
|
+
bake(budget: number): Schematic;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Serialize the FULL design document to `.nucm` project-tier
|
|
318
|
+
* bytes (magic `NUCM`): cells deduped by content hash, instance
|
|
319
|
+
* transforms, ports with scanned hardware, every bus layer with
|
|
320
|
+
* its fragment, runs and `intended`/`routed`/`failed: reason`
|
|
321
|
+
* state, and the loose base layer. Base64 across the bridge.
|
|
322
|
+
*/
|
|
323
|
+
toNucmB64(): string;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Reopen a `.nucm` design document from raw bytes. The reloaded
|
|
327
|
+
* design is the same model mid-edit: rerouting works.
|
|
328
|
+
*/
|
|
329
|
+
static fromNucm(data: Array<number>): Design;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Export the design as a LAYERED `.litematic` (interchange tier):
|
|
333
|
+
* one named region per layer (`inst:{name}`, `bus:{name}`, loose
|
|
334
|
+
* base) plus the design manifest as a root-level
|
|
335
|
+
* `NucleationDesign` tag. Opens in Litematica as a plain
|
|
336
|
+
* multi-region litematic; reimports as a design whose cell
|
|
337
|
+
* references have degraded to embedded copies. Base64 across the
|
|
338
|
+
* bridge.
|
|
339
|
+
*/
|
|
340
|
+
toLitematicB64(): string;
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Import a layered `.litematic` (with a `NucleationDesign`
|
|
344
|
+
* manifest) from raw bytes; a plain litematic errors loudly —
|
|
345
|
+
* open those with `Schematic.from_litematic`.
|
|
346
|
+
*/
|
|
347
|
+
static fromLitematic(data: Array<number>): Design;
|
|
348
|
+
}
|