///|
// A distinct type for entity IDs, preventing mix-ups with regular Ints.

///|
/// STEP entity instance id (`#` in the file).
///
/// Distinct from plain `Int32` so entity ids cannot be confused with other
/// integers. Ids are assigned sequentially by the repository on write.
pub(all) struct EntityId {
  /// The numeric part of the `#` reference (without the `#`).
  value : Int32
}

///|
// A reference to another entity, holding its ID.
// (TypeScript has `Ref`; we keep the runtime representation unparameterized.)

///|
/// Reference to another entity in the same repository, by `EntityId`.
///
/// The type parameter is not tracked, mirroring the untyped `#id` reference
/// syntax of STEP: type checking of references happens at the entity-decoder
/// layer, not in `Ref` itself.
pub(all) struct Ref {
  /// Id of the referenced entity.
  id : EntityId
}