API Reference

Browse the public API surface of ng-forge packages

Package
Type

Core @ng-forge/dynamic-forms

Classes 17

ClassAppendArrayItemEvent

Event dispatched to append a new item at the END of an array field. This is the most common array operation - adding it...

ClassConsoleLogger

Console-based logger implementation.

ClassDynamicFormError

Base error class for all Dynamic Forms errors. This class centralizes the `[Dynamic Forms]` prefix, ensuring consistent...

ClassFormClearEvent

Event dispatched when the form should be cleared. This event instructs the dynamic form component to clear all field va...

ClassFormResetEvent

Event dispatched when the form should be reset to its default values. This event instructs the dynamic form component t...

ClassInsertArrayItemEvent

Event dispatched to insert a new item at a SPECIFIC INDEX in an array field. Use this when you need precise control ove...

ClassMoveArrayItemEvent

Event dispatched to move an existing item from one index to another within an array field. This is an atomic reorder op...

ClassNextPageEvent
ClassNoopLogger

No-operation logger implementation. All methods are no-ops - used in production by default.

ClassPageChangeEvent
ClassPopArrayItemEvent

Event dispatched to remove the LAST item from an array field. Equivalent to JavaScript's `Array.pop()` - removes from t...

ClassPrependArrayItemEvent

Event dispatched to prepend a new item at the BEGINNING of an array field. Use this when new items should appear at the...

ClassPreviousPageEvent
ClassRemoveAtIndexEvent

Event dispatched to remove an item at a SPECIFIC INDEX from an array field. Use this when you need precise control over...

ClassRootFormRegistryService

Registry service that provides access to the root form and its values. Constructed via factory in `provideDynamicFormDI...

ClassShiftArrayItemEvent

Event dispatched to remove the FIRST item from an array field. Equivalent to JavaScript's `Array.shift()` - removes fro...

ClassSubmitEvent

Interfaces 59

InterfaceArrayButtonConfig

Configuration for auto-generated add/remove buttons in simplified array fields.

InterfaceArrayContext

Array context for fields rendered within arrays. Provides position and parent array information for components inside ar...

InterfaceArrayField

Array field interface for creating dynamic field collections that map to array values. Key concepts: - The outer `field...

InterfaceArrayItemContext

Context object for array item operations (add/remove) Provides the necessary information to resolve tokens in array item...

InterfaceAsyncCondition

Condition that evaluates based on a registered async function. The function is resolved reactively — when dependent for...

InterfaceAsyncCustomValidator

Async custom validator configuration using Angular's resource-based API Angular's validateAsync uses the resource API f...

InterfaceAsyncValidatorConfig

Async custom validator configuration using Angular's validateAsync API. Returns Observable<ValidationError | ValidationE...

InterfaceBaseCheckedField
InterfaceBaseValidatorConfig

Base configuration shared by all validators

InterfaceBaseValueField
InterfaceBuiltInValidatorConfig

Built-in validator configuration (required, email, min, max, etc.)

InterfaceButtonLogicContext

Context for resolving button disabled state. @public

InterfaceContainerField

Container field interface for wrapping child fields with UI chrome. A container field is a container that renders its c...

InterfaceCssWrapper

Configuration for the built-in 'css' wrapper type. The CSS wrapper applies CSS classes around wrapped content via a Dyn...

InterfaceCustomFnConfig

Signal forms adapter configuration for advanced form behavior. Provides configuration options for signal forms integrat...

InterfaceCustomValidatorConfig

Custom validator configuration using Angular's public FieldContext API Returns ValidationError | ValidationError[] | nul...

InterfaceDeclarativeHttpValidatorConfig

