nucleation 0.6.0 → 0.8.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.
- package/AnimationEffect.d.mts +44 -0
- package/AnimationEffect.d.ts +1 -1
- package/Autostack.d.mts +43 -0
- package/Autostack.d.ts +2 -2
- package/BlockPos.d.mts +28 -0
- package/BlockState.d.mts +39 -0
- package/BlockState.d.ts +1 -1
- package/Blocks.d.mts +91 -0
- package/Blocks.d.ts +1 -1
- package/Brush.d.mts +99 -0
- package/Brush.d.ts +21 -12
- package/Brush.mjs +66 -9
- package/BuildAnimation.d.mts +142 -0
- package/BuildAnimation.d.ts +5 -5
- package/BuildingTool.d.mts +46 -0
- package/BuildingTool.d.ts +4 -4
- package/CellularSdfConfig.d.mts +22 -0
- package/CellularSdfConfig.d.ts +22 -0
- package/CellularSdfConfig.mjs +69 -0
- package/ChunkMeshResult.d.mts +75 -0
- package/ChunkMeshResult.d.ts +7 -7
- package/CircuitBuilder.d.mts +118 -0
- package/CircuitBuilder.d.ts +6 -6
- package/Curve3D.d.mts +27 -0
- package/Curve3D.d.ts +1 -1
- package/DefinitionRegion.d.mts +274 -0
- package/DefinitionRegion.d.ts +5 -5
- package/Diff.d.mts +88 -0
- package/Diff.d.ts +2 -2
- package/Dimensions.d.mts +28 -0
- package/DistanceField.d.mts +39 -0
- package/DistanceField.d.ts +1 -1
- package/ExecutionMode.d.mts +42 -0
- package/ExecutionMode.d.ts +2 -2
- package/Field3.d.mts +40 -0
- package/Field3.d.ts +40 -0
- package/Field3.mjs +160 -0
- package/FieldProgram.d.mts +40 -0
- package/FieldProgram.d.ts +40 -0
- package/FieldProgram.mjs +167 -0
- package/FieldProgramBinaryOp.d.mts +42 -0
- package/FieldProgramBinaryOp.d.ts +42 -0
- package/FieldProgramBinaryOp.mjs +118 -0
- package/FieldProgramBuilder.d.mts +104 -0
- package/FieldProgramBuilder.d.ts +104 -0
- package/FieldProgramBuilder.mjs +486 -0
- package/FieldProgramDistanceKind.d.mts +26 -0
- package/FieldProgramDistanceKind.d.ts +26 -0
- package/FieldProgramDistanceKind.mjs +78 -0
- package/FieldProgramUnaryOp.d.mts +34 -0
- package/FieldProgramUnaryOp.d.ts +34 -0
- package/FieldProgramUnaryOp.mjs +102 -0
- package/FieldProgramValueType.d.mts +25 -0
- package/FieldProgramValueType.d.ts +25 -0
- package/FieldProgramValueType.mjs +75 -0
- package/FieldRange.d.mts +15 -0
- package/FieldRange.d.ts +15 -0
- package/FieldRange.mjs +108 -0
- package/Fingerprint.d.mts +44 -0
- package/Fingerprint.d.ts +2 -2
- package/GeneratedChunk.d.mts +35 -0
- package/GeneratedChunk.d.ts +35 -0
- package/GeneratedChunk.mjs +178 -0
- package/GeneratedChunkCoverage.d.mts +25 -0
- package/GeneratedChunkCoverage.d.ts +25 -0
- package/GeneratedChunkCoverage.mjs +75 -0
- package/GeneratedChunkOverlayMode.d.mts +24 -0
- package/GeneratedChunkOverlayMode.d.ts +24 -0
- package/GeneratedChunkOverlayMode.mjs +72 -0
- package/GeneratedWorldStream.d.mts +28 -0
- package/GeneratedWorldStream.d.ts +28 -0
- package/GeneratedWorldStream.mjs +86 -0
- package/Geo.d.mts +41 -0
- package/Geo.d.ts +2 -2
- package/InterpolationSpace.d.mts +25 -0
- package/IoLayout.d.mts +26 -0
- package/IoLayoutBuilder.d.mts +73 -0
- package/IoLayoutBuilder.d.ts +4 -4
- package/IoType.d.mts +41 -0
- package/ItemModelConfig.d.mts +65 -0
- package/ItemModelConfig.d.ts +1 -1
- package/ItemModelPackBuilder.d.mts +32 -0
- package/ItemModelPackBuilder.d.ts +1 -1
- package/ItemModelResult.d.mts +72 -0
- package/ItemModelResult.d.ts +7 -7
- package/ItemScale.d.mts +31 -0
- package/LayoutFunction.d.mts +52 -0
- package/LayoutFunction.d.ts +1 -1
- package/MchprsWorld.d.mts +131 -0
- package/MchprsWorld.d.ts +3 -3
- package/MeshBounds.d.mts +40 -0
- package/MeshConfig.d.mts +101 -0
- package/MeshConfig.d.ts +1 -1
- package/MeshJob.d.mts +44 -0
- package/MeshJob.d.ts +7 -7
- package/MeshPhase.d.mts +38 -0
- package/MeshProgress.d.mts +32 -0
- package/MeshProgress.d.ts +1 -1
- package/MeshResult.d.mts +65 -0
- package/MeshResult.d.ts +5 -5
- package/MultiMeshResult.d.mts +50 -0
- package/MultiMeshResult.d.ts +5 -5
- package/Nbt.d.mts +50 -0
- package/Nbt.d.ts +1 -1
- package/NucleationError.d.mts +41 -0
- package/NucleationError.d.ts +5 -0
- package/NucleationError.mjs +8 -1
- package/OutputCondition.d.mts +45 -0
- package/OutputCondition.d.ts +1 -1
- package/Palette.d.mts +145 -0
- package/Palette.d.ts +9 -1
- package/Palette.mjs +35 -0
- package/PaletteBuilder.d.mts +119 -0
- package/PaletteBuilder.d.ts +2 -2
- package/RawMeshExport.d.mts +74 -0
- package/RawMeshExport.d.ts +4 -4
- package/RedstoneGraph.d.mts +58 -0
- package/RedstoneGraph.d.ts +1 -1
- package/RegionBounds.d.mts +41 -0
- package/RenderConfig.d.mts +101 -0
- package/RenderConfig.d.ts +1 -1
- package/Renderer.d.mts +51 -0
- package/Renderer.d.ts +4 -4
- package/ResourcePack.d.mts +105 -0
- package/ResourcePack.d.ts +3 -3
- package/ResourcePackList.d.mts +32 -0
- package/Schematic.d.mts +734 -0
- package/Schematic.d.ts +4 -4
- package/SchematicBuilder.d.mts +103 -0
- package/SchematicBuilder.d.ts +2 -2
- package/SchematicRegions.d.mts +93 -0
- package/SchematicRegions.d.ts +3 -3
- package/Scripting.d.mts +40 -0
- package/Scripting.d.ts +2 -2
- package/Sdf.d.mts +234 -0
- package/Sdf.d.ts +208 -13
- package/Sdf.mjs +1106 -11
- package/SdfAxis.d.mts +25 -0
- package/SdfAxis.d.ts +25 -0
- package/SdfAxis.mjs +75 -0
- package/SdfBounds.d.mts +19 -0
- package/SdfBounds.d.ts +19 -0
- package/SdfBounds.mjs +160 -0
- package/SdfCellMode.d.mts +26 -0
- package/SdfCellMode.d.ts +26 -0
- package/SdfCellMode.mjs +78 -0
- package/SdfNormal.d.mts +16 -0
- package/SdfNormal.d.ts +16 -0
- package/SdfNormal.mjs +121 -0
- package/Shape.d.mts +143 -0
- package/Shape.d.ts +2 -2
- package/SortStrategy.d.mts +86 -0
- package/SortStrategy.d.ts +1 -1
- package/Store.d.mts +83 -0
- package/Store.d.ts +2 -2
- package/StoreIo.d.mts +71 -0
- package/StoreIo.d.ts +2 -2
- package/TextureAtlas.d.mts +40 -0
- package/TextureAtlas.d.ts +4 -4
- package/TextureInfo.d.mts +34 -0
- package/TypedCircuitExecutor.d.mts +101 -0
- package/TypedCircuitExecutor.d.ts +6 -6
- package/Value.d.mts +73 -0
- package/Value.d.ts +1 -1
- package/VideoConfig.d.mts +15 -0
- package/Voxelizer.d.mts +58 -0
- package/Voxelizer.d.ts +4 -4
- package/WorldChunkView.d.mts +75 -0
- package/WorldChunkView.d.ts +2 -2
- package/WorldGenerator.d.mts +75 -0
- package/WorldGenerator.d.ts +75 -0
- package/WorldGenerator.mjs +255 -0
- package/WorldSink.d.mts +50 -0
- package/WorldSink.d.ts +2 -2
- package/WorldStream.d.mts +45 -0
- package/WorldStream.d.ts +2 -2
- package/WsPartitionHints.d.mts +29 -0
- package/WsPartitionHints.d.ts +1 -1
- package/WsProfile.d.mts +46 -0
- package/WsProfile.d.ts +1 -1
- package/WsRunResult.d.mts +83 -0
- package/WsRunResult.d.ts +5 -5
- package/WsSegmentJob.d.mts +28 -0
- package/WsSegmentJob.d.ts +1 -1
- package/diplomat-runtime.d.mts +15 -0
- package/index.d.mts +177 -0
- package/index.d.ts +106 -70
- package/index.mjs +37 -1
- package/nucleation.wasm +0 -0
- package/package.json +2 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { Brush } from "./Brush.mjs"
|
|
3
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
4
|
+
import type { Schematic } from "./Schematic.mjs"
|
|
5
|
+
import type { Shape } from "./Shape.mjs"
|
|
6
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Namespace for the fill operations that combine a schematic, a shape and a
|
|
12
|
+
* brush (the old `buildingtool_*` free functions).
|
|
13
|
+
*/
|
|
14
|
+
export class BuildingTool {
|
|
15
|
+
/** @internal */
|
|
16
|
+
get ffiValue(): pointer;
|
|
17
|
+
/** @internal */
|
|
18
|
+
constructor();
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Fill `shape` into `schematic` using `brush`.
|
|
23
|
+
*/
|
|
24
|
+
static fill(schematic: Schematic, shape: Shape, brush: Brush): void;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Fill `count` copies of `shape`, each offset by `offset * i`.
|
|
28
|
+
*/
|
|
29
|
+
static rstack(schematic: Schematic, shape: Shape, brush: Brush, count: number, offsetX: number, offsetY: number, offsetZ: number): void;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Masked fill that preserves everything already placed: `brush` is
|
|
33
|
+
* only written where `schematic` currently has air (or nothing at
|
|
34
|
+
* all), so existing structures inside `shape` survive untouched.
|
|
35
|
+
*/
|
|
36
|
+
static fillOnlyAir(schematic: Schematic, shape: Shape, brush: Brush): void;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Masked fill that only overwrites the listed blocks: `targets_json`
|
|
40
|
+
* is a JSON array of block ids (e.g. `["minecraft:stone"]`, state
|
|
41
|
+
* properties ignored) and every cell of `shape` whose current block
|
|
42
|
+
* id is in the list is replaced by `brush` — everything else,
|
|
43
|
+
* including air, is left alone.
|
|
44
|
+
*/
|
|
45
|
+
static fillReplacing(schematic: Schematic, shape: Shape, brush: Brush, targetsJson: string): void;
|
|
46
|
+
}
|
package/BuildingTool.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// generated by diplomat-tool
|
|
2
|
-
import type { Brush } from "./Brush"
|
|
3
|
-
import type { NucleationError } from "./NucleationError"
|
|
4
|
-
import type { Schematic } from "./Schematic"
|
|
5
|
-
import type { Shape } from "./Shape"
|
|
2
|
+
import type { Brush } from "./Brush.mjs"
|
|
3
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
4
|
+
import type { Schematic } from "./Schematic.mjs"
|
|
5
|
+
import type { Shape } from "./Shape.mjs"
|
|
6
6
|
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
7
7
|
|
|
8
8
|
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
* Immutable hashed-cell variation shared by coordinated SDF source layers.
|
|
9
|
+
*/
|
|
10
|
+
export class CellularSdfConfig {
|
|
11
|
+
/** @internal */
|
|
12
|
+
get ffiValue(): pointer;
|
|
13
|
+
/** @internal */
|
|
14
|
+
constructor();
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Validates every field up front, so a config that constructs here is
|
|
19
|
+
* never rejected for its own values by a later `cellular_sdf` call.
|
|
20
|
+
*/
|
|
21
|
+
static create(cellSizeX: number, cellSizeZ: number, seed: bigint, maxJitterX: number, maxJitterZ: number, maxYawDegrees: number, minScale: number, maxScale: number, minYOffset: number, maxYOffset: number, presenceNumerator: number, presenceDenominator: number, featureSalt: bigint): CellularSdfConfig;
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
* Immutable hashed-cell variation shared by coordinated SDF source layers.
|
|
9
|
+
*/
|
|
10
|
+
export class CellularSdfConfig {
|
|
11
|
+
/** @internal */
|
|
12
|
+
get ffiValue(): pointer;
|
|
13
|
+
/** @internal */
|
|
14
|
+
constructor();
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Validates every field up front, so a config that constructs here is
|
|
19
|
+
* never rejected for its own values by a later `cellular_sdf` call.
|
|
20
|
+
*/
|
|
21
|
+
static create(cellSizeX: number, cellSizeZ: number, seed: bigint, maxJitterX: number, maxJitterZ: number, maxYawDegrees: number, minScale: number, maxScale: number, minYOffset: number, maxYOffset: number, presenceNumerator: number, presenceDenominator: number, featureSalt: bigint): CellularSdfConfig;
|
|
22
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import { NucleationError } from "./NucleationError.mjs"
|
|
3
|
+
import wasm from "./diplomat-wasm.mjs";
|
|
4
|
+
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
5
|
+
|
|
6
|
+
const CellularSdfConfig_box_destroy_registry = new FinalizationRegistry((ptr) => {
|
|
7
|
+
wasm.CellularSdfConfig_destroy(ptr);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Immutable hashed-cell variation shared by coordinated SDF source layers.
|
|
12
|
+
*/
|
|
13
|
+
export class CellularSdfConfig {
|
|
14
|
+
// Internal ptr reference:
|
|
15
|
+
#ptr = null;
|
|
16
|
+
|
|
17
|
+
// Lifetimes are only to keep dependencies alive.
|
|
18
|
+
// Since JS won't garbage collect until there are no incoming edges.
|
|
19
|
+
#selfEdge = [];
|
|
20
|
+
|
|
21
|
+
#internalConstructor(symbol, ptr, selfEdge) {
|
|
22
|
+
if (symbol !== diplomatRuntime.internalConstructor) {
|
|
23
|
+
console.error("CellularSdfConfig is an Opaque type. You cannot call its constructor.");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
this.#ptr = ptr;
|
|
27
|
+
this.#selfEdge = selfEdge;
|
|
28
|
+
|
|
29
|
+
// Are we being borrowed? If not, we can register.
|
|
30
|
+
if (this.#selfEdge.length === 0) {
|
|
31
|
+
CellularSdfConfig_box_destroy_registry.register(this, this.#ptr);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
/** @internal */
|
|
37
|
+
get ffiValue() {
|
|
38
|
+
return this.#ptr;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Validates every field up front, so a config that constructs here is
|
|
44
|
+
* never rejected for its own values by a later `cellular_sdf` call.
|
|
45
|
+
*/
|
|
46
|
+
static create(cellSizeX, cellSizeZ, seed, maxJitterX, maxJitterZ, maxYawDegrees, minScale, maxScale, minYOffset, maxYOffset, presenceNumerator, presenceDenominator, featureSalt) {
|
|
47
|
+
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
const result = wasm.CellularSdfConfig_create(diplomatReceive.buffer, cellSizeX, cellSizeZ, seed, maxJitterX, maxJitterZ, maxYawDegrees, minScale, maxScale, minYOffset, maxYOffset, presenceNumerator, presenceDenominator, featureSalt);
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
if (!diplomatReceive.resultFlag) {
|
|
54
|
+
const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
|
|
55
|
+
throw new globalThis.Error('NucleationError.' + cause.value, { cause });
|
|
56
|
+
}
|
|
57
|
+
return new CellularSdfConfig(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
finally {
|
|
61
|
+
diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
|
|
62
|
+
diplomatReceive.free();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
constructor(symbol, ptr, selfEdge) {
|
|
67
|
+
return this.#internalConstructor(...arguments)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { BlockPos } from "./BlockPos.mjs"
|
|
3
|
+
import type { MeshConfig } from "./MeshConfig.mjs"
|
|
4
|
+
import type { MeshResult } from "./MeshResult.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
|
+
* Per-chunk mesh results. Wraps {@link crate::meshing::ChunkMeshResult}.
|
|
15
|
+
*/
|
|
16
|
+
export class ChunkMeshResult {
|
|
17
|
+
/** @internal */
|
|
18
|
+
get ffiValue(): pointer;
|
|
19
|
+
/** @internal */
|
|
20
|
+
constructor();
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Mesh with the default chunk size (old ABI: `schematic_mesh_by_chunk`).
|
|
25
|
+
*/
|
|
26
|
+
static create(schematic: Schematic, pack: ResourcePack, config: MeshConfig): ChunkMeshResult;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Mesh with an explicit chunk size (old ABI: `schematic_mesh_by_chunk_size`).
|
|
30
|
+
*/
|
|
31
|
+
static createWithSize(schematic: Schematic, pack: ResourcePack, config: MeshConfig, chunkSize: number): ChunkMeshResult;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Mesh chunks against a pre-built shared atlas, synchronously
|
|
35
|
+
* (old ABI: `schematic_mesh_chunks_with_atlas`). For progress
|
|
36
|
+
* reporting use {@link MeshJob::start} instead.
|
|
37
|
+
*/
|
|
38
|
+
static createWithAtlas(schematic: Schematic, pack: ResourcePack, config: MeshConfig, chunkSize: number, atlas: TextureAtlas): ChunkMeshResult;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Number of chunk meshes.
|
|
42
|
+
*/
|
|
43
|
+
chunkCount(): number;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Coordinate of the `index`-th chunk (old ABI:
|
|
47
|
+
* `chunkmeshresult_chunk_coordinates` returned all of them flat).
|
|
48
|
+
*/
|
|
49
|
+
chunkCoordinateAt(index: number): BlockPos;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The mesh for one chunk coordinate (cloned).
|
|
53
|
+
*/
|
|
54
|
+
getMesh(cx: number, cy: number, cz: number): MeshResult;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Total vertex count across all chunk meshes.
|
|
58
|
+
*/
|
|
59
|
+
totalVertexCount(): number;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Total triangle count across all chunk meshes.
|
|
63
|
+
*/
|
|
64
|
+
totalTriangleCount(): number;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* All chunk meshes serialized in the NUCM cache format, base64-encoded.
|
|
68
|
+
*/
|
|
69
|
+
nucmDataB64(): string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* NUCM v2 with a shared atlas, base64-encoded.
|
|
73
|
+
*/
|
|
74
|
+
nucmDataWithAtlasB64(atlas: TextureAtlas): string;
|
|
75
|
+
}
|
package/ChunkMeshResult.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// generated by diplomat-tool
|
|
2
|
-
import type { BlockPos } from "./BlockPos"
|
|
3
|
-
import type { MeshConfig } from "./MeshConfig"
|
|
4
|
-
import type { MeshResult } from "./MeshResult"
|
|
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 { BlockPos } from "./BlockPos.mjs"
|
|
3
|
+
import type { MeshConfig } from "./MeshConfig.mjs"
|
|
4
|
+
import type { MeshResult } from "./MeshResult.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,118 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { IoType } from "./IoType.mjs"
|
|
3
|
+
import type { LayoutFunction } from "./LayoutFunction.mjs"
|
|
4
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
5
|
+
import type { Schematic } from "./Schematic.mjs"
|
|
6
|
+
import type { SortStrategy } from "./SortStrategy.mjs"
|
|
7
|
+
import type { TypedCircuitExecutor } from "./TypedCircuitExecutor.mjs"
|
|
8
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* High-level circuit builder. `build`/`build_validated` consume it
|
|
14
|
+
* (PORTING rule 11). Regions are given as flat `[x,y,z,...]` positions
|
|
15
|
+
* (see module notes).
|
|
16
|
+
*/
|
|
17
|
+
export class CircuitBuilder {
|
|
18
|
+
/** @internal */
|
|
19
|
+
get ffiValue(): pointer;
|
|
20
|
+
/** @internal */
|
|
21
|
+
constructor();
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Create a builder for a schematic (cloned; no IO defined yet).
|
|
26
|
+
*/
|
|
27
|
+
static create(schematic: Schematic): CircuitBuilder;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Create a builder pre-populated from Insign annotations.
|
|
31
|
+
*/
|
|
32
|
+
static fromInsign(schematic: Schematic): CircuitBuilder;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Add an input with full control.
|
|
36
|
+
*/
|
|
37
|
+
withInput(name: string, ioType: IoType, layout: LayoutFunction, regionPositions: Array<number>): void;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Add an input with full control and a custom sort strategy.
|
|
41
|
+
*/
|
|
42
|
+
withInputSorted(name: string, ioType: IoType, layout: LayoutFunction, regionPositions: Array<number>, sort: SortStrategy): void;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Add an input with automatic layout inference.
|
|
46
|
+
*/
|
|
47
|
+
withInputAuto(name: string, ioType: IoType, regionPositions: Array<number>): void;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Add an input with automatic layout inference and a custom sort.
|
|
51
|
+
*/
|
|
52
|
+
withInputAutoSorted(name: string, ioType: IoType, regionPositions: Array<number>, sort: SortStrategy): void;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Add an output with full control.
|
|
56
|
+
*/
|
|
57
|
+
withOutput(name: string, ioType: IoType, layout: LayoutFunction, regionPositions: Array<number>): void;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Add an output with full control and a custom sort strategy.
|
|
61
|
+
*/
|
|
62
|
+
withOutputSorted(name: string, ioType: IoType, layout: LayoutFunction, regionPositions: Array<number>, sort: SortStrategy): void;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Add an output with automatic layout inference.
|
|
66
|
+
*/
|
|
67
|
+
withOutputAuto(name: string, ioType: IoType, regionPositions: Array<number>): void;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Add an output with automatic layout inference and a custom sort.
|
|
71
|
+
*/
|
|
72
|
+
withOutputAutoSorted(name: string, ioType: IoType, regionPositions: Array<number>, sort: SortStrategy): void;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Set simulation options.
|
|
76
|
+
*/
|
|
77
|
+
withOptions(optimize: boolean, ioOnly: boolean): void;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Set the state mode ("stateless" | "stateful" | "manual").
|
|
81
|
+
*/
|
|
82
|
+
withStateMode(mode: string): void;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Validate the configuration without consuming the builder.
|
|
86
|
+
*/
|
|
87
|
+
validate(): void;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Build the executor. Consumes the builder.
|
|
91
|
+
*/
|
|
92
|
+
build(): TypedCircuitExecutor;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Build the executor with validation. Consumes the builder.
|
|
96
|
+
*/
|
|
97
|
+
buildValidated(): TypedCircuitExecutor;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Number of inputs defined so far (0 if the builder was consumed).
|
|
101
|
+
*/
|
|
102
|
+
inputCount(): number;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Number of outputs defined so far (0 if the builder was consumed).
|
|
106
|
+
*/
|
|
107
|
+
outputCount(): number;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Input names as a JSON array string.
|
|
111
|
+
*/
|
|
112
|
+
inputNamesJson(): string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Output names as a JSON array string.
|
|
116
|
+
*/
|
|
117
|
+
outputNamesJson(): string;
|
|
118
|
+
}
|
package/CircuitBuilder.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// generated by diplomat-tool
|
|
2
|
-
import type { IoType } from "./IoType"
|
|
3
|
-
import type { LayoutFunction } from "./LayoutFunction"
|
|
4
|
-
import type { NucleationError } from "./NucleationError"
|
|
5
|
-
import type { Schematic } from "./Schematic"
|
|
6
|
-
import type { SortStrategy } from "./SortStrategy"
|
|
7
|
-
import type { TypedCircuitExecutor } from "./TypedCircuitExecutor"
|
|
2
|
+
import type { IoType } from "./IoType.mjs"
|
|
3
|
+
import type { LayoutFunction } from "./LayoutFunction.mjs"
|
|
4
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
5
|
+
import type { Schematic } from "./Schematic.mjs"
|
|
6
|
+
import type { SortStrategy } from "./SortStrategy.mjs"
|
|
7
|
+
import type { TypedCircuitExecutor } from "./TypedCircuitExecutor.mjs"
|
|
8
8
|
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
9
9
|
|
|
10
10
|
|
package/Curve3D.d.mts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
* A sampled 3D polyline. Closed curves include the final segment back to
|
|
9
|
+
* the first point and retain arc-length parameterisation for animation.
|
|
10
|
+
* Oversized point sets and overflowing segment lengths are rejected.
|
|
11
|
+
*/
|
|
12
|
+
export class Curve3D {
|
|
13
|
+
/** @internal */
|
|
14
|
+
get ffiValue(): pointer;
|
|
15
|
+
/** @internal */
|
|
16
|
+
constructor();
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a curve from flat `[x0, y0, z0, x1, y1, z1, …]` coordinates.
|
|
21
|
+
*/
|
|
22
|
+
static fromPoints(coordinates: Array<number>, closed: boolean): Curve3D;
|
|
23
|
+
|
|
24
|
+
pointCount(): number;
|
|
25
|
+
|
|
26
|
+
isClosed(): boolean;
|
|
27
|
+
}
|
package/Curve3D.d.ts
CHANGED