import type { FormMetadata, FieldMetadata, Metadata, Pretty } from './context'; type FormControlProps = { key: string | undefined; id: string; name: string; form: string; required?: boolean; 'aria-describedby'?: string; 'aria-invalid'?: boolean; }; type FormControlOptions = { /** * Decide whether to include `aria-invalid` and `aria-describedby` in the result. */ ariaAttributes?: true; /** * Decide whether the `aria-invalid` and `aria-describedby` attributes should be based on `meta.errors` or `meta.allErrors`. * @default 'errors' */ ariaInvalid?: 'errors' | 'allErrors'; /** * Assign additional `id` to the `aria-describedby` attribute. */ ariaDescribedBy?: string; } | { ariaAttributes: false; }; type InputProps = Pretty; type InputOptions = Pretty; /** * Decide whether defaultValue should be returned. Pass `false` if you want to mange the value yourself. */ value?: boolean; })>; type SelectProps = Pretty; type SelectOptions = Pretty; type TextareaProps = Pretty; type TextareaOptions = Pretty; /** * Derives aria attributes of a form control based on the field metadata. */ export declare function getAriaAttributes(metadata: Metadata, options?: FormControlOptions, field?: boolean): { 'aria-invalid'?: boolean; 'aria-describedby'?: string; }; /** * Derives the properties of a form element based on the form metadata, * including `id`, `onSubmit`, `noValidate`, and `aria-describedby`. * * **Example:** * ```tsx *
* ``` */ export declare function getFormProps, FormError>(metadata: FormMetadata, options?: FormControlOptions): { 'aria-invalid'?: boolean; 'aria-describedby'?: string; id: import("@conform-to/dom").FormId; onSubmit: (event: React.FormEvent) => void; noValidate: boolean; }; /** * Derives the properties of a fieldset element based on the field metadata, * including `id`, `name`, `form`, and `aria-describedby`. * * **Example:** * ```tsx *
* ``` */ export declare function getFieldsetProps | undefined | unknown>(metadata: FieldMetadata, options?: FormControlOptions, field?: boolean): { 'aria-invalid'?: boolean; 'aria-describedby'?: string; id: string; name: import("@conform-to/dom").FieldName; form: import("@conform-to/dom").FormId; }; /** * Derives common properties of a form control based on the field metadata, * including `key`, `id`, `name`, `form`, `required`, `autoFocus`, `aria-invalid` and `aria-describedby`. */ export declare function getFormControlProps(metadata: FieldMetadata, options?: FormControlOptions): FormControlProps; /** * Derives the properties of an input element based on the field metadata, * including common form control attributes like `key`, `id`, `name`, `form`, `autoFocus`, `aria-invalid`, `aria-describedby` * and constraint attributes such as `type`, `required`, `minLength`, `maxLength`, `min`, `max`, `step`, `pattern`, `multiple`. * Depends on the provided options, it will also set `defaultChecked` / `value` if it is a checkbox or radio button, * or otherwise `defaultValue`. * * See https://conform.guide/api/react/getInputProps * * **Example:** * ```tsx * // To setup an uncontrolled input * * // To setup an uncontrolled checkbox * * // To setup an input without defaultValue * * // To setup a radio button without defaultChecked state * * ``` */ export declare function getInputProps(metadata: FieldMetadata, options: Options): InputProps & Pick; /** * Derives the properties of a select element based on the field metadata, * including common form control attributes like `key`, `id`, `name`, `form`, `autoFocus`, `aria-invalid`, `aria-describedby` * and constraint attributes such as `required` or `multiple`. * Depends on the provided options, it will also set `defaultValue` / `value`. * * See https://conform.guide/api/react/getSelectProps * * **Example:** * ```tsx * // To setup an uncontrolled select * * ``` */ export declare function getSelectProps(metadata: FieldMetadata, options?: SelectOptions): SelectProps; /** * Derives the properties of a textarea element based on the field metadata, * including common form control attributes like `key`, `id`, `name`, `form`, `autoFocus`, `aria-invalid`, `aria-describedby` * and constraint attributes such as `required`, `minLength` or `maxLength`. * Depends on the provided options, it will also set `defaultValue` / `value`. * * See https://conform.guide/api/react/getTextareaProps * * **Example:** * ```tsx * // To setup an uncontrolled textarea *