@xyflow/system
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -10,3 +10,3 @@ import { internalsSymbol } from '../constants'; | ||
*/ | ||
export type NodeBase<NodeData extends Record<string, unknown> = Record<string, unknown>, NodeType extends string | undefined = string | undefined> = { | ||
export type NodeBase<NodeData extends Record<string, unknown> = Record<string, unknown>, NodeType extends string = string> = { | ||
/** Unique id of a node */ | ||
@@ -79,19 +79,10 @@ id: string; | ||
* @public | ||
* @param id - The id of the node. | ||
*/ | ||
export type NodeProps<NodeData = any> = { | ||
id: NodeBase['id']; | ||
data: NodeData; | ||
dragHandle: NodeBase['dragHandle']; | ||
type: NodeBase['type']; | ||
selected: NodeBase['selected']; | ||
isConnectable: NodeBase['connectable']; | ||
zIndex: NodeBase['zIndex']; | ||
export type NodeProps<NodeType extends NodeBase> = Pick<NodeType, 'id' | 'data' | 'width' | 'height' | 'sourcePosition' | 'targetPosition' | 'selected' | 'dragHandle'> & Required<Pick<NodeType, 'type' | 'dragging' | 'zIndex'>> & { | ||
/** whether a node is connectable or not */ | ||
isConnectable: boolean; | ||
/** position absolute x value */ | ||
positionAbsoluteX: number; | ||
/** position absolute x value */ | ||
positionAbsoluteY: number; | ||
width?: number; | ||
height?: number; | ||
dragging: NodeBase['dragging']; | ||
sourcePosition?: NodeBase['sourcePosition']; | ||
targetPosition?: NodeBase['targetPosition']; | ||
}; | ||
@@ -98,0 +89,0 @@ export type NodeHandleBounds = { |
@@ -17,3 +17,3 @@ import { type Transform, type XYPosition, type Rect, type NodeOrigin, type NodeBase, type EdgeBase, type FitViewParamsBase, type FitViewOptionsBase, CoordinateExtent, OnError, OnBeforeDeleteBase, NodeLookup } from '../types'; | ||
*/ | ||
export declare const isNodeBase: <NodeType extends NodeBase<Record<string, unknown>, string | undefined> = NodeBase<Record<string, unknown>, string | undefined>>(element: any) => element is NodeType; | ||
export declare const isNodeBase: <NodeType extends NodeBase<Record<string, unknown>, string> = NodeBase<Record<string, unknown>, string>>(element: any) => element is NodeType; | ||
/** | ||
@@ -27,3 +27,3 @@ * Pass in a node, and get connected nodes where edge.source === node.id | ||
*/ | ||
export declare const getOutgoers: <NodeType extends NodeBase<Record<string, unknown>, string | undefined> = NodeBase<Record<string, unknown>, string | undefined>, EdgeType extends EdgeBase<Record<string, unknown>, string | undefined> = EdgeBase<Record<string, unknown>, string | undefined>>(node: NodeType | { | ||
export declare const getOutgoers: <NodeType extends NodeBase<Record<string, unknown>, string> = NodeBase<Record<string, unknown>, string>, EdgeType extends EdgeBase<Record<string, unknown>, string | undefined> = EdgeBase<Record<string, unknown>, string | undefined>>(node: NodeType | { | ||
id: string; | ||
@@ -39,3 +39,3 @@ }, nodes: NodeType[], edges: EdgeType[]) => NodeType[]; | ||
*/ | ||
export declare const getIncomers: <NodeType extends NodeBase<Record<string, unknown>, string | undefined> = NodeBase<Record<string, unknown>, string | undefined>, EdgeType extends EdgeBase<Record<string, unknown>, string | undefined> = EdgeBase<Record<string, unknown>, string | undefined>>(node: NodeType | { | ||
export declare const getIncomers: <NodeType extends NodeBase<Record<string, unknown>, string> = NodeBase<Record<string, unknown>, string>, EdgeType extends EdgeBase<Record<string, unknown>, string | undefined> = EdgeBase<Record<string, unknown>, string | undefined>>(node: NodeType | { | ||
id: string; | ||
@@ -61,3 +61,3 @@ }, nodes: NodeType[], edges: EdgeType[]) => NodeType[]; | ||
export declare const getNodesBounds: (nodes: NodeBase[], params?: GetNodesBoundsParams) => Rect; | ||
export declare const getNodesInside: <NodeType extends NodeBase<Record<string, unknown>, string | undefined>>(nodes: NodeType[], rect: Rect, [tx, ty, tScale]?: Transform, partially?: boolean, excludeNonSelectableNodes?: boolean, nodeOrigin?: NodeOrigin) => NodeType[]; | ||
export declare const getNodesInside: <NodeType extends NodeBase<Record<string, unknown>, string>>(nodes: NodeType[], rect: Rect, [tx, ty, tScale]?: Transform, partially?: boolean, excludeNonSelectableNodes?: boolean, nodeOrigin?: NodeOrigin) => NodeType[]; | ||
/** | ||
@@ -69,3 +69,3 @@ * Get all connecting edges for a given set of nodes | ||
*/ | ||
export declare const getConnectedEdges: <NodeType extends NodeBase<Record<string, unknown>, string | undefined> = NodeBase<Record<string, unknown>, string | undefined>, EdgeType extends EdgeBase<Record<string, unknown>, string | undefined> = EdgeBase<Record<string, unknown>, string | undefined>>(nodes: NodeType[], edges: EdgeType[]) => EdgeType[]; | ||
export declare const getConnectedEdges: <NodeType extends NodeBase<Record<string, unknown>, string> = NodeBase<Record<string, unknown>, string>, EdgeType extends EdgeBase<Record<string, unknown>, string | undefined> = EdgeBase<Record<string, unknown>, string | undefined>>(nodes: NodeType[], edges: EdgeType[]) => EdgeType[]; | ||
export declare function fitView<Params extends FitViewParamsBase<NodeBase>, Options extends FitViewOptionsBase<NodeBase>>({ nodes, width, height, panZoom, minZoom, maxZoom, nodeOrigin }: Params, options?: Options): boolean; | ||
@@ -72,0 +72,0 @@ /** |
@@ -10,2 +10,3 @@ export * from './connections'; | ||
export * from './types'; | ||
export * from './shallow-node-data'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -10,3 +10,3 @@ import { internalsSymbol } from '../constants'; | ||
*/ | ||
export type NodeBase<NodeData extends Record<string, unknown> = Record<string, unknown>, NodeType extends string | undefined = string | undefined> = { | ||
export type NodeBase<NodeData extends Record<string, unknown> = Record<string, unknown>, NodeType extends string = string> = { | ||
/** Unique id of a node */ | ||
@@ -79,19 +79,10 @@ id: string; | ||
* @public | ||
* @param id - The id of the node. | ||
*/ | ||
export type NodeProps<NodeData = any> = { | ||
id: NodeBase['id']; | ||
data: NodeData; | ||
dragHandle: NodeBase['dragHandle']; | ||
type: NodeBase['type']; | ||
selected: NodeBase['selected']; | ||
isConnectable: NodeBase['connectable']; | ||
zIndex: NodeBase['zIndex']; | ||
export type NodeProps<NodeType extends NodeBase> = Pick<NodeType, 'id' | 'data' | 'width' | 'height' | 'sourcePosition' | 'targetPosition' | 'selected' | 'dragHandle'> & Required<Pick<NodeType, 'type' | 'dragging' | 'zIndex'>> & { | ||
/** whether a node is connectable or not */ | ||
isConnectable: boolean; | ||
/** position absolute x value */ | ||
positionAbsoluteX: number; | ||
/** position absolute x value */ | ||
positionAbsoluteY: number; | ||
width?: number; | ||
height?: number; | ||
dragging: NodeBase['dragging']; | ||
sourcePosition?: NodeBase['sourcePosition']; | ||
targetPosition?: NodeBase['targetPosition']; | ||
}; | ||
@@ -98,0 +89,0 @@ export type NodeHandleBounds = { |
@@ -17,3 +17,3 @@ import { type Transform, type XYPosition, type Rect, type NodeOrigin, type NodeBase, type EdgeBase, type FitViewParamsBase, type FitViewOptionsBase, CoordinateExtent, OnError, OnBeforeDeleteBase, NodeLookup } from '../types'; | ||
*/ | ||
export declare const isNodeBase: <NodeType extends NodeBase<Record<string, unknown>, string | undefined> = NodeBase<Record<string, unknown>, string | undefined>>(element: any) => element is NodeType; | ||
export declare const isNodeBase: <NodeType extends NodeBase<Record<string, unknown>, string> = NodeBase<Record<string, unknown>, string>>(element: any) => element is NodeType; | ||
/** | ||
@@ -27,3 +27,3 @@ * Pass in a node, and get connected nodes where edge.source === node.id | ||
*/ | ||
export declare const getOutgoers: <NodeType extends NodeBase<Record<string, unknown>, string | undefined> = NodeBase<Record<string, unknown>, string | undefined>, EdgeType extends EdgeBase<Record<string, unknown>, string | undefined> = EdgeBase<Record<string, unknown>, string | undefined>>(node: NodeType | { | ||
export declare const getOutgoers: <NodeType extends NodeBase<Record<string, unknown>, string> = NodeBase<Record<string, unknown>, string>, EdgeType extends EdgeBase<Record<string, unknown>, string | undefined> = EdgeBase<Record<string, unknown>, string | undefined>>(node: NodeType | { | ||
id: string; | ||
@@ -39,3 +39,3 @@ }, nodes: NodeType[], edges: EdgeType[]) => NodeType[]; | ||
*/ | ||
export declare const getIncomers: <NodeType extends NodeBase<Record<string, unknown>, string | undefined> = NodeBase<Record<string, unknown>, string | undefined>, EdgeType extends EdgeBase<Record<string, unknown>, string | undefined> = EdgeBase<Record<string, unknown>, string | undefined>>(node: NodeType | { | ||
export declare const getIncomers: <NodeType extends NodeBase<Record<string, unknown>, string> = NodeBase<Record<string, unknown>, string>, EdgeType extends EdgeBase<Record<string, unknown>, string | undefined> = EdgeBase<Record<string, unknown>, string | undefined>>(node: NodeType | { | ||
id: string; | ||
@@ -61,3 +61,3 @@ }, nodes: NodeType[], edges: EdgeType[]) => NodeType[]; | ||
export declare const getNodesBounds: (nodes: NodeBase[], params?: GetNodesBoundsParams) => Rect; | ||
export declare const getNodesInside: <NodeType extends NodeBase<Record<string, unknown>, string | undefined>>(nodes: NodeType[], rect: Rect, [tx, ty, tScale]?: Transform, partially?: boolean, excludeNonSelectableNodes?: boolean, nodeOrigin?: NodeOrigin) => NodeType[]; | ||
export declare const getNodesInside: <NodeType extends NodeBase<Record<string, unknown>, string>>(nodes: NodeType[], rect: Rect, [tx, ty, tScale]?: Transform, partially?: boolean, excludeNonSelectableNodes?: boolean, nodeOrigin?: NodeOrigin) => NodeType[]; | ||
/** | ||
@@ -69,3 +69,3 @@ * Get all connecting edges for a given set of nodes | ||
*/ | ||
export declare const getConnectedEdges: <NodeType extends NodeBase<Record<string, unknown>, string | undefined> = NodeBase<Record<string, unknown>, string | undefined>, EdgeType extends EdgeBase<Record<string, unknown>, string | undefined> = EdgeBase<Record<string, unknown>, string | undefined>>(nodes: NodeType[], edges: EdgeType[]) => EdgeType[]; | ||
export declare const getConnectedEdges: <NodeType extends NodeBase<Record<string, unknown>, string> = NodeBase<Record<string, unknown>, string>, EdgeType extends EdgeBase<Record<string, unknown>, string | undefined> = EdgeBase<Record<string, unknown>, string | undefined>>(nodes: NodeType[], edges: EdgeType[]) => EdgeType[]; | ||
export declare function fitView<Params extends FitViewParamsBase<NodeBase>, Options extends FitViewOptionsBase<NodeBase>>({ nodes, width, height, panZoom, minZoom, maxZoom, nodeOrigin }: Params, options?: Options): boolean; | ||
@@ -72,0 +72,0 @@ /** |
@@ -10,2 +10,3 @@ export * from './connections'; | ||
export * from './types'; | ||
export * from './shallow-node-data'; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@xyflow/system", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "xyflow core system that powers React Flow and Svelte Flow.", | ||
@@ -50,5 +50,5 @@ "keywords": [ | ||
"typescript": "5.1.3", | ||
"@xyflow/tsconfig": "0.0.0", | ||
"@xyflow/eslint-config": "0.0.0", | ||
"@xyflow/rollup-config": "0.0.0", | ||
"@xyflow/eslint-config": "0.0.0" | ||
"@xyflow/tsconfig": "0.0.0" | ||
}, | ||
@@ -55,0 +55,0 @@ "rollup": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
512873
170
8062