Files
blocky/internal/block/component.go
2026-02-12 20:34:32 +00:00

29 lines
460 B
Go

package block
import (
"blocky/internal/block/validation"
"encoding/json"
)
type ComponentType int8
const (
_ ComponentType = iota
TextComponentType
Int64ComponentType
Date
)
type Component interface {
Type() ComponentType
Identifier() string
Name() string
NewInstance() ComponentInstance
Validators() []validation.Validator
}
type ComponentInstance interface {
FromJSON(component Component, data json.RawMessage) error
Value() interface{}
}