Interface: CodePart
Extended by VisualPart, CodePart and InlineValuePart
Hierarchy
↳
CodePart
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
Defined in
customView
• Optional
customView: CustomPartViewFn
Defined in
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
Defined in
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
Defined in
description
• Optional
description: string
Is displayed in the visual editor and used to search for parts.
Inherited from
Defined in
fn
• Optional
fn: RunPartFunction
Deprecated
use ['run'] instead
Defined in
id
• id: string
Part's unique id. instances refer use this to refer to the correct part
Inherited from
Defined in
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
Defined in
namespace
• Optional
namespace: string
TBD
Inherited from
Defined in
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
Defined in
reactiveInputs
• Optional
reactiveInputs: string
[]
Deprecated
- TBD
Inherited from
Defined in
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
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.