Interface

AddonKindDefinition

@ng-forge/dynamic-forms

Per-kind registration metadata.

Registered via withCustomAddon(...) features (or adapter feature helpers like withPrimeNGAddons()); resolved at render time by <df-addon-slot>.

Signature

interface AddonKindDefinition<
  T extends BaseAddon = BaseAddon
>

Type Parameters

NameConstraintDefaultDescription
TBaseAddonBaseAddon-

Properties

NameTypeDescription
kind stringDiscriminant matching addon.kind.
loadComponent LazyComponentLoaderLazy loader for the kind's renderer component.
validate ?AddonShapeValidator<T> | undefinedOptional shape validator — throw DynamicFormError to drop the addon with a warning.
schema ?AddonKindSchema | undefinedOptional JSON Schema fragment for MCP / pre-flight tooling.
jsonSafe ?boolean | undefined

Whether the kind survives JSON.stringify / JSON.parse. Kinds whose shape includes a function payload (e.g., the built-in 'component' loader, inline prime-button action handlers) declare jsonSafe: false so the validator drops them when the config was loaded from a JSON source (sanitizeFormConfig(config, { source: 'json' })). Defaults to true — kinds are JSON-safe unless explicitly opted out.