We are Coltor Apps ― a software development agency behind this OSS. Need a reliable tech partner?

Let’s talk

React API Reference

InterpreterEntityInstance

This interface describes the properties of an interpreter entity instance, which is usually injected as a prop into interpreter entities components.

Reference

InterpreterEntityInstance<TEntity>

import { type InterpreterEntityInstance } from "@coltorapps/builder-react";

import { textFieldEntity } from "./text-field-entity";

type InterpreterTextFieldInstance = InterpreterEntityInstance<
  typeof textFieldEntity
>;

Properties

The InterpreterEntityInstance interfaces has the following properties:

PropTypeDescription
idstringThe unique identifier of the entity.
typestringThe type identifier of the entity. Corresponds to the key of the entity definition in the builder defintion.
childrenarray optionalOptional array of child entity IDs.
parentIdstring optionalOptional ID of the parent entity. If undefined, the entity is considered a root-level entity.
attributesobjectA record of all attributes values for the entity, keyed by attribute name.
metadataunknownYour custom metadata associated with the entity.
getValuefunctionReturns the current value of the entity, or undefined if no value is set.
setValuefunctionSets the entity’s value.
getErrorfunctionReturns the current validation error associated with the entity’s value, if any.
setErrorfunctionSets a validation error for the entity’s value.
resetValuefunctionResets the value of the entity to its initial state.
clearValuefunctionClears the value of the entity completely.
resetErrorfunctionClears the current validation error.
validatefunctionValidates the current value of the entity. Returns a promise that resolves with the validation result.
subscribeToValuefunctionSubscribes to changes in the entity’s value. Returns an unsubscribe function.
subscribeToErrorfunctionSubscribes to changes in the entity’s error state. Returns an unsubscribe function.
Previous
InterpreterEntityComponentProps

Canary Branch