Libraries v5.0.0
    Preparing search index...

    Type Alias SchemaFormInstance<TSchema>

    SchemaFormInstance: {
        _getFormContext: () => FormContextValue;
        getValue: () => InferType<TSchema>;
        handleSubmit: <TData = void>(
            onValid: (
                values: InferType<TSchema>,
            ) => FormSubmitResult<TData> | Promise<FormSubmitResult<TData>>,
            options?: FormSubmitOptions<InferType<TSchema>, TData>,
        ) => FormSubmitHandler;
        reset: (values?: Partial<InferType<TSchema>>) => void;
        setIssues: (issues: readonly FormIssue[]) => void;
        setValue: (values: Partial<InferType<TSchema>>) => void;
        submit: () => Promise<ValidationResult<InferType<TSchema>>>;
        useField: <TPropertySchema extends SchemaBuilder<any, any, any, any>>(
            forProperty: (
                tree: PropertyDescriptorTree<TSchema, TSchema>,
            ) => PropertyDescriptor<TSchema, TPropertySchema, any>,
        ) => UseFieldResult<InferType<TPropertySchema>>;
        validate: () => Promise<ValidationResult<InferType<TSchema>>>;
    } & FormSubmissionState

    A stable form controller with reactive field and submission subscriptions.

    Type Parameters

    • TSchema extends ObjectSchemaBuilder<any, any, any>

    Type Declaration

    • Internal_getFormContext: () => FormContextValue

      — Used by FormProvider and Field to access internal context.

    • getValue: () => InferType<TSchema>

      Read the current snapshot. Use setters rather than mutating it.

    • handleSubmit: <TData = void>(
          onValid: (
              values: InferType<TSchema>,
          ) => FormSubmitResult<TData> | Promise<FormSubmitResult<TData>>,
          options?: FormSubmitOptions<InferType<TSchema>, TData>,
      ) => FormSubmitHandler

      Validate and submit once; repeated calls while pending are ignored.

    • reset: (values?: Partial<InferType<TSchema>>) => void

      Clear values, or establish supplied values as the new clean baseline.

    • setIssues: (issues: readonly FormIssue[]) => void

      Replace external issues without changing values. Empty pointers and unbound fields appear in form.error; bound fields receive the first issue and are marked touched. Prefer returned submission issues for async race protection. Pass [] to clear external issues without clearing local validation errors.

    • setValue: (values: Partial<InferType<TSchema>>) => void

      Shallow-merge values without marking fields touched.

    • submit: () => Promise<ValidationResult<InferType<TSchema>>>
    • useField: <TPropertySchema extends SchemaBuilder<any, any, any, any>>(
          forProperty: (
              tree: PropertyDescriptorTree<TSchema, TSchema>,
          ) => PropertyDescriptor<TSchema, TPropertySchema, any>,
      ) => UseFieldResult<InferType<TPropertySchema>>
    • validate: () => Promise<ValidationResult<InferType<TSchema>>>