Skip to main content

Type Alias: ModelMixin<Added, Req, ExtraProps>

type ModelMixin<Added, Req, ExtraProps> = <B>(base) => ModelClass<InstanceType<B> & Added & object>;

Mixin function type for model classes.

Type Parameters​

Type ParameterDefault typeDescription
Added extends object-Shape added by the mixin.
RequnknownShape that must exist in the input model instance.
ExtraProps extends ModelPropsModelPropsModelProps to merge into the class's propsTypeSymbol marker. When using defineModelMixin, this is always set to the real ModelProps object so that ModelData / ModelCreationData resolve to the exact prop types.

Type Parameters​

Type Parameter
B extends ModelClass<AnyModel & ReqObj<Req>>

Parameters​

ParameterType
baseB

Returns​

ModelClass<InstanceType<B> & Added & object>