2024-03-11 19:37:58 +01:00
|
|
|
type NodeInputFloat = {
|
|
|
|
type: "float";
|
|
|
|
value?: number;
|
|
|
|
min?: number;
|
|
|
|
max?: number;
|
2024-03-14 16:55:11 +01:00
|
|
|
step?: number;
|
2024-03-11 19:37:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type NodeInputInteger = {
|
|
|
|
type: "integer";
|
|
|
|
value?: number;
|
|
|
|
min?: number;
|
|
|
|
max?: number;
|
|
|
|
}
|
|
|
|
|
2024-03-14 16:55:11 +01:00
|
|
|
type NodeInputBoolean = {
|
|
|
|
type: "boolean";
|
|
|
|
value?: boolean;
|
|
|
|
}
|
|
|
|
|
2024-03-11 19:37:58 +01:00
|
|
|
type NodeInputSelect = {
|
|
|
|
type: "select";
|
2024-04-04 19:17:27 +02:00
|
|
|
labels: string[];
|
|
|
|
value?: number;
|
2024-03-11 19:37:58 +01:00
|
|
|
}
|
|
|
|
|
2024-03-11 22:00:16 +01:00
|
|
|
type DefaultOptions = {
|
|
|
|
internal?: boolean;
|
2024-04-05 18:03:23 +02:00
|
|
|
external?: boolean;
|
2024-04-05 16:45:57 +02:00
|
|
|
title?: string;
|
2024-03-11 22:00:16 +01:00
|
|
|
}
|
|
|
|
|
2024-03-14 16:55:11 +01:00
|
|
|
export type NodeInput = (NodeInputBoolean | NodeInputFloat | NodeInputInteger | NodeInputSelect) & DefaultOptions;
|
2024-03-19 16:41:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
export type NodeInputType<T extends Record<string, NodeInput>> = {
|
|
|
|
[K in keyof T]: T[K]["value"]
|
|
|
|
};
|