Skip to main content

Interface: CodePart

Extended by VisualPart, CodePart and InlineValuePart

Hierarchy

Properties

completionOutputs

Optional completionOutputs: string[]

Instructs Flyde that the part is in "explicit completion" mode and describes which outputs trigger the part's completion. Receives a list of outputs that should trigger an explicit completion of the part when they emit a value. Any of the listed outputs will trigger a completion (i.e. completionOutput[0] OR completionOutput[1]) Leave empty for implicit completion. This should work best for 99% of the case.

To declare that 2 different outputs must emit a value in order to trigger a completion, different outputs can be joined together with a + sign as following:

{
...
completionOutputs: ["data+headers", "error"] // this means either data AND headers, OR "error" will trigger an explicit completion.

See the Parts lifecycle for more info

Inherited from

BasePart.completionOutputs

Defined in

core/src/part/part.ts:131


customView

Optional customView: CustomPartViewFn

Defined in

core/src/part/part.ts:170


customViewCode

Optional customViewCode: string

Supply a custom string template (EJS format) to control how an instance of this part will be rendered in the visual editor. The template has access to static values, making it possible to expose valuable information in the instance itself:

Example

A "Delay" part has 2 inputs: value and a time. In many cases, the time input will be provided statically. It can be convenient to show the time input in the instance itself so it shows "Delay 500ms" instead of "Delay" (in the case 500 is the static value of time)

{
...,
customViewCode: "<% if (inputs.time) { %> Delay <%- inputs.time %> ms <% } else { %> Delay <% } %>",
}

Inherited from

BasePart.customViewCode

Defined in

core/src/part/part.ts:151


defaultStyle

Optional defaultStyle: PartStyle

All instances of this part will inherit the default style if it is supplied. See PartStyle for the full options supported

Inherited from

BasePart.defaultStyle

Defined in

core/src/part/part.ts:156


description

Optional description: string

Is displayed in the visual editor and used to search for parts.

Inherited from

BasePart.description

Defined in

core/src/part/part.ts:84


fn

Optional fn: RunPartFunction

Deprecated

use ['run'] instead

Defined in

core/src/part/part.ts:169


id

id: string

Part's unique id. instances refer use this to refer to the correct part

Inherited from

BasePart.id

Defined in

core/src/part/part.ts:80


inputs

inputs: Record<string, InputPin>

A pin on a part that receives data. Each part can have zero or more input pins.

Example for the inputs of a mathematical multiplier part:

{
multiplicand: { description: "The number to be multiplied" },
multiplier: { description: "The number with which we multiply" },
}

Inherited from

BasePart.inputs

Defined in

core/src/part/part.ts:100


namespace

Optional namespace: string

TBD

Inherited from

BasePart.namespace

Defined in

core/src/part/part.ts:117


outputs

outputs: Record<string, OutputPin>

A pin on a part that sends data. Each part can have zero or more output pins. For example, a "Split array" part might have one input pin for an array and two output pins for the first and second halves of the array:

Example

{
'first half': { description: "The first half of the array" },
'second half': { description: "The second half of the array" },
}

Inherited from

BasePart.outputs

Defined in

core/src/part/part.ts:113


reactiveInputs

Optional reactiveInputs: string[]

Deprecated

  • TBD

Inherited from

BasePart.reactiveInputs

Defined in

core/src/part/part.ts:135


run

run: RunPartFunction

This function will run as soon as the part's inputs are satisfied. It has access to the parts inputs values, and output pins. See RunPartFunction for more information.

Defined in

core/src/part/part.ts:165


searchKeywords

Optional searchKeywords: string[]

A list of keywords that can be used to search for the part. Useful for parts that users might search using different words.

Inherited from

BasePart.searchKeywords

Defined in

core/src/part/part.ts:88