Viv JavaScript Runtime - v0.10.2
    Preparing search index...

    Interface EntityView

    A read-only data view describing an entity in a host application.

    An 'entity' in Viv parlance is a character, location, item, or action. In terms of operational semantics, it is something for which an entity ID must be provisioned (by the host application), such that any call to HostApplicationAdapter.getEntityView with that entity ID will return a read-only entity view.

    Minimally, the entity view must contain a few required fields, but generally it should contain any custom fields that are referenced in your Viv code, so that conditions and other expressions can be evaluated.

    The host application is responsible for furnishing entity views in the formats that inherit from this shape -- CharacterView, ItemView, LocationView, and ActionView -- and as such it is also responsible for persisting the entity data undergirding those views.

    That said, the host application is free to model and persist this underlying data using whatever representations and methods its developers see fit. For instance, you might store a compact representation that is expanded into a richer view with derived properties. The key is to ensure that the actual underlying representation can be modified via calls to HostApplicationAdapter.updateEntityProperty, if implemented, and/or any CustomFunction.

    interface EntityView {
        entityType: EntityType;
        id: string;
        [key: string]: ExpressionValue;
    }

    Hierarchy (View Summary)

    Indexable

    • [key: string]: ExpressionValue

      Additional properties whose structure depends entirely on the host application, with the caveat that the Viv runtime expects a plain object all the way down. As such, the values embedded here should not include types like functions or members of custom classes, but rather exclusively the types defined in the ExpressionValue union.

    Index

    Properties

    Properties

    entityType: EntityType

    Discriminator for the entity type.

    id: string

    A unique identifier for the entity.