Skip to content

Documentation


Documentation / @blazetrails/activemodel / AttributeRegistration

Variable: AttributeRegistration ​

const AttributeRegistration: { ClassMethods: { _defaultAttributes: AttributeSet; attribute: void; attributeTypes: Record<string, ValueType<unknown>> | Hash<string, ValueType<unknown>>; decorateAttributes: void; typeForAttribute: ValueType; }; [included]: void; }

Defined in: packages/activemodel/lib/attribute-registration.ts:250

Type Declaration ​

ClassMethods ​

ClassMethods: { _defaultAttributes: AttributeSet; attribute: void; attributeTypes: Record<string, ValueType<unknown>> | Hash<string, ValueType<unknown>>; decorateAttributes: void; typeForAttribute: ValueType; }

ClassMethods._defaultAttributes() ​

_defaultAttributes(this): AttributeSet

Parameters ​
ParameterType
thisAttributeHostInternals & HostAsClass
Returns ​

AttributeSet

Invented Arm ​

registerSubclass — PERMANENT

ClassMethods.attribute() ​

attribute(this, name, type?, options?): void

Parameters ​
ParameterTypeDefault value
thisAttributeRegistrationHostundefined
namestringundefined
typestring | ValueType<unknown> | AttributeOptions | nullnull
optionsAttributeOptions{}
Returns ​

void

ClassMethods.attributeTypes() ​

attributeTypes(this): Record<string, ValueType<unknown>> | Hash<string, ValueType<unknown>>

Parameters ​
ParameterType
thisAttributeHostInternals
Returns ​

Record<string, ValueType<unknown>> | Hash<string, ValueType<unknown>>

Invented Arm ​

if — PERMANENT

ClassMethods.decorateAttributes() ​

decorateAttributes(this, names, decorator): void

Parameters ​
ParameterType
thisAttributeHostInternals
namesstring[] | null
decoratorAttributeDecorator
Returns ​

void

ClassMethods.typeForAttribute() ​

typeForAttribute(this, attributeName, block?): ValueType

Parameters ​
ParameterType
thisAttributeHostInternals
attributeNamestring
block?() => ValueType
Returns ​

ValueType

[included]() ​

[included](base): void

Parameters ​

ParameterType
base(...args) => unknown

Returns ​

void