form-graph
    Preparing search index...

    Function defineDef

    • Identity wrapper for hand-written defs and def-factory returns. Use it INSTEAD of a return-type annotation: annotating : FieldDef<T, M> widens input to SchemaLike<unknown>, which silently erases the def's typed write path (DefInputValue falls back to the parsed value type and controllers stop accepting raw input shapes). defineDef validates the object the way satisfies FieldDef<T, M> does — T inferred from output — while preserving the concrete schema types. One difference from satisfies: callback params (correct, meta, coerce) get no contextual type here, so annotate them; the check still rejects a wrong annotation.

      Type Parameters

      Parameters

      • def: D & ConsistentDef<D>

      Returns D