TerminalValueShape type

Concrete terminal values in the generated client API.

Scalar kinds describe the JavaScript value accepted by the generated TypeScript surface, not necessarily the semantic TypeSpec scalar. For example, a numeric duration is a NumberShape, while the default ISO8601 duration is a StringShape; their narrowed encoding fields retain the TypeSpec source semantics needed for wire conversion. Numeric and boolean literal shapes can carry the same narrowly applicable encodings that TypeSpec permits on those values. String literals, enums, unions, and null remain distinct non-encodable terminal categories. Expressions are orthogonal wrappers around any value shape and are handled before shape-directed conversion.

type TerminalValueShape =
  | AnyShape
  | StringShape
  | BooleanShape
  | NumberShape
  | BytesShape
  | DateShape
  | StringLiteralShape
  | NumberLiteralShape
  | BooleanLiteralShape
  | EnumShape
  | UnionShape
  | NullShape