components/flow/FlowContext
useFlowContext()
function useFlowContext(): FlowContext;
Returns
FlowContext
useFlowNode()
function useFlowNode<T>(nodeId): {
getAttr: <K>(attr) => InputsOf<T>[K] | undefined;
getConnectedInputs: () => Set<string>;
isHandleConnected: (handleId, type?) => boolean;
node: Node;
setAttr: <K>(attr, value) => void;
};
Type Parameters
| Type Parameter |
Default type |
T extends OpFieldNames |
OpFieldNames |
Parameters
| Parameter |
Type |
nodeId |
string |
Returns
{
getAttr: <K>(attr) => InputsOf<T>[K] | undefined;
getConnectedInputs: () => Set<string>;
isHandleConnected: (handleId, type?) => boolean;
node: Node;
setAttr: <K>(attr, value) => void;
}
getAttr
getAttr: <K>(attr) => InputsOf<T>[K] | undefined;
Type Parameters
| Type Parameter |
K extends string | number | symbol |
Parameters
Returns
InputsOf<T>[K] | undefined
getConnectedInputs: () => Set<string>;
Returns
Set<string>
isHandleConnected
isHandleConnected: (handleId, type?) => boolean;
Parameters
| Parameter |
Type |
handleId |
string |
type? |
"source" | "target" |
Returns
boolean
node
setAttr
setAttr: <K>(attr, value) => void;
Type Parameters
| Type Parameter |
K extends string | number | symbol |
Parameters
| Parameter |
Type |
attr |
K |
value |
InputsOf<T>[K] |
Returns
void
FlowContext
const FlowContext: Context;