Skip to content

TemplateBuilder

Defined in: builder/template.ts:58

readonly events: Record<string, EventBuilder>

Defined in: builder/template.ts:59


readonly key: string

Defined in: builder/template.ts:60


readonly parent: AppBuilder

Defined in: builder/template.ts:61


readonly prn: string

Defined in: builder/index.ts:32

BaseBuilder.prn


readonly properties: Record<string, JsonPropertyBuilder | TemplatePropertyBuilder>

Defined in: builder/template.ts:43

TemplatePropertiesBuilder.properties


readonly relations: Record<string, RelationBuilder>

Defined in: builder/template.ts:62


readonly roles: Record<string, BaseRoleBuilder>

Defined in: builder/template.ts:63


readonly states: Record<string, StateBuilder>

Defined in: builder/template.ts:64

addEvent(key): EventBuilder

Defined in: builder/template.ts:69

Adds an event that can be published against items of this template type.

string

EventBuilder


addGrant(role, properties): TemplateGrantBuilder

Defined in: builder/template.ts:93

Gives the role access to the specified properties for a given item.

BaseRoleBuilder

PropertyBuilder[]

TemplateGrantBuilder


addParentListener(key, childEvent, handler): EventParentListenerBuilder

Defined in: builder/template.ts:76

Adds an listener to an event called on a child item. The listener will be called in response to the child item’s event with the parent as the item. These listeners ‘bubble’ up, calling each parent with a registered listener

string

EventBuilder

EventParentListener

EventParentListenerBuilder


addProperty<TType>(key, type, options?): TType extends keyof TemplatePropertyBuilderMap ? TemplatePropertyBuilderMap[TType] : TemplatePropertyBuilder

Defined in: builder/template.ts:49

Adds a data type property of the given type to the payload for this transition.

TType extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | PropertyDefinitionType

string

TType

PropertyDefinitionOptions

TType extends keyof TemplatePropertyBuilderMap ? TemplatePropertyBuilderMap[TType] : TemplatePropertyBuilder

TemplatePropertiesBuilder.addProperty


addRelation(key, cardinality, to, options?): RelationBuilder

Defined in: builder/template.ts:83

Creates a Relation of the specified cardinality from this template to the other supplied template.

string

RelationCardinality

TemplateBuilder | UnionBuilder

RelationOptions

RelationBuilder

RelationBuilder for more information


addRole(key, callback): TemplateRoleBuilder

Defined in: builder/template.ts:99

Creates a role specific to this template (i.e. items). For example, the item may have “collaborators” that are given access to specific items.

string

TemplateRoleCallback

TemplateRoleBuilder


addState(key): StateBuilder

Defined in: builder/template.ts:105

Creates a new state in the finite state machine for items of this template type.

string

StateBuilder


setDescription(description): this

Defined in: builder/index.ts:33

string

this

BaseBuilder.setDescription


setExtensible(): TemplateBuilder

Defined in: builder/template.ts:110

Sets this template as extensible.

TemplateBuilder


toDefinition(): TemplateDefinition

Defined in: builder/template.ts:112

TemplateDefinition