Add generic support for the type property on the Node type

This commit is contained in:
Richard Schulz
2022-11-29 17:24:34 +01:00
parent 6526e3297e
commit a1cc9da535
+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;