readTrait
Call Signature
Section titled “Call Signature”readTrait<
S>(entity,trait):DeepReadonly<TraitRecord<S>> |undefined
entity’s record of trait, read-only at any depth: for a view, a
HUD, a test or any system. Undefined where it lacks the trait. It is
the record itself, not a copy: the type alone keeps a reader from
writing it.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
S extends Schema |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
entity |
Entity |
trait |
PredictedTrait<S> | CoreTrait<S> |
Returns
Section titled “Returns”DeepReadonly<TraitRecord<S>> | undefined
Call Signature
Section titled “Call Signature”readTrait<
T>(entity,trait):DeepReadonly<TraitRecord<T>> |undefined
entity’s record of trait, read-only at any depth: for a view, a
HUD, a test or any system. Undefined where it lacks the trait. It is
the record itself, not a copy: the type alone keeps a reader from
writing it.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends Trait |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
entity |
Entity |
trait |
T |
Returns
Section titled “Returns”DeepReadonly<TraitRecord<T>> | undefined