Versions in this module Expand all Collapse all v1 v1.5.0 Aug 29, 2026 v1.4.0 Aug 29, 2026 Changes in this version + var ErrCatalogFrozen = errors.New("component catalog builder is frozen") + var ErrDefinitionAbsent = errors.New("component definition not found") + var ErrDuplicate = errors.New("component definition already registered") + var ErrInvalidKey = errors.New("component key requires kind, variant, and target") + var ErrInvalidMode = errors.New("component definition has invalid composition mode") + var ErrNilRenderer = errors.New("component definition renderer must not be nil") + type Builder struct + func NewBuilder() *Builder + func (builder *Builder) Freeze() (*Catalog, error) + func (builder *Builder) Register(definition Definition) error + type Catalog struct + func NewCatalog(definitions ...Definition) (*Catalog, error) + func (catalog *Catalog) Lookup(key Key) (Definition, error) + func (catalog *Catalog) Metadata() []Metadata + type Definition interface + Defaults func() document.Props + Key func() Key + Mode func() document.CompositionMode + Render func(context.Context, RenderContext, document.Component) (Output, error) + Schema func() json.RawMessage + Validate func(document.Component) document.Problems + Version func() string + func Builtins(target string) ([]Definition, error) + type FuncDefinition struct + func NewDefinition(key Key, mode document.CompositionMode, schema json.RawMessage, ...) (*FuncDefinition, error) + func NewVersionedDefinition(key Key, version string, mode document.CompositionMode, schema json.RawMessage, ...) (*FuncDefinition, error) + func (definition *FuncDefinition) Defaults() document.Props + func (definition *FuncDefinition) Key() Key + func (definition *FuncDefinition) Mode() document.CompositionMode + func (definition *FuncDefinition) Render(ctx context.Context, renderContext RenderContext, node document.Component) (Output, error) + func (definition *FuncDefinition) Schema() json.RawMessage + func (definition *FuncDefinition) Validate(node document.Component) document.Problems + func (definition *FuncDefinition) Version() string + type Key struct + Kind string + Target string + Variant string + func (key Key) String() string + func (key Key) Valid() bool + type Metadata struct + Defaults map[string]any + Key Key + Mode string + Schema []byte + Version string + type Output struct + Assets []document.AssetRef + Content []byte + Dependencies []string + type RenderContext struct + Theme string + Values map[string]any + type Renderer func(context.Context, RenderContext, document.Component) (Output, error) + type Validator func(document.Component) document.Problems Other modules containing this package github.com/BuddhiLW/AutoPDF/v2