Merge pull request #2771 from wbkd/richschulz/improve-typing-for-node-type
Types: improve typing for node type
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@reactflow/core': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Types: improve typing for node type
|
||||||
@@ -5,11 +5,11 @@ import { internalsSymbol } from '../utils';
|
|||||||
import type { XYPosition, Position, CoordinateExtent, HandleElement } from '.';
|
import type { XYPosition, Position, CoordinateExtent, HandleElement } from '.';
|
||||||
|
|
||||||
// interface for the user node items
|
// interface for the user node items
|
||||||
export type Node<T = any> = {
|
export type Node<T = any, U extends string | undefined = string | undefined> = {
|
||||||
id: string;
|
id: string;
|
||||||
position: XYPosition;
|
position: XYPosition;
|
||||||
data: T;
|
data: T;
|
||||||
type?: string;
|
type?: U;
|
||||||
style?: CSSProperties;
|
style?: CSSProperties;
|
||||||
className?: string;
|
className?: string;
|
||||||
sourcePosition?: Position;
|
sourcePosition?: Position;
|
||||||
|
|||||||
Reference in New Issue
Block a user