@xyflow/svelte
Version:
Svelte Flow - A highly customizable Svelte library for building node-based editors, workflow systems, diagrams and more.
21 lines (20 loc) • 1.03 kB
TypeScript
import { type XYPosition } from '@xyflow/system';
import type { Edge, Node } from '../types';
/**
* Test whether an object is usable as a Node
* @public
* @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true
* @param element - The element to test
* @returns A boolean indicating whether the element is an Node
*/
export declare const isNode: <NodeType extends Node = Node>(element: unknown) => element is NodeType;
/**
* Test whether an object is usable as an Edge
* @public
* @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true
* @param element - The element to test
* @returns A boolean indicating whether the element is an Edge
*/
export declare const isEdge: <EdgeType extends Edge = Edge>(element: unknown) => element is EdgeType;
export declare function toPxString(value: number | undefined): string | undefined;
export declare const arrowKeyDiffs: Record<string, XYPosition>;