Discriminated union over component names: each variant constrains field to the numeric paths of that component. TS narrows inline object literals by component discriminant — zero runtime overhead.
field
component
Discriminated union over component names: each variant constrains
fieldto the numeric paths of that component. TS narrows inline object literals bycomponentdiscriminant — zero runtime overhead.