nucleation 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,26 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* What kind of distance a field program's output represents.
|
|
8
|
+
*/
|
|
9
|
+
export class FieldProgramDistanceKind {
|
|
10
|
+
|
|
11
|
+
/** @internal */
|
|
12
|
+
static fromValue(value: FieldProgramDistanceKind | string): FieldProgramDistanceKind;
|
|
13
|
+
|
|
14
|
+
get value(): string;
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
get ffiValue(): number;
|
|
18
|
+
|
|
19
|
+
static Exact : FieldProgramDistanceKind;
|
|
20
|
+
static LowerBound : FieldProgramDistanceKind;
|
|
21
|
+
static Estimate : FieldProgramDistanceKind;
|
|
22
|
+
static Implicit : FieldProgramDistanceKind;
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
constructor(value: FieldProgramDistanceKind | string );
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* What kind of distance a field program's output represents.
|
|
8
|
+
*/
|
|
9
|
+
export class FieldProgramDistanceKind {
|
|
10
|
+
|
|
11
|
+
/** @internal */
|
|
12
|
+
static fromValue(value: FieldProgramDistanceKind | string): FieldProgramDistanceKind;
|
|
13
|
+
|
|
14
|
+
get value(): string;
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
get ffiValue(): number;
|
|
18
|
+
|
|
19
|
+
static Exact : FieldProgramDistanceKind;
|
|
20
|
+
static LowerBound : FieldProgramDistanceKind;
|
|
21
|
+
static Estimate : FieldProgramDistanceKind;
|
|
22
|
+
static Implicit : FieldProgramDistanceKind;
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
constructor(value: FieldProgramDistanceKind | string );
|
|
26
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import wasm from "./diplomat-wasm.mjs";
|
|
3
|
+
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What kind of distance a field program's output represents.
|
|
9
|
+
*/
|
|
10
|
+
export class FieldProgramDistanceKind {
|
|
11
|
+
#value = undefined;
|
|
12
|
+
|
|
13
|
+
static #values = new Map([
|
|
14
|
+
["Exact", 0],
|
|
15
|
+
["LowerBound", 1],
|
|
16
|
+
["Estimate", 2],
|
|
17
|
+
["Implicit", 3]
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
static getAllEntries() {
|
|
21
|
+
return FieldProgramDistanceKind.#values.entries();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
#internalConstructor(value) {
|
|
25
|
+
if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) {
|
|
26
|
+
// We pass in two internalConstructor arguments to create *new*
|
|
27
|
+
// instances of this type, otherwise the enums are treated as singletons.
|
|
28
|
+
if (arguments[1] === diplomatRuntime.internalConstructor ) {
|
|
29
|
+
this.#value = arguments[2];
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
return FieldProgramDistanceKind.#objectValues[arguments[1]];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (value instanceof FieldProgramDistanceKind) {
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let intVal = FieldProgramDistanceKind.#values.get(value);
|
|
40
|
+
|
|
41
|
+
// Nullish check, checks for null or undefined
|
|
42
|
+
if (intVal != null) {
|
|
43
|
+
return FieldProgramDistanceKind.#objectValues[intVal];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
throw TypeError(value + " is not a FieldProgramDistanceKind and does not correspond to any of its enumerator values.");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** @internal */
|
|
50
|
+
static fromValue(value) {
|
|
51
|
+
return new FieldProgramDistanceKind(value);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
get value(){
|
|
55
|
+
return [...FieldProgramDistanceKind.#values.keys()][this.#value];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
get ffiValue(){
|
|
60
|
+
return this.#value;
|
|
61
|
+
}
|
|
62
|
+
static #objectValues = [
|
|
63
|
+
new FieldProgramDistanceKind(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0),
|
|
64
|
+
new FieldProgramDistanceKind(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1),
|
|
65
|
+
new FieldProgramDistanceKind(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2),
|
|
66
|
+
new FieldProgramDistanceKind(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3),
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
static Exact = FieldProgramDistanceKind.#objectValues[0];
|
|
70
|
+
static LowerBound = FieldProgramDistanceKind.#objectValues[1];
|
|
71
|
+
static Estimate = FieldProgramDistanceKind.#objectValues[2];
|
|
72
|
+
static Implicit = FieldProgramDistanceKind.#objectValues[3];
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
constructor(value) {
|
|
76
|
+
return this.#internalConstructor(...arguments)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Unary field-program operations (see `crate::sdf::UnaryOp`).
|
|
8
|
+
*/
|
|
9
|
+
export class FieldProgramUnaryOp {
|
|
10
|
+
|
|
11
|
+
/** @internal */
|
|
12
|
+
static fromValue(value: FieldProgramUnaryOp | string): FieldProgramUnaryOp;
|
|
13
|
+
|
|
14
|
+
get value(): string;
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
get ffiValue(): number;
|
|
18
|
+
|
|
19
|
+
static Neg : FieldProgramUnaryOp;
|
|
20
|
+
static Abs : FieldProgramUnaryOp;
|
|
21
|
+
static Sqrt : FieldProgramUnaryOp;
|
|
22
|
+
static Log : FieldProgramUnaryOp;
|
|
23
|
+
static Sin : FieldProgramUnaryOp;
|
|
24
|
+
static Cos : FieldProgramUnaryOp;
|
|
25
|
+
static Acos : FieldProgramUnaryOp;
|
|
26
|
+
static VecX : FieldProgramUnaryOp;
|
|
27
|
+
static VecY : FieldProgramUnaryOp;
|
|
28
|
+
static VecZ : FieldProgramUnaryOp;
|
|
29
|
+
static Length : FieldProgramUnaryOp;
|
|
30
|
+
static Normalize : FieldProgramUnaryOp;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
constructor(value: FieldProgramUnaryOp | string );
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Unary field-program operations (see `crate::sdf::UnaryOp`).
|
|
8
|
+
*/
|
|
9
|
+
export class FieldProgramUnaryOp {
|
|
10
|
+
|
|
11
|
+
/** @internal */
|
|
12
|
+
static fromValue(value: FieldProgramUnaryOp | string): FieldProgramUnaryOp;
|
|
13
|
+
|
|
14
|
+
get value(): string;
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
get ffiValue(): number;
|
|
18
|
+
|
|
19
|
+
static Neg : FieldProgramUnaryOp;
|
|
20
|
+
static Abs : FieldProgramUnaryOp;
|
|
21
|
+
static Sqrt : FieldProgramUnaryOp;
|
|
22
|
+
static Log : FieldProgramUnaryOp;
|
|
23
|
+
static Sin : FieldProgramUnaryOp;
|
|
24
|
+
static Cos : FieldProgramUnaryOp;
|
|
25
|
+
static Acos : FieldProgramUnaryOp;
|
|
26
|
+
static VecX : FieldProgramUnaryOp;
|
|
27
|
+
static VecY : FieldProgramUnaryOp;
|
|
28
|
+
static VecZ : FieldProgramUnaryOp;
|
|
29
|
+
static Length : FieldProgramUnaryOp;
|
|
30
|
+
static Normalize : FieldProgramUnaryOp;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
constructor(value: FieldProgramUnaryOp | string );
|
|
34
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import wasm from "./diplomat-wasm.mjs";
|
|
3
|
+
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Unary field-program operations (see `crate::sdf::UnaryOp`).
|
|
9
|
+
*/
|
|
10
|
+
export class FieldProgramUnaryOp {
|
|
11
|
+
#value = undefined;
|
|
12
|
+
|
|
13
|
+
static #values = new Map([
|
|
14
|
+
["Neg", 0],
|
|
15
|
+
["Abs", 1],
|
|
16
|
+
["Sqrt", 2],
|
|
17
|
+
["Log", 3],
|
|
18
|
+
["Sin", 4],
|
|
19
|
+
["Cos", 5],
|
|
20
|
+
["Acos", 6],
|
|
21
|
+
["VecX", 7],
|
|
22
|
+
["VecY", 8],
|
|
23
|
+
["VecZ", 9],
|
|
24
|
+
["Length", 10],
|
|
25
|
+
["Normalize", 11]
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
static getAllEntries() {
|
|
29
|
+
return FieldProgramUnaryOp.#values.entries();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#internalConstructor(value) {
|
|
33
|
+
if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) {
|
|
34
|
+
// We pass in two internalConstructor arguments to create *new*
|
|
35
|
+
// instances of this type, otherwise the enums are treated as singletons.
|
|
36
|
+
if (arguments[1] === diplomatRuntime.internalConstructor ) {
|
|
37
|
+
this.#value = arguments[2];
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
return FieldProgramUnaryOp.#objectValues[arguments[1]];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (value instanceof FieldProgramUnaryOp) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
let intVal = FieldProgramUnaryOp.#values.get(value);
|
|
48
|
+
|
|
49
|
+
// Nullish check, checks for null or undefined
|
|
50
|
+
if (intVal != null) {
|
|
51
|
+
return FieldProgramUnaryOp.#objectValues[intVal];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
throw TypeError(value + " is not a FieldProgramUnaryOp and does not correspond to any of its enumerator values.");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
static fromValue(value) {
|
|
59
|
+
return new FieldProgramUnaryOp(value);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
get value(){
|
|
63
|
+
return [...FieldProgramUnaryOp.#values.keys()][this.#value];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
get ffiValue(){
|
|
68
|
+
return this.#value;
|
|
69
|
+
}
|
|
70
|
+
static #objectValues = [
|
|
71
|
+
new FieldProgramUnaryOp(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0),
|
|
72
|
+
new FieldProgramUnaryOp(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1),
|
|
73
|
+
new FieldProgramUnaryOp(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2),
|
|
74
|
+
new FieldProgramUnaryOp(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3),
|
|
75
|
+
new FieldProgramUnaryOp(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4),
|
|
76
|
+
new FieldProgramUnaryOp(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 5),
|
|
77
|
+
new FieldProgramUnaryOp(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 6),
|
|
78
|
+
new FieldProgramUnaryOp(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 7),
|
|
79
|
+
new FieldProgramUnaryOp(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 8),
|
|
80
|
+
new FieldProgramUnaryOp(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 9),
|
|
81
|
+
new FieldProgramUnaryOp(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 10),
|
|
82
|
+
new FieldProgramUnaryOp(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 11),
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
static Neg = FieldProgramUnaryOp.#objectValues[0];
|
|
86
|
+
static Abs = FieldProgramUnaryOp.#objectValues[1];
|
|
87
|
+
static Sqrt = FieldProgramUnaryOp.#objectValues[2];
|
|
88
|
+
static Log = FieldProgramUnaryOp.#objectValues[3];
|
|
89
|
+
static Sin = FieldProgramUnaryOp.#objectValues[4];
|
|
90
|
+
static Cos = FieldProgramUnaryOp.#objectValues[5];
|
|
91
|
+
static Acos = FieldProgramUnaryOp.#objectValues[6];
|
|
92
|
+
static VecX = FieldProgramUnaryOp.#objectValues[7];
|
|
93
|
+
static VecY = FieldProgramUnaryOp.#objectValues[8];
|
|
94
|
+
static VecZ = FieldProgramUnaryOp.#objectValues[9];
|
|
95
|
+
static Length = FieldProgramUnaryOp.#objectValues[10];
|
|
96
|
+
static Normalize = FieldProgramUnaryOp.#objectValues[11];
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
constructor(value) {
|
|
100
|
+
return this.#internalConstructor(...arguments)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The type of a value on a {@link FieldProgramBuilder}'s stack or in a slot.
|
|
8
|
+
*/
|
|
9
|
+
export class FieldProgramValueType {
|
|
10
|
+
|
|
11
|
+
/** @internal */
|
|
12
|
+
static fromValue(value: FieldProgramValueType | string): FieldProgramValueType;
|
|
13
|
+
|
|
14
|
+
get value(): string;
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
get ffiValue(): number;
|
|
18
|
+
|
|
19
|
+
static Scalar : FieldProgramValueType;
|
|
20
|
+
static Vec3 : FieldProgramValueType;
|
|
21
|
+
static Bool : FieldProgramValueType;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
constructor(value: FieldProgramValueType | string );
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The type of a value on a {@link FieldProgramBuilder}'s stack or in a slot.
|
|
8
|
+
*/
|
|
9
|
+
export class FieldProgramValueType {
|
|
10
|
+
|
|
11
|
+
/** @internal */
|
|
12
|
+
static fromValue(value: FieldProgramValueType | string): FieldProgramValueType;
|
|
13
|
+
|
|
14
|
+
get value(): string;
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
get ffiValue(): number;
|
|
18
|
+
|
|
19
|
+
static Scalar : FieldProgramValueType;
|
|
20
|
+
static Vec3 : FieldProgramValueType;
|
|
21
|
+
static Bool : FieldProgramValueType;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
constructor(value: FieldProgramValueType | string );
|
|
25
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import wasm from "./diplomat-wasm.mjs";
|
|
3
|
+
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The type of a value on a {@link FieldProgramBuilder}'s stack or in a slot.
|
|
9
|
+
*/
|
|
10
|
+
export class FieldProgramValueType {
|
|
11
|
+
#value = undefined;
|
|
12
|
+
|
|
13
|
+
static #values = new Map([
|
|
14
|
+
["Scalar", 0],
|
|
15
|
+
["Vec3", 1],
|
|
16
|
+
["Bool", 2]
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
static getAllEntries() {
|
|
20
|
+
return FieldProgramValueType.#values.entries();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
#internalConstructor(value) {
|
|
24
|
+
if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) {
|
|
25
|
+
// We pass in two internalConstructor arguments to create *new*
|
|
26
|
+
// instances of this type, otherwise the enums are treated as singletons.
|
|
27
|
+
if (arguments[1] === diplomatRuntime.internalConstructor ) {
|
|
28
|
+
this.#value = arguments[2];
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
return FieldProgramValueType.#objectValues[arguments[1]];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (value instanceof FieldProgramValueType) {
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let intVal = FieldProgramValueType.#values.get(value);
|
|
39
|
+
|
|
40
|
+
// Nullish check, checks for null or undefined
|
|
41
|
+
if (intVal != null) {
|
|
42
|
+
return FieldProgramValueType.#objectValues[intVal];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
throw TypeError(value + " is not a FieldProgramValueType and does not correspond to any of its enumerator values.");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
static fromValue(value) {
|
|
50
|
+
return new FieldProgramValueType(value);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get value(){
|
|
54
|
+
return [...FieldProgramValueType.#values.keys()][this.#value];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
get ffiValue(){
|
|
59
|
+
return this.#value;
|
|
60
|
+
}
|
|
61
|
+
static #objectValues = [
|
|
62
|
+
new FieldProgramValueType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0),
|
|
63
|
+
new FieldProgramValueType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1),
|
|
64
|
+
new FieldProgramValueType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2),
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
static Scalar = FieldProgramValueType.#objectValues[0];
|
|
68
|
+
static Vec3 = FieldProgramValueType.#objectValues[1];
|
|
69
|
+
static Bool = FieldProgramValueType.#objectValues[2];
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
constructor(value) {
|
|
73
|
+
return this.#internalConstructor(...arguments)
|
|
74
|
+
}
|
|
75
|
+
}
|
package/FieldRange.d.mts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The closed interval a field's values are analytically proven to lie in.
|
|
8
|
+
*/
|
|
9
|
+
export class FieldRange {
|
|
10
|
+
get min(): number;
|
|
11
|
+
get max(): number;
|
|
12
|
+
/** @internal */
|
|
13
|
+
constructor();
|
|
14
|
+
|
|
15
|
+
}
|
package/FieldRange.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The closed interval a field's values are analytically proven to lie in.
|
|
8
|
+
*/
|
|
9
|
+
export class FieldRange {
|
|
10
|
+
get min(): number;
|
|
11
|
+
get max(): number;
|
|
12
|
+
/** @internal */
|
|
13
|
+
constructor();
|
|
14
|
+
|
|
15
|
+
}
|
package/FieldRange.mjs
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import wasm from "./diplomat-wasm.mjs";
|
|
3
|
+
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The closed interval a field's values are analytically proven to lie in.
|
|
9
|
+
*/
|
|
10
|
+
export class FieldRange {
|
|
11
|
+
#min;
|
|
12
|
+
get min() {
|
|
13
|
+
return this.#min;
|
|
14
|
+
}
|
|
15
|
+
#max;
|
|
16
|
+
get max() {
|
|
17
|
+
return this.#max;
|
|
18
|
+
}
|
|
19
|
+
#internalConstructor(structObj, internalConstructor) {
|
|
20
|
+
if (typeof structObj !== "object") {
|
|
21
|
+
throw new Error("FieldRange's constructor takes an object of FieldRange's fields.");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (internalConstructor !== diplomatRuntime.internalConstructor) {
|
|
25
|
+
throw new Error("FieldRange is an out struct and can only be created internally.");
|
|
26
|
+
}
|
|
27
|
+
if ("min" in structObj) {
|
|
28
|
+
this.#min = structObj.min;
|
|
29
|
+
} else {
|
|
30
|
+
throw new Error("Missing required field min.");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if ("max" in structObj) {
|
|
34
|
+
this.#max = structObj.max;
|
|
35
|
+
} else {
|
|
36
|
+
throw new Error("Missing required field max.");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Return this struct in FFI function friendly format.
|
|
43
|
+
// Returns an array that can be expanded with spread syntax (...)
|
|
44
|
+
_intoFFI(
|
|
45
|
+
dst,
|
|
46
|
+
functionCleanupArena,
|
|
47
|
+
appendArrayMap
|
|
48
|
+
) {
|
|
49
|
+
|
|
50
|
+
this._writeToArrayBuffer(wasm.memory.buffer, dst, functionCleanupArena, appendArrayMap);
|
|
51
|
+
|
|
52
|
+
return dst;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static get _sizeBytes() {
|
|
56
|
+
return 8;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/// Currently unused, we may want to use later on though:
|
|
60
|
+
static get _sizeAlign() {
|
|
61
|
+
return 4;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
static _fromSuppliedValue(internalConstructor, obj) {
|
|
65
|
+
if (internalConstructor !== diplomatRuntime.internalConstructor) {
|
|
66
|
+
throw new Error("_fromSuppliedValue cannot be called externally.");
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (obj instanceof FieldRange) {
|
|
70
|
+
return obj;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return FieldRange.fromFields(obj);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
_writeToArrayBuffer(
|
|
77
|
+
arrayBuffer,
|
|
78
|
+
offset,
|
|
79
|
+
functionCleanupArena,
|
|
80
|
+
appendArrayMap
|
|
81
|
+
) {
|
|
82
|
+
diplomatRuntime.writeToArrayBuffer(arrayBuffer, offset + 0, this.#min, Float32Array);
|
|
83
|
+
diplomatRuntime.writeToArrayBuffer(arrayBuffer, offset + 4, this.#max, Float32Array);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// This struct contains borrowed fields, so this takes in a list of
|
|
87
|
+
// "edges" corresponding to where each lifetime's data may have been borrowed from
|
|
88
|
+
// and passes it down to individual fields containing the borrow.
|
|
89
|
+
// This method does not attempt to handle any dependencies between lifetimes, the caller
|
|
90
|
+
// should handle this when constructing edge arrays.
|
|
91
|
+
static _fromFFI(internalConstructor, ptr) {
|
|
92
|
+
if (internalConstructor !== diplomatRuntime.internalConstructor) {
|
|
93
|
+
throw new Error("FieldRange._fromFFI is not meant to be called externally. Please use the default constructor.");
|
|
94
|
+
}
|
|
95
|
+
let structObj = {};
|
|
96
|
+
const minDeref = (new Float32Array(wasm.memory.buffer, ptr, 1))[0];
|
|
97
|
+
structObj.min = minDeref;
|
|
98
|
+
const maxDeref = (new Float32Array(wasm.memory.buffer, ptr + 4, 1))[0];
|
|
99
|
+
structObj.max = maxDeref;
|
|
100
|
+
|
|
101
|
+
return new FieldRange(structObj, internalConstructor);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
constructor(structObj, internalConstructor) {
|
|
106
|
+
return this.#internalConstructor(...arguments)
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 fingerprint free functions (PORTING rule 12).
|
|
10
|
+
*/
|
|
11
|
+
export class Fingerprint {
|
|
12
|
+
/** @internal */
|
|
13
|
+
get ffiValue(): pointer;
|
|
14
|
+
/** @internal */
|
|
15
|
+
constructor();
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The fingerprint of a schematic for the given preset, as a hex string.
|
|
20
|
+
* Errors with `InvalidArgument` on an unknown preset.
|
|
21
|
+
*/
|
|
22
|
+
static compute(schematic: Schematic, preset: string): string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The structural signature (JSON) of a schematic for the given preset.
|
|
26
|
+
*/
|
|
27
|
+
static signatureJson(schematic: Schematic, preset: string): string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Translation-invariant fuzzy distance between two builds' footprints.
|
|
31
|
+
*/
|
|
32
|
+
static footprintDistance(a: Schematic, b: Schematic, preset: string): number;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The schematic's translation/scale-invariant FFT shape footprint as a
|
|
36
|
+
* JSON array of floats.
|
|
37
|
+
*/
|
|
38
|
+
static footprintJson(schematic: Schematic, preset: string): string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Whether two schematics share the same fingerprint for the given preset.
|
|
42
|
+
*/
|
|
43
|
+
static isDuplicate(a: Schematic, b: Schematic, preset: string): boolean;
|
|
44
|
+
}
|
package/Fingerprint.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,35 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { GeneratedChunkCoverage } from "./GeneratedChunkCoverage.mjs"
|
|
3
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
4
|
+
import type { WorldChunkView } from "./WorldChunkView.mjs"
|
|
5
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* One generated chunk plus coverage and source-version metadata.
|
|
11
|
+
* Call `take_view` once to move its chunk into the existing world-stream API.
|
|
12
|
+
*/
|
|
13
|
+
export class GeneratedChunk {
|
|
14
|
+
/** @internal */
|
|
15
|
+
get ffiValue(): pointer;
|
|
16
|
+
/** @internal */
|
|
17
|
+
constructor();
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
cx(): number;
|
|
21
|
+
|
|
22
|
+
cz(): number;
|
|
23
|
+
|
|
24
|
+
coverage(): GeneratedChunkCoverage;
|
|
25
|
+
|
|
26
|
+
sourceId(): string;
|
|
27
|
+
|
|
28
|
+
version(): string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Consume the generated chunk payload. Metadata access and a second call
|
|
32
|
+
* return `AlreadyConsumed` afterwards.
|
|
33
|
+
*/
|
|
34
|
+
takeView(): WorldChunkView;
|
|
35
|
+
}
|