import type { StringLike } from "@ariakit/core/form/types";
import type { CollectionItemOptions } from "../collection/collection-item.js";
import type { As, Props } from "../utils/types.js";
import type { FormStore } from "./form-store.js";
/**
 * Returns props to create a `FormDescription` component.
 * @see https://ariakit.org/components/form
 * @example
 * ```jsx
 * const store = useFormStore({ defaultValues: { email: "" } });
 * const props = useFormError({ store, name: store.names.email });
 *
 * store.useValidate(() => {
 *   if (!store.getValue(store.names.email)) {
 *     store.setError(store.names.email, "Email is required!");
 *   }
 * });
 *
 * <Form store={store}>
 *   <FormLabel name={store.names.email}>Email</FormLabel>
 *   <FormInput name={store.names.email} />
 *   <Role {...props} />
 * </Form>
 * ```
 */
export declare const useFormError: import("../utils/types.js").Hook<FormErrorOptions<"div">>;
/**
 * Renders an element that displays an error message. The `children` will be
 * automatically set to the error message set on the store.
 * @see https://ariakit.org/components/form
 * @example
 * ```jsx
 * const form = useFormStore({ defaultValues: { email: "" } });
 *
 * form.useValidate(() => {
 *   if (!form.values.email) {
 *     form.setError(form.names.email, "Email is required!");
 *   }
 * });
 *
 * <Form store={form}>
 *   <FormLabel name={form.names.email}>Email</FormLabel>
 *   <FormInput name={form.names.email} />
 *   <FormError name={form.names.email} />
 * </Form>
 * ```
 */
export declare const FormError: import("../utils/types.js").Component<FormErrorOptions<"div">>;
export interface FormErrorOptions<T extends As = "div"> extends CollectionItemOptions<T> {
    /**
     * Object returned by the `useFormStore` hook. If not provided, the parent
     * `Form` component's context will be used.
     */
    store?: FormStore;
    /**
     * Name of the field.
     */
    name: StringLike;
}
export type FormErrorProps<T extends As = "div"> = Props<FormErrorOptions<T>>;
