@joint/react
Version:
React bindings and hooks for JointJS to build interactive diagrams and graphs.
28 lines (27 loc) • 965 B
TypeScript
import type { dia } from '@joint/core';
import { CellMap } from '../utils/cell/cell-map';
import type { GraphLink } from '../types/link-types';
import type { GraphElement } from '../types/element-types';
interface StoreData<Element extends GraphElement = GraphElement> {
readonly updateStore: (graph: dia.Graph) => Set<dia.Cell.ID>;
readonly destroy: () => void;
elements: CellMap<Element>;
links: CellMap<GraphLink>;
}
/**
* Main data structure for the graph store data.
* We avoid using dia.elements and dia.link due to their mutable state.
* @group Data
* @returns - The store data.
* @description
* This function is used to create a store data for the graph.
* @internal
* @example
* ```ts
* const graph = new joint.dia.Graph();
* const storeData = new GraphStoreData(graph);
* storeData.update(graph);
* ```
*/
export declare function createStoreData<Element extends GraphElement = GraphElement>(): StoreData<Element>;
export {};