by default, the following subconfiguration is used for both class and instance:
{ baseKey: "_super", mirrorPrototype: true, propertyKeys: [] }
if your class's instances contain properties that are not defined in the prototype (i.e. dynamically assigned properties),
then you will need to define them in instance.propertyKeys.
in a similar way, if your class has dynamically assigned static properties, then you'll need to define them in
class.propertyKeys for them to get mirrored.
the baseKey option lets you pick the key that is used for accessing the composed base object from the derived subclass.
assuming that class.baseKey = "_super" and instance.baseKey = "_super", then the generated "subclass" will be able to access the enclosed class in the following way:
inside a static class method: this._super satisfies typeof cls
inside an instance method: this._super satisfies InstanceType<typeof cls>
configuration options for the function subclassThroughComposition.
this configuration effectively specifies the MirrorObjectThroughCompositionConfig configuration for the
class
and itsinstance
s.by default, the following subconfiguration is used for both
class
andinstance
:{ baseKey: "_super", mirrorPrototype: true, propertyKeys: [] }
if your class's instances contain properties that are not defined in the prototype (i.e. dynamically assigned properties), then you will need to define them in
instance.propertyKeys
. in a similar way, if your class has dynamically assigned static properties, then you'll need to define them inclass.propertyKeys
for them to get mirrored.the
baseKey
option lets you pick the key that is used for accessing the composed base object from the derived subclass. assuming thatclass.baseKey = "_super"
andinstance.baseKey = "_super"
, then the generated "subclass" will be able to access the enclosed class in the following way:this._super satisfies typeof cls
this._super satisfies InstanceType<typeof cls>