@tripetto
The @tripetto
decorator is used to register the runner part of node and condition blocks. There are three types of blocks that can be registered:
NodeBlock
: Visual blocks that interact with the user and collect response data;ConditionBlock
: Blocks that are used in branches to define conditions;HeadlessBlock
: Invisible blocks that can perform actions.
See the blocks documentation to learn how to develop custom blocks.
Decorator type
Class ℹ️
Applies to
Decorator signature
@tripetto(properties: INodeBlockDecorator | IConditionBlockDecorator | IHeadlessBlockDecorator)
Decorator parameters
Name | Type | Optional | Description |
---|---|---|---|
properties | INodeBlockDecorator | IConditionBlockDecorator | IHeadlessBlockDecorator | No | Specifies the block properties that implicitly determine the type of block. |
Example
import { tripetto, NodeBlock } from "@tripetto/runner";
@tripetto({
type: "node",
identifier: "example-block",
})
class ExampleBlock extends NodeBlock {
// Block implementation here
}
⛓️ Interfaces
🔗 INodeBlockDecorator
Describes the interface for registering a NodeBlock
.
Type declaration
interface INodeBlockDecorator { type: "node"; identifier: string; alias?: string | string[];Optional namespace?: string | string[];Optional autoRender?: boolean;Optional autoValidate?: boolean;Optional ref?: {};Optional }
🏷️ alias
Specifies optional type aliases (alternative type identifiers for the block).
Type
string | string[]
🏷️ autoRender
Specifies if the block needs to be rerendered upon value store (disabled by default).
Type
boolean
🏷️ autoValidate
Specifies if the block checks if all required slots contain a value (enabled by default).
Type
boolean
🏷️ identifier
Specifies the unique type identifier for the block.
Type
string
🏷️ namespace
Specifies the namespace(s) for the block.
Type
string | string[]
🏷️ ref
Optional reference to pass static data to the block.
Type
{}
🏷️ type
Specifies to register a node block.
Type
"node"
🔗 IConditionBlockDecorator
Describes the interface for registering a ConditionBlock
.
Type declaration
interface IConditionBlockDecorator { type: "condition"; identifier: string; alias?: string | string[];Optional namespace?: string | string[];Optional }
🏷️ alias
Specifies optional type aliases (alternative type identifiers for the block).
Type
string | string[]
🏷️ identifier
Specifies the unique type identifier for the block.
Type
string
🏷️ namespace
Specifies the namespace(s) for the block.
Type
string | string[]
🏷️ type
Specifies to register a condition block.
Type
"condition"
🔗 IHeadlessBlockDecorator
Describes the interface for registering a HeadlessBlock
.
Type declaration
interface IHeadlessBlockDecorator { type: "headless"; identifier: string; alias?: string | string[];Optional namespace?: string | string[];Optional }
🏷️ alias
Specifies optional type aliases (alternative type identifiers for the block).
Type
string | string[]
🏷️ identifier
Specifies the unique type identifier for the block.
Type
string
🏷️ namespace
Specifies the namespace(s) for the block.
Type
string | string[]
🏷️ type
Specifies to register a headless block.
Type
"headless"