@joint/react
Version:
React bindings and hooks for JointJS to build interactive diagrams and graphs.
35 lines (34 loc) • 980 B
TypeScript
import type { dia } from '@joint/core';
/**
* A custom hook that removes an node or link from the graph by its ID.
* @group Hooks
* @returns A function that removes the element from the graph.
* @example
* ```ts
* const removeCell = useRemoveCell();
* removeCell('1');
* ```
*/
export declare function useRemoveCell(): (id: dia.Cell.ID) => void;
/**
* A custom hook that removes an element from the graph by its ID.
* @group Hooks
* @returns A function that removes the element from the graph.
* @example
* ```ts
* const removeElement = useRemoveElement();
* removeElement('1');
* ```
*/
export declare function useRemoveElement(): (id: dia.Cell.ID) => void;
/**
* A custom hook that removes a link from the graph by its ID.
* @group Hooks
* @returns A function that removes the link from the graph.
* @example
* ```ts
* const removeLink = useRemoveLink();
* removeLink('1');
* ```
*/
export declare function useRemoveLink(): (id: dia.Cell.ID) => void;