ISlot interface
đ Descriptionâ
Interface that describes a slot within the form definition. Slots serve as the data transporters for the form. Each node block defines the slots required for the data collection of that block.
đ Type declarationâ
Besides the listed properties, slots may store additional properties in the slot object.
interface ISlot<T> { id: string;Readonly type: string;Readonly kind: "static" | "dynamic" | "feature" | "meta";Readonly reference: string;Readonly sequence?: number;ReadonlyOptional label?: string;ReadonlyOptional name?: string;ReadonlyOptional placeholder?: string;ReadonlyOptional alias?: string;ReadonlyOptional required?: boolean;ReadonlyOptional pipeable?: boolean | { pipe?: string; label?: string; alias?: string; content?: "value" "label" | "name" | { string: string; text?: string; markdown?: string; }; };ReadonlyOptional default?: T;ReadonlyOptional exportable?: boolean;ReadonlyOptional actionable?: boolean;ReadonlyOptional protected?: boolean;ReadonlyOptional }
đī¸ Propertiesâ
đˇī¸ actionable
â
Specifies if the slot is actionable. Actionable slots are special slots used to perform certain actions.
Typeâ
boolean
More information about post-processing actions and the difference between exportable and actionable data.
đˇī¸ alias
â
Specifies the alias for the slot. Aliases are used in the dataset to identify a certain value.
Typeâ
string
đˇī¸ default
â
Specifies the default value for the slot.
Typeâ
T
(depends on the slot type)
đˇī¸ exportable
â
Specifies if the slot is exportable. Exportable slots are part of the dataset that contains all the collected values of a form.
Typeâ
boolean
More information about exportable data.
đˇī¸ id
â
Specifies the unique identifier of the slot.
Typeâ
string
đˇī¸ kind
â
Specifies the kind of slot. It can be one of the following values:
static
: Static slots defined by the node block (for example, a slot to hold the value of a text input block);dynamic
: Slots defined for dynamic items of a node block (for example, slots for multiple-choice options);feature
: Slots defined for certain features of a node block (for example, a slot to hold a score when the score feature of a node block is activated);meta
: Slots that hold meta-data for a node block (for example, a slot that holds the time taken for answering a node block).
Typeâ
"static" | "dynamic" | "feature" | "meta"
đˇī¸ label
â
Specifies a human readable label for the slot.
Typeâ
string
đˇī¸ name
â
Specifies the slot name.
Typeâ
string
đˇī¸ pipeable
â
Specifies if the slot is pipeable. Pipeable slots can be used/referenced by other node blocks. It is used to pass information of a block to other blocks, for example, when asking the form respondent for its name and then use that name elsewhere in the form.
To simply enable or disable piping for the slot (based on the slot value), supply a boolean value. If you need more control over the pipe, you can supply an object with a more specific configuration.
Typeâ
boolean | {
/* Optional name for the pipe. This is used to group slot values that have the same pipe name. */
pipe?: string;
/* Optional localized label for the pipe. */
label?: string;
/* Optional alias for the pipe. */
alias?: string;
/*
* Specifies the field or content that should be used as the data that goes
* into the pipe. It can be one of the following values:
* - `value`: Use the current string value of the slot (this is the default behavior);
* - `label`: Use the slot label;
* - `name`: Use the name of the slot;
* - Custom configuration to supply the data that goes into the pipe.
*/
content?: "value" | "label" | "name" | {
/* Contains the content as a string without any markup or variables. */
string: string;
/* Contains the content as text with support for variables. */
text?: string;
/* Contains markdown content with support for basic formatting, hyperlinks, and variables. */
markdown?: string;
};
/*
* Specifies the name of a legacy pipe. Only here for backward compatibility. Do not use.
* @deprecated
*/
legacy?: string; đī¸
}
đˇī¸ placeholder
â
Specifies the slot placeholder.
Typeâ
string
đˇī¸ protected
â
Specifies whether the slot is write-protected and can only be changed by the block that created the slot. Other blocks in the form (like the Setter block) cannot change the data of the slot.
Typeâ
boolean
đˇī¸ reference
â
Contains the slot reference, which is a unique identifier for the slot within the node block. It is used by node blocks to retrieve slots based on the unique reference.
Typeâ
string
đˇī¸ required
â
Specifies if the slot is required and needs a value before a form can complete.
Typeâ
boolean
The Runner library will automatically validate if all required slots have a valid value.
đˇī¸ sequence
â
Specifies the sequence of a slot (used to order the slots).
Typeâ
number
đˇī¸ type
â
Specifies the slot type identifier.
Typeâ
string