import React from 'react';
import { z } from 'zod';
import type { ActionResult } from '../index.js';
import { type ZodValidationAttrs } from './helpers.js';
export declare const useForm: <Schema extends z.ZodObject>() => {
    state: undefined;
    schema: undefined;
    debug: boolean;
} | {
    state: ActionResult<Schema>;
    schema: Schema;
    debug: boolean | undefined;
};
type UseFieldReturn = {
    invalid: string[] | undefined;
    value: any;
    input: {
        id: string;
        name: string;
        'aria-invalid': boolean;
        autoComplete: 'on' | 'off' | undefined;
        defaultValue?: string;
        defaultChecked?: boolean;
    } & Omit<ZodValidationAttrs, 'type'>;
};
export declare const useField: <Schema extends z.ZodObject>() => UseFieldReturn;
export declare function Form<Schema extends z.ZodObject>({ children, action, state, schema, className, reset, onSuccess, onError, debug, ...props }: React.ComponentProps<'form'> & {
    children: React.ReactNode;
    action: (payload: FormData) => void;
    state: ActionResult<Schema>;
    schema: Schema;
    className?: string;
    reset?: boolean;
    onSuccess?: (data: any, formData: z.TypeOf<Schema> | undefined) => void;
    onError?: (error: string) => void;
    debug?: boolean;
}): React.JSX.Element;
export declare function FormField<Schema extends z.ZodObject>({ render, name, }: {
    render: (field: ReturnType<typeof useField>) => React.ReactNode;
    name: keyof z.TypeOf<Schema>;
}): React.JSX.Element;
export {};
//# sourceMappingURL=index.d.ts.map