the cells collection to infer from, usually typeof cells
import type { InferElement } from '@joint/react';
const cells = [
{ id: 'a', type: 'element', data: { label: 'A' } },
{ id: 'e', type: 'link', source: { id: 'a' }, target: { id: 'b' }, data: { weight: 2 } },
] as const;
type Node = InferElement<typeof cells>; // element variant of the union
type NodeData = InferElement<typeof cells>['data']; // { label: 'A' }
Infer the element record type from a cells collection, typically
typeof cells. Selects the member whosetypeis'element', so a mixed array narrows to its element variant with the inferreddatashape. Compose with Computed for reading hooks, or index['data']for the render-data type.Custom shapes (a
typeother than'element') are excluded, type the record union manually for those, as documented on CellRecord.