UNPKG

@joint/react

Version:

React bindings and hooks for JointJS to build interactive diagrams and graphs.

14 lines (13 loc) 445 B
import type { dia } from '@joint/core'; import type { GraphLink } from '../types/link-types'; /** * A custom hook that adds a link to the graph. * @group Hooks * @returns A function that adds the link to the graph. * @example * ```ts * const addLink = useCreateLink(); * addLink({ id: '1', source: { id: '2' }, target: { id: '3' } }); * ``` */ export declare function useCreateLink<T extends dia.Link | GraphLink>(): (link: T) => void;