InputOf interface

Carries an optional Expression brand on an Input-shaped interface.

This is the asymmetric-brand trick that makes the Input type system work without discriminated unions:

  • Every generated *Input interface extends InputOf<Raw> and therefore inherits the optional brand. Plain literal values (e.g. { foo: 1 }) trivially satisfy it because the brand property is absent, which is permitted by an optional field.
  • Expression<Raw> carries a required brand of the same shape. Required-fields-satisfy-optional is part of TS structural assignability, so any Expression<Raw> is assignable where an InputOf<Raw> (and thus any *Input that extends it) is expected.

Net effect: a single MInput parameter accepts both literals and whole-subtree Expression<M> replacements — no MInput | Expression<M> union is needed in the generated signatures. Callers that want to inspect whether a value is a literal or expression use isExpression().

Property Details

[___expressionBrand]

[___expressionBrand]?: ExpressionNode<Raw>

Property Value