wip
This commit is contained in:
@@ -26,7 +26,6 @@ const DefaultOptionsSchema = z.object({
|
||||
export const NodeInputFloatSchema = z.object({
|
||||
...DefaultOptionsSchema.shape,
|
||||
type: z.literal('float'),
|
||||
element: z.literal('slider').optional(),
|
||||
value: z.number().optional(),
|
||||
min: z.number().optional(),
|
||||
max: z.number().optional(),
|
||||
@@ -36,12 +35,17 @@ export const NodeInputFloatSchema = z.object({
|
||||
export const NodeInputIntegerSchema = z.object({
|
||||
...DefaultOptionsSchema.shape,
|
||||
type: z.literal('integer'),
|
||||
element: z.literal('slider').optional(),
|
||||
value: z.number().optional(),
|
||||
min: z.number().optional(),
|
||||
max: z.number().optional()
|
||||
});
|
||||
|
||||
export const NodeInputShapeSchema = z.object({
|
||||
...DefaultOptionsSchema.shape,
|
||||
type: z.literal('shape'),
|
||||
value: z.array(z.number()).optional()
|
||||
});
|
||||
|
||||
export const NodeInputBooleanSchema = z.object({
|
||||
...DefaultOptionsSchema.shape,
|
||||
type: z.literal('boolean'),
|
||||
@@ -84,6 +88,7 @@ export const NodeInputSchema = z.union([
|
||||
NodeInputBooleanSchema,
|
||||
NodeInputFloatSchema,
|
||||
NodeInputIntegerSchema,
|
||||
NodeInputShapeSchema,
|
||||
NodeInputSelectSchema,
|
||||
NodeInputSeedSchema,
|
||||
NodeInputVec3Schema,
|
||||
|
||||
@@ -103,6 +103,15 @@ pub struct NodeInputVec3 {
|
||||
pub value: Option<Vec<f64>>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct NodeInputShape {
|
||||
#[serde(flatten)]
|
||||
pub default_options: DefaultOptions,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub value: Option<Vec<f64>>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct NodeInputGeometry {
|
||||
#[serde(flatten)]
|
||||
@@ -125,6 +134,7 @@ pub enum NodeInput {
|
||||
select(NodeInputSelect),
|
||||
seed(NodeInputSeed),
|
||||
vec3(NodeInputVec3),
|
||||
shape(NodeInputShape),
|
||||
geometry(NodeInputGeometry),
|
||||
path(NodeInputPath),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user