Skip to content

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#
Parameter Type
ir any
Returns#

void


FlowContext#

Properties#

activeNodeSet#

activeNodeSet: string;

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#

rerun: () => void;
Returns#

void

selectedNode#

selectedNode: any;

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#

setRerun: (fn) => void;
Parameters#
Parameter Type
fn () => void
Returns#

void

setSelectedNode#

setSelectedNode: (node) => void;
Parameters#
Parameter Type
node any
Returns#

void

statusMap#

statusMap: Record<string, NodeExecutionStatus>;

FlowNodeData#

Extends#

  • Record<string, any>

Type Parameters#

Type Parameter Default type
T Record<string, any>

Indexable#

[key: string]: any

Properties#

attrs#

attrs: T;

id#

id: string;

label#

label: string;

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>;

dynamicInputs?#

optional dynamicInputs?: (attrs) => Record<string, React.ReactNode>;
Parameters#
Parameter Type
attrs AttrsT
Returns#

Record<string, React.ReactNode>

icon?#

optional icon?: any;

label#

label: (t) => string;
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#

type: T;

FlowNodeSet#

Type Parameters#

Type Parameter Default type
T extends string string
AttrsMap extends NodeTypeToAttrs<T> NodeTypeToAttrs<T>

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;
}>;

irTransformer?#

optional irTransformer?: (ir) => any;
Parameters#
Parameter Type
ir FlowIR
Returns#

any

name#

name: string;

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#
Parameter Type
attr K
Returns#

AttrsT[K]

id#

id: string;

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#

t: TFunction<any, any>;

type#

type: T;

BaseDType#

type BaseDType = string;

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#

Parameter Type
attrs T

Returns#

FlowNodeSignature<T>


DynamicInput#

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#

id: string;

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#

dtype: DType;

id#

id: string;

label#

label: (t) => string;
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#

FlowAttribute: V;

label#

label: (t) => string;
Parameters#
Parameter Type
t TFunction<any, any>
Returns#

string

options?#

optional options?: V[];

FlowAttributeDefinition#

type FlowAttributeDefinition<T> = { [K in keyof T]: FlowAttribute<T[K]> };

Type Parameters#

Type Parameter
T

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#

in: FlowArgument[];

out#

out: FlowArgument[];

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