feat: testing on how to flatten tree structures
This commit is contained in:
@@ -45,7 +45,24 @@ export type Socket = {
|
||||
|
||||
|
||||
export interface NodeRegistry {
|
||||
/**
|
||||
* Load the nodes with the given ids
|
||||
* @param nodeIds - The ids of the nodes to load
|
||||
* @returns A promise that resolves when the nodes are loaded
|
||||
* @throws An error if the nodes could not be loaded
|
||||
* @remarks This method should be called before calling getNode or getAllNodes
|
||||
*/
|
||||
load: (nodeIds: string[]) => Promise<void>;
|
||||
/**
|
||||
* Get a node by id
|
||||
* @param id - The id of the node to get
|
||||
* @returns The node with the given id, or undefined if no such node exists
|
||||
*/
|
||||
getNode: (id: string) => NodeType | undefined;
|
||||
/**
|
||||
* Get all nodes
|
||||
* @returns An array of all nodes
|
||||
*/
|
||||
getAllNodes: () => NodeType[];
|
||||
}
|
||||
|
||||
|
@@ -26,6 +26,7 @@ type NodeInputSelect = {
|
||||
|
||||
type DefaultOptions = {
|
||||
internal?: boolean;
|
||||
title?: string;
|
||||
}
|
||||
|
||||
export type NodeInput = (NodeInputBoolean | NodeInputFloat | NodeInputInteger | NodeInputSelect) & DefaultOptions;
|
||||
|
26
packages/types/parameters.ts
Normal file
26
packages/types/parameters.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
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