Declarative HTTP validator configuration — fully JSON-serializable, no function registration required. Uses `HttpReques...

InterfaceDynamicFormFieldRegistry

Global interface for dynamic form field definitions with categorization This interface combines containers and leaves fr...

InterfaceEvaluationContext
InterfaceFieldDef

Base interface for all dynamic form field definitions. This interface defines the common properties that all field type...

InterfaceFieldMeta

Base interface for native HTML attributes that can be passed to form field elements. This interface serves as the base ...

InterfaceFieldOption
InterfaceFieldRegistryContainers

Container fields registry - augment this interface to add custom container fields

InterfaceFieldRegistryLeaves

Leaf fields registry - augment this interface to add custom leaf fields

InterfaceFieldRegistryWrappers

Wrapper type registry for module augmentation. Augment this interface to add type-safe wrapper type definitions.

InterfaceFieldSignalContext

Field signal context - the "nervous system" of the dynamic form. Provided via FIELD_SIGNAL_CONTEXT injection token. Giv...

InterfaceFieldStateInfo

Represents the state information of a single form field. Used in evaluation contexts to allow expressions and condition...

InterfaceFieldTypeDefinition

Configuration interface for registering custom field types. Defines how a field type should be handled by the dynamic f...

InterfaceFieldWithValidation
InterfaceFieldWrapperContract

Contract that wrapper components must satisfy. Each wrapper exposes a `#fieldComponent` ViewContainerRef where the inne...

InterfaceFormConfig

Configuration interface for defining dynamic form structure and behavior. This interface defines the complete form sche...

InterfaceFormEvent

Base interface for all form events in the dynamic form system. All form events must implement this interface to be comp...

InterfaceFormModeDetectionResult

Result of form mode detection with validation details

InterfaceFormOptions

Global form configuration options. Controls form-wide behavior including disabled state and button behavior configurati...

InterfaceGroupField

Group field interface for creating logical field groupings that map to object values Groups create nested form structure...

InterfaceHttpCondition

Condition that evaluates based on an HTTP response from a remote server. The HTTP request is resolved reactively — when...

InterfaceHttpCustomValidator

HTTP-based validator configuration for Angular's validateHttp API Angular's validateHttp provides optimized HTTP valida...

InterfaceHttpRequestConfig

Configuration for an HTTP request used by declarative HTTP validators, derivations, and conditions. All string values i...

InterfaceHttpResourceRequest

HTTP request configuration for validateHttp API

InterfaceHttpValidationResponseMapping

Mapping configuration for interpreting HTTP responses as validation results. Expressions in `validWhen` and `errorParam...

InterfaceLogger

Interface for dynamic forms logger implementations. Allows custom logging integrations (Sentry, DataDog, etc.)

InterfaceNextButtonOptions

Options for controlling next page button disabled behavior. @public

InterfaceNonFieldLogicContext

Context for resolving state (hidden/disabled) for non-form-bound elements. This is a generalized context that can be us...

InterfacePageField

Page field interface for creating top-level page layouts This is a special field type that contains other field definiti...

InterfaceReadonlyFieldTree

Read-only view of a single field's observable state. Whitelisted read signals copied from Angular Signal Forms' `FieldS...

InterfaceRowField

Row field interface for creating horizontal layouts. A row is a synthetic field type that resolves to a Container at run...

InterfaceSchemaApplicationConfig

Configuration for applying predefined schemas

InterfaceSchemaDefinition

Reusable schema definition that can be referenced by name

InterfaceSimplifiedArrayField

Simplified array field interface for common use cases. Instead of manually specifying each item in `fields`, provide a ...

InterfaceSubmissionConfig

Configuration for form submission handling. When provided, enables integration with Angular Signal Forms' native `submi...

InterfaceSubmitButtonOptions

Options for controlling submit button disabled behavior. @public

InterfaceTextField

Text field definition for displaying translatable text content

InterfaceTokenContext

Context for token resolution in event args

InterfaceValidationMessages
InterfaceValueExclusionConfig

