@joint/react
    Preparing search index...

    Type Alias InferLink<Cells>

    InferLink: Extract<CellArrayMember<Cells>, { type: typeof LINK_MODEL_TYPE }>

    Infer the link record type from a cells collection, the link counterpart of InferElement. Selects the member whose type is 'link'.

    Type Parameters

    • Cells

      the cells collection to infer from, usually typeof cells

    import type { InferLink } 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 Edge = InferLink<typeof cells>; // link variant of the union
    type EdgeData = InferLink<typeof cells>['data']; // { weight: 2 }