components/flow/types
FlowConfiguration
Properties
defaultNodeSet?
optional defaultNodeSet?: string;
edgeTypes?
optional edgeTypes?: Record<string, FC<any>>;
nodeSets
nodeSets: FlowNodeSet<string, NodeTypeToAttrs<string>>[];
onNodeError?
optional onNodeError?: (nodeId, error) => void;
Parameters
| Parameter |
Type |
nodeId |
string |
error |
string |
Returns
void
onPipelineRun?
optional onPipelineRun?: (ir) => void;
Parameters
Returns
void
FlowContext
Properties
activeNodeSet
configuration
configuration: FlowConfiguration;
errorMap
errorMap: Record<string, string>;
readOnly?
optional readOnly?: boolean;
registerSetNodeAttr?
optional registerSetNodeAttr?: (fn) => void;
Register the setNodeAttr callback from FlowCanvas
Parameters
| Parameter |
Type |
fn |
(nodeId, attr, value) => void |
Returns
void
rerun
Returns
void
selectedNode
setActiveNodeSet
setActiveNodeSet: (nodeSet) => void;
Parameters
| Parameter |
Type |
nodeSet |
string |
Returns
void
setNodeAttr?
optional setNodeAttr?: (nodeId, attr, value) => void;
Set a node attribute value - updates the local nodes state for proper reactivity
Parameters
| Parameter |
Type |
nodeId |
string |
attr |
string |
value |
unknown |
Returns
void
setRerun
Parameters
| Parameter |
Type |
fn |
() => void |
Returns
void
setSelectedNode
setSelectedNode: (node) => void;
Parameters
Returns
void
statusMap
statusMap: Record<string, NodeExecutionStatus>;
FlowNodeData
Extends
Type Parameters
| Type Parameter |
Default type |
T |
Record<string, any> |
Indexable
Properties
attrs
id
label
FlowNodeDefinition
Type Parameters
| Type Parameter |
Default type |
T extends string |
string |
AttrsT |
Record<string, any> |
Properties
category?
optional category?: string;
component
component: FlowNodeComponent<T, AttrsT>;
optional dynamicInputs?: (attrs) => Record<string, React.ReactNode>;
Parameters
| Parameter |
Type |
attrs |
AttrsT |
Returns
Record<string, React.ReactNode>
icon?
label
Parameters
| Parameter |
Type |
t |
TFunction<any, any> |
Returns
string
pluginId?
optional pluginId?: string;
requiredCapabilities?
optional requiredCapabilities?: string[];
requiredOps?
optional requiredOps?: string[];
settingsComponent?
optional settingsComponent?: FlowNodeSettingsComponent<T, AttrsT>;
signature
signature:
| FlowNodeSignature<AttrsT>
| DynamicFlowNodeSignature<AttrsT>;
singleton?
optional singleton?: boolean;
type
FlowNodeSet
Type Parameters
Properties
categories?
optional categories?: Record<string, T[]>;
categoryColors?
optional categoryColors?: Record<string, string>;
categoryIcons?
optional categoryIcons?: Record<string, SvgIconComponent>;
customParser?
optional customParser?: (nodes, edges) => any;
Parameters
| Parameter |
Type |
nodes |
Node<FlowNodeData<AttrsT>, T>[] |
edges |
any[] |
Returns
any
customValidation?
optional customValidation?: (nodes, edges) => boolean;
Parameters
| Parameter |
Type |
nodes |
Node<FlowNodeData<AttrsT>, T>[] |
edges |
any[] |
Returns
boolean
dtypeColorMap?
optional dtypeColorMap?: Record<string, {
bg: string;
handle: string;
text: string;
}>;
optional irTransformer?: (ir) => any;
Parameters
Returns
any
name
nodes
nodes: { [K in string]: FlowNodeDefinition<K, AttrsMap[K]> };
FlowNodeSettingsInfo
Type Parameters
| Type Parameter |
Default type |
T extends string |
string |
AttrsT |
Record<string, any> |
Properties
data
data: FlowNodeData<AttrsT>;
getAttr
getAttr: <K>(attr) => AttrsT[K];
Type Parameters
| Type Parameter |
K extends string | number | symbol |
Parameters
Returns
AttrsT[K]
id
setAttr
setAttr: <K>(attr, value) => void;
Type Parameters
| Type Parameter |
K extends string | number | symbol |
Parameters
| Parameter |
Type |
attr |
K |
value |
AttrsT[K] |
Returns
void
t
type
BaseDType
DType
type DType = BaseDType | `${BaseDType}|${BaseDType}` | string;
DynamicFlowNodeSignature
type DynamicFlowNodeSignature<T> = (attrs) => FlowNodeSignature<T>;
Type Parameters
| Type Parameter |
Default type |
T |
Record<string, any> |
Parameters
Returns
FlowNodeSignature<T>
type DynamicInput = {
component: React.ReactNode;
condition?: (attrs) => boolean;
id: string;
};
Properties
component
component: React.ReactNode;
condition?
optional condition?: (attrs) => boolean;
Parameters
| Parameter |
Type |
attrs |
Record<string, any> |
Returns
boolean
id
FlowArgument
type FlowArgument = {
allowMultiple?: boolean;
dtype: DType;
id: string;
label: (t) => string;
optional?: boolean;
};
Properties
allowMultiple?
optional allowMultiple?: boolean;
Allow multiple connections to/from this handle.
For outputs: allow one output to connect to multiple inputs (fan-out)
For inputs: allow multiple outputs to connect to this input (fan-in/merge)
dtype
id
label
Parameters
| Parameter |
Type |
t |
TFunction<any, any> |
Returns
string
optional?
optional optional?: boolean;
FlowAttribute
type FlowAttribute<V> = {
FlowAttribute: V;
label: (t) => string;
options?: V[];
};
Type Parameters
| Type Parameter |
Default type |
V |
unknown |
Properties
FlowAttribute
label
Parameters
| Parameter |
Type |
t |
TFunction<any, any> |
Returns
string
options?
FlowAttributeDefinition
type FlowAttributeDefinition<T> = { [K in keyof T]: FlowAttribute<T[K]> };
Type Parameters
FlowNode
type FlowNode<T, AttrsT> = Node<FlowNodeData<AttrsT>, T>;
Type Parameters
| Type Parameter |
Default type |
T extends string |
string |
AttrsT |
Record<string, any> |
FlowNodeComponent
type FlowNodeComponent<T, AttrsT> = React.FC<FlowNodeProps<T, AttrsT>>;
Type Parameters
| Type Parameter |
Default type |
T extends string |
string |
AttrsT |
Record<string, any> |
FlowNodeProps
type FlowNodeProps<T, AttrsT> = NodeProps<FlowNode<T, AttrsT>>;
Type Parameters
| Type Parameter |
Default type |
T extends string |
string |
AttrsT |
Record<string, any> |
FlowNodeSettingsComponent
type FlowNodeSettingsComponent<T, AttrsT> = React.FC<FlowNodeSettingsInfo<T, AttrsT>>;
Type Parameters
| Type Parameter |
Default type |
T extends string |
string |
AttrsT |
Record<string, any> |
FlowNodeSignature
type FlowNodeSignature<T> = {
attrs: FlowAttributeDefinition<T>;
in: FlowArgument[];
out: FlowArgument[];
};
Type Parameters
| Type Parameter |
Default type |
T |
Record<string, any> |
Properties
attrs
attrs: FlowAttributeDefinition<T>;
in
out
NodeExecutionStatus
type NodeExecutionStatus = "pending" | "executing" | "completed" | "error";
NodeTypeToAttrs
type NodeTypeToAttrs<T> = Record<T, Record<string, any>>;
Type Parameters
| Type Parameter |
Default type |
T extends string |
string |