Configuration for excluding field values from form submission output based on their reactive state (hidden, disabled, re...

InterfaceWrapperFieldInputs

Input shape passed to a wrapper component via the `fieldInputs` input. Carries the wrapped field's mapper outputs plus ...

InterfaceWrapperRegistration

User-facing wrapper registration shape used with `createWrappers(...)`. Extends `WrapperTypeDefinition` with an optiona...

InterfaceWrappersBundle

Branded bundle returned by `createWrappers(...)`. Carries: - `ɵkind: 'wrappers'` — discriminant recognised by `provideD...

InterfaceWrapperTypeDefinition

Configuration interface for registering wrapper types. Defines how a wrapper component is loaded and identified. Wrappe...

Types 50

TypeArrayAllowedChildren

Fields that are allowed as children of Array fields Arrays can contain: rows, groups, and leaf fields (but NOT pages or ...

TypeArrayFieldTree

Type representing a FieldTree for an array. Extends FieldTree to add numeric indexing for accessing item FieldTrees.

TypeArrayItemDefinitionTemplate

Template type for array items used in events. Canonical definition lives in {@link ArrayItemDefinition} — this alias pre...

TypeArrayItemTemplate

An array item template is an array of allowed children that defines one OBJECT array item's fields. Used for object arra...

TypeAsyncConditionFunction

Async function for conditions — returns boolean. The function receives the evaluation context and may return a Promise ...

TypeAsyncDerivationFunction

Async function for derivations — returns any value. The function receives the evaluation context and may return a Promi...

TypeAvailableFieldTypes

Extract field types that are available in the registry

TypeCheckedFieldComponent
TypeConditionalExpression

Discriminated union of all conditional expression types. Each variant only allows the properties relevant to its type, ...

TypeContainerAllowedChildren

Fields that are allowed as children of Container fields. Containers are pure layout primitives that flatten their childr...

TypeContainerFieldTypes

Union type of all registered container field definitions

TypeCustomValidator

Custom validator function signature using Angular's public FieldContext API Takes FieldContext (full Angular context) a...

TypeDynamicText
TypeExtractField

Extract a specific field type from RegisteredFieldTypes based on the `type` discriminant. This enables proper type narro...

TypeExtractFieldDefs

Extract FieldDef types from provider result

TypeExtractFormValue

Extract form value type from provider result

TypeFieldComponent

Type utility for extracting component input properties from field definitions. Transforms field definition properties i...

TypeFieldPathAccess

Type helper for accessing nested field paths safely This allows accessing child paths while maintaining some type safety

TypeFieldScope

Semantic grouping of interchangeable field UI alternatives. Used by tooling (e.g., openapi-generator) to discover which...

TypeFieldStateContext

Field state context for the current field being evaluated. Used as `fieldState` in evaluation contexts. @public

TypeFormEventConstructor

Constructor type for form event classes. Defines the shape of event class constructors that can be used with the event ...

TypeFormFieldStateMap

Map of field keys to their state information. Used as `formFieldState` in evaluation contexts to access state of any fi...

TypeFormMode

Form mode enumeration distinguishing between paged and non-paged forms

TypeFormStateCondition

Special form-state conditions for button disabled logic. These conditions evaluate form or page-level state rather than...

TypeGroupAllowedChildren

Fields that are allowed as children of Group fields Groups can contain: rows and leaf fields (but NOT pages or other gro...

TypeInferFormValue

Infer form value type from fields array or FormConfig. Recursively processes nested structures and merges the results. L...

TypeInferWrapperRegistry

Derive the `FieldRegistryWrappers` augmentation shape from a wrapper bundle. Maps each registration's `wrapperName` to ...

TypeLeafFieldTypes

Union type of all registered leaf field definitions

TypeLogicConfig

Union type for all logic configurations. - `StateLogicConfig`: For field state changes (hidden, readonly, disabled, req...

TypeMapperFn

Mapper function that converts a field definition to component inputs. Mappers run within an injection context and can i...

TypeNarrowField

Narrow a field definition based on its `type` property. Use this to get proper type inference when working with field un...

TypeNarrowFields

Narrow each field in an array based on its `type` property. Use with `satisfies` to get proper type inference for field ...

TypeNonFieldLogicConfig

Logic config restricted to types valid for non-form-bound elements. This is a subset of LogicConfig that only includes h...

TypeNonFieldLogicType

Allowed logic types for non-form-bound elements (buttons, text fields, etc.). These elements only support hidden and dis...

TypePageAllowedChildren

Type constraints for field nesting rules These ensure that container fields can only contain valid child field types No...

TypePrettify
TypeRegisteredFieldTypes

Union type of all registered field definitions

TypeResolvedValueExclusionConfig

Fully resolved exclusion config with all properties required. Produced by the 3-tier resolution: `field ?? form ?? globa...

TypeRowAllowedChildren

Row is a synthetic field type that resolves to a Container at runtime, so it accepts the same children as a Container.

TypeStateLogicConfig

Configuration for conditional field state logic. Defines how field behavior changes based on conditions. Supports hidin...

TypeSubmissionActionResult

The result type for submission actions. Can be either a Promise or an Observable. For success: return `undefined`, `nul...

TypeTextElementType

Text element type for rendering different HTML text elements

TypeTextProps

Properties for text field configuration

TypeValidationError

Re-export Angular's ValidationError for consistency This replaces our custom ValidationError interface

TypeValidatorConfig

Configuration for signal forms validator functions that can be serialized from API. Discriminated union type for type-sa...

TypeValueFieldComponent
TypeValueHandlingMode

Defines how a field type handles form values and data collection. - 'include': Field contributes to form values (defaul...

TypeValueType

Supported primitive value types for form fields. This type represents all possible value types that can be used in form ...

TypeWithInputSignals
TypeWrapperConfig

Resolves a wrapper type name to its registered config interface. When `TWrappers` is a specific registered key (e.g., `...

Functions 51

FunctionapplyMetaToElement

Applies meta attributes to a DOM element and tracks which attributes were applied. This utility handles: - Removing pre...

FunctionapplyValidator
FunctionapplyValidators
FunctionarrayEvent

Builder for array manipulation events. Provides a fluent, discoverable API for array operations. Type `arrayEvent('key'...

FunctionarrayFieldMapper

Maps an array field definition to component inputs. Array components create nested form structures under the array's ke...

FunctionbaseFieldMapper

Base field mapper that extracts common field properties into component inputs. Returns a Signal containing the Record o...

FunctionbuildBaseInputs

Builds base input properties from a field definition. This is a helper function that extracts common field properties. ...

FunctioncontainerFieldMapper

Maps a container field definition to component inputs. Container components are layout containers that don't change the...

FunctioncreateField

Creates a typed field configuration with helpful error messages for common mistakes. This helper function provides earl...

FunctioncreateWrappers

Bundle wrapper registrations into a single object that can be passed to `provideDynamicForm(...)`.

FunctiondynamicTextToObservable

Converts DynamicText (string | Observable | Signal) to Observable<string> Unifies all three types into a consistent Obse...

FunctionevaluateNonFieldDisabled

Evaluates the disabled state for non-form-bound elements synchronously. This is a pure function (no signal allocation) ...

FunctionevaluateNonFieldHidden

Evaluates the hidden state for non-form-bound elements synchronously. This is a pure function (no signal allocation) th...

Functionfield

Shorthand alias for createField

FunctionformConfig

Type-safe form config builder that ensures schema matches field structure. This helper function provides type safety wh...

FunctiongetArrayLength

Get the length of an array FieldTree.

FunctiongroupFieldMapper

Maps a group field definition to component inputs. Group components create nested form structures under the group's key...

FunctionhasFormValue

Type guard to check if a form event has a form value attached. Use this to safely access the `formValue` property on ev...

FunctioninterpolateParams

Interpolates {{param}} placeholders in message with error values

FunctionisArrayField

Type guard for ArrayField with proper type narrowing. Validates that the field is an array type with a fields property t...

FunctionisCheckedField
FunctionisContainerField

Type guard to check if a field is a container field (page, row, group, or array) Container fields have a 'fields' proper...

FunctionisContainerTypedField

Type guard for ContainerField with proper type narrowing. `wrappers` is part of the type but optional in practice — man...

FunctionisDisplayOnlyField

Type guard to check if a field is excluded from form values (display-only field) Currently this includes text fields and...

FunctionisEqual

Performs a deep equality comparison between two values. Handles: - Primitives (including NaN via Object.is) - Dates (by...

FunctionisFormStateCondition

Type guard to check if a condition is a FormStateCondition.

FunctionisGroupField

Type guard for GroupField with proper type narrowing

FunctionisLeafField

Type guard to check if a field is a leaf field (value or display field) Leaf fields don't have children and either contr...

FunctionisPageField

Type guard for PageField with proper type narrowing

FunctionisRowField

Type guard for RowField with proper type narrowing

FunctionisSimplifiedArrayField

Type guard for SimplifiedArrayField. Checks for `type: 'array'` with a `template` property (discriminant from full Array...

FunctionisValueBearingField

Type guard to check if a field has a value property (value-bearing field) These fields contribute to the form value outp...

FunctionisValueField
FunctionisWrappersBundle

Type guard for a `WrappersBundle`.

FunctionisWrapperTypeDefinition

Type guard for WrapperTypeDefinition. Discriminates via `wrapperName` — field types use `name`, wrapper types use `wrap...

Functionomit

Creates a new object without the specified keys Native replacement for lodash omit()

FunctionpageFieldMapper

Maps a page field definition to component inputs. Page fields are layout containers that don't modify the form context....

FunctionprovideDynamicForm

Provider function to configure the dynamic form system with field types and options. This function creates environment ...

FunctionresolveNextButtonDisabled

Resolves the disabled state for a next page button. The disabled state is determined by (in order of precedence): 1. Ex...

FunctionresolveNonFieldDisabled

Resolves the disabled state for non-form-bound elements as a reactive signal. Wraps {@link evaluateNonFieldDisabled} in...

FunctionresolveNonFieldHidden

Resolves the hidden state for non-form-bound elements as a reactive signal. Wraps {@link evaluateNonFieldHidden} in a `...

FunctionresolveSubmitButtonDisabled

Resolves the disabled state for a submit button. The disabled state is determined by (in order of precedence): 1. Expli...

FunctionresolveTokens

Resolves special tokens in event arguments to their actual values Supported tokens: - $key: The current field key - $in...

FunctionrowFieldMapper

Maps a row field definition to container component inputs. `row` is a virtual field type: it resolves to `ContainerFiel...

FunctiontextFieldMapper

Maps a text field definition to component inputs. Text fields are display-only fields that don't participate in the for...

FunctiontoReadonlyFieldTree

Build a `ReadonlyFieldTree` by extracting the whitelisted read signals from a Signal Forms `FieldTree`. Returns a fresh ...

FunctionwithEventFormValue

Enables automatic form value attachment to all events dispatched through the EventBus. When this feature is enabled, ev...

FunctionwithLoggerConfig

Configure logging for dynamic forms. By default, general logging is enabled (ConsoleLogger) and derivation logging is d...

FunctionwithPreviousValue

Wraps a `Resource` so that the previous resolved value is preserved while the resource is loading or reloading. This pre...

FunctionwithValueExclusionDefaults

Configures global value exclusion defaults for form submission output. Value exclusion is **enabled by default** — fiel...

FunctionwrapperProps

Zero-cost type carrier used in wrapper registrations. Returns `undefined` at runtime but is typed as `T`, so TypeScript...

Constants 11

ConstARRAY_CONTEXT

Injection token for providing array context metadata to mappers and components. This token is optionally provided by Ar...

ConstBUILT_IN_FIELDS

Built-in field types provided by the dynamic form library. Each field type is validated at compile time using satisfies...

ConstDEFAULT_PROPS

Injection token for form-level default props. Default props are form-wide property defaults that are merged with field-...

ConstDEFAULT_VALIDATION_MESSAGES

Injection token for form-level default validation messages. Default validation messages act as fallbacks when fields ha...

ConstDEFAULT_WRAPPERS

Injection token for form-level default wrappers. Provides a Signal of the `defaultWrappers` array from FormConfig. Cons...

ConstDynamicFormLogger

Injection token for the dynamic forms logger. Provided by provideDynamicForm() with ConsoleLogger as default. Override ...

ConstFIELD_REGISTRY

Injection token for the global field type registry. Provides access to the map of registered field types throughout the...

ConstFIELD_SIGNAL_CONTEXT

Injection token for providing field signal context to mappers and components. The field signal context is the "nervous ...

ConstFORM_OPTIONS

Injection token for form-level options. Form options control form-wide behavior including button disabled states. Used ...

ConstINITIALIZATION_TIMEOUT_MS

Injection token for configuring the initialization timeout in milliseconds. Defaults to 10 seconds. When the timeout is ...

ConstWRAPPER_REGISTRY

Injection token for the wrapper type registry. Provides access to the map of registered wrapper types. The registry is ...