Function decoratedModel

  • Marks a class (which MUST inherit from the Model abstract class) as a model and decorates some of its methods/properties.

    Type Parameters

    • M
    • MC extends (new (...ags: any) => M)

    Parameters

    • name: undefined | string

      Unique name for the model type. Note that this name must be unique for your whole application, so it is usually a good idea to use some prefix unique to your application domain. If you don't want to assign a name yet (e.g. for a base model) pass undefined.

    • clazz: MC

      Model class.

    • decorators: {
          [k in string | number | symbol]?: AnyFunction | readonly AnyFunction[]
      }

      Decorators.

    Returns MC