import type { UseFormProps, UseFormReturn } from "react-hook-form";
type FormMethods = UseFormReturn & {
    /**
     * Trigger the form submit event
     */
    triggerSubmit: () => void;
    /**
     * The id of the form in the DOM
     */
    formId: string;
};
interface FormProps {
    /**
     * Content of the form. Can be either React nodes or a render function that receives form methods
     * and returns React nodes. The render function approach is useful when you need access to form state
     * or methods (e.g., to disable submit button while submitting).
     */
    children: React.ReactNode | ((methods: FormMethods) => React.ReactNode);
    /**
     * Handler called when the form is submitted. Receives the form data as an argument.
     * The data structure will match the names of your form fields.
     *
     * @param data - An object containing the form values, keyed by field names
     */
    onSubmit: (data: any) => void | Promise<void>;
    /**
     * Whether to reset the form after a successful submit.
     *
     * @default false
     */
    resetOnSuccessfulSubmit?: boolean;
    /**
     * Whether to submit only changed values.
     *
     * When enabled, the `onSubmit` callback will only receive fields whose values differ from their
     * corresponding `defaultValues`.
     *
     * @default false
     */
    submitChangesOnly?: boolean;
    /**
     * Initial values for the form fields. Keys should match the 'name' props of your form fields.
     * Useful for editing existing data or setting initial state.
     */
    defaultValues?: Record<string, any>;
    /**
     * Whether to handle errors that happen during the submit process manually instead of showing
     * them automatically.
     *
     * @default false The errors will be rendered automatically on top of the form.
     */
    renderSubmitErrorsManually?: boolean;
    /**
     * Additional props to pass to the form config from react-hook-form.
     *
     * Note: this could affect the form behavior, use with caution.
     */
    extraFormProps?: UseFormProps;
    /**
     * Callback to match a submission error with one or more form fields or form level errors.
     *
     * @default defaultOnError The form tries to match the error with a field name by default and if it
     * doesn't match any field name, then an generic error or the error message will be shown as a form
     * level error.
     *
     * @returns An object where each key should be a field name or "root.serverError" for form level errors.
     * If the keys doesn't match any field name, then the UI error should be handled manually using the form
     * error state to get the message.
     */
    submissionErrorMatcher?: (error: Error, fieldNames: string[]) => Record<string, string>;
    /**
     * Additional CSS class name to apply to the form element.
     * Use this to customize the form's styling.
     */
    className?: string;
}
/**
 * A form component that integrates with react-hook-form for form state management and validation.
 *
 * @example
 * ```tsx
 * // Basic usage
 * <Form onSubmit={handleSubmit}>
 *   <StringField name="email" label="Email" />
 *   <Button type="submit">Submit</Button>
 * </Form>
 *
 * // With form methods access
 * <Form onSubmit={handleSubmit}>
 *   {({ formState: { isSubmitting } }) => (
 *     <>
 *       <StringField name="email" label="Email" />
 *       <Button type="submit" disabled={isSubmitting}>
 *         {isSubmitting ? 'Submitting...' : 'Submit'}
 *       </Button>
 *     </>
 *   )}
 * </Form>
 *
 * // With default values
 * <Form
 *   onSubmit={handleSubmit}
 *   defaultValues={{
 *     email: 'user@example.com'
 *   }}
 * >
 *   <StringField name="email" label="Email" />
 * </Form>
 * ```
 */
export declare const Form: import("react").ForwardRefExoticComponent<FormProps & import("react").RefAttributes<UseFormReturn>>;
export {};
//# sourceMappingURL=form.d.ts.map