Merge pull request #2771 from wbkd/richschulz/improve-typing-for-node-type

Types: improve typing for node type
This commit is contained in:
Moritz Klack
2023-01-25 14:18:02 +01:00
committed by GitHub
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@reactflow/core': patch
---
Types: improve typing for node type
+2 -2
View File
@@ -5,11 +5,11 @@ import { internalsSymbol } from '../utils';
import type { XYPosition, Position, CoordinateExtent, HandleElement } from '.';
// interface for the user node items
export type Node<T = any> = {
export type Node<T = any, U extends string | undefined = string | undefined> = {
id: string;
position: XYPosition;
data: T;
type?: string;
type?: U;
style?: CSSProperties;
className?: string;
sourcePosition?: Position;