feat: style settings better
This commit is contained in:
@ -5,5 +5,8 @@
|
||||
"main": "src/index.ts",
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"zod": "^3.22.5"
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
@ -130,3 +130,4 @@ pub struct NodeType {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub outputs: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user