Resolves any input cell shape to its internal store form, the variant with
framework-populated fields (id, position, size, angle, data for
elements; id, source, target, data for links) required.
Distributes over unions, so a single utility covers every input flavor:
Input
Result
Computed<ElementRecord<D>>
element with required fields
Computed<LinkRecord<D>>
link with required fields
Computed<CellRecord<E, L>>
resolved element or resolved link
To keep a custom record's exact shape, compose it OUTSIDE the wrapper, e.g.
Computed<CellRecord> | MyCustomRecord. Passing a custom element- or
link-shaped record (any object with a type field) directly through
Computed re-maps it to the internal element/link record, because it
structurally matches the same branch as ElementRecord /
LinkRecord.
Reading hooks (useCell, useCells) yield the Computed variant so
consumers don't need ?? {} / ?? 0 fallbacks for fields the store
always populates.
Resolves any input cell shape to its internal store form, the variant with framework-populated fields (
id,position,size,angle,datafor elements;id,source,target,datafor links) required.Distributes over unions, so a single utility covers every input flavor:
Computed<ElementRecord<D>>Computed<LinkRecord<D>>Computed<CellRecord<E, L>>To keep a custom record's exact shape, compose it OUTSIDE the wrapper, e.g.
Computed<CellRecord> | MyCustomRecord. Passing a custom element- or link-shaped record (any object with atypefield) directly throughComputedre-maps it to the internal element/link record, because it structurally matches the same branch as ElementRecord / LinkRecord.Reading hooks (useCell, useCells) yield the
Computedvariant so consumers don't need?? {}/?? 0fallbacks for fields the store always populates.