import * as React from "react"; import type { defs } from "../FormHost"; import type { FormHostMembers } from "../hostContext"; import type { ElementType } from "react"; /** * Renders the title for a Form Element. * @param elementId The id of the DOM element representing the Form Element. * When specified, the title is marked as "for" that DOM element. * @param required Indicates if the element is a required field. If so, the title is rendered with an asterisk beside it. * @param title The title of the element. * @param inputId (optional) The id of the DOM element representing the main input for the Form Element. * @param component (optional) The component type to use for rendering the title. * @returns A title component, or `null` if there is no title. */ export declare function renderTitle(elementId: string, required: boolean | undefined, title: defs.Text | undefined, inputId?: string | undefined, component?: ElementType | undefined): React.JSX.Element | null; /** * Renders the description for a Form Element. * @param description The description of the Form Element. * @param elementId The id of the DOM element representing the Form Element. * @param enabled True if the Form Element is enabled, false otherwise. * @param className (optional) A class name to add to the component. * @returns A description component, or `null` if there is no description. */ export declare function renderDescription(description: defs.Text | undefined, elementId: string, enabled: boolean | undefined, className?: string): React.JSX.Element | null; /** * Renders the accessible description for a Form Element. * @param accessibleDescription The element's accessible description. * @param description The element's description. * @param elementId The element's id. * @param host The FormHost, containing the `translateText()` method. * @returns An accessible description component, or `null` if there is no accessible description or description. */ export declare function renderAccessibleDescription(accessibleDescription: string | undefined, description: defs.Text | undefined, elementId: string, host: FormHostMembers): React.JSX.Element | null; /** * Renders the error for a Form Element. * @param error The error to be rendered. * @returns An error component, or `null` if there is no error. */ export declare function renderError(error: defs.Text | undefined): React.JSX.Element | null; /** * Returns a memoized function which asks the host to focus the provided element when the form is * initially shown. Ignores the specified target if it is null or disabled. * @param enabled True if the Form Element is enabled, false otherwise. * @param name The name of the form element that the target HTML element belongs to. * @param renderFocus The renderFocus function supplied to the Form Element from the host. * @returns A memoized function that focuses a target HTML element. */ export declare function useFocusCallback(enabled: boolean, name: string | undefined, host: FormHostMembers): (target: (HTMLElement & { disabled?: boolean; thumbRefs?: any[]; }) | null) => void;