feat: style settings better

This commit is contained in:
2024-04-19 20:30:51 +02:00
parent c62cfbf75e
commit f1fcf78f6c
9 changed files with 41 additions and 89 deletions

View File

@ -5,5 +5,8 @@
"main": "src/index.ts",
"keywords": [],
"author": "",
"license": "ISC"
"license": "ISC",
"dependencies": {
"zod": "^3.22.5"
}
}

View File

@ -31,6 +31,23 @@ type NodeInputSeed = {
value?: number;
}
type NodeInputVec3 = {
type: "vec3";
value?: number[];
}
type NodeInputModel = {
type: "model";
}
type NodeInputPlant = {
type: "plant"
}
type InputTypes = (NodeInputSeed | NodeInputBoolean | NodeInputFloat | NodeInputInteger | NodeInputSelect | NodeInputSeed | NodeInputVec3 | NodeInputModel | NodeInputPlant);
type InputId = InputTypes["type"];
type DefaultOptions = {
internal?: boolean;
external?: boolean;
@ -38,10 +55,8 @@ type DefaultOptions = {
label?: string | false;
}
type InputTypes = (NodeInputSeed | NodeInputBoolean | NodeInputFloat | NodeInputInteger | NodeInputSelect);
export type NodeInput = InputTypes & {
type: InputTypes["type"] | InputTypes["type"][];
type: InputId | InputId[];
} & DefaultOptions;

View File

@ -130,3 +130,4 @@ pub struct NodeType {
#[serde(skip_serializing_if = "Option::is_none")]
pub outputs: Option<Vec<String>>,
}

View File

@ -1,26 +0,0 @@
type RandomParameter = {
type: "random";
min: Parameter;
max: Parameter;
seed: number;
}
type MathParameter = {
type: "math";
op_type: number;
a: Parameter;
b: Parameter;
}
type NoiseParameter = {
type: "noise";
frequency: Parameter;
amplitude: Parameter;
seed: number;
}
type Parameter = number | RandomParameter | MathParameter | NoiseParameter;