trait
trait<
Trait>(token): <T>(target) =>T
Defined in: Trait.ts:55
Class decorator that registers a trait on an entity subclass. The type constraint enforces that the class implements all trait members.
@trait(Interactable)class LightEntity extends Entity { priority = 4; interact() { ... } // TS error if missing}Type Parameters
Section titled “Type Parameters”Trait
Parameters
Section titled “Parameters”TraitToken<Trait>
Returns
Section titled “Returns”<T>(target) => T