WriteTemplate
Presents a Template inside a read-write execution, returning writable Items and creating new ones.
Extends
Section titled “Extends”ReadTemplate<TWriteItem>
Type Parameters
Section titled “Type Parameters”TWriteItem
Section titled “TWriteItem”TWriteItem extends WriteItem = WriteItem
The writable Item type generated for this Template.
Properties
Section titled “Properties”definition
Section titled “definition”
readonlydefinition:TemplateDefinition
The complete Template definition.
Inherited from
Section titled “Inherited from”grants
Section titled “grants”
readonlygrants:TemplateGrantInstance[]
Grants declared on the Template, one per granted Role.
Inherited from
Section titled “Inherited from”isExtensible
Section titled “isExtensible”
readonlyisExtensible:boolean
Whether parent Items may extend this Template’s Properties for their children; see ReadTemplateExtension.
Inherited from
Section titled “Inherited from”
readonlyprn:string
The PRN identifying this Template, for example prn::identity:template/user.
Inherited from
Section titled “Inherited from”properties
Section titled “properties”
readonlyproperties:Readonly<Record<string,PropertyDefinition>>
Property definitions declared by the Template, keyed by Property key.
Inherited from
Section titled “Inherited from”relations
Section titled “relations”
readonlyrelations:Record<string,RelationDefinition>
Relations declared from and to this Template, keyed by Relation key.
Inherited from
Section titled “Inherited from”
readonlyroles:Record<string,TemplateRoleInstance>
Template Roles declared by the Template, keyed by Role key.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”assertType()
Section titled “assertType()”assertType(
value):asserts value is TWriteItem
Narrows a value to an Item of this Template, throwing when it is not one.
Parameters
Section titled “Parameters”unknown
The value to test.
Returns
Section titled “Returns”asserts value is TWriteItem
Throws
Section titled “Throws”when value is not an Item of this Template.
createItem()
Section titled “createItem()”createItem(
parent,options):Promise<TWriteItem>
Creates an Item of this Template under a parent; equivalent to parent.createChild(template, options).
Parameters
Section titled “Parameters”parent
Section titled “parent”The Item to create the new Item under.
options
Section titled “options”Key, Property values and initial state for the new Item.
Returns
Section titled “Returns”Promise<TWriteItem>
The created Item.
getItem()
Section titled “getItem()”getItem(
id):Promise<TWriteItem|undefined>
Loads an Item of this Template by identifier, writable in the current execution.
Parameters
Section titled “Parameters”string
The Item identifier.
Returns
Section titled “Returns”Promise<TWriteItem | undefined>
The Item, or undefined when the active principal cannot read it or it is not of this Template.
Overrides
Section titled “Overrides”isType()
Section titled “isType()”isType(
value):value is TWriteItem
Reports whether a value is an Item of this Template, narrowing it to the writable Item type when it is.
Parameters
Section titled “Parameters”unknown
The value to test.
Returns
Section titled “Returns”value is TWriteItem
Overrides
Section titled “Overrides”selectItems()
Section titled “selectItems()”selectItems():
TemplateItemCursorSelector<TWriteItem>
Starts a selection over every Item of this Template in the Workspace, returning writable Items.
Returns
Section titled “Returns”TemplateItemCursorSelector<TWriteItem>

