import type { FocusEvent } from "react";
import type { StringLike } from "@ariakit/core/form/types";
import type { BooleanOrCallback } from "@ariakit/core/utils/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 `FormField` component. Unlike `useFormInput`, this
 * hook doesn't automatically returns the `value` and `onChange` props. This is
 * so we can use it not only for native form elements but also for custom
 * components whose value is not controlled by the native `value` and `onChange`
 * props.
 * @see https://ariakit.org/components/form
 * @example
 * ```jsx
 * const store = useFormStore({ defaultValues: { content: "" } });
 * const props = useFormField({ store, name: store.names.content });
 * const value = store.useValue(store.names.content);
 *
 * <Form store={store}>
 *   <FormLabel name={store.names.content}>Content</FormLabel>
 *   <Role
 *     {...props}
 *     value={value}
 *     onChange={(value) => store.setValue(store.names.content, value)}
 *     render={<Editor />}
 *   />
 * </Form>
 * ```
 */
export declare const useFormField: import("../utils/types.js").Hook<FormFieldOptions<"input">>;
/**
 * Renders a form field. Unlike `FormInput`, this component doesn't
 * automatically pass the `value` and `onChange` props down to the underlying
 * element. This is so we can use it not only for native form elements but also
 * for custom components whose value is not controlled by the native `value` and
 * `onChange` props.
 * @see https://ariakit.org/components/form
 * @example
 * ```jsx
 * const form = useFormStore({ defaultValues: { content: "" } });
 * const value = form.useValue(form.names.content);
 *
 * <Form store={form}>
 *   <FormLabel name={form.names.content}>Content</FormLabel>
 *   <FormField
 *     {...props}
 *     value={value}
 *     onChange={(value) => form.setValue(form.names.content, value)}
 *     render={<Editor />}
 *   />
 * </Form>
 * ```
 */
export declare const FormField: import("../utils/types.js").Component<FormFieldOptions<"input">>;
export interface FormFieldOptions<T extends As = "input"> 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;
    /**
     * Whether the field should be marked touched on blur.
     * @default true
     */
    touchOnBlur?: BooleanOrCallback<FocusEvent>;
}
export type FormFieldProps<T extends As = "input"> = Props<FormFieldOptions<T>>;
