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 Parameter | Default type | Description |
|---|---|---|
Added extends object | - | Shape added by the mixin. |
Req | unknown | Shape that must exist in the input model instance. |
ExtraProps extends ModelProps | ModelProps | ModelProps 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
| Parameter | Type |
|---|---|
base | B |
Returns
ModelClass<InstanceType<B> & Added & object>