nodes/packages/types/inputs.ts

39 lines
668 B
TypeScript
Raw Normal View History

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;
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;
export type NodeInputType<T extends Record<string, NodeInput>> = {
[K in keyof T]: T[K]["value"]
};