Reference
@reckona/mreact-forms
29 public exports.
Function
Interface
InterfaceBaseCreateFormOptions
interface BaseCreateFormOptionsConfigures fields and validation shared by schema and non-schema forms.InterfaceCreateFormOptionsWithoutSchemainterface CreateFormOptionsWithoutSchemaConfigures form creation without schema-level submit value transformation.InterfaceCreateFormOptionsWithSchemainterface CreateFormOptionsWithSchemaConfigures form creation with a Standard Schema validator that may transform submit values.InterfaceFieldApiinterface FieldApiExposes state, binding, blur, and value update controls for one field.InterfaceFieldArrayApiinterface FieldArrayApiExposes stable keyed row state and mutation helpers for an array field.InterfaceFieldArrayRowinterface FieldArrayRowDescribes one rendered row in a form array field.InterfaceFieldBindinginterface FieldBindingProvides DOM event handlers and current value for binding a field to an input.InterfaceFieldBindingOptionsinterface FieldBindingOptionsConfigures which DOM event updates a field binding.InterfaceFieldStateinterface FieldStateDescribes the derived state for one form field.InterfaceFieldValidationConfiginterface FieldValidationConfigConfigures one field validator and which other fields should re-trigger it.InterfaceFormApiinterface FormApiProvides reactive form state, field access, validation, submit, reset, and error controls.InterfaceFormStateinterface FormStateDescribes the complete reactive state tracked by a form instance.InterfaceServerActionErrorsinterface ServerActionErrorsRepresents field and form errors returned by a server action.Re-export
Re-exportInferStandardSchemaInput
const InferStandardSchemaInput: unknownRe-exports Standard Schema types used by form schema options.Re-exportInferStandardSchemaOutputconst InferStandardSchemaOutput: unknownRe-exports Standard Schema types used by form schema options.Re-exportStandardSchemaV1const StandardSchemaV1: unknownRe-exports Standard Schema types used by form schema options.Re-exportStandardSchemaValidationResultconst StandardSchemaValidationResult: unknownRe-exportvalidateStandardSchemaconst validateStandardSchema: unknownValidates an unknown value with a Standard Schema and normalizes the result shape.Type Alias
Type AliasArrayFieldValue
type ArrayFieldValue = TValues[Name] extends readonly infer Item[] ? Item : neverExtracts an array field's item type.Type AliasCreateFormOptionstype CreateFormOptions = CreateFormOptionsWithoutSchema<TValues> | CreateFormOptionsWithSchema<TValues, TSubmitValues>Configures form creation with optional field validators and optional Standard Schema validation.Type AliasFieldNametype FieldName = Extract<keyof TValues, string>Extracts string field names from a form value object.Type AliasFieldValidationEntrytype FieldValidationEntry = FieldValidator<TValue, TValues> | FieldValidationConfig<TValue, TValues>Provides either a validator function or a validator descriptor with dependencies.Type AliasFieldValidatortype FieldValidator = (value: TValue, values: TValues): readonly string[] | string | undefined | Promise<readonly ...[] | string | undefined>Validates one field value against the full form values object.Type AliasFormErrorstype FormErrors = Partial<Record<FieldName<TValues> | "root", string[]>>Maps field names and the root form key to validation error messages.Type AliasFormSubmitResulttype FormSubmitResult = { data: TResult; status: "success" } | { status: "duplicate" } | { errors: FormErrors<TValues>; status: "invalid" } | { error: unknown; status: "error" }Reports the result of a form submit handler after validation and error capture.Type AliasFormValidateModetype FormValidateMode = "change" | "blur" | "submit"Names the form events that can trigger validation.Type AliasFormValidationResulttype FormValidationResult = { success: true; value: TSubmitValues } | { errors: FormErrors<TValues>; success: false } | { error: unknown; success: false }Reports either successful normalized submit values or form validation errors.Type AliasFormValuestype FormValues = objectRepresents the object shape managed by a form instance.