refactor(inrernals): use one prop for all internals

This commit is contained in:
moklick
2022-05-26 20:20:35 +02:00
parent 732d92d10b
commit ee7084b5dc
9 changed files with 35 additions and 30 deletions
+6 -4
View File
@@ -2,7 +2,7 @@ import { CSSProperties, MouseEvent as ReactMouseEvent } from 'react';
import { XYPosition, Position, CoordinateExtent } from './utils';
import { HandleElement } from './handles';
import { handleBoundsSymbol, isParentSymbol, zSymbol } from '../utils';
import { internalsSymbol } from '../utils';
// interface for the user node items
export interface Node<T = any> {
@@ -29,9 +29,11 @@ export interface Node<T = any> {
positionAbsolute?: XYPosition;
// only used internally
[zSymbol]?: number;
[handleBoundsSymbol]?: NodeHandleBounds;
[isParentSymbol]?: boolean;
[internalsSymbol]: {
z?: number;
handleBounds?: NodeHandleBounds;
isParent?: boolean;
};
}
// props that get passed to a custom node