pkg-components
Version:
14 lines (12 loc) • 496 B
text/typescript
/** ================================
* Context
* ================================ */
import { createContext } from "react";
import { CardData } from "../types";
export const ConnectorContext = createContext<{
register: (id: string, el: HTMLElement | null, data: CardData) => void;
unregister: (id: string) => void;
updatePos: (id: string, x: number, y: number) => void;
getRects: () => Record<string, DOMRect | undefined>;
recalc: () => void;
} | null>(null);