chore(types): cleanup

This commit is contained in:
moklick
2024-02-18 19:54:55 +01:00
parent a16c5c9bd5
commit 5e56dd58c0
2 changed files with 6 additions and 8 deletions
@@ -79,7 +79,7 @@ export const getInitialStore = ({
height?: number; height?: number;
fitView?: boolean; fitView?: boolean;
}) => { }) => {
const nodeLookup = new Map(); const nodeLookup: NodeLookup = new Map();
const nextNodes = adoptUserProvidedNodes(nodes, nodeLookup, { const nextNodes = adoptUserProvidedNodes(nodes, nodeLookup, {
nodeOrigin: [0, 0], nodeOrigin: [0, 0],
elevateNodesOnSelect: false elevateNodesOnSelect: false
+5 -7
View File
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { internalsSymbol } from '../constants'; import { internalsSymbol } from '../constants';
import type { XYPosition, Position, CoordinateExtent, HandleElement } from '.'; import type { XYPosition, Position, CoordinateExtent, HandleElement } from '.';
import { Optional } from '../utils/types'; import { Optional } from '../utils/types';
@@ -6,8 +5,8 @@ import { Optional } from '../utils/types';
/** /**
* Framework independent node data structure. * Framework independent node data structure.
* *
* @typeParam T - type of the node data * @typeParam NodeData - type of the node data
* @typeParam U - type of the node * @typeParam NodeType - type of the node
*/ */
export type NodeBase< export type NodeBase<
NodeData extends Record<string, unknown> = Record<string, unknown>, NodeData extends Record<string, unknown> = Record<string, unknown>,
@@ -77,17 +76,16 @@ export type NodeBase<
}; };
}; };
// props that get passed to a custom node
/** /**
* The node data structure that gets used for the nodes prop. * The node data structure that gets used for the nodes prop.
* *
* @public * @public
* @param id - The id of the node. * @param id - The id of the node.
*/ */
export type NodeProps<T = any> = { // eslint-disable-next-line @typescript-eslint/no-explicit-any
/** Id of the node */ export type NodeProps<NodeData = any> = {
id: NodeBase['id']; id: NodeBase['id'];
data: T; data: NodeData;
dragHandle: NodeBase['dragHandle']; dragHandle: NodeBase['dragHandle'];
type: NodeBase['type']; type: NodeBase['type'];
selected: NodeBase['selected']; selected: NodeBase['selected'];