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.
Identity wrapper for hand-written defs and def-factory returns. Use it INSTEAD of a return-type annotation: annotating
: FieldDef<T, M>widensinputtoSchemaLike<unknown>, which silently erases the def's typed write path (DefInputValuefalls back to the parsed value type and controllers stop accepting raw input shapes).defineDefvalidates the object the waysatisfies FieldDef<T, M>does — T inferred fromoutput— while preserving the concrete schema types. One difference fromsatisfies: callback params (correct,meta,coerce) get no contextual type here, so annotate them; the check still rejects a wrong annotation.