@theredhead — Frontend Library - v0.2.1
    Preparing search index...

    Signal-based form engine. Takes a FormSchema, creates reactive state for every field and group, evaluates conditions, runs validation, and produces a JSON output object.

    The engine is framework-agnostic (no Angular DI required) — it operates purely on signals and plain objects.

    const engine = new FormEngine(schema);
    engine.setValue("email", "test@example.com");
    console.log(engine.values()); // { email: "test@example.com", … }
    console.log(engine.valid()); // true / false
    Index

    Constructors

    Properties

    dirty: Signal<boolean>

    Whether any field value differs from its default.

    groups: readonly GroupState[]

    Ordered group states.

    schema: FormSchema
    touched: Signal<boolean>

    Whether any field has been interacted with.

    valid: Signal<boolean>

    Whether every visible field passes validation.

    values: Signal<FormValues>

    Live snapshot of all field values (including hidden fields).

    Methods

    • Get the FieldState for a field by ID. Throws if the field is not found.

      Parameters

      • id: string

      Returns FieldState

    • Mark all fields as touched (e.g. on submit attempt).

      Returns void

    • Mark a field as touched.

      Parameters

      • id: string

      Returns void

    • Produce the JSON output — a plain object containing only visible field values.

      Returns Signal<FormValues>

    • Reset the form to its initial default values and clear touched/dirty state.

      Returns void

    • Set the value of a single field by ID.

      Parameters

      • id: string
      • value: unknown

      Returns void