Files
blocky/internal/block/component.go

28 lines
440 B
Go

package block
import (
"blocky/internal/block/validation"
"encoding/json"
)
type ComponentType int8
const (
_ ComponentType = iota
TextComponentType
NumberComponentType
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
}