Merge pull request #4865 from xyflow/react/built-in-node-type

refactor(types): add group node to BuiltInNode type
This commit is contained in:
Moritz Klack
2024-12-04 13:09:44 +01:00
committed by GitHub
3 changed files with 12 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@xyflow/react': patch
'@xyflow/svelte': patch
---
Add group node to BuiltInNode type
+3 -1
View File
@@ -56,6 +56,8 @@ export type NodeWrapperProps<NodeType extends Node> = {
nodeClickDistance?: number;
};
export type BuiltInNode = Node<{ label: string }, 'input' | 'output' | 'default'>;
export type BuiltInNode =
| Node<{ label: string }, 'input' | 'output' | 'default'>
| Node<Record<string, never>, 'group'>;
export type NodeProps<NodeType extends Node = Node> = NodePropsBase<NodeType>;
+3 -1
View File
@@ -44,7 +44,9 @@ export type NodeTypes = Record<
export type DefaultNodeOptions = Partial<Omit<Node, 'id'>>;
export type BuiltInNode = Node<{ label: string }, 'input' | 'output' | 'default'>;
export type BuiltInNode =
| Node<{ label: string }, 'input' | 'output' | 'default'>
| Node<Record<string, never>, 'group'>;
export type NodeEventMap = {
nodeclick: { node: Node; event: MouseEvent | TouchEvent };