import * as React from "react";
import { ErrorValidationMode } from "../types";
export declare type AriaFormGroupFieldData = {
    getLegendProps: (label: React.ReactNode) => {
        children: React.ReactNode;
    };
    getOptionControlProps: (optionValue: string) => {
        id: string;
        required: boolean;
    };
    getOptionLabelProps: (optionValue: string) => {
        htmlFor: string;
    };
    hintProps: {
        id: string;
        hidden: boolean;
        "aria-hidden": boolean;
    };
    errorProps: {
        id: string;
        hidden: boolean;
        "aria-hidden": boolean;
        "aria-live": `polite` | `assertive` | `off` | undefined;
    };
    meta: {
        required: boolean;
    };
};
/**
 * "group" fields (radio buttons and checkbox groups) are more complicated
 * than "single" ones when it comes to aria-attributes
 *
 * Apparently, we cannot just put aria-invalid and aria-describedby to each option's input,
 * as this would result in too many screen reader announcements
 *
 * Atatching those aria- attributes to only the first option kinda works but not entirely without issues
 *
 * So instead we are going to require the actual hint and error messages and put them (visually hidden) in the group label,
 * while marking the actual visible messages as hidden from screen readers
 * For more details see this article: https://blog.tenon.io/accessible-validation-of-checkbox-and-radiobutton-groups
 */
export declare function useAriaFormGroupField(fieldId: string, { required, error, hint, hasError, hasHint, validationMode, }: {
    required?: boolean;
    error?: React.ReactNode;
    hint?: React.ReactNode;
    hasError?: boolean;
    hasHint?: boolean;
    validationMode?: ErrorValidationMode;
}): AriaFormGroupFieldData;
