Skip to main content

API Reference

Quick reference of all public exports from each eSheet package.

@esheet/core

Types

ExportKindDescription
FormDefinitionInterfaceTop-level form structure
FieldDefinitionInterfaceSingle field structure
FieldResponseInterfaceResponse values for a field
FormResponseType aliasRecord<string, FieldResponse>
SelectedOptionInterface{ id, value } for selected options
FieldTypeTypeUnion of 19 field type strings
TextInputTypeTypeUnion of 9 text input variants
FieldOptionInterfaceOption in a choice field
MatrixRow / MatrixColumnInterfaceMatrix dimensions
ConditionalRuleInterfaceConditional rule structure
ConditionInterfaceSingle condition
ConditionOperatorTypeUnion of 10 operators
ConditionalEffectType'visible' | 'enable' | 'required'
LogicModeType'AND' | 'OR'
FieldCategoryTypeField grouping category
AnswerTypeTypeHow a field stores its answer
FieldTypeMetaInterfaceField type metadata
FieldTypeRegistryTypeRegistry map
FieldComponentPropsInterfaceProps contract for field components
HydratedResponseItemInterface{ id, text, answer } — one per answerable field, returned by hydrateResponse
FieldNodeInterfaceNode in normalized definition tree
NormalizedDefinitionInterfaceFlat normalized representation of a form
AddFieldOptionsInterfaceOptions for FormStore.addField()

Constants

ExportDescription
SCHEMA_TYPE'mieforms-v1.0'
FIELD_TYPESArray of 19 field type strings
TEXT_INPUT_TYPESArray of 9 text input type strings
CONDITION_OPERATORSArray of 10 operator strings
CONDITIONAL_EFFECTSArray of 3 effect strings

Zod Schemas

ExportValidates
formDefinitionSchemaFormDefinition
fieldDefinitionSchemaFieldDefinition
fieldTypeSchemaFieldType
conditionSchemaCondition
conditionalRuleSchemaConditionalRule
formDefinitionJSONSchemaJSON Schema (Draft-07) for Monaco

Store Factories

ExportReturnsDescription
createFormStore(def?)FormStoreCreate a new form state store
createUIStore()UIStoreCreate a new UI state store

Logic & Validation

ExportDescription
evaluateRule(rule, normalized, responses)Evaluate a conditional rule
evaluateCondition(condition, definition, response)Evaluate a single condition
evaluateExpression(expression, normalized, responses)Evaluate an expression string
isExpressionValid(expr)Validate expression syntax
resolveEffect(effect, field, normalized, responses)Resolve a conditional effect
validateField(fieldId, normalized, responses)Validate a single field
validateForm(normalized, responses)Validate all fields

Utilities

ExportDescription
normalizeDefinition(def)Convert tree → flat normalized state
hydrateDefinition(normalized)Convert flat → nested tree
hydrateResponse(normalized, responses)Walk normalized definition and return HydratedResponseItem[] for export/submission
generateFieldId(fieldType)Generate a unique field ID
generateOptionId()Generate a unique option ID
generateRowId()Generate a unique matrix row ID
generateColumnId()Generate a unique matrix column ID

Registry

ExportDescription
registerFieldType(key, meta)Register a field type
registerFieldElements(elements)Batch-register UI element classes for field types
getFieldTypeMeta(key)Get field type metadata
getRegisteredFieldTypes()List all registered types
resetFieldTypeRegistry()Reset to built-in types

@esheet/fields

Components

All 19 field components: TextField, LongTextField, MultiTextField, RadioField, CheckField, BooleanField, DropdownField, MultiSelectDropdownField, RatingField, RankingField, SliderField, SingleMatrixField, MultiMatrixField, SectionField, DisplayField, HtmlField, ImageField, SignatureField, DiagramField

Custom Controls

ExportDescription
CustomRadioStyled radio with onSelect/onUnselect
CustomCheckboxStyled checkbox
CustomDropdownStyled dropdown
DrawingPadCanvas drawing component

Drawing Types

ExportDescription
DrawingDataDrawing canvas data structure
DrawingPadConfigConfiguration options for DrawingPad
DrawingPadPayloadPayload emitted by DrawingPad on change
NormalizedPoint{ x, y } coordinate normalized to canvas size
StrokeSingle stroke in a drawing (array of NormalizedPoint)

Icons

ExportDescription
TrashIconTrash / delete icon
PlusIconPlus / add icon
ArrowUpIconArrow up icon
ArrowDownIconArrow down icon
UpDownArrowIconUp-down (reorder) arrow icon

Registry

ExportDescription
registerCustomFieldTypes(types)Register custom field types with components
registerFieldComponents(map)Register a map of field type -> React component
getFieldComponent(fieldType)Get the React component for a field type
getRegisteredComponentKeys()List all registered field component keys
resetComponentRegistry()Reset the component registry to built-in defaults

Context

ExportDescription
FormStoreContextReact context for FormStore
UIContextReact context for UIStore
useFormStore()Hook to access FormStore
useUI()Hook to access UIStore

@esheet/builder

Components

ExportDescription
EsheetBuilderMain builder component
BuilderHeaderMode switcher header (advanced)
CodeViewJSON/YAML editor (advanced)
FieldWrapperSelection chrome wrapper (advanced)

Hooks & Context

ExportDescription
useFormStore()Access FormStore from context
useUI()Access UIStore from context
useInstanceId()Get unique instance ID
FormStoreContextFormStore React context
UIContextUIStore React context
InstanceIdContextInstance ID React context

Types

ExportDescription
EsheetBuilderPropsBuilder component props
CodeViewPropsProps for CodeView
FieldWrapperPropsProps for FieldWrapper
FieldWrapperRenderPropsRender props passed to FieldWrapper children

@esheet/renderer

Components

ExportDescription
EsheetRendererMain renderer component (forwardRef)
RendererBodyInner renderer body (advanced)
FieldNodeRenders a single field node inside the renderer (advanced)

Hooks

ExportDescription
useRendererInit()Initialize renderer with form data (advanced)

Types

ExportDescription
EsheetRendererPropsRenderer component props
EsheetRendererHandleRef handle type (getResponse, getFormStore, getUIStore)

@esheet/renderer-standalone

Functions

ExportDescription
mountStandaloneRenderer(container, props)Mount EsheetRenderer into a DOM node and return a control handle

Types

ExportDescription
EsheetRendererStandaloneHandleHandle with unmount(), getResponse(), and getValidResponse()

@esheet/renderer-blaze

Functions

ExportDescription
registerBlazeTemplate(templateName?)Register a Blaze template wrapper for the renderer. Returns false when required Blaze globals are not available, otherwise true.

registerBlazeTemplate uses esheetRenderer as the default template name when no argument is provided.