Skip to main content

@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.
tip

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

NameTypeOptionalDescription
propertiesINodeBlockDecorator | IConditionBlockDecorator | IHeadlessBlockDecoratorNoSpecifies 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
}
🖱️ Hover with the mouse over a property name for a tooltip with the description of that property. Click it for more information.

🏷️ 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
}
🖱️ Hover with the mouse over a property name for a tooltip with the description of that property. Click it for more information.

🏷️ 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
}
🖱️ Hover with the mouse over a property name for a tooltip with the description of that property. Click it for more information.

🏷️ 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"