TemplateBuilder
Defined in: builder/template.ts:58
Extends
Section titled “Extends”Properties
Section titled “Properties”events
Section titled “events”
readonlyevents:Record<string,EventBuilder>
Defined in: builder/template.ts:59
readonlykey:string
Defined in: builder/template.ts:60
parent
Section titled “parent”
readonlyparent:AppBuilder
Defined in: builder/template.ts:61
readonlyprn:string
Defined in: builder/index.ts:32
Inherited from
Section titled “Inherited from”properties
Section titled “properties”
readonlyproperties:Record<string,JsonPropertyBuilder|TemplatePropertyBuilder>
Defined in: builder/template.ts:43
Inherited from
Section titled “Inherited from”TemplatePropertiesBuilder.properties
relations
Section titled “relations”
readonlyrelations:Record<string,RelationBuilder>
Defined in: builder/template.ts:62
readonlyroles:Record<string,BaseRoleBuilder>
Defined in: builder/template.ts:63
states
Section titled “states”
readonlystates:Record<string,StateBuilder>
Defined in: builder/template.ts:64
Methods
Section titled “Methods”addEvent()
Section titled “addEvent()”addEvent(
key):EventBuilder
Defined in: builder/template.ts:69
Adds an event that can be published against items of this template type.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”addGrant()
Section titled “addGrant()”addGrant(
role,properties):TemplateGrantBuilder
Defined in: builder/template.ts:93
Gives the role access to the specified properties for a given item.
Parameters
Section titled “Parameters”properties
Section titled “properties”Returns
Section titled “Returns”addParentListener()
Section titled “addParentListener()”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
Parameters
Section titled “Parameters”string
childEvent
Section titled “childEvent”handler
Section titled “handler”Returns
Section titled “Returns”addProperty()
Section titled “addProperty()”addProperty<
TType>(key,type,options?):TTypeextends keyofTemplatePropertyBuilderMap?TemplatePropertyBuilderMap[TType] :TemplatePropertyBuilder
Defined in: builder/template.ts:49
Adds a data type property of the given type to the payload for this transition.
Type Parameters
Section titled “Type Parameters”TType extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | PropertyDefinitionType
Parameters
Section titled “Parameters”string
TType
options?
Section titled “options?”Returns
Section titled “Returns”TType extends keyof TemplatePropertyBuilderMap ? TemplatePropertyBuilderMap[TType] : TemplatePropertyBuilder
Inherited from
Section titled “Inherited from”TemplatePropertiesBuilder.addProperty
addRelation()
Section titled “addRelation()”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.
Parameters
Section titled “Parameters”string
cardinality
Section titled “cardinality”TemplateBuilder | UnionBuilder
options?
Section titled “options?”Returns
Section titled “Returns”RelationBuilder for more information
addRole()
Section titled “addRole()”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.
Parameters
Section titled “Parameters”string
callback
Section titled “callback”Returns
Section titled “Returns”addState()
Section titled “addState()”addState(
key):StateBuilder
Defined in: builder/template.ts:105
Creates a new state in the finite state machine for items of this template type.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”setDescription()
Section titled “setDescription()”setDescription(
description):this
Defined in: builder/index.ts:33
Parameters
Section titled “Parameters”description
Section titled “description”string
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”setExtensible()
Section titled “setExtensible()”setExtensible():
TemplateBuilder
Defined in: builder/template.ts:110
Sets this template as extensible.
Returns
Section titled “Returns”TemplateBuilder
toDefinition()
Section titled “toDefinition()”toDefinition():
TemplateDefinition
Defined in: builder/template.ts:112