mobx-keystone
    Preparing search index...

    Type Alias ModelMixin<Added, Req, ExtraProps>

    ModelMixin: <B extends ModelClass<AnyModel & ReqObj<Req>>>(
        base: B,
    ) => ModelClass<
        InstanceType<B> & Added & { "[propsTypeSymbol]": ExtraProps },
    >

    Mixin function type for model classes.

    Type Parameters

    • 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 Declaration