functional-models
    Preparing search index...

    Interface ModelDefinition<TData>

    Expressively defines metadata for a given model.

    interface ModelDefinition<TData extends DataDescription> {
        api?: Partial<ApiInfoPartialRest>;
        description: string;
        displayName: string;
        modelValidators: readonly ModelValidatorComponent<TData, object, object>[];
        namespace: string;
        pluralName: string;
        primaryKeyName: string;
        properties: PropertiesList<Required<TData>>;
        singularName: string;
    }

    Type Parameters

    Index

    Properties

    api?: Partial<ApiInfoPartialRest>

    The raw api information provided in. When looking for a fleshed out version of this data look at ModelType.getApiInfo

    description: string

    A helpful human-readable description that explains what the model is and what it is used for.

    displayName: string

    A text used for displaying the name of the model in a UI.

    modelValidators: readonly ModelValidatorComponent<TData, object, object>[]

    Validators of the overall model (rather than properties)

    namespace: string

    The name that this model exists within, such as an app. This is used to combine with the pluralName to create a unique name across a system that it is used in.

    Recommended: If you are creating reusable libraries/packages for people, we recommend using the name of the package itself. Example: "@my-scoped-package/name"

    If you are creating this model to be used locally, just use the "app" name that the model corresponds to. Example: "auth"

    The namespace is also used in the auto-generation of RestInfo.endpoint. If you want to design the endpoint so that it looks/reads/flows better then consider overriding the endpoint yourself.

    pluralName: string

    The primary name for the model and instances of the model. This should be a name for multiple of the model instances.

    primaryKeyName: string

    The name of the property that has the unique id for the model. Used to uniquely identify instances of this model vs other ones.

    properties: PropertiesList<Required<TData>>

    The properties that make up the model.

    singularName: string

    The name for a model/instance where there is one of them.