import { type Control, type FieldPath, type FieldValues, type UseFormReturn } from "react-hook-form"; import type { FormStateAdapter } from "../props/components/form.prop.js"; /** * Context carrying a framework-agnostic {@link FormStateAdapter}. `FormRoot` provides it on the * adapter path (server-driven form libraries — Inertia/formik/TanStack); it stays `null` on the * built-in react-hook-form path, where `FormFieldControl` falls back to RHF's own context. */ export declare const FormAdapterContext: import("react").Context; /** Read the active form-state adapter, or `null` when `FormRoot` runs the react-hook-form path. */ export declare function useFormAdapter(): FormStateAdapter | null; /** Form-wide options shared by BOTH paths — currently the antd-style form-level `disabled`. */ export interface FormOptionsContextValue { disabled: boolean; submitting?: boolean; } /** Defaults to enabled so a `FormField`/`FormFieldControl` outside a `FormRoot` keeps working. */ export declare const FormOptionsContext: import("react").Context; /** * Whether the surrounding `FormRoot` disables its fields (`FormRoot disabled`). Read it for the * action buttons, which are NOT fields and so are never disabled automatically. */ export declare function useFormDisabled(): boolean; /** * Whether the surrounding `FormRoot` is currently submitting — works for BOTH paths: the adapter's * `isSubmitting` (e.g. Inertia's `processing`) or react-hook-form's `formState.isSubmitting`. */ export declare function useFormSubmitting(): boolean; /** * The react-hook-form instance of the surrounding `FormRoot` (antd `Form.useFormInstance`) — for * `setValue`/`trigger`/`getValues` deep inside a form without prop-drilling `form`. Throws on the * adapter path, which has no RHF instance; use {@link useFormAdapter} there. */ export declare function useFormInstance(): UseFormReturn; export declare function getFallbackFormControl(): Control; /** * Subscribe to a field's value (antd `Form.useWatch`) — the "show this section only when `plan` * is `enterprise`" case, WITHOUT re-rendering the whole form. Omit `name` for every value. * Works on both paths: react-hook-form's `useWatch`, or the adapter's `getValue`/`getValues`. * * Returns `unknown` — the same contract as `FormFieldControl`'s render-prop `value`. Narrow at the * call site (`String(v ?? "")`, a Zod parse, a type guard). */ export declare function useFormWatch(name?: FieldPath): unknown; /** * Normalise a control's change payload to a bare value. The `FormFieldControl` render-prop spreads * `onChange` onto a control that may call it with a DOM `ChangeEvent` (native ``) OR a raw * value (a `Select`'s `onValueChange`). */ export declare function extractControlValue(arg: unknown): unknown;