Skip to content

TypeScript Function APIDocs


TypeScript Function API / asset_builder / PropBuilder

Class: PropBuilder

Creates a prop to attach values to an asset

Example

ts
const propName = new PropBuilder()
  .setName("name")
  .setKind("string")
  .setDocumentation("This is the documentation for the prop")
  .setWidget(new PropWidgetDefinitionBuilder().setKind("text").build())
 .build();

Implements

Constructors

new PropBuilder()

new PropBuilder(): PropBuilder

Returns

PropBuilder

Properties

prop

prop: PropDefinition

Defined in

asset_builder.ts:547

Methods

addChild()

addChild(child): this

Adds a child to an object type prop

Parameters

child: PropDefinition

Returns

this

this

Example

ts
.addChild(new PropBuilder()
    .setKind("string")
    .setName("sweetChildProp")
    .setWidget(new PropWidgetDefinitionBuilder().setKind("text").build())
    .build())

Implementation of

IPropBuilder.addChild

Defined in

asset_builder.ts:563


setEntry()

setEntry(entry): this

Adds an entry to array or map type props

Parameters

entry: PropDefinition

Returns

this

this

Example

ts
.setEntry(new PropBuilder()
    .setKind("string")
    .setName("iamanentryprop")
    .setWidget(new PropWidgetDefinitionBuilder().setKind("text").build())
    .build())

Implementation of

IPropBuilder.setEntry

Defined in

asset_builder.ts:590


addMapKeyFunc()

addMapKeyFunc(func): this

Add a button for putting entries into maps

Parameters

func: MapKeyFunc

Returns

this

this

Example

ts
.addMapKeyFunc(new MapKeyFuncBuilder()
   .setKey("Name")
   .build()

Implementation of

IPropBuilder.addMapKeyFunc

Defined in

asset_builder.ts:613


setValidationFormat()

setValidationFormat(format): this

Add joi validation schema to this prop

Parameters

format: Schema<any>

{Joi.Schema} - A joi schema object

Returns

this

this

Example

ts
.setValidationFormat(Joi.string().required())

Implementation of

IPropBuilder.setValidationFormat

Defined in

asset_builder.ts:630


build()

build(): PropDefinition

Build the object

Returns

PropDefinition

Example

ts
.build()

Implementation of

IPropBuilder.build

Defined in

asset_builder.ts:647


setDefaultValue()

setDefaultValue(value): this

Set a value to be automatically populated in the prop

Parameters

value: any

Returns

this

this

Example

ts
.setDefaultValue("cats")

Implementation of

IPropBuilder.setDefaultValue

Defined in

asset_builder.ts:662


setDocLink(link): this

Set a link to external documentation that will appear beneath the prop

Parameters

link: string

Returns

this

this

Example

ts
.setDocLink("https://www.systeminit.com/")

Implementation of

IPropBuilder.setDocLink

Defined in

asset_builder.ts:677


setDocumentation()

setDocumentation(docs): this

Sets inline documentation for the prop

Parameters

docs: string

Returns

this

this

Example

ts
.setDocumentation("This is documentation for the prop")

Implementation of

IPropBuilder.setDocumentation

Defined in

asset_builder.ts:692


setDocLinkRef()

setDocLinkRef(ref): this

Parameters

ref: string

Returns

this

Implementation of

IPropBuilder.setDocLinkRef

Defined in

asset_builder.ts:697


setHidden()

setHidden(hidden): this

Whether the prop should be displayed in th UI or not

Parameters

hidden: boolean

Returns

this

this

Example

ts
.setHidden(true)

Implementation of

IPropBuilder.setHidden

Defined in

asset_builder.ts:712


setKind()

setKind(kind): this

The type of the prop

Parameters

kind: PropDefinitionKind

{PropDefinitionKind} [array | boolean | integer | map | object | string]

Returns

this

this

Example

ts
.setKind("text")

Implementation of

IPropBuilder.setKind

Defined in

asset_builder.ts:727


setName()

setName(name): this

The prop name. This will appear in the model UI

Parameters

name: string

the name of the prop

Returns

this

this

Example

ts
.setName("Region")

Implementation of

IPropBuilder.setName

Defined in

asset_builder.ts:742


setValueFrom()

setValueFrom(valueFrom): this

DEPRECATED: this method no longer does anything. It will be ignored when executing the asset function. Please use the asset editing interface to perform equivalent functionality.

If the prop is new, you will need to regenerate the asset first!

In the past, this was used to set the value of this prop using a ValueFromBuilder.

Parameters

valueFrom: ValueFrom

Returns

this

this

Example

ts
.setValueFrom(new ValueFromBuilder()
   .setKind("inputSocket")
   .setSocketName("Region")
   .build())

Implementation of

IPropBuilder.setValueFrom

Defined in

asset_builder.ts:761


setWidget()

setWidget(widget): this

The type of widget for the prop, determing how it is displayed in the UI

Parameters

widget: PropWidgetDefinition

Returns

this

this

Example

ts
setWidget(new PropWidgetDefinitionBuilder()
.setKind("text")
.build())

Implementation of

IPropBuilder.setWidget

Defined in

asset_builder.ts:778