Skip to content

TemplateDefinition

Describes one Template as the compiler emits it, adding behavior to the structure: Events, Grants, Roles, states and parent Listeners.

readonly optional description?: string

Description set with setDescription, or undefined.

BasicTemplateDefinition.description


readonly events: Record<string, EventDefinition>

Events declared on the Template, keyed by Event key.


readonly fromRelations: Record<string, RelationDefinition>

Relations declared on this Template, keyed by Relation key.

BasicTemplateDefinition.fromRelations


readonly grants: readonly TemplateGrantDefinition[]

Grants that make Items visible to Roles and decide which Properties each Role may read.


readonly isExtensible: boolean

Whether Items of this Template accept extension Properties, which are stored on the parent Item and shared by its children of this Template.


readonly key: string

Key of the Template, unique within its App.


readonly parentListeners: Record<string, EventParentListenerDefinition>

Listeners on this Template for Events of child Items, keyed by Listener key.


readonly prn: string

PRN of the Template, prn::<app>:template/<key>.

BasicTemplateDefinition.prn


readonly properties: Record<string, PropertyDefinition>

Properties of the Template, keyed by Property key.

BasicTemplateDefinition.properties


readonly roles: Record<string, TemplateRoleDefinition>

Template Roles, keyed by Role key.


readonly states: Record<string, StateDefinition>

States of the state machine, keyed by state key; empty when the Template has no states.


readonly toRelations: Record<string, RelationDefinition>

Relations that target this Template, directly or through a Union, keyed by their toKey; filled once every App is built.

BasicTemplateDefinition.toRelations


readonly unionPrns: readonly string[]

PRNs of the Unions this Template belongs to; filled once every App is built.